Skip to content

Commit

Permalink
fix: rsp ci test (#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwen01 authored Sep 17, 2024
1 parent 7724722 commit e3ffe8b
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 6 deletions.
47 changes: 46 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- "crates/**"
- "Cargo.toml"
- ".github/workflows/**"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
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
45 changes: 44 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
4 changes: 2 additions & 2 deletions examples/rsp/program/src/main.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -10,7 +10,7 @@ pub fn main() {

// Execute the block.
let executor = ClientExecutor;
let header = executor.execute::<EthereumVariant>(input).expect("failed to execute client");
let header = executor.execute::<OptimismVariant>(input).expect("failed to execute client");
let block_hash = header.hash_slow();

// Commit the block hash.
Expand Down
Binary file removed examples/rsp/script/input/1/20526624.bin
Binary file not shown.
Binary file added examples/rsp/script/input/10/122853660.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/rsp/script/src/main.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e3ffe8b

Please sign in to comment.