Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/actions/rust-setup/action.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
runs:
using: composite
steps:
- id: preinstalled
run: |
set -euo pipefail
if command -v rustc >/dev/null 2>&1 \
&& command -v cargo >/dev/null 2>&1 \
&& cargo fmt --version >/dev/null 2>&1 \
&& cargo clippy --version >/dev/null 2>&1; then
echo "available=true" >> "$GITHUB_OUTPUT"
rustc --version
cargo --version
cargo fmt --version
cargo clippy --version
else
echo "available=false" >> "$GITHUB_OUTPUT"
fi
shell: bash

- run: |
set -euo pipefail
packages=(
Expand Down Expand Up @@ -44,5 +61,10 @@ runs:
shell: bash

- uses: dtolnay/rust-toolchain@1.91.1
if: ${{ steps.preinstalled.outputs.available != 'true' }}
env:
HTTP_PROXY: ${{ runner.environment == 'self-hosted' && 'http://192.168.1.89:7890' || '' }}
HTTPS_PROXY: ${{ runner.environment == 'self-hosted' && 'http://192.168.1.89:7890' || '' }}
NO_PROXY: ${{ runner.environment == 'self-hosted' && 'localhost,127.0.0.1,192.168.0.0/16,172.16.0.0/16,192.168.250.0/24' || '' }}
with:
components: rustfmt, clippy
66 changes: 6 additions & 60 deletions .github/workflows/check_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ env:
ENV_TEST_ON_CI: 1
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
HTTP_PROXY: http://192.168.1.89:7890
HTTPS_PROXY: http://192.168.1.89:7890
NO_PROXY: localhost,127.0.0.1,192.168.0.0/16,172.16.0.0/16,192.168.250.0/24
GIT_CONFIG_COUNT: 2
GIT_CONFIG_KEY_0: http.version
GIT_CONFIG_VALUE_0: HTTP/1.1
Expand Down Expand Up @@ -89,12 +92,6 @@ jobs:
- name: Setup Rust
uses: ./.github/actions/rust-setup

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: 'ci'
cache-on-failure: true

- name: Install cargo tools
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -147,12 +144,6 @@ jobs:
- name: Setup Rust
uses: ./.github/actions/rust-setup

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: 'ci'
cache-on-failure: true

- name: Install cargo tools
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -188,12 +179,6 @@ jobs:
- name: Setup Rust
uses: ./.github/actions/rust-setup

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: 'ci'
cache-on-failure: true

- name: Install cargo tools
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -229,12 +214,6 @@ jobs:
- name: Setup Rust
uses: ./.github/actions/rust-setup

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: 'ci'
cache-on-failure: true

- name: Install cargo tools
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -270,12 +249,6 @@ jobs:
- name: Setup Rust
uses: ./.github/actions/rust-setup

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: 'ci'
cache-on-failure: true

- name: Install cargo tools
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -311,12 +284,6 @@ jobs:
- name: Setup Rust
uses: ./.github/actions/rust-setup

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: 'ci'
cache-on-failure: true

- name: Install cargo tools
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -351,7 +318,7 @@ jobs:
id: binaries
shell: bash
run: |
if [[ -x target/optci/rooch && -x target/optci/rooch-genesis && -x target/optci/framework-release ]]; then
if [[ -f target/optci/rooch && -f target/optci/rooch-genesis && -f target/optci/framework-release ]]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
Expand All @@ -362,13 +329,6 @@ jobs:
if: ${{ steps.binaries.outputs.available != 'true' }}
uses: ./.github/actions/rust-setup

- name: Cache Rust dependencies for local binary rebuild fallback
if: ${{ steps.binaries.outputs.available != 'true' }}
uses: Swatinem/rust-cache@v2
with:
shared-key: 'ci'
cache-on-failure: true

- name: Rebuild binaries locally when artifact download is unavailable
if: ${{ steps.binaries.outputs.available != 'true' }}
run: cargo build --profile optci --workspace --bins -j 16
Expand Down Expand Up @@ -415,7 +375,7 @@ jobs:
id: binaries
shell: bash
run: |
if [[ -x target/optci/rooch && -x target/optci/rooch-genesis && -x target/optci/framework-release ]]; then
if [[ -f target/optci/rooch && -f target/optci/rooch-genesis && -f target/optci/framework-release ]]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
Expand All @@ -426,13 +386,6 @@ jobs:
if: ${{ steps.binaries.outputs.available != 'true' }}
uses: ./.github/actions/rust-setup

- name: Cache Rust dependencies for local binary rebuild fallback
if: ${{ steps.binaries.outputs.available != 'true' }}
uses: Swatinem/rust-cache@v2
with:
shared-key: 'ci'
cache-on-failure: true

- name: Rebuild binaries locally when artifact download is unavailable
if: ${{ steps.binaries.outputs.available != 'true' }}
run: cargo build --profile optci --workspace --bins -j 16
Expand Down Expand Up @@ -475,7 +428,7 @@ jobs:
id: binaries
shell: bash
run: |
if [[ -x target/optci/rooch && -x target/optci/rooch-genesis && -x target/optci/framework-release ]]; then
if [[ -f target/optci/rooch && -f target/optci/rooch-genesis && -f target/optci/framework-release ]]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
Expand All @@ -486,13 +439,6 @@ jobs:
if: ${{ steps.binaries.outputs.available != 'true' }}
uses: ./.github/actions/rust-setup

- name: Cache Rust dependencies for local binary rebuild fallback
if: ${{ steps.binaries.outputs.available != 'true' }}
uses: Swatinem/rust-cache@v2
with:
shared-key: 'ci'
cache-on-failure: true

- name: Rebuild binaries locally when artifact download is unavailable
if: ${{ steps.binaries.outputs.available != 'true' }}
run: cargo build --profile optci --workspace --bins -j 16
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/cross_platform_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ env:
CARGO_BUILD_JOBS: 2
CARGO_NET_RETRY: 10
CARGO_NET_GIT_FETCH_WITH_CLI: true
HTTP_PROXY: http://192.168.1.89:7890
HTTPS_PROXY: http://192.168.1.89:7890
NO_PROXY: localhost,127.0.0.1,192.168.0.0/16,172.16.0.0/16,192.168.250.0/24
GIT_CONFIG_COUNT: 2
GIT_CONFIG_KEY_0: http.version
GIT_CONFIG_VALUE_0: HTTP/1.1
Expand Down Expand Up @@ -74,19 +77,16 @@ jobs:
Write-Host "=== Disk Space Before Build ==="
Get-PSDrive -PSProvider FileSystem | Select-Object Name, @{Name='Used(GB)';Expression={[math]::Round($_.Used/1GB,2)}}, @{Name='Free(GB)';Expression={[math]::Round($_.Free/1GB,2)}}

- name: Setup Rust (self-hosted Linux)
if: matrix.os == 'self-hosted'
uses: ./.github/actions/rust-setup

- name: Install Rust toolchain
if: matrix.os == 'windows-latest'
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}

- name: Cache Rust dependencies (Optimized)
uses: Swatinem/rust-cache@v2
with:
shared-key: cross-platform-${{ matrix.target }}
cache-on-failure: true
cache-targets: true
cache-all-crates: true

- name: Install Linux dependencies
if: matrix.os == 'self-hosted'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
jobs:
check_validation_changes:
name: Check Validation Changes
runs-on: [self-hosted, larger-runner, ephemeral-vm]
runs-on: ubuntu-latest
outputs:
dockerfile_debug: ${{ steps.changes.outputs.dockerfile_debug }}
dockerfile: ${{ steps.changes.outputs.dockerfile }}
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,17 @@ generate-genesis:
# Install required cargo tools
install-tools:
@echo "🔧 Installing required cargo tools..."
cargo install cargo-machete --locked --version 0.7.0
cargo install cargo-nextest --locked --version 0.9.97-b.2
@echo "✅ All required cargo tools are installed"
@mkdir -p "$(HOME)/.cargo/bin"
@if command -v cargo-machete >/dev/null 2>&1; then \
echo "Using preinstalled cargo-machete"; \
else \
echo "Installing cargo-machete from GitHub releases..."; \
curl -LsSf https://github.com/bnjbvr/cargo-machete/releases/download/v0.7.0/cargo-machete-v0.7.0-x86_64-unknown-linux-musl.tar.gz | tar xz -C "$(HOME)/.cargo/bin"; \
fi
@if cargo nextest --version >/dev/null 2>&1; then \
echo "Using preinstalled cargo-nextest"; \
else \
echo "Installing cargo-nextest from GitHub releases..."; \
curl -LsSf https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-0.9.97/cargo-nextest-0.9.97-x86_64-unknown-linux-gnu.tar.gz | tar xz -C "$(HOME)/.cargo/bin"; \
fi
@echo "✅ All required cargo tools are installed"
5 changes: 5 additions & 0 deletions crates/rooch-config/src/state_prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ pub struct ReplayConfig {
/// Enable verification of final state root
pub verify_final_state_root: bool,

/// Skip final compact/cleanup for the output DB (faster cutover, larger on-disk)
#[serde(default)]
pub skip_final_compact: bool,

/// Enable intermediate checkpoints during replay
pub enable_checkpoints: bool,

Expand Down Expand Up @@ -237,6 +241,7 @@ impl Default for ReplayConfig {
Self {
default_batch_size: 1000,
verify_final_state_root: true,
skip_final_compact: false,
enable_checkpoints: true,
checkpoint_interval: 10000,
max_retry_attempts: 3,
Expand Down
1 change: 1 addition & 0 deletions crates/rooch-pruner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ moveos-config = { workspace = true }
moveos-types = { workspace = true }
move-core-types = { workspace = true }
raw-store = { workspace = true }
accumulator = { workspace = true }
bcs = { workspace = true }
sysinfo = { workspace = true }
rocksdb = { workspace = true }
Expand Down
Loading
Loading