go-ethereum/eth/downloader
Karl Bartel 913720b201
eth/downloader: capture deferred head during skeleton sync restart
On L2 chains with fast block times (1-2s), the skeleton sync can enter a death spiral when a missed p2p gossip block creates a chain gap. The gap triggers a sync restart, but filler.suspend() blocks while the backfiller imports queued blocks. During this window, all incoming head events are dropped, causing 2-3+ blocks to be lost at fast block rates. The restart then uses a stale head, the next block creates another gap, and the cycle repeats indefinitely. This problem was introduced by https://github.com/ethereum/go-ethereum/pull/27397 .

Fix this by remembering the latest forced head event received during the suspend window instead of just dropping it, and using it as the restart target. This ensures the restart head is current, so the next arriving block extends the chain without a gap, breaking the cascade.

L1 Ethereum is currently unaffected since suspend() completes well before the next block arrives due to the 12s block time.
2026-03-11 12:39:08 +01:00
..
api.go eth/downloader: fix incomplete code comment (#32354) 2025-08-07 16:31:02 +02:00
beacondevsync.go eth/downloader: keep current syncmode in downloader only (#33157) 2025-12-08 22:49:57 +01:00
beaconsync.go eth/downloader: fix stale beacon header deletion (#33481) 2025-12-29 16:13:30 +08:00
downloader.go eth: resolve finalized from disk if it's not recently announced (#33150) 2026-03-11 11:23:00 +08:00
downloader_test.go eth/protocols/eth: drop protocol version eth/68 (#33511) 2026-02-28 21:43:40 +01:00
events.go
fetchers.go cmd, eth, internal: introduce debug_sync (#32177) 2025-07-28 14:57:45 +08:00
fetchers_concurrent.go eth/downloader: purge pre-merge sync code (#29281) 2024-04-30 15:46:53 +02:00
fetchers_concurrent_bodies.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
fetchers_concurrent_receipts.go eth/protocols/eth: implement eth/69 (#29158) 2025-05-16 17:10:47 +02:00
metrics.go core, eth/downloader: implement pruning mode sync (#31414) 2025-04-03 15:16:35 +02:00
peer.go all: nuke total difficulty (#30744) 2025-01-28 18:55:41 +01:00
queue.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
queue_test.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
resultstore.go core, eth/downloader: implement pruning mode sync (#31414) 2025-04-03 15:16:35 +02:00
skeleton.go eth/downloader: capture deferred head during skeleton sync restart 2026-03-11 12:39:08 +01:00
skeleton_test.go eth/protocols/eth: drop protocol version eth/68 (#33511) 2026-02-28 21:43:40 +01:00
statesync.go eth: request id dispatcher and direct req/reply APIs (#23576) 2021-11-26 13:26:03 +02:00
syncmode.go core, eth: add lock protection in snap sync (#33428) 2025-12-19 09:36:48 +01:00
testchain_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00