go-ethereum/eth/protocols/snap
CPerezz c2e1785a48
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
eth/protocols/snap: restore peers to idle pool on request revert (#33790)
All five `revert*Request` functions (account, bytecode, storage,
trienode heal, bytecode heal) remove the request from the tracked set
but never restore the peer to its corresponding idle pool. When a
request times out and no response arrives, the peer is permanently lost
from the idle pool, preventing new work from being assigned to it.

In normal operation mode (snap-sync full state) this bug is masked by
pivot movement (which resets idle pools via new Sync() cycles every ~15
minutes) and peer churn (reconnections re-add peers via Register()).
However in scenarios like the one I have running my (partial-stateful
node)[https://github.com/ethereum/go-ethereum/pull/33764] with
long-running sync cycles and few peers, all peers can eventually leak
out of the idle pools, stalling sync entirely.

Fix: after deleting from the request map, restore the peer to its idle
pool if it is still registered (guards against the peer-drop path where
Unregister already removed the peer). This mirrors the pattern used in
all five On* response handlers.


This only seems to manifest in peer-thirstly scenarios as where I find
myself when testing snapsync for the partial-statefull node).
Still, thought was at least good to raise this point. Unsure if required
to discuss or not
2026-02-24 09:14:11 +08:00
..
discovery.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
gentrie.go eth/protocols/snap: cleanup dangling account trie nodes due to incomplete storage (#30258) 2024-08-12 10:43:54 +02:00
gentrie_test.go common, eth: remove duplicate test cases (#32624) 2025-09-19 17:20:44 -06:00
handler.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
handler_fuzzing_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
metrics.go eth/protocols/snap: add healing and syncing metrics (#32258) 2025-07-24 16:43:04 +08:00
peer.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
progress_test.go core, eth/protocols/snap, internal/ethapi: remove redundant types (#29841) 2024-05-27 14:39:39 +08:00
protocol.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
range.go eth/protocols/snap: optimize incHash (#32748) 2025-10-10 13:48:25 +08:00
range_test.go eth/protocols/snap: fix snap sync failure on empty storage range (#28306) 2023-10-13 09:08:26 +02:00
sort_test.go core, les, eth: port snap sync changes (#24898) 2022-07-15 14:55:51 +03:00
sync.go eth/protocols/snap: restore peers to idle pool on request revert (#33790) 2026-02-24 09:14:11 +08:00
sync_test.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00