core: add comment about nonce update order

This commit is contained in:
Felix Lange 2024-12-02 13:06:03 +01:00 committed by lightclient
parent 0f85021cb6
commit bf01e0d2b6
No known key found for this signature in database
GPG key ID: 75C916AFEE20183E

View file

@ -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)
}