Fetch snapshots during join, rather than at startup#7630
Open
eddyashton wants to merge 38 commits intomicrosoft:mainfrom
Open
Fetch snapshots during join, rather than at startup#7630eddyashton wants to merge 38 commits intomicrosoft:mainfrom
eddyashton wants to merge 38 commits intomicrosoft:mainfrom
Conversation
…_fetch_during_join
…_fetch_during_join
…_fetch_during_join
…_fetch_during_join
eddyashton
commented
Jan 29, 2026
eddyashton
commented
Jan 29, 2026
eddyashton
commented
Jan 29, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Shift snapshot fetching later in the node startup flow so joiners only fetch a newer snapshot after receiving a StartupSeqnoIsOld response, while refactoring snapshot handling to separate receipt verification from snapshot deserialisation.
Changes:
- Move join-time snapshot discovery/fetching into the enclave join path (triggered on
StartupSeqnoIsOld) rather than doing it at host startup. - Refactor snapshot serdes into segment separation + explicit receipt verification, and add helpers to enumerate committed snapshots across directories.
- Update snapshot lookup/redirect behaviour, tests, and operator documentation to reflect the new flow.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/reconfiguration.py | Adjusts join test to exercise redirected snapshot discovery and snapshot absence scenarios. |
| src/snapshots/snapshot_manager.h | Simplifies latest-snapshot lookup API to return a single path from multiple directories. |
| src/snapshots/filenames.h | Adds helpers to list/sort committed snapshots across directories and select the newest. |
| src/snapshots/fetch.h | Updates peer snapshot fetch to use in-memory CA blob rather than a CA path. |
| src/node/snapshot_serdes.h | Splits receipt verification from snapshot application (segment separation + verify + deserialise). |
| src/node/rpc/file_serving_handlers.h | Redirects snapshot requests using the snapshot filename rather than a full path. |
| src/node/node_state.h | Adds join-triggered background snapshot fetching and local snapshot discovery/verification during join/recover. |
| src/host/test/ledger.cpp | Updates tests for the new snapshot-manager return type (path semantics). |
| src/host/run.cpp | Removes host-side snapshot preload/fetch, and forwards join snapshot-fetch settings into StartupConfig. |
| src/enclave/main.cpp | Updates enclave create entrypoint signature (no startup snapshot payload). |
| src/enclave/entry_points.h | Updates enclave create entrypoint declaration accordingly. |
| src/enclave/enclave.h | Updates enclave node creation call signature accordingly. |
| include/ccf/node/startup_config.h | Adds join snapshot-fetch config fields to StartupConfig::Join. |
| doc/operations/ledger_snapshot.rst | Documents the new join flow (including flowchart) and revised snapshot-fetch timing. |
achamayou
reviewed
Jan 30, 2026
…_fetch_during_join
11 tasks
…_fetch_during_join
…shton/CCF into snapshot_fetch_during_join
…_fetch_during_join
…_fetch_during_join
…_fetch_during_join
…_fetch_during_join
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was a 'mare to land. Will add some comments inline.
The goal was to push snapshot fetching later in the startup process, and late enough that we can do it when receiving a
StartupSeqnoIsOlderror response to a/join.While doing that, I've decoupled the verification from the deserialisation of the snapshots, in a hopefully readable way, alongside a bunch of the helper functions for accessing snapshots.