go-ethereum/eth
CPerezz cdb4d77819
core, eth: fix end-to-end partial state sync pipeline
Fix several interacting issues that prevented partial state nodes from
syncing and following the chain on bal-devnet-2:

1. Stale pivot deadlock: Replace unconditional pivot suppression with
   rate-limited advances (2-minute cooldown). This prevents the restart
   loop bug while allowing recovery when the initial pivot is too stale
   for peers to serve.

2. Storage root resolution: Add snap-based resolver that queries peers
   for untracked contracts' storage roots during BAL processing. This
   lets the computed state root converge toward the header root.

3. SetCanonical for partial state: When the computed root differs from
   the header root (expected when untracked contracts have unresolved
   storage roots), check HasState(partialState.Root()) instead of only
   HasState(block.Root()). Guard against zero root during snap sync.

4. Canonical hash backfill: AdvancePartialHead now writes canonical
   hashes for all blocks between the pivot and snap head, fixing the
   "final block not in canonical chain" error caused by
   InsertReceiptChain skipping blocks whose bodies already exist.

5. Gap block processing: After snap sync completes, process accumulated
   blocks between the sync head and chain tip using their persisted BALs
   before entering steady-state chain following.

6. Computed root chaining: Use partialState.Root() (actual computed root)
   as parentRoot for subsequent blocks, not the header root. This ensures
   correct trie chaining when computed != header root.

Tested end-to-end on bal-devnet-2: snap sync completes, gap blocks
processed, canonical head advances at chain tip (~1 block/12s).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 12:05:26 +02:00
..
catalyst core, eth: fix end-to-end partial state sync pipeline 2026-04-17 12:05:26 +02:00
downloader core, eth: fix end-to-end partial state sync pipeline 2026-04-17 12:05:26 +02:00
ethconfig eth: add chain retention, BAL engine API support, and bug fixes 2026-04-17 11:55:16 +02:00
fetcher eth/fetcher: fix flaky test by improving event unsubscription (#33950) 2026-03-05 11:48:44 +08:00
filters eth/filters: rangeLogs should error on invalid block range (#33763) 2026-03-18 23:31:40 +01:00
gasestimator core: implement eip-7778: block gas accounting without refunds (#33593) 2026-03-04 18:18:18 +08:00
gasprice eth/gasprice: reduce allocations (#33698) 2026-01-28 20:33:04 +01:00
protocols eth/protocols/snap: add stateless peer cooldown for partial state mode 2026-04-17 12:01:43 +02:00
syncer eth/downloader: keep current syncmode in downloader only (#33157) 2025-12-08 22:49:57 +01:00
tracers core: introduce vm.GasBudget 2026-04-08 15:35:49 +02:00
api_admin.go eth: ignore genesis block on importChain (#27956) 2023-08-21 13:32:34 -04:00
api_backend.go ethapi: add partial state awareness to RPC layer (Phase 4) 2026-04-17 11:11:23 +02:00
api_backend_test.go core/txpool: add eip2681 check for incoming transactions (#32726) 2025-09-25 13:15:12 +02:00
api_debug.go eth/tracers/logger: conform structLog tracing to spec (#34093) 2026-03-31 16:02:40 +02:00
api_debug_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
api_miner.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
backend.go core, eth: fix end-to-end partial state sync pipeline 2026-04-17 12:05:26 +02:00
dropper.go eth: fix panic in randomDuration when min equals max (#33193) 2025-11-19 01:54:53 +08:00
handler.go core, eth: fix end-to-end partial state sync pipeline 2026-04-17 12:05:26 +02:00
handler_eth.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
handler_eth_test.go eth: implement EIP-7975 (eth/70 - partial block receipt lists) (#33153) 2026-03-30 15:17:37 +02:00
handler_partial.go core, eth: fix end-to-end partial state sync pipeline 2026-04-17 12:05:26 +02:00
handler_snap.go core, eth: fix end-to-end partial state sync pipeline 2026-04-17 12:05:26 +02:00
handler_test.go eth: implement EIP-7975 (eth/70 - partial block receipt lists) (#33153) 2026-03-30 15:17:37 +02:00
peer.go eth/protocols/eth: implement eth/69 (#29158) 2025-05-16 17:10:47 +02:00
peerset.go eth: stabilize tx relay peer selection (#31714) 2025-08-28 16:05:54 +02:00
state_accessor.go eth/tracers/logger: conform structLog tracing to spec (#34093) 2026-03-31 16:02:40 +02:00
sync.go miner: add OpenTelemetry spans for block building path (#33773) 2026-03-16 19:24:41 +01:00
sync_test.go eth: implement EIP-7975 (eth/70 - partial block receipt lists) (#33153) 2026-03-30 15:17:37 +02:00