Skip to content

Commit 9b94402

Browse files
fjllightclient
authored andcommitted
core: more comment
1 parent 1110fc5 commit 9b94402

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

core/state_transition.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,10 +585,13 @@ func (st *stateTransition) applyAuthorization(msg *Message, auth *types.Authoriz
585585
// Otherwise install delegation to auth.Address.
586586
st.state.SetCode(authority, types.AddressToDelegation(auth.Address))
587587

588-
// Usually the delegation target is added to the access list in statedb.Prepare(..).
589-
// However if the destination address of the transaction is an EOA, and the EOA gains
590-
// a new delegation in the same transaction, we need to explicitly add the delegation
591-
// address here since Prepare has already happened.
588+
// If an account has a code delegation to another account, that account will be added to
589+
// the access list in statedb.Prepare(..).
590+
//
591+
// However if the destination address of the transaction (msg) gains a new delegation
592+
// in this same transaction, we need to explicitly warm the delegation address here,
593+
// since Prepare has already happened. The intention here is to behave as if the
594+
// delegation was already present before calling Prepare.
592595
if *msg.To == authority {
593596
st.state.AddAddressToAccessList(auth.Address)
594597
}

0 commit comments

Comments
 (0)