perf(l1): run batch block execution on spawn_blocking #24150
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: L2 Prover | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["**"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| actions: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| # Work around frequent libgit2/submodule fetch flakiness in CI. | |
| CARGO_NET_GIT_FETCH_WITH_CLI: "true" | |
| CARGO_NET_RETRY: "10" | |
| jobs: | |
| detect-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| run_tests: ${{ steps.finish.outputs.run_tests }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/detect-changes | |
| id: changes | |
| - name: finish | |
| id: finish | |
| # Documentation and repository metadata only: no job here builds it. | |
| run: echo "run_tests=${{ steps.changes.outputs.inert_only == 'false' }}" >> "$GITHUB_OUTPUT" | |
| - name: Print result | |
| run: echo "run_tests=${{ steps.finish.outputs.run_tests }}" | |
| lint_zk: | |
| name: Lint ${{ matrix.backend }} backend | |
| needs: detect-changes | |
| if: ${{ needs.detect-changes.outputs.run_tests == 'true' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # Note: openvm backend linting is disabled due to a problem in the installation https://github.com/lambdaclass/ethrex/issues/5509 | |
| # Note: risc0 backend linting is temporarily disabled: the c-kzg 2.1.8 floor exceeds the | |
| # highest risc0 c-kzg fork tag (v2.1.7-risczero.0), so the guest workspace can't resolve. | |
| # Re-add "risc0" once risc0/c-kzg-4844 publishes a >=2.1.8 tag. | |
| backend: ["sp1", "zisk"] | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Free Disk Space | |
| uses: ./.github/actions/free-disk | |
| - name: Add Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install RISC0 | |
| if: matrix.backend == 'risc0' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| uses: ./.github/actions/install-risc0 | |
| - name: Install SP1 | |
| if: matrix.backend == 'sp1' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| uses: ./.github/actions/install-sp1 | |
| - name: Install ZisK | |
| if: matrix.backend == 'zisk' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SETUP_KEY: none | |
| uses: ./.github/actions/install-zisk | |
| - name: RISC-V OpenVM toolchain install | |
| if: matrix.backend == 'openvm' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| 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 | |
| - name: Check ${{ matrix.backend }} backend | |
| run: | | |
| cargo check -r -p ethrex-prover -F "${{ matrix.backend }},ci" | |
| - name: Clippy ${{ matrix.backend }} backend | |
| run: | | |
| cargo clippy -r -p ethrex-prover --all-targets -F "${{ matrix.backend }},ci" | |
| - name: Check ${{ matrix.backend }} Cargo.lock modified but not committed | |
| run: | | |
| git diff --exit-code -- crates/guest-program/bin/${{ matrix.backend }}/Cargo.lock | |
| # zkevm_bench is a standalone workspace excluded from the root workspace | |
| # (it hard-depends on x86-64-only zisk), so it must be linted explicitly. | |
| # --all-targets compiles the smoke test without running it (the test needs | |
| # a full guest ELF, which CI skips). --locked doubles as a lockfile check. | |
| - name: Clippy zkevm_bench | |
| if: matrix.backend == 'zisk' | |
| run: | | |
| cargo clippy --locked --manifest-path tooling/zkevm_bench/Cargo.toml --all-targets | |
| - name: Check zkevm_bench Cargo.lock modified but not committed | |
| if: matrix.backend == 'zisk' | |
| run: | | |
| git diff --exit-code -- tooling/zkevm_bench/Cargo.lock | |
| lint_exec: | |
| name: Lint exec backend | |
| needs: detect-changes | |
| if: ${{ needs.detect-changes.outputs.run_tests == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Add Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check exec | |
| run: | | |
| cargo check -p ethrex-prover | |
| - name: Clippy exec | |
| run: | | |
| cargo clippy -p ethrex-prover --all-targets | |
| lint_tdx: | |
| name: Lint tdx backend | |
| needs: detect-changes | |
| if: ${{ needs.detect-changes.outputs.run_tests == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Add Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check tdx | |
| run: | | |
| cd crates/l2/tee/quote-gen | |
| cargo check | |
| - name: Clippy tdx | |
| run: | | |
| cd crates/l2/tee/quote-gen | |
| cargo clippy --all-targets | |
| # The purpose of this job is to add it as a required check in GitHub so that we don't have to add every individual job as a required check | |
| all-tests: | |
| # "Lint" is a required check, don't change the name | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| needs: [detect-changes, lint_exec, lint_tdx, lint_zk] | |
| # Make sure this job runs even if the previous jobs failed or were skipped | |
| if: ${{ needs.detect-changes.outputs.run_tests == 'true' && always() && needs.lint_exec.result != 'skipped' && needs.lint_tdx.result != 'skipped' && needs.lint_zk.result != 'skipped' }} | |
| steps: | |
| - name: Check if any job failed | |
| run: | | |
| if [ "${{ needs.lint_exec.result }}" != "success" ]; then | |
| echo "Job Lint exec Check failed" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.lint_tdx.result }}" != "success" ]; then | |
| echo "Job Lint TDX failed" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.lint_zk.result }}" != "success" ]; then | |
| echo "Job Lint ZK failed" | |
| exit 1 | |
| fi |