feat: Switch verifier 6 to rolling hash #654
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: "Rust CI" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - stable | |
| pull_request: | |
| permissions: read-all | |
| jobs: | |
| tests: | |
| name: tests | |
| runs-on: [matterlabs-ci-runner-highmem] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "" | |
| - name: Setup | |
| run: | | |
| rustup set profile minimal | |
| - name: Compile | |
| run: cargo build --verbose | |
| # - name: tests | |
| # run: cargo test --profile cli -- --nocapture | |
| formatting: | |
| name: cargo fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: rustfmt | |
| rustflags: "" | |
| - name: Setup | |
| run: | | |
| rustup set profile minimal | |
| - name: Rustfmt Check | |
| uses: actions-rust-lang/rustfmt@v1 | |
| simulator_isa_tests: | |
| name: ISA tests for simulator | |
| runs-on: [matterlabs-ci-runner-highmem] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "" | |
| - name: Setup | |
| run: | | |
| rustup set profile minimal | |
| - name: tests | |
| working-directory: ./risc_v_simulator | |
| run: cargo test --release --features=delegation | |
| # run: cargo test --release | |
| # - name: tests | |
| # run: cargo test --profile cli -- --nocapture | |
| # isa_tests: | |
| # name: ISA tests | |
| # runs-on: [matterlabs-ci-runner-highmem] | |
| # steps: | |
| # - uses: actions/checkout@v3 | |
| # - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| # with: | |
| # rustflags: "" | |
| # - name: Setup | |
| # run: | | |
| # rustup set profile minimal | |
| # - name: tests | |
| # working-directory: ./circuit_defs/opcode_tests | |
| # run: cargo test --profile test-release --lib --package opcode_tests | |
| # # run: cargo test --release | |
| # # - name: tests | |
| # # run: cargo test --profile cli -- --nocapture | |
| full_recursion_fast: | |
| # full recursion using a pre-compiled binaries. | |
| name: full_recursion_fast | |
| runs-on: [matterlabs-ci-runner-c3d] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "" | |
| - name: Display CPU Info | |
| run: | | |
| echo "Checking CPU capabilities..." | |
| lscpu | grep avx512 || echo "AVX-512 not supported on this runner" | |
| - name: Setup | |
| run: | | |
| rustup set profile minimal | |
| - name: Run Blake(fibonacci) and prove | |
| working-directory: execution_utils | |
| run: cargo test --release -- --nocapture --exact test_prove_fib | |
| # run: cargo test --release -- --nocapture --ignored test_prove_fib | |
| - name: Run base layer recursive verifier over Blake(fibonacci) and prove | |
| working-directory: execution_utils | |
| run: cargo test --release -- --nocapture --exact test_prove_recursion_over_base | |
| # run: cargo test --release -- --nocapture --ignored test_prove_recursion_over_base | |
| - name: Run recursive layer verifier over base layer verifier and prove | |
| working-directory: execution_utils | |
| run: cargo test --release -- --nocapture --exact test_prove_recursion_over_recursion | |
| # run: cargo test --release -- --nocapture --ignored test_prove_recursion_over_recursion | |
| risc_v_test_delegations: | |
| name: risc_v_tests_delegations | |
| runs-on: [matterlabs-ci-runner] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "" | |
| - name: Setup | |
| run: | | |
| rustup set profile minimal | |
| - name: Compile | |
| working-directory: ./risc_v_simulator | |
| run: cargo build --features delegation --verbose | |
| - name: test | |
| working-directory: ./risc_v_simulator | |
| run: cargo test --features delegation | |
| circuits_generated: | |
| name: circuits_generated | |
| runs-on: [matterlabs-ci-runner-highmem] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "" | |
| - name: Setup | |
| run: | | |
| rustup set profile default | |
| - name: Regenerate verifiers | |
| run: ./recreate_verifiers.sh | |
| - name: Check if anything has changed | |
| run: | | |
| MODIFIED_FILES=$(git status --porcelain) | |
| if [ -n "$MODIFIED_FILES" ]; then | |
| echo "The following files were modified - did you run ./recreate_verifiers.sh? " | |
| echo "$MODIFIED_FILES" | |
| exit 1 | |
| else | |
| echo "No files were modified." | |
| fi | |
| # verifier_binaries_generated: | |
| # name: verifier_binaries_generated | |
| # runs-on: [matterlabs-ci-runner-highmem] | |
| # steps: | |
| # - uses: actions/checkout@v3 | |
| # - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| # with: | |
| # rustflags: "" | |
| # - name: Setup | |
| # run: | | |
| # rustup set profile minimal | |
| # rustup target add riscv32i-unknown-none-elf | |
| # cargo install cargo-binutils | |
| # rustup component add llvm-tools-preview | |
| # rustup component add rust-src | |
| # - name: Regenerate verifiers | |
| # working-directory: ./tools/verifier | |
| # run: ./build.sh | |
| # - name: Check if anything has changed | |
| # run: | | |
| # MODIFIED_FILES=$(git status --porcelain) | |
| # if [ -n "$MODIFIED_FILES" ]; then | |
| # echo "The following files were modified - did you run ./tools/verifier/build.sh? " | |
| # echo "$MODIFIED_FILES" | |
| # exit 1 | |
| # else | |
| # echo "No files were modified." | |
| # fi | |
| build_cli_with_verify: | |
| runs-on: [matterlabs-ci-runner-c3d] | |
| name: build_cli_with_verify | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "" | |
| - name: Setup | |
| run: | | |
| rustup set profile minimal | |
| - name: Compile | |
| run: cargo build --profile cli -p cli --features include_verifiers | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli_with_verify | |
| path: target/cli/cli | |
| build_cli_no_verifiers: | |
| runs-on: [matterlabs-ci-runner-highmem] | |
| name: build_cli_no_verifiers | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "" | |
| - name: Setup | |
| run: | | |
| rustup set profile minimal | |
| - name: Compile | |
| run: cargo build --release -p cli --no-default-features | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli | |
| path: target/release/cli | |
| build_cli_no_verifiers_512: | |
| runs-on: [matterlabs-ci-runner-c3d] | |
| name: build_cli_no_verifiers_512 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "" | |
| - name: Setup | |
| run: | | |
| rustup set profile minimal | |
| - name: Compile | |
| run: RUSTFLAGS="-C target-feature=+avx512f" cargo build --release -p cli --no-default-features | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli_512 | |
| path: target/release/cli | |
| build_verifier: | |
| runs-on: [matterlabs-ci-runner-c3d] | |
| name: build_verifier | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "" | |
| - name: Setup | |
| working-directory: tools/verifier | |
| run: | | |
| rustup set profile minimal | |
| rustup target add riscv32i-unknown-none-elf | |
| cargo install cargo-binutils | |
| rustup component add llvm-tools-preview | |
| rustup component add rust-src | |
| - name: ObjCopy | |
| working-directory: tools/verifier | |
| run: cargo objcopy --release -Z build-std=core,panic_abort,alloc -Z build-std-features=panic_immediate_abort -- -O binary app.bin | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: verifier | |
| path: tools/verifier/app.bin | |
| basic_example: | |
| name: basic_example | |
| runs-on: [matterlabs-ci-runner-highmem] | |
| needs: [build_cli_with_verify] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cli_with_verify | |
| - name: Setup | |
| run: chmod +x ./cli && mkdir output | |
| - name: Run | |
| run: ./cli run --bin examples/basic_fibonacci/app.bin --expected-results 144 | |
| - name: Prove | |
| run: ./cli prove --bin examples/basic_fibonacci/app.bin | |
| - name: Verify | |
| run: ./cli verify --proof output/proof_0.json | |
| - name: Verify all | |
| run: ./cli verify-all --metadata output/metadata.json | |
| large_example: | |
| name: large_example | |
| runs-on: [matterlabs-ci-runner-highmem] | |
| needs: [build_cli_with_verify] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cli_with_verify | |
| - name: Setup | |
| run: chmod +x ./cli && mkdir output | |
| - name: Run | |
| run: ./cli run --bin examples/dynamic_fibonacci/app.bin --input-file examples/dynamic_fibonacci/input.txt --cycles 10000000 --expected-results 3291,500000 | |
| - name: Prove | |
| run: ./cli prove --bin examples/dynamic_fibonacci/app.bin --input-file examples/dynamic_fibonacci/input.txt | |
| - name: Verify 0 | |
| run: ./cli verify --proof output/proof_0.json | |
| - name: Verify 1 | |
| run: ./cli verify --proof output/proof_1.json | |
| - name: Verify all | |
| run: ./cli verify-all --metadata output/metadata.json | |
| delegation_example: | |
| name: delegation_example | |
| runs-on: [matterlabs-ci-runner-highmem] | |
| needs: [build_cli_with_verify] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cli_with_verify | |
| - name: Setup | |
| run: chmod +x ./cli && mkdir output | |
| - name: Run delegation | |
| run: ./cli run --bin examples/hashed_fibonacci/app.bin --input-file examples/hashed_fibonacci/input.txt --expected-results 1597,15,2242890078 | |
| - name: Prove delegation | |
| run: ./cli prove --bin examples/hashed_fibonacci/app.bin --input-file examples/hashed_fibonacci/input.txt | |
| - name: Verify | |
| run: ./cli verify --proof output/proof_0.json | |
| - name: Verify delegation | |
| run: ./cli verify --proof output/delegation_proof_1991_0.json | |
| - name: Verify all | |
| run: ./cli verify-all --metadata output/metadata.json | |
| verification_example: | |
| name: verification_example | |
| runs-on: [matterlabs-ci-runner-highmem] | |
| needs: [build_cli_with_verify, build_verifier] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cli_with_verify | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: verifier | |
| - name: Setup | |
| run: chmod +x ./cli && mkdir output | |
| - name: Create basic fibonacci proof | |
| run: ./cli prove --bin examples/basic_fibonacci/app.bin | |
| - name: Flatten basic fibonacci proof | |
| run: ./cli flatten --input-file output/proof_0.json --output-file output/proof_flatten0.json | |
| - name: Run verification in riscV | |
| run: ./cli run --bin app.bin --input-file output/proof_flatten0.json --cycles 10000000 --machine reduced --expected-results 1,2,3,0,0,0,0,0 | |
| - name: Create recursion output dir | |
| run: mkdir recursion_proofs | |
| - name: Prove verification in riscV | |
| run: ./cli prove --machine reduced --bin app.bin --input-file output/proof_flatten0.json --output-dir recursion_proofs/ | |
| # now verify the recursion proofs.. | |
| - name: Verify recursion delegation | |
| run: ./cli verify --proof recursion_proofs/delegation_proof_1991_0.json | |
| - name: Verify recursion basic | |
| run: ./cli verify --proof recursion_proofs/reduced_proof_0.json | |
| # Test incremental proofs. | |
| oh_bender: | |
| name: oh_bender_incremental_proofs | |
| runs-on: [matterlabs-ci-runner-c3d] | |
| needs: [build_cli_no_verifiers_512, build_verifier] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cli_512 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: verifier | |
| - name: Display structure of downloaded files | |
| run: ls -R | |
| - name: Set permissions | |
| run: chmod +x ./cli | |
| - name: Create output | |
| run: mkdir output | |
| - name: Create basic fibonacci proof | |
| run: ./cli prove --bin examples/basic_fibonacci/app.bin --until final-recursion --output-dir output | |
| - name: Flatten 2 basic fibonacci proofs | |
| run: ./cli flatten-two --first-metadata output/metadata.json --second-metadata output/metadata.json --output-file output/proof_merged_flatten.json | |
| - name: Run | |
| run: ./cli run --bin app.bin --input-file output/proof_merged_flatten.json --cycles 20000000 --machine reduced --expected-results 1454345518,1110133826,1035806769,2339543873,3120453366,2871045712,1011786604,901067344 | |
| full_recursion: | |
| name: full_recursion | |
| runs-on: [matterlabs-ci-runner-c3d] | |
| needs: [build_cli_no_verifiers_512, build_verifier] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cli_512 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: verifier | |
| - name: Display structure of downloaded files | |
| run: ls -R | |
| - name: Set permissions | |
| run: chmod +x ./cli | |
| - name: Create output | |
| run: mkdir output | |
| - name: Create basic fibonacci proof | |
| run: ./cli prove --bin examples/basic_fibonacci/app.bin | |
| - name: Recursion 0 - create output dir | |
| run: mkdir recursion_proofs_0 | |
| - name: Recursion 0 - Flatten | |
| run: ./cli flatten-all --input-metadata output/metadata.json --output-file output/proof_flatten0.json | |
| - name: Recursion 0 - Run | |
| run: ./cli run --bin app.bin --input-file output/proof_flatten0.json --cycles 10000000 --machine reduced --expected-results 144,0,0,0,0,0,0,0 | |
| - name: Recursion 0 - Prove | |
| run: ./cli prove --machine reduced --bin app.bin --input-file output/proof_flatten0.json --output-dir recursion_proofs_0/ --prev-metadata output/metadata.json | |
| #- name: Recursion 0 - Verify (on cpu) | |
| # run: ./cli verify-all --metadata recursion_proofs_0/metadata.json | |
| - name: Recursion 1 - create output dir | |
| run: mkdir recursion_proofs_1 | |
| - name: Recursion 1 - Flatten | |
| run: ./cli flatten-all --input-metadata recursion_proofs_0/metadata.json --output-file output/proof_flatten1.json | |
| - name: Recursion 1 - Run | |
| run: ./cli run --bin app.bin --input-file output/proof_flatten1.json --cycles 32000000 --machine reduced --expected-results 144,0,0,0,0,0,0,0 | |
| - name: Recursion 1 - Prove | |
| run: ./cli prove --machine reduced --bin app.bin --input-file output/proof_flatten1.json --output-dir recursion_proofs_1/ --prev-metadata recursion_proofs_0/metadata.json | |
| #- name: Recursion 1 - Verify (on cpu) | |
| # run: ./cli verify-all --metadata recursion_proofs_1/metadata.json | |
| - name: Recursion 2 - create output dir | |
| run: mkdir recursion_proofs_2 | |
| - name: Recursion 2 - Flatten | |
| run: ./cli flatten-all --input-metadata recursion_proofs_1/metadata.json --output-file output/proof_flatten2.json | |
| - name: Recursion 2 - Run | |
| run: ./cli run --bin app.bin --input-file output/proof_flatten2.json --cycles 50000000 --machine reduced --expected-results 144,0,0,0,0,0,0,0 | |
| - name: Recursion 2 - Prove | |
| run: ./cli prove --machine reduced --bin app.bin --input-file output/proof_flatten2.json --output-dir recursion_proofs_2/ --prev-metadata recursion_proofs_0/metadata.json | |
| #- name: Recursion 2 - Verify (on cpu) | |
| # run: ./cli verify-all --metadata recursion_proofs_2/metadata.json |