@@ -19,7 +19,6 @@ package state
1919
2020import (
2121 "bytes"
22- "errors"
2322 "fmt"
2423 "maps"
2524 "math/big"
@@ -75,8 +74,6 @@ func (m *mutation) isDelete() bool {
7574 return m .typ == deletion
7675}
7776
78- var ErrArbTxFilter error = errors .New ("internal error" )
79-
8077// StateDB structs within the ethereum protocol are used to store anything
8178// within the merkle trie. StateDBs take care of caching and storing
8279// nested states. It's the general query interface to retrieve:
@@ -90,7 +87,6 @@ var ErrArbTxFilter error = errors.New("internal error")
9087// commit states.
9188type StateDB struct {
9289 arbExtraData * ArbitrumExtraData // must be a pointer - can't be a part of StateDB allocation, otherwise its finalizer might not get called
93- arbTxFilter bool
9490
9591 db Database
9692 prefetcher * triePrefetcher
@@ -225,13 +221,11 @@ func New(root common.Hash, db Database, snaps *snapshot.Tree) (*StateDB, error)
225221}
226222
227223func (s * StateDB ) FilterTx () {
228- if ! s .arbTxFilter {
229- s .arbTxFilter = true
230- }
224+ s .arbExtraData .arbTxFilter = true
231225}
232226
233227func (s * StateDB ) IsTxFiltered () bool {
234- return s .arbTxFilter
228+ return s .arbExtraData . arbTxFilter
235229}
236230
237231// SetLogger sets the logger for account update hooks.
@@ -751,6 +745,7 @@ func (s *StateDB) Copy() *StateDB {
751745 recentWasms : s .arbExtraData .recentWasms .Copy (),
752746 openWasmPages : s .arbExtraData .openWasmPages ,
753747 everWasmPages : s .arbExtraData .everWasmPages ,
748+ arbTxFilter : s .arbExtraData .arbTxFilter ,
754749 },
755750
756751 db : s .db ,
@@ -834,7 +829,7 @@ func (s *StateDB) Copy() *StateDB {
834829func (s * StateDB ) Snapshot () int {
835830 id := s .nextRevisionId
836831 s .nextRevisionId ++
837- s .validRevisions = append (s .validRevisions , revision {id , s .journal .length (), new (big.Int ).Set (s .arbExtraData .unexpectedBalanceDelta ), s .arbTxFilter })
832+ s .validRevisions = append (s .validRevisions , revision {id , s .journal .length (), new (big.Int ).Set (s .arbExtraData .unexpectedBalanceDelta ), s .arbExtraData . arbTxFilter })
838833 return id
839834}
840835
@@ -850,7 +845,7 @@ func (s *StateDB) RevertToSnapshot(revid int) {
850845 revision := s .validRevisions [idx ]
851846 snapshot := revision .journalIndex
852847 s .arbExtraData .unexpectedBalanceDelta = new (big.Int ).Set (revision .unexpectedBalanceDelta )
853- s .arbTxFilter = revision .arbTxFilter
848+ s .arbExtraData . arbTxFilter = revision .arbTxFilter
854849
855850 // Replay the journal to undo changes and remove invalidated snapshots
856851 s .journal .revert (s , snapshot )
@@ -1236,7 +1231,7 @@ func (s *StateDB) GetTrie() Trie {
12361231// The associated block number of the state transition is also provided
12371232// for more chain context.
12381233func (s * StateDB ) Commit (block uint64 , deleteEmptyObjects bool ) (common.Hash , error ) {
1239- if s .arbTxFilter {
1234+ if s .arbExtraData . arbTxFilter {
12401235 return common.Hash {}, ErrArbTxFilter
12411236 }
12421237 // Short circuit in case any database failure occurred earlier.
0 commit comments