Skip to content

gc optimize#3843

Merged
jolestar merged 10 commits into
mainfrom
gc_optimize
Dec 4, 2025
Merged

gc optimize#3843
jolestar merged 10 commits into
mainfrom
gc_optimize

Conversation

@jolestar

@jolestar jolestar commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Summary

Summary about this PR

  • Closes #issue

Copilot AI review requested due to automatic review settings December 3, 2025 13:09
@jolestar jolestar requested a review from baichuan3 as a code owner December 3, 2025 13:09
@vercel

vercel Bot commented Dec 3, 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 Dec 3, 2025 11:13pm
test-portal Ready Ready Preview Comment Dec 3, 2025 11:13pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
rooch Ignored Ignored Preview Dec 3, 2025 11:13pm

@github-actions

github-actions Bot commented Dec 3, 2025

Copy link
Copy Markdown

Dependency Review

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

OpenSSF Scorecard

PackageVersionScoreDetails
cargo/crossbeam-deque >= 0.8.0, < 0.9.0 🟢 4.3
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Code-Review🟢 3Found 7/21 approved changesets -- score normalized to 3
Maintained⚠️ 20 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 2
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Vulnerabilities🟢 100 existing vulnerabilities detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • crates/rooch-pruner/Cargo.toml

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 implements garbage collection optimizations for the Rooch blockchain pruner. The main focus is on improving performance through batched I/O operations and parallel processing with work-stealing. The changes introduce a new AtomicBloomFilterMarker for thread-safe node marking, refactor the reachability analysis to use batch reads, and add a parallel implementation with work-stealing for multi-core systems.

Key changes:

  • Added multi_get batch read method to NodeDBStore for efficient I/O
  • Implemented AtomicBloomFilterMarker using atomic operations for lock-free parallel marking
  • Refactored single-threaded reachability to use batch I/O processing
  • Added parallel reachability builder with work-stealing using crossbeam-deque
  • Updated GC integration to choose between parallel and single-threaded modes
  • Added comprehensive test coverage for parallel execution scenarios

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
moveos/moveos-store/src/state_store/mod.rs Added multi_get method for batch node retrieval to optimize I/O
crates/rooch-pruner/src/marker.rs Implemented AtomicBloomFilterMarker with lock-free atomic operations for parallel GC
crates/rooch-pruner/src/reachability.rs Refactored reachability analysis with batch I/O and added parallel work-stealing implementation
crates/rooch-pruner/src/garbage_collector.rs Updated to conditionally use parallel or single-threaded reachability based on worker count
crates/rooch-pruner/src/tests/reachability_correctness.rs Added extensive tests for parallel execution, work stealing, and consistency validation
crates/rooch-pruner/src/tests/gc_integration_test.rs Updated expected marker type to reflect AtomicBloomFilter usage
crates/rooch-pruner/Cargo.toml Added crossbeam-deque dependency for work-stealing queues
Cargo.lock Updated lock file with crossbeam-deque 0.8 dependency

Comment thread moveos/moveos-store/src/state_store/mod.rs
Comment thread crates/rooch-pruner/src/marker.rs
Comment thread crates/rooch-pruner/src/reachability.rs
Comment thread crates/rooch-pruner/src/reachability.rs Outdated
Comment thread crates/rooch-pruner/src/reachability.rs Outdated
Comment thread crates/rooch-pruner/src/tests/reachability_correctness.rs
Comment thread crates/rooch-pruner/src/marker.rs
Comment thread crates/rooch-pruner/src/reachability.rs
Comment thread crates/rooch-pruner/src/marker.rs
Comment thread crates/rooch-pruner/src/marker.rs
@github-actions

github-actions Bot commented Dec 3, 2025

Copy link
Copy Markdown

Docker images for this PR are available:

  • ghcr.io/rooch-network/rooch:pr-3843
  • ghcr.io/rooch-network/rooch:pr-3843-a887a1d
  • ghcr.io/rooch-network/rooch:pr-3843_debug
  • ghcr.io/rooch-network/rooch:pr-3843-a887a1d_debug

Pull commands:

  • docker pull ghcr.io/rooch-network/rooch:pr-3843
  • docker pull ghcr.io/rooch-network/rooch:pr-3843-a887a1d
  • docker pull ghcr.io/rooch-network/rooch:pr-3843_debug
  • docker pull ghcr.io/rooch-network/rooch:pr-3843-a887a1d_debug

@jolestar jolestar merged commit 546d210 into main Dec 4, 2025
17 checks passed
@jolestar jolestar deleted the gc_optimize branch December 4, 2025 00:52
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