Skip to content

Commit

Permalink
core: add comment about nonce update order
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl authored and lightclient committed Dec 12, 2024
1 parent 0f85021 commit bf01e0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit bf01e0d

Please sign in to comment.