diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7b091c40f..83dc53cfea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,7 @@ on: - "crates/**" - "Cargo.toml" - ".github/workflows/**" + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -167,6 +168,7 @@ jobs: cargo remove sp1-sdk cargo add sp1-sdk --path $GITHUB_WORKSPACE/crates/sdk SP1_DEV=1 RUST_LOG=info cargo run --release + test-cuda: name: Test CUDA runs-on: nvidia-gpu-linux-x64 @@ -200,4 +202,47 @@ jobs: /home/runner/.sp1/bin/sp1up sudo apt install libssl-dev pkg-config cd examples/fibonacci - RUST_LOG=info cargo run --release --features cuda \ No newline at end of file + RUST_LOG=info cargo run --release --features cuda + + rsp-low-memory: + name: Example (RSP Low Memory) + strategy: + matrix: + mem_limit: [16, 32, 64] + runs-on: + [ + runs-on, + "ram=${{ matrix.mem_limit }}", + family=c7a, + image=ubuntu22-full-x64, + "run-id=${{ github.run_id }}", + ] + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Setup CI + uses: ./.github/actions/setup + + - name: Install SP1 toolchain + run: | + curl -L https://sp1.succinct.xyz | bash + ~/.sp1/bin/sp1up + ~/.sp1/bin/cargo-prove prove --version + - name: Install SP1 CLI + run: | + cd crates/cli + cargo install --force --locked --path . + cd ~ + - name: Run script + run: | + cd examples/rsp/program + cargo add sp1-zkvm --path $GITHUB_WORKSPACE/crates/zkvm/entrypoint + cd ../script + cargo remove sp1-sdk + cargo add sp1-sdk --path $GITHUB_WORKSPACE/crates/sdk + SP1_DEV=1 RUST_LOG=info RUSTFLAGS="-C target-cpu=native" cargo run --release -- --prove + + diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8630a06b18..b14cfbee18 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -312,4 +312,47 @@ jobs: cd ../script cargo remove sp1-sdk cargo add sp1-sdk --path $GITHUB_WORKSPACE/crates/sdk - SP1_DEV=1 RUST_LOG=info cargo run --release \ No newline at end of file + SP1_DEV=1 RUST_LOG=info cargo run --release + + rsp-low-memory: + name: Example (RSP Low Memory) + strategy: + matrix: + mem_limit: [16, 32, 64] + runs-on: + [ + runs-on, + "ram=${{ matrix.mem_limit }}", + family=c7a, + image=ubuntu22-full-x64, + "run-id=${{ github.run_id }}", + ] + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Setup CI + uses: ./.github/actions/setup + + - name: Install SP1 toolchain + run: | + curl -L https://sp1.succinct.xyz | bash + ~/.sp1/bin/sp1up + ~/.sp1/bin/cargo-prove prove --version + - name: Install SP1 CLI + run: | + cd crates/cli + cargo install --force --locked --path . + cd ~ + - name: Run script + run: | + cd examples/rsp/program + cargo add sp1-zkvm --path $GITHUB_WORKSPACE/crates/zkvm/entrypoint + cd ../script + cargo remove sp1-sdk + cargo add sp1-sdk --path $GITHUB_WORKSPACE/crates/sdk + SP1_DEV=1 RUST_LOG=info RUSTFLAGS="-C target-cpu=native" cargo run --release -- --prove + + diff --git a/examples/rsp/program/src/main.rs b/examples/rsp/program/src/main.rs index 9ba86bd98c..19e0665484 100644 --- a/examples/rsp/program/src/main.rs +++ b/examples/rsp/program/src/main.rs @@ -1,7 +1,7 @@ #![no_main] sp1_zkvm::entrypoint!(main); -use rsp_client_executor::{io::ClientExecutorInput, ClientExecutor, EthereumVariant}; +use rsp_client_executor::{io::ClientExecutorInput, ClientExecutor, OptimismVariant}; pub fn main() { // Read the input. @@ -10,7 +10,7 @@ pub fn main() { // Execute the block. let executor = ClientExecutor; - let header = executor.execute::(input).expect("failed to execute client"); + let header = executor.execute::(input).expect("failed to execute client"); let block_hash = header.hash_slow(); // Commit the block hash. diff --git a/examples/rsp/script/input/1/20526624.bin b/examples/rsp/script/input/1/20526624.bin deleted file mode 100644 index 688cf1f7b9..0000000000 Binary files a/examples/rsp/script/input/1/20526624.bin and /dev/null differ diff --git a/examples/rsp/script/input/10/122853660.bin b/examples/rsp/script/input/10/122853660.bin new file mode 100644 index 0000000000..25bf1d936c Binary files /dev/null and b/examples/rsp/script/input/10/122853660.bin differ diff --git a/examples/rsp/script/src/main.rs b/examples/rsp/script/src/main.rs index ea526aeb3e..06cb5a197c 100644 --- a/examples/rsp/script/src/main.rs +++ b/examples/rsp/script/src/main.rs @@ -1,6 +1,6 @@ use clap::Parser; use reth_primitives::B256; -use rsp_client_executor::{io::ClientExecutorInput, CHAIN_ID_ETH_MAINNET}; +use rsp_client_executor::{io::ClientExecutorInput, CHAIN_ID_OP_MAINNET}; use std::path::PathBuf; use sp1_sdk::{utils, ProverClient, SP1Stdin}; @@ -28,7 +28,7 @@ fn main() { let args = Args::parse(); // Load the input from the cache. - let client_input = load_input_from_cache(CHAIN_ID_ETH_MAINNET, 20526624); + let client_input = load_input_from_cache(CHAIN_ID_OP_MAINNET, 122853660); // Generate the proof. let client = ProverClient::new();