feat(accumulator): compact tx non-frozen nodes#4031
Merged
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces transaction accumulator storage growth by no longer persisting transient (non-frozen) internal nodes, relying on reconstruction from frozen subtree roots/placeholders when needed, and adds a CLI command to clean up historically persisted non-frozen nodes from RocksDB.
Changes:
- Stop writing non-frozen tx accumulator nodes to durable storage while keeping them available via cache/reconstruction for proofs and reopen behavior.
- Add
rooch db tx-accumulator-compactto replay historical leaves, identify persisted non-frozen node hashes, and delete them in batches (optionally forcing RocksDB compaction). - Wire the new command into the
dbCLI command set.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| moveos/moveos-commons/accumulator/src/tree.rs | Avoid persisting non-frozen nodes; add frontier hash reconstruction path during node-hash lookups. |
| crates/rooch/src/commands/db/mod.rs | Register the new TxAccumulatorCompact DB subcommand and dispatch it. |
| crates/rooch/src/commands/db/commands/mod.rs | Export the new tx_accumulator_compact command module. |
| crates/rooch/src/commands/db/commands/tx_accumulator_compact.rs | Implement the compact command, batching/progress output, optional CF compaction, and unit tests. |
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
rooch db tx-accumulator-compactto dry-run/delete historical non-frozen nodes, with batching/progress and optional RocksDB compactionTests
cargo fmt --all -- --checkcargo check -p rooch --bin roochcargo test -p accumulator -- --nocapturecargo test -p rooch tx_accumulator_compact --lib -- --nocapture