mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
check code existence
This commit is contained in:
parent
f9776c2d17
commit
5ed2114eec
1 changed files with 5 additions and 5 deletions
|
|
@ -612,7 +612,7 @@ func (st *stateTransition) validateAuthorization(auth types.SetCodeAuth) (author
|
||||||
if !skipValidation && nonce+1 < nonce {
|
if !skipValidation && nonce+1 < nonce {
|
||||||
return authority, ErrAuthorizationNonceOverflow
|
return authority, ErrAuthorizationNonceOverflow
|
||||||
}
|
}
|
||||||
// Get authority from auth (may recover from signature or use explicit address).
|
// Get authority from auth
|
||||||
authority, err = auth.GetAuthority()
|
authority, err = auth.GetAuthority()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return authority, fmt.Errorf("%w: %v", ErrAuthorizationInvalidSignature, err)
|
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.
|
// Note it is added to the access list even if the authorization is invalid.
|
||||||
st.state.AddAddressToAccessList(authority)
|
st.state.AddAddressToAccessList(authority)
|
||||||
// Skip state checks during gas estimation
|
|
||||||
if !skipValidation {
|
|
||||||
code := st.state.GetCode(authority)
|
code := st.state.GetCode(authority)
|
||||||
if _, ok := types.ParseDelegation(code); len(code) != 0 && !ok {
|
if _, ok := types.ParseDelegation(code); len(code) != 0 && !ok {
|
||||||
return authority, ErrAuthorizationDestinationHasCode
|
return authority, ErrAuthorizationDestinationHasCode
|
||||||
}
|
}
|
||||||
|
// Skip state checks during gas estimation
|
||||||
|
if !skipValidation {
|
||||||
if have := st.state.GetNonce(authority); have != nonce {
|
if have := st.state.GetNonce(authority); have != nonce {
|
||||||
return authority, ErrAuthorizationNonceMismatch
|
return authority, ErrAuthorizationNonceMismatch
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue