Skip to content

Commit

Permalink
Fix/pevm oom (bnb-chain#210)
Browse files Browse the repository at this point in the history
Co-authored-by: andyzhang2023 <andyzhang2023@gmail.com>
  • Loading branch information
2 people authored and sunny2022da committed Nov 3, 2024
1 parent b7c798e commit bf98242
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ func (pool *LegacyPool) Init(gasTip uint64, head *types.Header, reserve txpool.A
}

func (pool *LegacyPool) loopOfSync() {
ticker := time.NewTicker(200 * time.Millisecond)
ticker := time.NewTicker(200 * time.Second)
for {
select {
case <-pool.reorgShutdownCh:
Expand Down Expand Up @@ -1892,6 +1892,7 @@ func (pool *LegacyPool) demoteUnexecutables(demoteAddrs []common.Address) {
}
demoteTxMeter.Mark(int64(len(demoteAddrs)))

var removed = 0
// Iterate over all accounts and demote any non-executable transactions
gasLimit := txpool.EffectiveGasLimit(pool.chainconfig, pool.currentHead.Load().GasLimit, pool.config.EffectiveGasCeil)
for _, addr := range demoteAddrs {
Expand Down Expand Up @@ -1955,7 +1956,9 @@ func (pool *LegacyPool) demoteUnexecutables(demoteAddrs []common.Address) {
}
}
pool.pendingCache.del(dropPendingCache, pool.signer)
removed += len(dropPendingCache)
}
pool.priced.Removed(removed)
}

// addressByHeartbeat is an account address tagged with its last activity timestamp.
Expand Down

0 comments on commit bf98242

Please sign in to comment.