Skip to content

Introduce state prune with snapshots and changeset replayer#3848

Merged
jolestar merged 9 commits into
mainfrom
state_prune_cmd
Dec 13, 2025
Merged

Introduce state prune with snapshots and changeset replayer#3848
jolestar merged 9 commits into
mainfrom
state_prune_cmd

Conversation

@jolestar

@jolestar jolestar commented Dec 7, 2025

Copy link
Copy Markdown
Contributor

Summary

Summary about this PR

  • Closes #issue

Copilot AI review requested due to automatic review settings December 7, 2025 14:09
@vercel

vercel Bot commented Dec 7, 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 12, 2025 2:20am
test-portal Ready Ready Preview Comment Dec 12, 2025 2:20am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
rooch Ignored Ignored Preview Dec 12, 2025 2:20am

@github-actions

github-actions Bot commented Dec 7, 2025

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 introduces a state pruning system with snapshot creation and changeset replay capabilities for managing large-scale state data in the Rooch blockchain. The implementation includes CLI commands, core pruning logic, configuration management, and comprehensive E2E tests. Additionally, the PR replaces emoji symbols with text-based markers (e.g., [PASS], [FAIL]) in test output across the codebase for better compatibility.

Key changes include:

  • New state-prune CLI command with snapshot and replay subcommands for state management operations
  • Core implementation files including SnapshotBuilder and IncrementalReplayer for snapshot creation and changeset replay
  • Configuration structures and metadata tracking for state pruning operations
  • Extended StateStore with range query capabilities for retrieving changeset batches
  • Comprehensive TypeScript E2E tests validating the state-prune functionality
  • Test output standardization replacing emoji/unicode symbols with ASCII text markers

Reviewed changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
sdk/typescript/rooch-pruner-e2e/src/case/state-prune.spec.ts New E2E test suite for state-prune commands with comprehensive test coverage
crates/testsuite/tests/integration.rs Replaced emoji symbols with text markers in test output
crates/rooch/src/commands/statedb/commands/export.rs Added placeholder snapshot mode implementation and modified state root extraction logic
crates/rooch/src/commands/db/mod.rs Added StatePrune command to DB command enum
crates/rooch/src/commands/db/commands/state_prune_wrapper.rs Wrapper implementation for state-prune commands (duplicate structure)
crates/rooch/src/commands/db/commands/state_prune/*.rs Alternative modular implementation of state-prune commands (conflicts with wrapper)
crates/rooch/src/commands/db/commands/mod.rs Added state_prune_wrapper module export
crates/rooch-types/src/transaction/authenticator.rs Replaced emoji symbols with text markers in test output
crates/rooch-store/src/state_store/mod.rs Added changeset range query methods with iterator and batch fallback
crates/rooch-store/src/lib.rs Forwarded new range query methods from StateDBStore
crates/rooch-pruner/src/tests/*.rs Replaced emoji symbols with text markers across all test files
crates/rooch-pruner/src/state_prune/*.rs Core state pruning implementation including snapshot builder, incremental replayer, progress tracking, and metadata
crates/rooch-pruner/src/lib.rs Added state_prune module export
crates/rooch-pruner/Cargo.toml Added serde_json dependency
crates/rooch-config/src/state_prune.rs Configuration structures for state pruning operations
crates/rooch-config/src/lib.rs Added state_prune module export
Cargo.lock Updated with new dependency (serde_json for rooch-pruner)

Comment thread crates/rooch-config/src/state_prune.rs Outdated
Comment thread crates/rooch/src/commands/db/commands/state_prune/replay.rs Outdated
Comment thread crates/rooch-pruner/src/state_prune/snapshot_builder.rs Outdated
Comment thread crates/rooch-pruner/src/state_prune/incremental_replayer.rs Outdated
Comment thread sdk/typescript/rooch-pruner-e2e/src/case/state-prune.spec.ts Outdated
Comment thread crates/rooch/src/commands/db/commands/state_prune.rs Outdated
Comment thread crates/rooch-pruner/src/state_prune/incremental_replayer.rs
Comment thread sdk/typescript/rooch-pruner-e2e/src/case/state-prune.spec.ts
Comment thread sdk/typescript/rooch-pruner-e2e/src/case/state-prune.spec.ts
Comment thread sdk/typescript/rooch-pruner-e2e/src/case/state-prune.spec.ts Outdated
@github-actions

github-actions Bot commented Dec 8, 2025

Copy link
Copy Markdown

Docker images for this PR are available:

  • ghcr.io/rooch-network/rooch:pr-3848
  • ghcr.io/rooch-network/rooch:pr-3848-115eb99
  • ghcr.io/rooch-network/rooch:pr-3848_debug
  • ghcr.io/rooch-network/rooch:pr-3848-115eb99_debug

Pull commands:

  • docker pull ghcr.io/rooch-network/rooch:pr-3848
  • docker pull ghcr.io/rooch-network/rooch:pr-3848-115eb99
  • docker pull ghcr.io/rooch-network/rooch:pr-3848_debug
  • docker pull ghcr.io/rooch-network/rooch:pr-3848-115eb99_debug

@jolestar jolestar merged commit 0fdef34 into main Dec 13, 2025
16 of 17 checks passed
@jolestar jolestar deleted the state_prune_cmd branch December 13, 2025 08:11
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