diff --git a/core/state/journal.go b/core/state/journal.go index 99046ef124..df3cdee7b8 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -130,6 +130,7 @@ type ( } eip6780DeletableChange struct { account common.Address + prev bool } // Changes to other state values. @@ -258,7 +259,7 @@ func (ch codeChange) copy() journalEntry { } func (ch eip6780DeletableChange) revert(s *StateDB) { - s.getStateObject(ch.account).eip6780Deletable = false + s.getStateObject(ch.account).eip6780Deletable = ch.prev } func (ch eip6780DeletableChange) dirtied() *common.Address { diff --git a/core/state/state_object.go b/core/state/state_object.go index ca5329431c..3ee521bec1 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -531,11 +531,9 @@ func (s *stateObject) setNonce(nonce uint64) { } func (s *stateObject) SetEIP6780Deletable() { - if s.eip6780Deletable { - return // might be possible in fuzzing - } s.db.journal.append(eip6780DeletableChange{ account: s.address, + prev: s.eip6780Deletable, }) s.eip6780Deletable = true } diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index 1687bc7e6b..f29c5f12b3 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -917,7 +917,7 @@ func TestSelfDestructAccountAfterDeploy(t *testing.T) { t.Fatalf("self-destructed should not be applied") } - // Self-destruct the account with destructible flag setting + // Self-destruct the account with deletable flag setting state.SetEIP6780Deletable(addr) state.SetCode(addr, []byte{0x1}) state.Selfdestruct6780(addr)