Repository navigation
feat(seid): add statesync export and import - #4861
Draft
blindchaser wants to merge 8 commits into
Draft
blindchaser wants to merge 8 commits into
blindchaser wants to merge 8 commits into
Conversation
create packs the current FlatKV checkpoint of a running Autobahn node and its state sync proof file into a tar.zst archive, to a file or to stdout. restore installs one into a fresh fullnode home. Both refuse unless [giga.state_sync] enabled is true. restore imports the archived rows into a staged checkpoint, verifies it, and requires its row count, bytes and state hash to equal the manifest. It then prepares the epoch registry from the checkpoint before it writes its marker. After the marker, restore installs the epoch registry and then the checkpoint, so FlatKV reaches the marker height only when the home is complete. With an earlier restore's marker present, restore clears that FlatKV data before it extracts, so the free space check counts it. restore deletes only data that its own marker shows it wrote, and completes when it is run again after any failure or crash. create removes what an earlier stopped run left, and locks the staging parent and the output dir, so a second create on either fails at once. With --out -, create takes stdout before the parent command hooks run, so log lines cannot enter the archive. Co-authored-by: Cursor <cursoragent@cursor.com>
…tore `seid state-sync-snapshot restore` now verifies the archived state sync proof file against the epoch registry of the checkpoint: the road block against the epoch of height H, and the AppQC against its committee. An archive whose proof does not verify is refused before the home changes. After it seeds the epoch registry and before it installs FlatKV, restore stores the AppQC's app hash as the restore anchor at H, the first record of the empty app-hash vault. Node startup publishes that anchor through SetupComplete(H), so the seed only has to write the block records. - statesyncproof: Proof.Verify(epoch). - p2p: VerifyStateSyncProof(registry, data, road). - node: VerifyStateSyncProof, StoreRestoreAnchor, and the shared test fixture StateSyncProofForTesting. - restore: new stop step "restore anchor stored"; the failure goals check the vault at every step. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## yiren/giga-ss5-epoch-seed #4861 +/- ##
=============================================================
+ Coverage 61.64% 61.68% +0.03%
=============================================================
Files 2082 2090 +8
Lines 162138 162949 +811
=============================================================
+ Hits 99946 100511 +565
- Misses 62187 62433 +246
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Nov 16, 2026
Merged
…esync export and import Co-authored-by: Cursor <cursoragent@cursor.com>
statesync import opens the checkpoint epoch registry with node.OpenCheckpointEpochs, verifies the state sync proof against it, and installs it with node.InstallEpochRegistry. The epoch-registry staging dir is gone. Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
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.
Summary
Adds
seid statesync exportandimport.exportpacks a FlatKV checkpoint and its state syncproof file into one archive, and
importinstalls that archive into a fresh Autobahn fullnodehome. This lets an operator start a Giga fullnode without a peer to state sync from.
Stacked on PR 4860 (epoch registry), which
is stacked on PR 4858 (FlatKV).
How it works:
exportlinks the checkpoint so pruning cannot remove it, and refuses a checkpoint without amatching proof file. With
--out -it prints{"height":H}on stderr.proof, then the FlatKV rows in chunks.
importimports the rows into a staging dir and requires the checkpoint stats and state hashto equal the manifest. It opens the epoch registry of the checkpoint in memory and verifies the
proof signatures with it.
hash of H as the restore anchor in an empty app-hash vault, and last the FlatKV checkpoint. An
import that fails or stops can run again on the same home.
The manifest state hash is an integrity check. Trust comes from the AppQC of H+1 that the node
verifies after it starts.
For reviewers
importWithagainst what the seed reads atstartup.
Test plan
signed by another validator, and rows or a state hash that do not match the manifest. A retry
replaces an earlier import, and a completed import holds the anchor.
exportandimportat each step and check that a retry succeeds.scripts/ramtest.sh ./cmd/seid/cmd/statesync ./sei-tendermint/node -race,make fmtcheckand golangci-lint v2.14.0 are clean.