feat: implement Plonk Bn254 proof verification for Solidity format #347
This file contains 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: Tests | |
on: | |
push: | |
branches: dev | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: CI Test Suite | |
runs-on: warp-ubuntu-latest-x64-32x | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: argumentcomputer/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- name: Setup CI | |
uses: ./.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
- name: Run cargo test on *all of* sphinx except the test_e2e_prove_plonk recursion test | |
run: | | |
cargo nextest run --cargo-profile dev-ci --profile ci --workspace --features "plonk" -E 'all() - test(test_e2e_prove_plonk)' | |
- name: Run cargo test with no default features | |
run: | | |
cargo nextest run -p sphinx-core --cargo-profile dev-ci --profile ci --no-default-features --features "debug" -E 'test(cpu::trace::tests)' | |
test-recursion-circuit: | |
name: Test recursion circuit | |
runs-on: warp-ubuntu-latest-x64-32x | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: argumentcomputer/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- name: Setup CI | |
uses: ./.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
- name: Run cargo test on the recursion circuit | |
run: | | |
cargo nextest run --cargo-profile dev-ci --profile ci --features "plonk" -E 'package(sphinx-recursion-circuit)' | |
clippy: | |
runs-on: warp-ubuntu-latest-x64-16x | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: argumentcomputer/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- name: Setup CI | |
uses: ./.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
- name: Check Rustfmt Code Style | |
run: cargo fmt --all --check | |
- name: check *everything* compiles | |
run: cargo check --all-targets --all-features --all --examples --tests --benches | |
# See '.cargo/config' for list of enabled/disabled clippy lints | |
- name: Check clippy warnings | |
run: cargo xclippy -D warnings | |
- name: Doctests | |
run: cargo test --doc --workspace | |
- name: Cargo-deny | |
uses: EmbarkStudios/cargo-deny-action@v1 | |
integration-tests-examples: | |
name: Build integration tests and examples | |
runs-on: warp-ubuntu-latest-x64-32x | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: argumentcomputer/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- name: Setup CI | |
uses: ./.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
perf: false | |
- name: Install deps | |
run: sudo apt update && sudo apt install cmake -y | |
- name: Install `cargo prove` CLI | |
run: | | |
cargo install --locked --force --path ./cli | |
cargo prove install-toolchain | |
working-directory: ${{ github.workspace }} | |
- name: Check examples | |
run: make | |
working-directory: ${{ github.workspace }}/examples | |
- name: Check integration tests | |
run: make | |
working-directory: ${{ github.workspace }}/tests | |
- name: Run cargo prove new | |
run: | | |
cargo prove new cargo-prove-test | |
cd cargo-prove-test/program | |
cat << EOF | tee -a Cargo.toml | |
[patch.'ssh://[email protected]/argumentcomputer/sphinx.git'] | |
sphinx-zkvm = { path = "../../zkvm/entrypoint" } | |
EOF | |
cd ../.. | |
cd cargo-prove-test/script | |
cat << EOF | tee -a Cargo.toml | |
[patch.'ssh://[email protected]/argumentcomputer/sphinx.git'] | |
sphinx-sdk = { path = "../../sdk" } | |
sphinx-helper = { path = "../../helper" } | |
EOF | |
cargo run --release -- --prove | |
mac-m1: | |
name: Check OSX ARM compiles | |
runs-on: warp-macos-latest-arm64-6x | |
if: github.event_name != 'pull_request' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: argumentcomputer/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- name: Setup CI | |
uses: ./.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
- name: Install `cargo prove` CLI | |
run: | | |
cargo install --locked --force --path ./cli | |
cargo prove install-toolchain | |
working-directory: ${{ github.workspace }} | |
- name: Check workspace | |
run: cargo check --all-targets --all-features --workspace | |
- name: Check examples | |
run: make | |
working-directory: ${{ github.workspace }}/examples | |
- name: Check integration tests | |
run: make | |
working-directory: ${{ github.workspace }}/tests | |
- name: Set env | |
if: failure() | |
run: | | |
echo "WORKFLOW_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | tee -a $GITHUB_ENV | |
- name: Open an issue on failure | |
if: failure() | |
uses: JasonEtco/create-an-issue@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_COMMIT: ${{ github.sha }} | |
WORKFLOW_URL: ${{ env.WORKFLOW_URL }} | |
with: | |
filename: .github/templates/M1_MAC.md | |
check-downstream-compiles: | |
runs-on: warp-ubuntu-latest-x64-16x | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- repo: zk-light-clients | |
path: aptos | |
features: aptos | |
- repo: zk-light-clients | |
path: ethereum | |
features: ethereum | |
- repo: lurk | |
path: "" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: argumentcomputer/ci-workflows | |
path: ci-workflows | |
- uses: ./ci-workflows/.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
with: | |
path: ${{ github.workspace }}/sphinx | |
- name: Setup CI | |
uses: ./sphinx/.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
perf: false | |
- name: Set `zk-light-clients` env | |
if: ${{ matrix.repo == 'zk-light-clients' }} | |
run: | | |
sudo apt-get update && sudo apt-get install -y build-essential pkg-config libssl-dev libudev-dev cmake clang | |
echo "RUSTFLAGS=${{ env.RUSTFLAGS }} --cfg tokio_unstable" | tee -a $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
with: | |
repository: argumentcomputer/${{ matrix.repo }} | |
path: ${{ github.workspace }}/${{ matrix.repo }} | |
token: ${{ secrets.REPO_TOKEN }} | |
- uses: ./ci-workflows/.github/actions/check-downstream-compiles | |
with: | |
upstream-path: "sphinx" | |
downstream-path: "${{ matrix.repo }}/${{ matrix.path }}" | |
features: "${{ matrix.features }}" |