fix(statedb): correct rebase artifact boundaries#3974
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes correctness issues in the statedb rebase artifact export/build flow by introducing explicit object-boundary markers and switching the artifact payload from JSONL to typed BCS chunks, ensuring paged objects rebuild deterministically.
Changes:
- Export now writes BCS chunk files with explicit
EndOfObjectrecords to disambiguate paged object boundaries. - Build now reconstructs a fresh output DB from the artifact (no input-store checkpointing) and restores
genesis_info+sequencer_infofrom artifact metadata. - Roundtrip test is strengthened to force paging and chunk splits to exercise boundary handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/dev-guide/mainnet_active_state_rebase_redesign_20260313.md | Updates the design note with the current in-tree implementation status for rebase export/build. |
| crates/rooch/src/commands/statedb/commands/rebase.rs | Implements the v2 BCS-chunk artifact format with end-of-object markers, metadata capture, fresh-build behavior, and stronger roundtrip testing. |
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+220
to
+224
| The first refactor slice now exists in-tree: | ||
|
|
||
| - `rebase-export` writes typed BCS chunks instead of JSONL string records | ||
| - `rebase-build` creates a fresh output DB from the artifact instead of checkpoint-forking the full input store | ||
| - artifact metadata now carries `genesis_info` and `sequencer_info` |
Comment on lines
+338
to
+341
| let genesis_info: moveos_types::genesis_info::GenesisInfo = | ||
| bcs::from_bytes(&fs::read(self.artifact_dir.join(&manifest.genesis_file))?)?; | ||
| let sequencer_info: rooch_types::sequencer::SequencerInfo = | ||
| bcs::from_bytes(&fs::read(self.artifact_dir.join(&manifest.sequencer_file))?)?; |
Comment on lines
+349
to
+352
| for chunk_file in &manifest.chunk_files { | ||
| let chunk: RebaseObjectChunk = | ||
| bcs::from_bytes(&fs::read(self.artifact_dir.join(chunk_file))?)?; | ||
| for record in chunk.records { |
Contributor
Author
|
Addressed the current Copilot comments:
The remaining known gap is still fresh-build continuation dependencies ( |
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
sequencer_infoat export start so artifact cutover metadata is not taken after traversal finishesTesting
cargo fmt --allcargo test -p rooch test_rebase_export_and_build_roundtrip -- --nocaptureNotes