Skip to content

Fix: chore(snapshot): remove unused/unsupported config knobs#3929

Merged
jolestar merged 2 commits into
mainfrom
holon/fix-3905-20260110-155343
Jan 11, 2026
Merged

Fix: chore(snapshot): remove unused/unsupported config knobs#3929
jolestar merged 2 commits into
mainfrom
holon/fix-3905-20260110-155343

Conversation

@holonbot

@holonbot holonbot Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

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 SnapshotBuilderConfig

File: crates/rooch-pruner/src/state_prune/config.rs

Removed fields:

  • workers - Number of parallel workers (unused in snapshot building)
  • enable_progress_tracking - Progress tracking was always enabled regardless of this setting
  • max_traversal_time_hours - Maximum traversal time limit (not enforced)
  • deduplication_strategy - Only RocksDB strategy is actually implemented
  • enable_bloom_filter - Legacy field replaced by deduplication_strategy
  • bloom_filter_fp_rate - Bloom filter false positive rate (unused)
  • deduplication_batch_size - Separate batch size for deduplication (unused)

Removed methods:

  • DeduplicationStrategy enum (removed entirely as only RocksDB is used)
  • get_deduplication_batch_size() method

Updated methods:

  • validate() - Removed validation for deleted fields
  • should_use_adaptive_batching() - Simplified to only check enable_adaptive_batching
  • from_state_prune_config() - Removed mapping of deleted fields

2. Removed Config Fields from SnapshotConfig

File: crates/rooch-config/src/state_prune.rs

Removed fields:

  • enable_progress_tracking - Unused in snapshot operations
  • max_traversal_time_hours - Not enforced in snapshot creation

3. Updated CLI Command

File: crates/rooch/src/commands/db/commands/state_prune/snapshot.rs

Removed:

  • --workers CLI argument
  • Import of DeduplicationStrategy
  • Hardcoded values for removed config fields

4. Updated Tests

Rust Tests:

  • crates/rooch-pruner/tests/state_prune_tests.rs - Removed assertions for deleted config fields
  • crates/rooch-pruner/src/tests/scalable_dedup_test.rs - Updated test configs to remove deleted fields

TypeScript Tests:

  • sdk/typescript/rooch-pruner-e2e/src/case/state-prune.spec.ts - Removed:
    • --workers CLI flag usage (2 locations)
    • Removed config fields in test configuration objects:
      • enable_progress_tracking
      • workers
      • max_traversal_time_hours
      • enable_bloom_filter
      • bloom_filter_fp_rate

Verification

Build Status

  • cargo check --package rooch-pruner - PASSED
  • cargo check --package rooch-config - PASSED
  • cargo check --package rooch - PASSED

Test Results

  • cargo test --package rooch-pruner --lib state_prune - 12 tests passed
  • cargo test --package rooch-pruner --test state_prune_tests - 17 tests passed

Note: 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)

pub struct SnapshotBuilderConfig {
    pub batch_size: usize,              // Batch size for processing nodes
    pub memory_limit: u64,              // Memory limit in bytes
    pub progress_interval_seconds: u64,  // Progress reporting interval
    pub enable_resume: bool,            // Enable resume functionality
    pub enable_adaptive_batching: bool, // Enable adaptive batch sizing
    pub memory_pressure_threshold: f64, // Memory pressure threshold
}

SnapshotConfig (after changes)

pub struct SnapshotConfig {
    pub default_output_dir: PathBuf,        // Default output directory
    pub max_batch_size: usize,              // Maximum batch size
    pub progress_interval_seconds: u64,     // Progress reporting interval
    pub enable_resume: bool,                // Enable resume functionality
}

Impact

  • Snapshot builder behavior is unchanged for the default path
  • Only RocksDB-based deduplication is now supported (the only working implementation)
  • Configuration is simpler and less confusing for users
  • All removed fields were either unused or had no effect on behavior

@holonbot holonbot Bot requested a review from jolestar as a code owner January 10, 2026 15:53
@vercel

vercel Bot commented Jan 10, 2026

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
rooch-portal-v2.1 Ready Ready Preview, Comment Jan 11, 2026 1:25am
test-portal Ready Ready Preview, Comment Jan 11, 2026 1:25am
1 Skipped Deployment
Project Deployment Review Updated (UTC)
rooch Ignored Ignored Preview Jan 11, 2026 1:25am

@github-actions

github-actions Bot commented Jan 10, 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 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 SnapshotBuilderConfig and associated DeduplicationStrategy enum
  • Removed 2 unused fields from SnapshotConfig
  • Updated CLI command to remove --workers flag 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

@jolestar

Copy link
Copy Markdown
Contributor

@holonbot

Please cargo fmt the code, and make sure the make lint passed

@holonbot

holonbot Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor Author

PR Fix Summary for #3929

Context

PR #3929 "Fix: chore(snapshot): remove unused/unsupported config knobs" had failing CI checks:

  • Rust Lint - failure
  • Quick Checks - failure

Root Cause

The code was not formatted according to Rust's standard formatting rules (rustfmt). This caused:

  1. cargo fmt -- --check to fail (part of Quick Checks)
  2. Rust Lint check to fail (which depends on fmt check passing)

Fix Applied

Ran cargo fmt to automatically format all Rust code according to the project's style guidelines.

Files Modified by Formatting

Only one file required formatting changes:

  • crates/rooch-pruner/tests/state_prune_tests.rs - Line wrapping for import statements

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,
};

Verification

Commands Run

  1. rustup component add rustfmt - Installed rustfmt component
  2. rustup component add clippy - Installed clippy component
  3. cargo fmt - Applied automatic code formatting
  4. cargo fmt -- --check - Verified formatting is correct (PASSED)
  5. make lint - Ran full linting suite (PASSED)

Test Results

  • cargo fmt -- --check: PASSED (no output = all files formatted correctly)
  • make lint: PASSED with message "All linting and formatting checks passed."
    • Clippy warnings shown are pre-existing in third_party/move/ and not related to this PR

PR-Related Changes

The PR itself removes unused snapshot configuration knobs:

  • Removed unused fields from SnapshotBuilderConfig and SnapshotConfig
  • Simplified configuration by removing non-functional options
  • Updated tests and CLI to match

The formatting fix ensures the code follows Rust style conventions.

Next Steps

The PR is now ready for merge. Both CI checks should pass once this fix is pushed.

@github-actions

Copy link
Copy Markdown

Holon completed successfully.

Run: https://github.com/rooch-network/rooch/actions/runs/20887219100

@jolestar jolestar merged commit fdf99a0 into main Jan 11, 2026
29 checks passed
@jolestar jolestar deleted the holon/fix-3905-20260110-155343 branch January 11, 2026 13:23
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.

chore(snapshot): remove unused/unsupported config knobs

2 participants