go-ethereum/eth/downloader
rjl493456442 12241bde26
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Keeper Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
core: add debug log and repair the missing hash and receipts (#35190)
This PR improves the block download used by snap sync. Specifically,
blocks and their associated data (receipts and canonical hash mappings)
are now written directly to the database without checking existence.

The current implementation could fail in cases where the block header
and body were already present (has.Block returns true), but the
corresponding canonical hash mapping was missing. One possible scenario
is when a newPayload event is processed without a subsequent
forkChoiceUpdate.

It is still unclear why Geth may re-enter snap sync after Engine API
events have been processed after the sync. Anyway, bypassing the
existence is a reasonable change.

What's more, in the downloader, the presence of canonical hash is also
considered for deciding the range of blocks to be downloaded.
Specifically:

- in the full sync, the block with header and body available but
canonical hash missing will be re-inserted;
- in the snap sync, the block with header, body and receipt available
but canonical hash missing will be re-inserted;
2026-06-23 14:46:38 +08:00
..
api.go eth,node: replace the deprecated TypeMux with Feed (#32585) 2026-05-08 10:12:46 +08:00
beacondevsync.go eth/downloader: keep current syncmode in downloader only (#33157) 2025-12-08 22:49:57 +01:00
beaconsync.go core: add debug log and repair the missing hash and receipts (#35190) 2026-06-23 14:46:38 +08:00
downloader.go core: add debug log and repair the missing hash and receipts (#35190) 2026-06-23 14:46:38 +08:00
downloader_test.go core: add debug log and repair the missing hash and receipts (#35190) 2026-06-23 14:46:38 +08:00
events.go eth,node: replace the deprecated TypeMux with Feed (#32585) 2026-05-08 10:12:46 +08:00
fetchers.go cmd, eth, internal: introduce debug_sync (#32177) 2025-07-28 14:57:45 +08:00
fetchers_concurrent.go eth/downloader: drop peers sending invalid bodies or receipts (#34745) 2026-04-30 17:55:26 +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: implement EIP-7975 (eth/70 - partial block receipt lists) (#33153) 2026-03-30 15:17:37 +02:00
metrics.go eth: reserve peer slot for usable snap peer (#35180) 2026-06-17 09:55:36 +08:00
peer.go eth: implement EIP-7975 (eth/70 - partial block receipt lists) (#33153) 2026-03-30 15:17:37 +02:00
queue.go eth/downloader: use batch index in deliver reconstruct (#34870) 2026-05-05 12:41:22 +02: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 core: add debug log and repair the missing hash and receipts (#35190) 2026-06-23 14:46:38 +08:00
skeleton_test.go core: add debug log and repair the missing hash and receipts (#35190) 2026-06-23 14:46:38 +08:00
statesync.go core, eth/protocols/snap, eth/downloader: snap/2 sync logic (#34626) 2026-06-11 14:45:07 +08: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