From 0e5ae8e438ef2a249aef62e614d1a2a0491cb85a Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Wed, 24 Sep 2025 17:13:08 +0200 Subject: [PATCH] core/txpool/blobpool: evict stale transactions from reorg buffer Signed-off-by: Csaba Kiraly --- core/txpool/blobpool/blobpool.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index efccc0a6ff..907904291b 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -2188,12 +2188,15 @@ func (p *BlobPool) gappedAllowance(addr common.Address) int { func (p *BlobPool) evictGapped() { cutoff := time.Now().Add(-gappedLifetime) for from, txs := range p.gapped { + nonce := p.state.GetNonce(from) // Reuse the original slice to avoid extra allocations. // This is safe because we only keep references to the original gappedTx objects, // and we overwrite the slice for this account after filtering. keep := txs[:0] for i, gtx := range txs { - if gtx.timestamp.Before(cutoff) { + if gtx.timestamp.Before(cutoff) || gtx.tx.Nonce() < nonce { + // Evict old or stale transactions + // Should we add stale to limbo here if it would belong? delete(p.gappedSource, gtx.tx.Hash()) txs[i] = nil // Explicitly nil out evicted element } else {