Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion x/vm/statedb/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ func (pc precompileCallChange) Revert(s *StateDB) {

// Restore processed events counter
s.processedEventsCount = pc.prevProcessedEventCount

// fix: decrement the precompile calls counter so that a reverted call
// does not permanently consume a slot in the per-tx limit, preventing
// an attacker from exhausting the limit via deliberate reverts.
if s.precompileCallsCounter > 0 {
s.precompileCallsCounter--
}
}

func (pc precompileCallChange) Dirtied() *common.Address {
Expand Down Expand Up @@ -301,4 +308,4 @@ func (ch accessListAddSlotChange) Revert(s *StateDB) {

func (ch accessListAddSlotChange) Dirtied() *common.Address {
return nil
}
}