diff --git a/.github/actions/install-openvm/action.yml b/.github/actions/install-openvm/action.yml new file mode 100644 index 00000000..1c5e9e25 --- /dev/null +++ b/.github/actions/install-openvm/action.yml @@ -0,0 +1,12 @@ +name: "Install OpenVM" +description: "Install OpenVM Toolchain" + +runs: + using: "composite" + steps: + - name: Install OpenVM + shell: bash + run: | + rustup install nightly-2025-02-14 + rustup component add rust-src --toolchain nightly-2025-02-14 + cargo +1.86 install --locked --git https://github.com/openvm-org/openvm.git --tag v1.4.1 cargo-openvm diff --git a/.github/workflows/pr-main.yaml b/.github/workflows/pr-main.yaml index 2a293796..59ddeee5 100644 --- a/.github/workflows/pr-main.yaml +++ b/.github/workflows/pr-main.yaml @@ -17,7 +17,19 @@ jobs: strategy: fail-fast: false matrix: - features: ["", "l2", "l2,sp1", "l2,risc0", "l2,zisk", "sp1", "risc0", "zisk"] + features: + [ + "", + "l2", + "l2,sp1", + "l2,risc0", + "l2,zisk", + "l2,openvm", + "sp1", + "risc0", + "zisk", + "openvm", + ] steps: - name: Checkout sources uses: actions/checkout@v4 @@ -48,6 +60,10 @@ jobs: if: contains(matrix.features, 'zisk') uses: ./.github/actions/install-zisk + - name: Install OpenVM + if: contains(matrix.features, 'openvm') + uses: ./.github/actions/install-openvm + - name: cargo fmt --check --all if: matrix.features == '' # Run only without features because it's redundant to run it on all jobs run: cargo fmt --check --all @@ -97,7 +113,7 @@ jobs: strategy: fail-fast: false matrix: - backend: ["sp1", "risc0", "exec"] + backend: ["sp1", "risc0", "exec", "zisk", "openvm"] steps: - name: Checkout sources uses: actions/checkout@v4 @@ -116,22 +132,23 @@ jobs: if: matrix.backend == 'sp1' uses: ./.github/actions/install-sp1 - - name: Build Risc0 - if: matrix.backend == 'risc0' - run: | - cargo b -r --no-default-features --features "${{ matrix.backend }}" + - name: Install OpenVM + if: matrix.backend == 'openvm' + uses: ./.github/actions/install-openvm - - name: Build SP1 - if: matrix.backend == 'sp1' + - name: Build + # Skip reason: https://github.com/lambdaclass/ethrex-replay/issues/53 + if: ${{ matrix.backend != 'zisk' }} run: | - cargo b -r --features "${{ matrix.backend }}" - - - name: Build No backend - if: matrix.backend == 'exec' - run: | - cargo b -r + if [ "${{ matrix.backend }}" = "exec" ]; then + cargo b -r + else + cargo b -r --features "${{ matrix.backend }}" + fi - name: Run + # Skip reason: https://github.com/lambdaclass/ethrex-replay/issues/53 + if: ${{ matrix.backend != 'zisk' }} env: BLOCK_NUMBER: 1265656 NETWORK: hoodi diff --git a/Makefile b/Makefile index 1d9138e4..b63e11e3 100644 --- a/Makefile +++ b/Makefile @@ -11,23 +11,48 @@ else REPLAY_BLOCK_ARGS := $(BLOCK_NUMBER) --rpc-url $(RPC_URL) endif -## Execution block +# Execution execute-ci: cargo r -r --no-default-features -- block $(REPLAY_BLOCK_ARGS) +execute-sp1-ci: + cargo r -r --features sp1 -- block --zkvm sp1 $(REPLAY_BLOCK_ARGS) --bench + +execute-risc0-ci: + cargo r -r --no-default-features --features risc0 -- block --zkvm risc0 $(REPLAY_BLOCK_ARGS) --bench + +execute-zisk-ci: + cargo r -r --features zisk -- block --zkvm zisk $(REPLAY_BLOCK_ARGS) --bench + +execute-openvm-ci: + cargo r -r --features openvm -- block --zkvm openvm $(REPLAY_BLOCK_ARGS) --bench + +# Proving + prove-sp1-gpu-ci: SP1_PROVER=cuda cargo r -r --features "sp1,gpu" -- block --zkvm sp1 --action prove --resource gpu $(REPLAY_BLOCK_ARGS) --bench prove-risc0-gpu-ci: cargo r -r --no-default-features --features "risc0,gpu" -- block --zkvm risc0 --action prove --resource gpu $(REPLAY_BLOCK_ARGS) --bench -execute-sp1-ci: - cargo r -r --features "sp1" -- block --zkvm sp1 $(REPLAY_BLOCK_ARGS) --bench +# Checks -execute-risc0-ci: - cargo r -r --no-default-features --features "risc0" -- block --zkvm risc0 $(REPLAY_BLOCK_ARGS) --bench +# GPU variants are not checked here to avoid requiring CUDA. +check: + cargo check --release + cargo check --release -F sp1 + cargo check --release -F sp1,profiling + cargo check --release -F risc0 + cargo check --release -F zisk + cargo check --release -F openvm + cargo check --release -F l2 + cargo check --release -F l2,sp1 + cargo check --release -F l2,sp1,profiling + cargo check --release -F l2,risc0 + cargo check --release -F l2,zisk + cargo check --release -F l2,openvm -update_ethrex: +update-ethrex: cargo update \ -p ethrex-config \ -p ethrex-storage \ @@ -42,6 +67,5 @@ update_ethrex: -p ethrex-l2 \ -p ethrex-storage-rollup \ -p ethrex-l2-rpc \ - -p ethrex\ - -prover \ + -p ethrex-prover \ -p guest_program diff --git a/src/cli.rs b/src/cli.rs index 60334129..5a3f0286 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -227,6 +227,7 @@ pub struct EthrexReplayOptions { pub enum ZKVM { Jolt, Nexus, + #[clap(name = "openvm")] OpenVM, Pico, Risc0,