From 313432e2a408f5d7d0f50c9ad4ccf515c8d21a56 Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Mon, 16 Dec 2024 18:13:08 -0600 Subject: [PATCH] address PR comments --- core/state/statedb.go | 8 +++++--- core/vm/interface.go | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index b56658614..ca9f778e0 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -51,7 +51,6 @@ type revision struct { // Arbitrum: track the total balance change across all accounts unexpectedBalanceDelta *big.Int - arbTxFilter bool } type mutationType int @@ -224,6 +223,10 @@ func (s *StateDB) FilterTx() { s.arbExtraData.arbTxFilter = true } +func (s *StateDB) ClearTxFilter() { + s.arbExtraData.arbTxFilter = false +} + func (s *StateDB) IsTxFiltered() bool { return s.arbExtraData.arbTxFilter } @@ -829,7 +832,7 @@ func (s *StateDB) Copy() *StateDB { func (s *StateDB) Snapshot() int { id := s.nextRevisionId s.nextRevisionId++ - s.validRevisions = append(s.validRevisions, revision{id, s.journal.length(), new(big.Int).Set(s.arbExtraData.unexpectedBalanceDelta), s.arbExtraData.arbTxFilter}) + s.validRevisions = append(s.validRevisions, revision{id, s.journal.length(), new(big.Int).Set(s.arbExtraData.unexpectedBalanceDelta)}) return id } @@ -845,7 +848,6 @@ func (s *StateDB) RevertToSnapshot(revid int) { revision := s.validRevisions[idx] snapshot := revision.journalIndex s.arbExtraData.unexpectedBalanceDelta = new(big.Int).Set(revision.unexpectedBalanceDelta) - s.arbExtraData.arbTxFilter = revision.arbTxFilter // Replay the journal to undo changes and remove invalidated snapshots s.journal.revert(s, snapshot) diff --git a/core/vm/interface.go b/core/vm/interface.go index 46a4537dd..c04aec6f8 100644 --- a/core/vm/interface.go +++ b/core/vm/interface.go @@ -50,6 +50,7 @@ type StateDB interface { // Arbitrum FilterTx() + ClearTxFilter() IsTxFiltered() bool Deterministic() bool