Fix: chore(snapshot): remove unused/unsupported config knobs#3929
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 |
There was a problem hiding this comment.
Pull request overview
This PR removes unused and unsupported configuration knobs from the snapshot building functionality to simplify the configuration and reduce user confusion. The changes align with issue #3905 by removing fields that were either never used, had no effect on behavior, or corresponded to unimplemented features.
Changes:
- Removed 7 unused fields from
SnapshotBuilderConfigand associatedDeduplicationStrategyenum - Removed 2 unused fields from
SnapshotConfig - Updated CLI command to remove
--workersflag and removed hardcoded values for deleted fields - Updated Rust and TypeScript tests to remove references to deleted configuration fields
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rooch-pruner/src/state_prune/config.rs | Removed unused config fields, DeduplicationStrategy enum, and related methods; simplified validation logic |
| crates/rooch-config/src/state_prune.rs | Removed enable_progress_tracking and max_traversal_time_hours from SnapshotConfig |
| crates/rooch/src/commands/db/commands/state_prune/snapshot.rs | Removed --workers CLI argument and hardcoded values for deleted config fields |
| crates/rooch-pruner/tests/state_prune_tests.rs | Updated test assertions to remove checks for deleted fields; corrected comment about memory_pressure_threshold upper bound |
| crates/rooch-pruner/src/tests/scalable_dedup_test.rs | Removed DeduplicationStrategy import and field references from test configs; updated comments |
| sdk/typescript/rooch-pruner-e2e/src/case/state-prune.spec.ts | Removed --workers CLI flag and deleted config fields from test configuration objects |
|
@holonbot Please cargo fmt the code, and make sure the |
PR Fix Summary for #3929ContextPR #3929 "Fix: chore(snapshot): remove unused/unsupported config knobs" had failing CI checks:
Root CauseThe code was not formatted according to Rust's standard formatting rules (rustfmt). This caused:
Fix AppliedRan Files Modified by FormattingOnly one file required formatting changes:
Specific change: // Before (poorly formatted - line breaks in awkward positions):
use rooch_pruner::state_prune::{
OperationStatus, OperationType, ProgressTracker, SnapshotBuilderConfig,
SnapshotProgress, StatePruneMetadata,
};
// After (properly formatted - single line where reasonable):
use rooch_pruner::state_prune::{
OperationStatus, OperationType, ProgressTracker, SnapshotBuilderConfig, SnapshotProgress,
StatePruneMetadata,
};VerificationCommands Run
Test Results
PR-Related ChangesThe PR itself removes unused snapshot configuration knobs:
The formatting fix ensures the code follows Rust style conventions. Next StepsThe PR is now ready for merge. Both CI checks should pass once this fix is pushed. |
|
Holon completed successfully. Run: https://github.com/rooch-network/rooch/actions/runs/20887219100 |
Fixes #3905
Summary: Remove Unused Snapshot Config Knobs
Issue
GitHub Issue #3905: Remove unused/unsupported snapshot configuration knobs that add confusion.
Changes Made
1. Removed Config Fields from
SnapshotBuilderConfigFile:
crates/rooch-pruner/src/state_prune/config.rsRemoved fields:
workers- Number of parallel workers (unused in snapshot building)enable_progress_tracking- Progress tracking was always enabled regardless of this settingmax_traversal_time_hours- Maximum traversal time limit (not enforced)deduplication_strategy- Only RocksDB strategy is actually implementedenable_bloom_filter- Legacy field replaced by deduplication_strategybloom_filter_fp_rate- Bloom filter false positive rate (unused)deduplication_batch_size- Separate batch size for deduplication (unused)Removed methods:
DeduplicationStrategyenum (removed entirely as only RocksDB is used)get_deduplication_batch_size()methodUpdated methods:
validate()- Removed validation for deleted fieldsshould_use_adaptive_batching()- Simplified to only checkenable_adaptive_batchingfrom_state_prune_config()- Removed mapping of deleted fields2. Removed Config Fields from
SnapshotConfigFile:
crates/rooch-config/src/state_prune.rsRemoved fields:
enable_progress_tracking- Unused in snapshot operationsmax_traversal_time_hours- Not enforced in snapshot creation3. Updated CLI Command
File:
crates/rooch/src/commands/db/commands/state_prune/snapshot.rsRemoved:
--workersCLI argumentDeduplicationStrategy4. Updated Tests
Rust Tests:
crates/rooch-pruner/tests/state_prune_tests.rs- Removed assertions for deleted config fieldscrates/rooch-pruner/src/tests/scalable_dedup_test.rs- Updated test configs to remove deleted fieldsTypeScript Tests:
sdk/typescript/rooch-pruner-e2e/src/case/state-prune.spec.ts- Removed:--workersCLI flag usage (2 locations)enable_progress_trackingworkersmax_traversal_time_hoursenable_bloom_filterbloom_filter_fp_rateVerification
Build Status
cargo check --package rooch-pruner- PASSEDcargo check --package rooch-config- PASSEDcargo check --package rooch- PASSEDTest Results
cargo test --package rooch-pruner --lib state_prune- 12 tests passedcargo test --package rooch-pruner --test state_prune_tests- 17 tests passedNote: One unrelated test (
test_batch_size_performance) failed due to a pre-existing memory alignment issue in bloom_filter.rs, not related to these changes.Remaining Config Fields
SnapshotBuilderConfig (after changes)
SnapshotConfig (after changes)
Impact