Update core/state_transition.go

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
This commit is contained in:
Danno Ferrin 2024-09-17 16:48:49 -06:00 committed by GitHub
parent 4392a1c4e6
commit 995310c2a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -515,7 +515,8 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
ret, _, st.gasRemaining, vmerr = st.evm.Create(sender, msg.Data, st.gasRemaining, value, rules.IsPrague)
// Special case for EOF, if the initcode or deployed code is
// invalid, the tx is considered valid (so update nonce), but
// is to be treated as an exceptional abort (so burn all gas).
// 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)
}