From a02f418945d469cf158ab88cacdf6edb62944427 Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Wed, 24 Sep 2025 10:34:20 +0800 Subject: [PATCH 1/4] eth/fetcher: improve the condition to stall peer in tx fetcher --- 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 3e050320e905..884469d27e89 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -375,9 +375,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)/4) { time.Sleep(200 * time.Millisecond) - log.Debug("Peer delivering stale transactions", "peer", peer, "rejected", otherreject) + log.Debug("Peer delivering invalid transactions", "peer", peer, "rejected", otherreject) } } select { From de60ff5036233448acbdcad88f7fc9918f15c506 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Tue, 30 Sep 2025 19:47:04 +0800 Subject: [PATCH 2/4] Fix indentation and formatting in tx_fetcher.go --- eth/fetcher/tx_fetcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index 884469d27e89..7bba239034d7 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -376,8 +376,8 @@ func (f *TxFetcher) Enqueue(peer string, txs []*types.Transaction, direct bool) // If 'other reject' is >25% of the deliveries in any batch, sleep a bit. if otherreject > int64(len(batch)/4) { - time.Sleep(200 * time.Millisecond) log.Debug("Peer delivering invalid transactions", "peer", peer, "rejected", otherreject) + time.Sleep(200 * time.Millisecond) } } select { From f8d5d10c0c795ce88ab4dce2721afb981dbe3b30 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Mon, 29 Dec 2025 15:18:50 +0100 Subject: [PATCH 3/4] make sure single tx batches are not over-penalized Signed-off-by: Csaba Kiraly --- eth/fetcher/tx_fetcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index 7bba239034d7..7e96af2ca6d2 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -375,7 +375,7 @@ 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 > int64(len(batch)/4) { + if otherreject > int64((len(batch)+3)/4) { log.Debug("Peer delivering invalid transactions", "peer", peer, "rejected", otherreject) time.Sleep(200 * time.Millisecond) } From b30e6728dba1fa63db6c322bc7119deebfb140b0 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Mon, 29 Dec 2025 15:19:48 +0100 Subject: [PATCH 4/4] fix log message Signed-off-by: Csaba Kiraly --- eth/fetcher/tx_fetcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index 7e96af2ca6d2..67c258f10e3b 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -376,7 +376,7 @@ func (f *TxFetcher) Enqueue(peer string, txs []*types.Transaction, direct bool) // If 'other reject' is >25% of the deliveries in any batch, sleep a bit. if otherreject > int64((len(batch)+3)/4) { - log.Debug("Peer delivering invalid transactions", "peer", peer, "rejected", otherreject) + log.Debug("Peer delivering stale or invalid transactions", "peer", peer, "rejected", otherreject) time.Sleep(200 * time.Millisecond) } }