From 5ed2114eec9f06ac0c8e0ea93fc261ef5af9c14f Mon Sep 17 00:00:00 2001 From: allen Date: Fri, 17 Oct 2025 13:31:26 -0400 Subject: [PATCH] check code existence --- core/state_transition.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index 668a99ecdb..0d1327b3bc 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -612,7 +612,7 @@ func (st *stateTransition) validateAuthorization(auth types.SetCodeAuth) (author if !skipValidation && nonce+1 < nonce { return authority, ErrAuthorizationNonceOverflow } - // Get authority from auth (may recover from signature or use explicit address). + // Get authority from auth authority, err = auth.GetAuthority() if err != nil { return authority, fmt.Errorf("%w: %v", ErrAuthorizationInvalidSignature, err) @@ -623,12 +623,12 @@ func (st *stateTransition) validateAuthorization(auth types.SetCodeAuth) (author // // Note it is added to the access list even if the authorization is invalid. st.state.AddAddressToAccessList(authority) + code := st.state.GetCode(authority) + if _, ok := types.ParseDelegation(code); len(code) != 0 && !ok { + return authority, ErrAuthorizationDestinationHasCode + } // Skip state checks during gas estimation if !skipValidation { - code := st.state.GetCode(authority) - if _, ok := types.ParseDelegation(code); len(code) != 0 && !ok { - return authority, ErrAuthorizationDestinationHasCode - } if have := st.state.GetNonce(authority); have != nonce { return authority, ErrAuthorizationNonceMismatch }