Skip to content

feat(state-prune): add snapshot speed knobs#3947

Merged
jolestar merged 3 commits into
mainfrom
feat/state-prune-snapshot-speedups
Feb 2, 2026
Merged

feat(state-prune): add snapshot speed knobs#3947
jolestar merged 3 commits into
mainfrom
feat/state-prune-snapshot-speedups

Conversation

@jolestar

@jolestar jolestar commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Summary\n- add CLI flags to control dedup, final compaction, and auto-compaction during state-prune snapshot\n- allow flush-only finish to avoid long compaction stalls on large snapshots\n- optional skip-dedup to save extra read I/O when SMT nodes are unique\n\n## Testing\n- cargo check -p rooch-pruner\n

Copilot AI review requested due to automatic review settings February 2, 2026 05:18
@vercel

vercel Bot commented Feb 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rooch-portal-v2.1 Ready Ready Preview, Comment Feb 2, 2026 5:28am
test-portal Ready Ready Preview, Comment Feb 2, 2026 5:28am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
rooch Ignored Ignored Preview Feb 2, 2026 5:28am

Request Review

@github-actions

github-actions Bot commented Feb 2, 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 introduces tunable performance/safety knobs for state-prune snapshot creation, focused on dedup behavior and RocksDB compaction/auto-compaction. It wires these knobs from the CLI through the snapshot builder configuration down to the RocksDB-backed writer and adds minimal test updates to reflect the new config fields.

Changes:

  • Adds three new CLI flags to snapshot (--skip-dedup, --skip-final-compact, --enable-auto-compactions) and plumbs them into SnapshotBuilderConfig.
  • Extends SnapshotBuilderConfig and SnapshotNodeWriter to support skipping deduplication, skipping final compaction (flush-only finish), and optionally disabling auto-compactions during snapshot builds, with appropriate behavior changes in traversal and finalization.
  • Updates snapshot-related tests to construct SnapshotBuilderConfig with the new fields and to keep scalable dedup tests aligned with the updated configuration structure.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
crates/rooch/src/commands/db/commands/state_prune/snapshot.rs Adds new CLI flags for deduplication, final compaction, and auto-compactions, and passes them into SnapshotBuilderConfig used to build snapshots and to persist operation metadata.
crates/rooch-pruner/src/state_prune/config.rs Extends SnapshotBuilderConfig with skip_dedup, skip_final_compact, and disable_auto_compactions, including defaults and construction from StatePruneConfig.
crates/rooch-pruner/src/state_prune/snapshot_builder.rs Wires config flags into traversal (optional dedup), SnapshotNodeWriter behavior (skip dedup, optionally disable auto-compactions), and finalize behavior (flush-only vs flush+compact), while keeping metadata and integrity verification paths intact.
crates/rooch-pruner/tests/snapshot_replay_e2e_test.rs Updates the snapshot e2e test configuration to include the new SnapshotBuilderConfig fields so tests compile and continue to exercise snapshot creation behavior with explicit settings.

@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown

Docker images for this PR are available:

  • ghcr.io/rooch-network/rooch:pr-3947
  • ghcr.io/rooch-network/rooch:pr-3947-012f04f

Pull commands:

  • docker pull ghcr.io/rooch-network/rooch:pr-3947
  • docker pull ghcr.io/rooch-network/rooch:pr-3947-012f04f

@jolestar jolestar merged commit cfaa106 into main Feb 2, 2026
29 checks passed
@jolestar jolestar deleted the feat/state-prune-snapshot-speedups branch February 2, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants