Skip to content

[Pruner] Pruner opt compact#3705

Merged
jolestar merged 2 commits into
mainfrom
pruner_opt_compact
Sep 25, 2025
Merged

[Pruner] Pruner opt compact#3705
jolestar merged 2 commits into
mainfrom
pruner_opt_compact

Conversation

@baichuan3

Copy link
Copy Markdown
Contributor

Summary

Summary about this PR

  • Closes #issue

@baichuan3 baichuan3 requested a review from jolestar as a code owner September 21, 2025 11:11
@vercel

vercel Bot commented Sep 21, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
rooch-portal-v2.1 Ready Ready Preview Comment Sep 21, 2025 11:11am
test-portal Ready Ready Preview Comment Sep 21, 2025 11:11am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
rooch Ignored Ignored Sep 21, 2025 11:11am

@github-actions

Copy link
Copy Markdown

Dependency Review

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

Scanned Files

None

@github-actions

Copy link
Copy Markdown

Docker images for this PR are available:

  • ghcr.io/rooch-network/rooch:pr-3705
  • ghcr.io/rooch-network/rooch:pr-3705-b37d443
  • ghcr.io/rooch-network/rooch:pr-3705_debug
  • ghcr.io/rooch-network/rooch:pr-3705-b37d443_debug

Pull commands:

  • docker pull ghcr.io/rooch-network/rooch:pr-3705
  • docker pull ghcr.io/rooch-network/rooch:pr-3705-b37d443
  • docker pull ghcr.io/rooch-network/rooch:pr-3705_debug
  • docker pull ghcr.io/rooch-network/rooch:pr-3705-b37d443_debug

@jolestar jolestar requested a review from Copilot September 22, 2025 05:56

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 optimizes the pruning process for the Rooch blockchain by introducing aggressive compaction and delete range functionality to improve storage efficiency and performance during state pruning operations.

  • Adds delete_range_nodes and aggressive_compact methods to NodeDBStore for more efficient bulk deletions
  • Replaces simple flush operations with flush-and-compact operations during pruning sweeps
  • Adjusts flush interval and logging for better pruning performance monitoring

Reviewed Changes

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

File Description
moveos/moveos-store/src/state_store/mod.rs Adds new methods for range deletion and aggressive compaction of RocksDB state nodes
crates/rooch-pruner/src/sweep_expired.rs Updates pruning logic to use compaction instead of simple flushes and adjusts flush intervals
crates/rooch-pruner/src/pruner.rs Minor logging position adjustment for pruner startup

Comment on lines +120 to +122
// self.moveos_store.node_store.flush_only()?;
// self.moveos_store.node_store.aggressive_compact()?;
self.moveos_store.node_store.flush_and_compact()?;

Copilot AI Sep 22, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out code. The old flush_only() and aggressive_compact() calls should be deleted rather than left as comments, as they add clutter and may cause confusion about the intended implementation.

Copilot uses AI. Check for mistakes.
Comment on lines +160 to +161
// self.moveos_store.node_store.flush_only()?;
// self.moveos_store.node_store.aggressive_compact()?;

Copilot AI Sep 22, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out code. These commented lines should be deleted to keep the codebase clean and avoid confusion about the current implementation approach.

Suggested change
// self.moveos_store.node_store.flush_only()?;
// self.moveos_store.node_store.aggressive_compact()?;

Copilot uses AI. Check for mistakes.
let mut copt = CompactOptions::default();
copt.set_bottommost_level_compaction(BottommostLevelCompaction::Force);
raw_db.compact_range_cf_opt(&cf, None::<&[u8]>, None::<&[u8]>, &copt);
// raw_db.compact_range_cf(&cf, None::<&[u8]>, None::<&[u8]>);

Copilot AI Sep 22, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out code. This alternative compaction call should be deleted since the implementation above it is being used.

Suggested change
// raw_db.compact_range_cf(&cf, None::<&[u8]>, None::<&[u8]>);

Copilot uses AI. Check for mistakes.
@jolestar jolestar merged commit 8422f2d into main Sep 25, 2025
19 of 21 checks passed
@jolestar jolestar deleted the pruner_opt_compact branch September 25, 2025 12:12
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.

3 participants