Verify ledger recovery from snapshot suffixes - #16
Merged
Conversation
Replay post-snapshot history through an independent recovered ledger and require its final state and root to match authoritative full-genesis replay. Cover genesis, behind-head, and head snapshots across restart.\n\nRefs #11
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.
Linked work
Advances #11
Outcome
Every retained snapshot now drives an independent recovery path: reopening starts a second ledger from the decoded snapshot, replays only later journal rows through fresh ordered queries, and requires the recovered head to equal authoritative full-genesis replay.
Scope
Included:
Excluded:
Protocol and compatibility impact
None. Full genesis replay remains the M1 startup and audit authority. This adds the independent snapshot-plus-suffix recovery check required by ADR 0007 without changing canonical ledger outputs or stored bytes.
Verification
Candidate:
f5a137a1df1d901067cd11531211bfa90a20dac6Passed locally:
cmake --build --preset gcc-debug --target storage_snapshot_v1_tests storage_sqlite_history_tests storage_sqlite_ledger_testsctest --test-dir out/build/gcc-debug --output-on-failure -R '^storage-(sqlite-ledger|sqlite-history|snapshot-v1)$'— 3/3 passedgit diff --checkGitHub Actions run 30164373238 passed on the exact candidate:
Risks and follow-up
The second recovery path intentionally duplicates history reads and kernel execution for audit independence. Full replay still constructs the published head. The next issue #11 slice is the canonical portable archive codec and serialized export/import boundary.
Checklist
current-state.mdare accurate.