Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: txpool reheap oom #211

Merged
merged 9 commits into from
Nov 26, 2024
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(400 * time.Millisecond)
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
Loading