[Pruner] Pruner opt compact#3705
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Docker images for this PR are available:
Pull commands:
|
There was a problem hiding this comment.
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_nodesandaggressive_compactmethods 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 |
| // self.moveos_store.node_store.flush_only()?; | ||
| // self.moveos_store.node_store.aggressive_compact()?; | ||
| self.moveos_store.node_store.flush_and_compact()?; |
There was a problem hiding this comment.
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.
| // self.moveos_store.node_store.flush_only()?; | ||
| // self.moveos_store.node_store.aggressive_compact()?; |
There was a problem hiding this comment.
Remove commented-out code. These commented lines should be deleted to keep the codebase clean and avoid confusion about the current implementation approach.
| // self.moveos_store.node_store.flush_only()?; | |
| // self.moveos_store.node_store.aggressive_compact()?; |
| 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]>); |
There was a problem hiding this comment.
Remove commented-out code. This alternative compaction call should be deleted since the implementation above it is being used.
| // raw_db.compact_range_cf(&cf, None::<&[u8]>, None::<&[u8]>); |
Summary
Summary about this PR