Skip to content

feat(accumulator): compact tx non-frozen nodes#4031

Merged
jolestar merged 2 commits into
mainfrom
feat/tx-accumulator-compact
Jul 5, 2026
Merged

feat(accumulator): compact tx non-frozen nodes#4031
jolestar merged 2 commits into
mainfrom
feat/tx-accumulator-compact

Conversation

@jolestar

@jolestar jolestar commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop persisting transient non-frozen tx accumulator nodes while keeping them in cache for proofs/reopen behavior
  • add rooch db tx-accumulator-compact to dry-run/delete historical non-frozen nodes, with batching/progress and optional RocksDB compaction
  • add unit coverage for replaying historical non-frozen hashes and deleting only existing candidates

Tests

  • cargo fmt --all -- --check
  • cargo check -p rooch --bin rooch
  • cargo test -p accumulator -- --nocapture
  • cargo test -p rooch tx_accumulator_compact --lib -- --nocapture

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-compact to replay historical leaves, identify persisted non-frozen node hashes, and delete them in batches (optionally forcing RocksDB compaction).
  • Wire the new command into the db CLI 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.

Comment thread crates/rooch/src/commands/db/commands/tx_accumulator_compact.rs
Comment thread crates/rooch/src/commands/db/commands/tx_accumulator_compact.rs Outdated
Comment thread crates/rooch/src/commands/db/commands/tx_accumulator_compact.rs Outdated
Comment thread moveos/moveos-commons/accumulator/src/tree.rs
@jolestar
jolestar merged commit f48c82e into main Jul 5, 2026
16 of 19 checks passed
@jolestar
jolestar deleted the feat/tx-accumulator-compact branch July 5, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants