From 9b94402a9eca2d8fa23bd55bdbf055a71cc3f62f Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 2 Dec 2024 14:33:34 +0100 Subject: [PATCH] core: more comment --- core/state_transition.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index c2200f4b2d..ce92b999ab 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -585,10 +585,13 @@ func (st *stateTransition) applyAuthorization(msg *Message, auth *types.Authoriz // Otherwise install delegation to auth.Address. st.state.SetCode(authority, types.AddressToDelegation(auth.Address)) - // Usually the delegation target is added to the access list in statedb.Prepare(..). - // However if the destination address of the transaction is an EOA, and the EOA gains - // a new delegation in the same transaction, we need to explicitly add the delegation - // address here since Prepare has already happened. + // If an account has a code delegation to another account, that account will be added to + // the access list in statedb.Prepare(..). + // + // 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 { st.state.AddAddressToAccessList(auth.Address) }