Repository navigation
fix(eth): bound the tx-sync wait by idle progress, not a 1s total #20234 - #2955
Merged
gzliudan merged 1 commit intoNov 4, 2026
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
gzliudan
requested review from
AnilChinchawale,
anunay-xin,
benjamin202410,
liam-lai and
wanwiset25
October 30, 2026 05:23
gzliudan
force-pushed
the
fix-eth-tx-sync-idle-timeout
branch
from
October 30, 2026 07:39
4e2c4e0 to
198a0a0
Compare
anunay-xin
approved these changes
Oct 30, 2026
gzliudan
force-pushed
the
fix-eth-tx-sync-idle-timeout
branch
2 times, most recently
from
November 1, 2026 11:04
c1f1029 to
7dc8fd0
Compare
benjamin202410
approved these changes
Nov 2, 2026
gzliudan
force-pushed
the
fix-eth-tx-sync-idle-timeout
branch
from
November 2, 2026 23:15
7dc8fd0 to
3ff0a91
Compare
wanwiset25
approved these changes
Nov 4, 2026
gzliudan
force-pushed
the
fix-eth-tx-sync-idle-timeout
branch
from
November 4, 2026 16:47
3ff0a91 to
736d163
Compare
testSyncTransaction gave the fetcher one second for the whole round trip: all 1024 transactions had to be announced or broadcast, fetched and pooled before `time.After(time.Second)` fired. Upstream ethereum#20234 built the timer inside the select, so it re-armed whenever a batch arrived; hoisting it out during the eth/65 fetch port (XinFinOrg#2490) turned a liveness check into a latency assertion. On a loaded race shard that is a coin flip: `race (bulk 4/4)` failed with "Failed to retrieve all transaction" while the neighbouring commits passed the same job, and the package ran 90s there against 24s a run earlier. Since XinFinOrg#2947 the announcement variant is gated behind -short, so the race job no longer runs it; the non-short tests job still does. Arm a single idle timer on every batch instead, and report how many transactions did arrive so the next failure is diagnosable. Comparing against len(alltxs) replaces the `got == 1024` literal, and a count above the batch size now fails immediately with the duplicate diagnosis. A second timer caps the whole wait at two minutes, so a fetcher that keeps trickling just under the idle limit cannot outlive the package timeout. Ref: ethereum#20234
gzliudan
force-pushed
the
fix-eth-tx-sync-idle-timeout
branch
from
November 4, 2026 16:50
736d163 to
9d439d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
testSyncTransaction(behindTestTransactionAnnouncementandTestTransactionPropagation) gave the fetcher one second for the entire batch: all 1024 transactions had to be announced or broadcast, fetched and pooled beforetime.After(time.Second)fired.Upstream ethereum#20234 built the timer inside the select, so it re-armed whenever a batch arrived; hoisting it out during the eth/65 fetch port (#2490) turned a liveness check into a latency assertion. The wait now bounds "no progress", not "not done yet", a second timer caps the whole thing at two minutes, and a count that overshoots the batch size fails immediately with a duplicate diagnosis instead of timing out. No production code changes.
Evidence
race (bulk 4/4)on feat(params,core,cmd/puppeth): enforce 0 < gap < epoch in CheckConfigForkOrder #2901 failed with--- FAIL: TestTransactionAnnouncement (20.70s)/protocol_test.go:371: Failed to retrieve all transaction, whileeth/was byte-identical to the previous commit, which passed the same job:ok .../eth 24.504sthere againstFAIL .../eth 90.405shere (eth/protocols/eth: 10.8s → 85.9s). A 4x slower worker was enough.After: the wait only expires once the peer stops delivering anything.
-race -shortall pass: serial,GOMAXPROCS=2,taskset -c 0,1, full-core busy loops, and three concurrent test processes.txSyncIdleTimeouttotime.Nanosecondfails fast with the count; forcingtxSyncTotalTimeoutto100mshits the total branch; a duplicate-delivery overlay (an extraSend(txs[:1])in the fake pool) now fails withgot 1027, want 1024 (duplicate or unexpected transactions)instead of passing.go test -run '^TestTransaction(Announcement|Propagation)$' -count=3 ./eth/ok 22.8s,go vet ./...clean, golangci-lint 0 issues,make test7m19s all green.-short, so the race job no longer runs it; the non-shorttestsjob still does.Merge Danger
Door: two-way — test-only, no production path, cheap to revert.
Blast Radius: one package's test timing; a genuinely stuck fetcher still fails, now after 10s of silence instead of 1s in total; a fetcher that keeps trickling just under that limit is capped at two minutes, so the failure stays a clean count instead of a package timeout.
Ref: ethereum#20234
Proposed changes
Fix the
ethtx-sync test wait so it bounds stalled progress rather than total latency, and make the failure diagnosable.Types of changes
Impacted Components
ethprotocol tests only; no production package changed.Checklist
The unchecked items are not applicable: this PR only changes a unit test's wait, with no production path, node behaviour, wire format, or documentation change.