go-ethereum/eth/fetcher
Csaba Kiraly 47c603388a eth/fetcher: add onAccepted callback to fix attribution race
enqueueAndTrack used pool.Has() after Enqueue to determine accepted
txs. Under concurrent delivery of the same tx from two peers, both
could see Has()==true, making attribution non-deterministic.

Add an onAccepted callback to the fetcher, called from Enqueue with
(peer, acceptedHashes) immediately after pool.Add returns for each
batch. Attribution happens atomically inside Enqueue using the per-tx
error from addTxs (nil = accepted), before another goroutine can
race.

Remove the enqueueAndTrack helper from handler_eth.go — the fetcher
now handles notification directly.
2026-04-10 12:18:56 +02:00
..
metrics.go eth: check for tx on chain as well (#33607) 2026-02-24 11:21:03 +01:00
tx_fetcher.go eth/fetcher: add onAccepted callback to fix attribution race 2026-04-10 12:18:56 +02:00
tx_fetcher_test.go eth/fetcher: add onAccepted callback to fix attribution race 2026-04-10 12:18:56 +02:00