mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-09 16:31:35 +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. |
||
|---|---|---|
| .. | ||
| api.go | ||
| beacondevsync.go | ||
| beaconsync.go | ||
| downloader.go | ||
| downloader_test.go | ||
| events.go | ||
| fetchers.go | ||
| fetchers_concurrent.go | ||
| fetchers_concurrent_bodies.go | ||
| fetchers_concurrent_receipts.go | ||
| metrics.go | ||
| peer.go | ||
| queue.go | ||
| queue_test.go | ||
| resultstore.go | ||
| skeleton.go | ||
| skeleton_test.go | ||
| statesync.go | ||
| syncmode.go | ||
| testchain_test.go | ||