From bf01e0d2b6dc9ad7e4ffdbb53c5fafc63294c587 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 2 Dec 2024 13:06:03 +0100 Subject: [PATCH] core: add comment about nonce update order --- core/state_transition.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/state_transition.go b/core/state_transition.go index 223169747b..e696f9bcd5 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -462,7 +462,9 @@ func (st *stateTransition) execute() (*ExecutionResult, error) { st.state.Prepare(rules, msg.From, st.evm.Context.Coinbase, msg.To, vm.ActivePrecompiles(rules), msg.AccessList) if !contractCreation { - // Increment the nonce for the next transaction + // Increment the nonce for the next transaction. + // Note: EIP-7702 authorizations can also modify the nonce. We perform + // this update first to ensure correct validation of authorization nonces. st.state.SetNonce(msg.From, st.state.GetNonce(msg.From)+1) }