core: panic if authorizations length doesn't match authorities

This commit is contained in:
lightclient 2025-10-29 20:11:31 -06:00
parent d7f29ad2e6
commit cc65a4ad32
No known key found for this signature in database
GPG key ID: 657913021EF45A6A

View file

@ -520,6 +520,10 @@ func (st *stateTransition) execute() (*ExecutionResult, error) {
// Apply EIP-7702 authorizations.
if msg.SetCodeAuthorizations != nil {
if len(msg.SetCodeAuthorizations) != len(msg.Authorities) {
// This is an invariant of Message that cannot be invalidated.
panic("Length of authorizations does match authorities")
}
for i, auth := range msg.SetCodeAuthorizations {
addr := msg.Authorities[i]
if addr == nil {