mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
d.partialSyncComplete is consulted by beaconBackfiller.resume() to skip redundant downloader cycles after the initial partial-state sync has finished. It was an in-memory atomic.Bool, so every process restart reset it to false, and the next forkchoiceUpdated from the CL would re-enter the sync loop. Persist the flag in leveldb via a new PartialSyncComplete marker: - Add ReadPartialSyncComplete / WritePartialSyncComplete / DeletePartialSyncComplete accessors in core/rawdb/accessors_chain.go backed by a single-byte value under the PartialSyncComplete key. - Write the marker in the downloader right after AdvancePartialHead succeeds (same spot we flip the in-memory flag). - Rehydrate the in-memory flag from leveldb in Downloader.New() so a freshly-started process with a completed partial-state sync keeps the resume short-circuit active from the first beacon forkchoice. Without this, the restart invariant relied on HasState(header.Root) accidentally returning false to reroute the downloader back to SnapSync; with this the resume guard is the primary protection regardless of how header-root convergence evolves. |
||
|---|---|---|
| .. | ||
| catalyst | ||
| downloader | ||
| ethconfig | ||
| fetcher | ||
| filters | ||
| gasestimator | ||
| gasprice | ||
| protocols | ||
| syncer | ||
| tracers | ||
| api_admin.go | ||
| api_backend.go | ||
| api_backend_test.go | ||
| api_debug.go | ||
| api_debug_test.go | ||
| api_miner.go | ||
| backend.go | ||
| dropper.go | ||
| handler.go | ||
| handler_eth.go | ||
| handler_eth_test.go | ||
| handler_partial.go | ||
| handler_snap.go | ||
| handler_test.go | ||
| peer.go | ||
| peerset.go | ||
| state_accessor.go | ||
| sync.go | ||
| sync_test.go | ||