Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Dec 10, 2024
1 parent 30abfa2 commit 418b284
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (s *StateDB) FilterTx(withBlock bool) {
}
}

func (s *StateDB) IsTxInvalid() bool {
func (s *StateDB) IsTxFiltered() bool {
return s.arbTxFilter == txFiltered
}

Expand Down Expand Up @@ -842,6 +842,9 @@ func (s *StateDB) Copy() *StateDB {

// Snapshot returns an identifier for the current revision of the state.
func (s *StateDB) Snapshot() int {
if s.arbTxFilter == txFiltered {
panic("trying to create a new snapshot when the previous transaction applied to this state was filtered. RevertToSnapshot should be called before moving on to the next transaction")
}
id := s.nextRevisionId
s.nextRevisionId++
s.validRevisions = append(s.validRevisions, revision{id, s.journal.length(), new(big.Int).Set(s.arbExtraData.unexpectedBalanceDelta)})
Expand Down Expand Up @@ -1248,7 +1251,7 @@ func (s *StateDB) GetTrie() Trie {
// The associated block number of the state transition is also provided
// for more chain context.
func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, error) {
if s.arbTxFilter == blockFiltered {
if s.arbTxFilter == blockFiltered || s.arbTxFilter == txFiltered {
return common.Hash{}, ErrArbTxFilter
}
// Short circuit in case any database failure occurred earlier.
Expand Down
2 changes: 1 addition & 1 deletion core/vm/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type StateDB interface {

// Arbitrum
FilterTx(bool)
IsTxInvalid() bool
IsTxFiltered() bool

Deterministic() bool
Database() state.Database
Expand Down

0 comments on commit 418b284

Please sign in to comment.