From b635e0632ce675be3d7cc0b498e08df8dc6346d6 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Thu, 1 Jan 2026 02:52:25 +0800 Subject: [PATCH] eth/fetcher: improve the condition to stall peer in tx fetcher (#32725) Signed-off-by: Csaba Kiraly Co-authored-by: Csaba Kiraly --- eth/fetcher/tx_fetcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index f024f3aeba..78e791f32b 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -352,9 +352,9 @@ func (f *TxFetcher) Enqueue(peer string, txs []*types.Transaction, direct bool) otherRejectMeter.Mark(otherreject) // If 'other reject' is >25% of the deliveries in any batch, sleep a bit. - if otherreject > addTxsBatchSize/4 { + if otherreject > int64((len(batch)+3)/4) { + log.Debug("Peer delivering stale or invalid transactions", "peer", peer, "rejected", otherreject) time.Sleep(200 * time.Millisecond) - log.Debug("Peer delivering stale transactions", "peer", peer, "rejected", otherreject) } } select {