diff --git a/core/state_transition.go b/core/state_transition.go index ee5ec85a27..bbc94ed0a3 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -491,7 +491,7 @@ func (st *stateTransition) execute() (*ExecutionResult, error) { // gas for initcode execution is not consumed. // Only intrinsic creation transaction costs are charged. if errors.Is(vmerr, vm.ErrInvalidEOFInitcode) { - st.state.SetNonce(msg.From, st.state.GetNonce(sender.Address())+1) + st.state.SetNonce(msg.From, st.state.GetNonce(sender.Address())+1, tracing.NonceChangeInvalidEOF) } } else { // Increment the nonce for the next transaction. diff --git a/core/tracing/hooks.go b/core/tracing/hooks.go index 4002b57207..68bfb2fedc 100644 --- a/core/tracing/hooks.go +++ b/core/tracing/hooks.go @@ -367,4 +367,8 @@ const ( // NonceChangeRevert is emitted when the nonce is reverted back to a previous value due to call failure. // It is only emitted when the tracer has opted in to use the journaling wrapper (WrapWithJournal). NonceChangeRevert NonceChangeReason = 6 + + // NonceChangeInvalidEOF is emitted when the nonce is changed when a new contract is created, + // but the creation fails because of an EOF error. + NonceChangeInvalidEOF NonceChangeReason = 6 )