mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
core: more comment
This commit is contained in:
parent
1110fc5fc6
commit
9b94402a9e
1 changed files with 7 additions and 4 deletions
|
|
@ -585,10 +585,13 @@ func (st *stateTransition) applyAuthorization(msg *Message, auth *types.Authoriz
|
||||||
// Otherwise install delegation to auth.Address.
|
// Otherwise install delegation to auth.Address.
|
||||||
st.state.SetCode(authority, types.AddressToDelegation(auth.Address))
|
st.state.SetCode(authority, types.AddressToDelegation(auth.Address))
|
||||||
|
|
||||||
// Usually the delegation target is added to the access list in statedb.Prepare(..).
|
// If an account has a code delegation to another account, that account will be added to
|
||||||
// However if the destination address of the transaction is an EOA, and the EOA gains
|
// the access list in statedb.Prepare(..).
|
||||||
// a new delegation in the same transaction, we need to explicitly add the delegation
|
//
|
||||||
// address here since Prepare has already happened.
|
// However if the destination address of the transaction (msg) gains a new delegation
|
||||||
|
// in this same transaction, we need to explicitly warm the delegation address here,
|
||||||
|
// since Prepare has already happened. The intention here is to behave as if the
|
||||||
|
// delegation was already present before calling Prepare.
|
||||||
if *msg.To == authority {
|
if *msg.To == authority {
|
||||||
st.state.AddAddressToAccessList(auth.Address)
|
st.state.AddAddressToAccessList(auth.Address)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue