Compare commits

...

10 Commits

Author SHA1 Message Date
github-actions[bot]
6e28b4829e ci: update version string in docs 2025-08-14 22:21:22 +00:00
dante
d7b04d0d25 chore: update icicle to latest (#998) 2025-08-14 18:21:06 -04:00
GarmashAlex
d50a4b7d59 fix: correct commitment type in ipa_commit function (#997) 2025-08-10 23:03:45 +01:00
dante
fad31de5b4 refactor: make reusable-verifier feat default (#996) 2025-07-30 14:54:08 -04:00
dante
2f1a3f430e feat: optional rebase scale override (#993) 2025-07-27 21:05:54 +01:00
dante
edd4d7f5b8 fix: less bleeding edge toolchain (#992) 2025-07-25 10:19:13 -04:00
dante
1c3ae450e1 fix: ios build 2025-07-25 09:57:23 -04:00
dante
afb4ca9f06 fix: release pipeline (#991) 2025-07-25 09:34:57 -04:00
dante
0e79d36238 fix: ln arg is too restrictive on distances (#989) 2025-07-24 18:56:50 -04:00
dante
e1c126c735 fix: ci (#988) 2025-07-23 20:11:31 -04:00
31 changed files with 1594 additions and 772 deletions

View File

@@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
@@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
@@ -49,7 +49,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
@@ -66,7 +66,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
@@ -83,7 +83,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
@@ -100,7 +100,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
@@ -117,7 +117,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
@@ -134,7 +134,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
@@ -151,7 +151,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
@@ -168,7 +168,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
@@ -185,7 +185,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true

View File

@@ -21,17 +21,19 @@ jobs:
name: publish-wasm-bindings
env:
RELEASE_TAG: ${{ github.ref_name }}
RUSTFLAGS: "-C target-feature=+atomics,+bulk-memory"
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
cache: false
- uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa #v0.4.0
with:
# Pin to version 0.12.1
@@ -40,7 +42,7 @@ jobs:
run: rustup target add wasm32-unknown-unknown
- name: Add rust-src
run: rustup component add rust-src --toolchain nightly-2025-02-17-x86_64-unknown-linux-gnu
run: rustup component add rust-src --toolchain nightly-2025-05-01-x86_64-unknown-linux-gnu
- name: Install binaryen
run: |
set -e

View File

@@ -13,9 +13,9 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: nanoGPT Mock

View File

@@ -27,6 +27,8 @@ jobs:
target: [x86_64]
env:
RELEASE_TAG: ${{ github.ref_name }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
@@ -36,6 +38,16 @@ jobs:
python-version: 3.12
architecture: x64
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential g++ gcc cmake libclang-dev llvm-dev libstdc++-12-dev libc6 libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- name: Set pyproject.toml version to match github tag and rename ezkl to ezkl-gpu
shell: bash
run: |
@@ -43,11 +55,12 @@ jobs:
sed "s/ezkl/ezkl-gpu/" pyproject.toml.orig > pyproject.toml.tmp
sed "s/0\\.0\\.0/${RELEASE_TAG//v}/" pyproject.toml.tmp > pyproject.toml
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2023-06-27
override: true
components: rustfmt, clippy
cache: false
- name: Set Cargo.toml version to match github tag and rename ezkl to ezkl-gpu
shell: bash
@@ -70,7 +83,7 @@ jobs:
target: ${{ matrix.target }}
manylinux: auto
container: off
args: --release --out dist --features python-bindings,icicle
args: --release --out dist --features python-bindings,gpu-accelerated
- name: Install built wheel
if: matrix.target == 'x86_64'

View File

@@ -48,11 +48,12 @@ jobs:
mv Cargo.lock Cargo.lock.orig
sed "s/0\\.0\\.0/${RELEASE_TAG//v}/" Cargo.lock.orig >Cargo.lock
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
cache: false
- name: Build wheels
if: matrix.target == 'universal2-apple-darwin'
@@ -113,11 +114,12 @@ jobs:
mv Cargo.lock Cargo.lock.orig
sed "s/0\\.0\\.0/${RELEASE_TAG//v}/" Cargo.lock.orig >Cargo.lock
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
cache: false
- name: Build wheels
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0

View File

@@ -47,17 +47,27 @@ jobs:
TARGET_DIR: ./target
RUST_BACKTRACE: 1
PCRE2_SYS_STATIC: 1
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
cache: false
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential g++ gcc cmake libclang-dev llvm-dev libstdc++-12-dev libc6 libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- name: Get release version from tag
shell: bash
@@ -78,7 +88,7 @@ jobs:
sudo apt-get update
- name: Build release binary
run: cargo build --release -Z sparse-registry --features icicle
run: cargo build --release -Z sparse-registry --features gpu-accelerated
- name: Build archive
shell: bash
@@ -117,27 +127,27 @@ jobs:
include:
- build: windows-msvc
os: windows-latest
rust: nightly-2025-02-17
rust: nightly-2025-05-01
target: x86_64-pc-windows-msvc
- build: macos
os: macos-13
rust: nightly-2025-02-17
rust: nightly-2025-05-01
target: x86_64-apple-darwin
- build: macos-aarch64
os: macos-13
rust: nightly-2025-02-17
rust: nightly-2025-05-01
target: aarch64-apple-darwin
- build: linux-musl
os: ubuntu-22.04
rust: nightly-2025-02-17
rust: nightly-2025-05-01
target: x86_64-unknown-linux-musl
- build: linux-gnu
os: ubuntu-22.04
rust: nightly-2025-02-17
rust: nightly-2025-05-01
target: x86_64-unknown-linux-gnu
- build: linux-aarch64
os: ubuntu-22.04
rust: nightly-2025-02-17
rust: nightly-2025-05-01
target: aarch64-unknown-linux-gnu
steps:
@@ -199,7 +209,7 @@ jobs:
- name: Build release binary (asm)
if: matrix.build == 'linux-gnu'
run: ${{ env.CARGO }} build --release ${{ env.TARGET_FLAGS }} -Z sparse-registry --features asm,mimalloc
run: ${{ env.CARGO }} build --release ${{ env.TARGET_FLAGS }} -Z sparse-registry --features mimalloc
- name: Build release binary (metal)
if: matrix.build == 'macos-aarch64'

View File

@@ -31,9 +31,9 @@ jobs:
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3
@@ -46,56 +46,76 @@ jobs:
build:
permissions:
contents: read
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: install libc6
run: sudo apt-get install -y libc6
- name: Install cmake and build dependencies
run: sudo apt-get update && sudo apt-get install -y cmake build-essential g++ gcc libclang-dev llvm-dev libstdc++-12-dev libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- name: Build
run: cargo build --verbose
docs:
permissions:
contents: read
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: install libc6
run: sudo apt-get install -y libc6
- name: Install cmake and build dependencies
run: sudo apt-get update && sudo apt-get install -y cmake build-essential g++ gcc libclang-dev llvm-dev libstdc++-12-dev libc6-dev libssl-dev pkg-config
- name: Docs
run: cargo doc --verbose
library-tests:
permissions:
contents: read
runs-on: ubuntu-latest-32-cores
runs-on: ubuntu-22.04
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: install libc6
run: sudo apt-get install -y libc6
- name: Install cmake and build dependencies
run: sudo apt-get update && sudo apt-get install -y cmake build-essential g++ gcc libclang-dev llvm-dev libstdc++-12-dev libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
with:
crate: cargo-nextest
@@ -105,56 +125,24 @@ jobs:
run: cargo test --doc --verbose
- name: Library tests
run: cargo nextest run --lib --verbose
- name: Library tests (original lookup)
run: cargo nextest run --lib --verbose --no-default-features --features ezkl,eth-original-lookup
# ultra-overflow-tests-gpu:
# runs-on: GPU
# env:
# ENABLE_ICICLE_GPU: true
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
# with:
# persist-credentials: false
# - uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
# with:
# toolchain: nightly-2025-02-17
# override: true
# components: rustfmt, clippy
# - uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
# with:
# crate: cargo-nextest
# locked: true
# - uses: mwilliamson/setup-wasmtime-action@bf814d7d8fc3c3a77dfe114bd9fb8a2c575f6ad6 #v2.0.0
# with:
# wasmtime-version: "3.0.1"
# # - name: Matmul overflow (wasi)
# # run: cargo wasi test matmul_col_ultra_overflow -- --include-ignored --nocapture
# # - name: Conv overflow (wasi)
# # run: cargo wasi test conv_col_ultra_overflow -- --include-ignored --nocapture
# - name: lookup overflow
# run: cargo nextest run lookup_ultra_overflow --no-capture --features icicle -- --include-ignored
# - name: Matmul overflow
# run: RUST_LOG=debug cargo nextest run matmul_col_ultra_overflow --no-capture --features icicle -- --include-ignored
# - name: Conv overflow
# run: RUST_LOG=debug cargo nextest run conv_col_ultra_overflow --no-capture --features icicle -- --include-ignored
# - name: Conv + relu overflow
# run: cargo nextest run conv_relu_col_ultra_overflow --no-capture --features icicle -- --include-ignored
ultra-overflow-tests_og-lookup:
ultra-overflow-tests-gpu:
permissions:
contents: read
runs-on: non-gpu
runs-on: gpu
env:
ENABLE_ICICLE_GPU: true
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
@@ -164,36 +152,54 @@ jobs:
- uses: mwilliamson/setup-wasmtime-action@bf814d7d8fc3c3a77dfe114bd9fb8a2c575f6ad6 #v2.0.0
with:
wasmtime-version: "3.0.1"
- name: Setup GPU dependencies
run: sudo ./setup-gpu.sh --yes
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential g++ gcc cmake libclang-dev llvm-dev libstdc++-12-dev libc6 libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
# - name: Matmul overflow (wasi)
# run: cargo wasi test matmul_col_ultra_overflow -- --include-ignored --nocapture
# - name: Conv overflow (wasi)
# run: cargo wasi test conv_col_ultra_overflow -- --include-ignored --nocapture
- name: lookup overflow
run: cargo nextest run --release lookup_ultra_overflow --no-capture --no-default-features --features ezkl,eth-original-lookup -- --include-ignored
run: cargo nextest run lookup_ultra_overflow --no-capture --features gpu-accelerated -- --include-ignored
- name: Matmul overflow
run: RUST_LOG=debug cargo nextest run --release matmul_col_ultra_overflow --no-capture --no-default-features --features ezkl,eth-original-lookup -- --include-ignored
run: RUST_LOG=debug cargo nextest run matmul_col_ultra_overflow --no-capture --features gpu-accelerated -- --include-ignored
- name: Conv overflow
run: RUST_LOG=debug cargo nextest run --release conv_col_ultra_overflow --no-capture --no-default-features --features ezkl,eth-original-lookup -- --include-ignored
run: RUST_LOG=debug cargo nextest run conv_col_ultra_overflow --no-capture --features gpu-accelerated -- --include-ignored
- name: Conv + relu overflow
run: cargo nextest run --release conv_relu_col_ultra_overflow --no-capture --no-default-features --features ezkl,eth-original-lookup -- --include-ignored
run: cargo nextest run conv_relu_col_ultra_overflow --no-capture --features gpu-accelerated -- --include-ignored
ultra-overflow-tests:
permissions:
contents: read
runs-on: non-gpu
runs-on: [ non-gpu, non-sgx ]
needs: [build, library-tests, docs]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: install libc6
run: sudo apt-get install -y libc6
- name: Install cmake and build dependencies
run: sudo apt-get update && sudo apt-get install -y cmake build-essential g++ gcc libclang-dev llvm-dev libstdc++-12-dev libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
with:
crate: cargo-nextest
@@ -217,20 +223,29 @@ jobs:
model-serialization:
permissions:
contents: read
runs-on: ubuntu-latest-16-cores
runs-on: ubuntu-22.04
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: install libc6
run: sudo apt-get install -y libc6
- name: Install cmake and build dependencies
run: sudo apt-get update && sudo apt-get install -y cmake build-essential g++ gcc libclang-dev llvm-dev libstdc++-12-dev libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
with:
crate: cargo-nextest
@@ -241,31 +256,41 @@ jobs:
wasm32-tests:
permissions:
contents: read
runs-on: ubuntu-latest-64-cores
runs-on: ubuntu-22.04
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
# add `atomics` and `bulk-memory` to RUSTFLAGS to enable wasm-bindgen tests
RUSTFLAGS: "-C target-feature=+atomics,+bulk-memory"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: install libc6
run: sudo apt-get install -y libc6
- name: Install cmake and build dependencies
run: sudo apt-get update && sudo apt-get install -y cmake build-essential g++ gcc libclang-dev llvm-dev libstdc++-12-dev libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa #v0.4.0
with:
# Pin to version 0.12.1
version: "v0.12.1"
# Pin to version 0.13.1
version: "v0.13.1"
- uses: nanasess/setup-chromedriver@affb1ea8848cbb080be372c1e8d7a5c173e9298f #v2.3.0
# with:
# chromedriver-version: "115.0.5790.102"
- name: Install wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown
- name: Add rust-src
run: rustup component add rust-src --toolchain nightly-2025-02-17-x86_64-unknown-linux-gnu
run: rustup component add rust-src --toolchain nightly-2025-05-01-x86_64-unknown-linux-gnu
- name: Create webdriver.json to disable timeouts
run: |
echo '{"args": ["--headless", "--disable-gpu", "--disable-dev-shm-usage", "--no-sandbox"]}' > webdriver.json
@@ -280,24 +305,29 @@ jobs:
mock-proving-tests:
permissions:
contents: read
runs-on: non-gpu
runs-on: [ non-gpu, non-sgx ]
needs: [build, library-tests, docs]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
with:
crate: cargo-nextest
locked: true
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
# - name: The Worm Mock
# run: cargo nextest run --verbose tests::large_mock_::large_tests_5_expects -- --include-ignored
- name: Large 1D Conv Mock
@@ -350,25 +380,34 @@ jobs:
prove-and-verify-evm-tests:
permissions:
contents: read
runs-on: non-gpu
# needs: [build, library-tests, docs, python-tests, python-integration-tests]
runs-on: [ non-gpu, non-sgx ]
needs: [build, library-tests, docs, python-tests, python-integration-tests]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C target-feature=+atomics,+bulk-memory"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa #v0.4.0
with:
# Pin to version 0.13.1
version: "v0.13.1"
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
with:
crate: cargo-nextest
locked: true
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
@@ -376,20 +415,20 @@ jobs:
uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b #v2.4.1
with:
version: 8
- name: Use Node.js 18.12.1
- name: Use Node.js 22.17.1
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 #v3.8.2
with:
node-version: "18.12.1"
node-version: "22.17.1"
cache: "pnpm"
- name: "Add rust-src"
run: rustup component add rust-src --toolchain nightly-2025-02-17-x86_64-unknown-linux-gnu
run: rustup component add rust-src --toolchain nightly-2025-05-01-x86_64-unknown-linux-gnu
- name: Install dependencies for js tests and package
run: |
pnpm install --frozen-lockfile
# - name: Install solc
# run: (hash svm 2>/dev/null || cargo install svm-rs) && svm install 0.8.20 && solc --version
- name: Install Anvil
run: cargo install --git https://github.com/foundry-rs/foundry --rev 62cdea8ff9e6efef011f77e295823b5f2dbeb3a1 --locked anvil --force
run: cargo install --git https://github.com/foundry-rs/foundry --rev 56b806a3ba7866a3b061093bebd0fa2ace97f1fc --locked anvil --force
- name: Build wasm package for nodejs target.
run: |
wasm-pack build --target nodejs --out-dir ./tests/wasm/nodejs . -- -Z build-std="panic_abort,std"
@@ -419,17 +458,17 @@ jobs:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
# with:
# persist-credentials: false
# - uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
# - uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
# with:
# toolchain: nightly-2025-02-17
# toolchain: nightly-2025-05-01
# override: true
# components: rustfmt, clippy
# - uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa #v0.4.0
# with:
# # Pin to version 0.12.1
# version: 'v0.12.1'
# # Pin to version 0.13.1
# version: 'v0.13.1'
# - name: Add rust-src
# run: rustup component add rust-src --toolchain nightly-2025-02-17
# run: rustup component add rust-src --toolchain nightly-2025-05-01
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
# with:
# persist-credentials: false
@@ -447,30 +486,32 @@ jobs:
prove-and-verify-tests:
permissions:
contents: read
runs-on: non-gpu
needs: [build, library-tests, docs]
runs-on: [ non-gpu, non-sgx ]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa #v0.4.0
with:
# Pin to version 0.12.1
version: "v0.12.1"
# Pin to version 0.13.1
version: "v0.13.1"
- name: Add wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown
- name: Add rust-src
run: rustup component add rust-src --toolchain nightly-2025-02-17-x86_64-unknown-linux-gnu
run: rustup component add rust-src --toolchain nightly-2025-05-01-x86_64-unknown-linux-gnu
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
@@ -478,10 +519,10 @@ jobs:
uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b #v2.4.1
with:
version: 8
- name: Use Node.js 18.12.1
- name: Use Node.js 22.17.1
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 #v3.8.2
with:
node-version: "18.12.1"
node-version: "22.17.1"
cache: "pnpm"
- name: Install dependencies for js tests
run: |
@@ -493,9 +534,9 @@ jobs:
with:
crate: cargo-nextest
locked: true
- name: Build wasm package for nodejs target.
run: |
wasm-pack build --target nodejs --out-dir ./tests/wasm/nodejs . -- -Z build-std="panic_abort,std"
# - name: Build wasm package for nodejs target.
# run: |
# wasm-pack build --target nodejs --out-dir ./tests/wasm/nodejs . -- -Z build-std="panic_abort,std"
- name: KZG prove and verify tests (public outputs + column overflow)
run: cargo nextest run --verbose tests::kzg_prove_and_verify_with_overflow_::w
- name: KZG prove and verify tests (public outputs + fixed params + column overflow)
@@ -504,10 +545,6 @@ jobs:
run: cargo nextest run --verbose tests::kzg_prove_and_verify_with_overflow_hashed_inputs_
- name: KZG prove and verify tests (public outputs)
run: cargo nextest run --verbose tests::kzg_prove_and_verify_tight_lookup_::t
- name: IPA prove and verify tests
run: cargo nextest run --verbose tests::ipa_prove_and_verify_::t --test-threads 1
- name: IPA prove and verify tests (ipa outputs)
run: cargo nextest run --verbose tests::ipa_prove_and_verify_ipa_output
- name: KZG prove and verify tests single inner col
run: cargo nextest run --verbose tests::kzg_prove_and_verify_single_col
- name: KZG prove and verify tests triple inner col
@@ -527,42 +564,53 @@ jobs:
- name: KZG prove and verify tests (hashed outputs)
run: cargo nextest run --verbose tests::kzg_prove_and_verify_hashed
# prove-and-verify-tests-gpu:
# runs-on: GPU
# env:
# ENABLE_ICICLE_GPU: true
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
# with:
# persist-credentials: false
# - uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
# with:
# toolchain: nightly-2025-02-17
# override: true
# components: rustfmt, clippy
# - name: Add rust-src
# run: rustup component add rust-src --toolchain nightly-2025-02-17-x86_64-unknown-linux-gnu
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
# - uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
# with:
# crate: cargo-nextest
# locked: true
# - name: KZG prove and verify tests (kzg outputs)
# run: cargo nextest run --verbose tests::kzg_prove_and_verify_kzg_output --features icicle --test-threads 1
# - name: KZG prove and verify tests (public outputs + column overflow)
# run: cargo nextest run --verbose tests::kzg_prove_and_verify_with_overflow_::w --features icicle --test-threads 1
# - name: KZG prove and verify tests (public outputs + fixed params + column overflow)
# run: cargo nextest run --verbose tests::kzg_prove_and_verify_with_overflow_fixed_params_ --features icicle --test-threads 1
# - name: KZG prove and verify tests (public outputs)
# run: cargo nextest run --verbose tests::kzg_prove_and_verify_::t --features icicle --test-threads 1
# - name: KZG prove and verify tests (public outputs + column overflow)
# run: cargo nextest run --verbose tests::kzg_prove_and_verify_::t --features icicle --test-threads 1
# - name: KZG prove and verify tests (public inputs)
# run: cargo nextest run --verbose tests::kzg_prove_and_verify_public_input --features icicle --test-threads 1
# - name: KZG prove and verify tests (fixed params)
# run: cargo nextest run --verbose tests::kzg_prove_and_verify_fixed_params --features icicle --test-threads 1
# - name: KZG prove and verify tests (hashed outputs)
# run: cargo nextest run --verbose tests::kzg_prove_and_verify_hashed --features icicle --test-threads 1
prove-and-verify-tests-gpu:
permissions:
contents: read
runs-on: gpu
needs: [build, library-tests, docs]
env:
ENABLE_ICICLE_GPU: true
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: Add rust-src
run: rustup component add rust-src --toolchain nightly-2025-05-01-x86_64-unknown-linux-gnu
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
with:
crate: cargo-nextest
locked: true
- name: Setup GPU dependencies
run: sudo ./setup-gpu.sh --yes
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential g++ gcc cmake libclang-dev llvm-dev libstdc++-12-dev libc6 libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- name: KZG prove and verify tests (kzg outputs)
run: cargo nextest run --verbose tests::kzg_prove_and_verify_kzg_output --features gpu-accelerated --test-threads 1
- name: KZG prove and verify tests (public outputs + column overflow)
run: cargo nextest run --verbose tests::kzg_prove_and_verify_with_overflow_::w --features gpu-accelerated --test-threads 1
- name: KZG prove and verify tests (public outputs + fixed params + column overflow)
run: cargo nextest run --verbose tests::kzg_prove_and_verify_with_overflow_fixed_params_ --features gpu-accelerated --test-threads 1
- name: KZG prove and verify tests (public outputs)
run: cargo nextest run --verbose tests::kzg_prove_and_verify_::t --features gpu-accelerated --test-threads 1
- name: KZG prove and verify tests (public inputs)
run: cargo nextest run --verbose tests::kzg_prove_and_verify_public_input --features gpu-accelerated --test-threads 1
- name: KZG prove and verify tests (fixed params)
run: cargo nextest run --verbose tests::kzg_prove_and_verify_fixed_params --features gpu-accelerated --test-threads 1
- name: KZG prove and verify tests (hashed outputs)
run: cargo nextest run --verbose tests::kzg_prove_and_verify_hashed --features gpu-accelerated --test-threads 1
prove-and-verify-mock-aggr-tests:
permissions:
@@ -571,15 +619,16 @@ jobs:
needs: [build, library-tests, docs, python-tests, python-integration-tests]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@4f94fbe7e03939b0e674bcc9ca609a16088f63ff #nightly branch, TODO: update when required
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
@@ -589,25 +638,39 @@ jobs:
- name: Mock aggr tests (KZG)
run: cargo nextest run --verbose tests_aggr::kzg_aggr_mock_prove_and_verify_ --test-threads 8
# prove-and-verify-aggr-tests-gpu:
# runs-on: GPU
# env:
# ENABLE_ICICLE_GPU: true
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
# with:
# persist-credentials: false
# - uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
# with:
# toolchain: nightly-2025-02-17
# override: true
# components: rustfmt, clippy
# - uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
# with:
# crate: cargo-nextest
# locked: true
# - name: KZG tests
# run: cargo nextest run --verbose tests_aggr::kzg_aggr_prove_and_verify_ --features icicle --test-threads 1 -- --include-ignored
prove-and-verify-aggr-tests-gpu:
permissions:
contents: read
runs-on: gpu
needs: [build, library-tests, docs, python-tests, python-integration-tests]
env:
ENABLE_ICICLE_GPU: true
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
with:
crate: cargo-nextest
locked: true
- name: Setup GPU dependencies
run: sudo ./setup-gpu.sh --yes
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential g++ gcc cmake libclang-dev llvm-dev libstdc++-12-dev libc6 libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- name: KZG tests
run: cargo nextest run --verbose tests_aggr::kzg_aggr_prove_and_verify_ --features gpu-accelerated --test-threads 1 -- --include-ignored
prove-and-verify-aggr-tests:
permissions:
@@ -616,15 +679,16 @@ jobs:
needs: [build, library-tests, docs, python-tests, python-integration-tests]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
@@ -641,15 +705,16 @@ jobs:
needs: [build, library-tests, docs, python-tests, python-integration-tests]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
@@ -659,28 +724,37 @@ jobs:
# - name: Install solc
# run: (hash svm 2>/dev/null || cargo install svm-rs) && svm install 0.8.20 && solc --version
- name: Install Anvil
run: cargo install --git https://github.com/foundry-rs/foundry --rev 62cdea8ff9e6efef011f77e295823b5f2dbeb3a1 --locked anvil --force
run: cargo install --git https://github.com/foundry-rs/foundry --rev 56b806a3ba7866a3b061093bebd0fa2ace97f1fc --locked anvil --force
- name: KZG prove and verify aggr tests
run: cargo nextest run --verbose tests_evm::kzg_evm_aggr_prove_and_verify_::t --test-threads 4 -- --include-ignored
examples:
permissions:
contents: read
runs-on: ubuntu-latest-32-cores
runs-on: ubuntu-22.04
needs: [build, library-tests, docs]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: install libc6
run: sudo apt-get install -y libc6
- name: Install cmake and build dependencies
run: sudo apt-get update && sudo apt-get install -y cmake build-essential g++ gcc libclang-dev llvm-dev libstdc++-12-dev libc6-dev libssl-dev pkg-config
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
with:
crate: cargo-nextest
@@ -691,22 +765,23 @@ jobs:
python-tests:
permissions:
contents: read
runs-on: non-gpu
runs-on: [ non-gpu, non-sgx ]
needs: [build, library-tests, docs]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
with:
python-version: "3.12"
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: Install cmake
@@ -716,7 +791,7 @@ jobs:
- name: Setup Virtual Env and Install python dependencies
run: python -m venv .env --clear; source .env/bin/activate; pip install -r requirements.txt;
- name: Install Anvil
run: cargo install --git https://github.com/foundry-rs/foundry --rev 62cdea8ff9e6efef011f77e295823b5f2dbeb3a1 --locked anvil --force
run: cargo install --git https://github.com/foundry-rs/foundry --rev 56b806a3ba7866a3b061093bebd0fa2ace97f1fc --locked anvil --force
- name: Build python ezkl
run: source .env/bin/activate; unset CONDA_PREFIX; maturin develop --features python-bindings,reusable-verifier --profile=test-runs
- name: Run pytest
@@ -725,22 +800,23 @@ jobs:
accuracy-measurement-tests:
permissions:
contents: read
runs-on: non-gpu
runs-on: [ non-gpu, non-sgx ]
needs: [build, library-tests, docs, python-tests, python-integration-tests]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
with:
python-version: "3.12"
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
@@ -764,20 +840,22 @@ jobs:
permissions:
contents: read
runs-on: large-self-hosted
needs: [build, library-tests, docs, python-tests]
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
with:
python-version: "3.11"
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
@@ -787,7 +865,7 @@ jobs:
# - name: Install solc
# run: (hash svm 2>/dev/null || cargo install svm-rs) && svm install 0.8.20 && solc --version
- name: Install Anvil
run: cargo install --git https://github.com/foundry-rs/foundry --rev 62cdea8ff9e6efef011f77e295823b5f2dbeb3a1 --locked anvil --force
run: cargo install --git https://github.com/foundry-rs/foundry --rev 56b806a3ba7866a3b061093bebd0fa2ace97f1fc --locked anvil --force
- name: Install pip
run: python -m ensurepip --upgrade
- name: Setup Virtual Env and Install python dependencies
@@ -828,23 +906,28 @@ jobs:
runs-on: macos-latest
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
with:
crate: cargo-nextest
locked: true
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- name: Run ios tests
run: CARGO_BUILD_TARGET=aarch64-apple-darwin RUSTUP_TOOLCHAIN=nightly-2025-02-17-aarch64-apple-darwin cargo test --test ios_integration_tests --features ios-bindings-test --no-default-features
run: CARGO_BUILD_TARGET=aarch64-apple-darwin RUSTUP_TOOLCHAIN=nightly-2025-05-01-aarch64-apple-darwin cargo test --test ios_integration_tests --features ios-bindings-test --no-default-features
swift-package-tests:
permissions:
@@ -854,16 +937,21 @@ jobs:
env:
EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }}
RUSTFLAGS: "-C linker=gcc"
OPENSSL_NO_VENDOR: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy
- name: Force rebuild icicle dependencies
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
- name: Build EzklCoreBindings
run: CONFIGURATION=debug cargo run --bin ios_gen_bindings --features "ios-bindings uuid camino uniffi_bindgen" --no-default-features
@@ -895,7 +983,7 @@ jobs:
cd ezkl-swift-package
xcodebuild test \
-scheme EzklPackage \
-destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5' \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.2' \
-resultBundlePath ../testResults
- name: Run Example App Tests
@@ -904,7 +992,7 @@ jobs:
xcodebuild test \
-project Example.xcodeproj \
-scheme EzklApp \
-destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5' \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.2' \
-parallel-testing-enabled NO \
-resultBundlePath ../../exampleTestResults \
-skip-testing:EzklAppUITests/EzklAppUITests/testButtonClicksInOrder

View File

@@ -15,9 +15,9 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
with:
toolchain: nightly-2025-02-17
toolchain: nightly-2025-05-01
override: true
components: rustfmt, clippy

300
Cargo.lock generated
View File

@@ -881,17 +881,6 @@ dependencies = [
"syn 2.0.101",
]
[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi 0.1.19",
"libc",
"winapi",
]
[[package]]
name = "aurora-engine-modexp"
version = "1.2.0"
@@ -970,29 +959,6 @@ dependencies = [
"serde",
]
[[package]]
name = "bindgen"
version = "0.69.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088"
dependencies = [
"bitflags 2.9.0",
"cexpr",
"clang-sys",
"itertools 0.12.1",
"lazy_static",
"lazycell",
"log",
"prettyplease",
"proc-macro2",
"quote",
"regex",
"rustc-hash 1.1.0",
"shlex",
"syn 2.0.101",
"which",
]
[[package]]
name = "bit-set"
version = "0.5.3"
@@ -1211,15 +1177,6 @@ dependencies = [
"shlex",
]
[[package]]
name = "cexpr"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
dependencies = [
"nom",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
@@ -1270,29 +1227,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"
dependencies = [
"ciborium-io",
"half 2.6.0",
]
[[package]]
name = "clang-sys"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]]
name = "clap"
version = "2.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
dependencies = [
"bitflags 1.3.2",
"textwrap 0.11.0",
"unicode-width 0.1.14",
"half",
]
[[package]]
@@ -1323,7 +1258,7 @@ version = "4.5.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06f5378ea264ad4f82bbc826628b5aad714a75abf6ece087e923010eb937fb6"
dependencies = [
"clap 4.5.37",
"clap",
]
[[package]]
@@ -1510,32 +1445,6 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "criterion"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f"
dependencies = [
"atty",
"cast",
"clap 2.34.0",
"criterion-plot 0.4.5",
"csv",
"itertools 0.10.5",
"lazy_static",
"num-traits",
"oorandom",
"plotters",
"rayon",
"regex",
"serde",
"serde_cbor",
"serde_derive",
"serde_json",
"tinytemplate",
"walkdir",
]
[[package]]
name = "criterion"
version = "0.5.1"
@@ -1545,8 +1454,8 @@ dependencies = [
"anes",
"cast",
"ciborium",
"clap 4.5.37",
"criterion-plot 0.5.0",
"clap",
"criterion-plot",
"is-terminal",
"itertools 0.10.5",
"num-traits",
@@ -1562,16 +1471,6 @@ dependencies = [
"walkdir",
]
[[package]]
name = "criterion-plot"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876"
dependencies = [
"cast",
"itertools 0.10.5",
]
[[package]]
name = "criterion-plot"
version = "0.5.0"
@@ -1644,27 +1543,6 @@ dependencies = [
"typenum",
]
[[package]]
name = "csv"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf"
dependencies = [
"csv-core",
"itoa",
"ryu",
"serde",
]
[[package]]
name = "csv-core"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d"
dependencies = [
"memchr",
]
[[package]]
name = "dashmap"
version = "5.5.3"
@@ -2065,12 +1943,12 @@ dependencies = [
"bincode",
"camino",
"chrono",
"clap 4.5.37",
"clap",
"clap_complete",
"colored",
"colored_json",
"console_error_panic_hook",
"criterion 0.5.1",
"criterion",
"ecc",
"env_logger 0.10.2",
"ethabi",
@@ -2082,6 +1960,7 @@ dependencies = [
"halo2_solidity_verifier",
"halo2curves 0.7.0 (git+https://github.com/privacy-scaling-explorations/halo2curves?rev=b753a832e92d5c86c5c997327a9cf9de86a18851)",
"hex",
"icicle-runtime",
"indicatif",
"instant",
"itertools 0.10.5",
@@ -2328,7 +2207,7 @@ version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8640e34b88f7652208ce9e88b1a37a2ae95227d84abec377ccd3c5cfeb141ed4"
dependencies = [
"rustix 1.0.5",
"rustix",
"windows-sys 0.59.0",
]
@@ -2521,12 +2400,6 @@ dependencies = [
"subtle",
]
[[package]]
name = "half"
version = "1.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403"
[[package]]
name = "half"
version = "2.6.0"
@@ -2541,7 +2414,7 @@ dependencies = [
[[package]]
name = "halo2_gadgets"
version = "0.2.0"
source = "git+https://github.com/zkonduit/halo2#f441c920be45f8f05d2c06a173d82e8885a5ed4d"
source = "git+https://github.com/zkonduit/halo2?branch=ac%2Fconditional-compilation-icicle2#1dd2090741f006fd031a07da7f3c9dfce5e0015e"
dependencies = [
"arrayvec 0.7.6",
"bitvec",
@@ -2558,7 +2431,7 @@ dependencies = [
[[package]]
name = "halo2_proofs"
version = "0.3.0"
source = "git+https://github.com/zkonduit/halo2#f441c920be45f8f05d2c06a173d82e8885a5ed4d"
source = "git+https://github.com/zkonduit/halo2#1dd2090741f006fd031a07da7f3c9dfce5e0015e?branch=ac%2Fconditional-compilation-icicle2#1dd2090741f006fd031a07da7f3c9dfce5e0015e"
dependencies = [
"bincode",
"blake2b_simd",
@@ -2568,7 +2441,7 @@ dependencies = [
"halo2curves 0.7.0 (git+https://github.com/privacy-scaling-explorations/halo2curves?rev=b753a832e92d5c86c5c997327a9cf9de86a18851)",
"icicle-bn254",
"icicle-core",
"icicle-cuda-runtime",
"icicle-runtime",
"instant",
"lazy_static",
"log",
@@ -2576,7 +2449,7 @@ dependencies = [
"mopro-msm",
"rand_chacha 0.3.1",
"rand_core 0.6.4",
"rustc-hash 2.1.1",
"rustc-hash",
"serde",
"sha3 0.9.1",
"tracing",
@@ -2791,15 +2664,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"libc",
]
[[package]]
name = "hermit-abi"
version = "0.3.9"
@@ -2991,33 +2855,45 @@ dependencies = [
[[package]]
name = "icicle-bn254"
version = "2.8.0"
source = "git+https://github.com/ingonyama-zk/icicle?branch=ezkl-icicle2#5dfe006a0f1bc62ea82ca297709bbf3d22a2ca25"
version = "3.7.0"
source = "git+https://github.com/ingonyama-zk/icicle?branch=emir%2Fgate_eval_2#012e00694f4cf399fe7a42d9cfbfa6cd7a60f876"
dependencies = [
"cmake",
"criterion 0.3.6",
"icicle-core",
"icicle-cuda-runtime",
"icicle-hash",
"icicle-runtime",
]
[[package]]
name = "icicle-core"
version = "2.8.0"
source = "git+https://github.com/ingonyama-zk/icicle?branch=ezkl-icicle2#5dfe006a0f1bc62ea82ca297709bbf3d22a2ca25"
version = "3.7.0"
source = "git+https://github.com/ingonyama-zk/icicle?branch=emir%2Fgate_eval_2#012e00694f4cf399fe7a42d9cfbfa6cd7a60f876"
dependencies = [
"criterion 0.3.6",
"hex",
"icicle-cuda-runtime",
"icicle-runtime",
"once_cell",
"rand 0.8.5",
"rayon",
]
[[package]]
name = "icicle-cuda-runtime"
version = "2.8.0"
source = "git+https://github.com/ingonyama-zk/icicle?branch=ezkl-icicle2#5dfe006a0f1bc62ea82ca297709bbf3d22a2ca25"
name = "icicle-hash"
version = "3.7.0"
source = "git+https://github.com/ingonyama-zk/icicle?branch=emir%2Fgate_eval_2#012e00694f4cf399fe7a42d9cfbfa6cd7a60f876"
dependencies = [
"bindgen",
"bitflags 1.3.2",
"cmake",
"icicle-core",
"icicle-runtime",
"rand 0.8.5",
]
[[package]]
name = "icicle-runtime"
version = "3.7.0"
source = "git+https://github.com/ingonyama-zk/icicle?branch=emir%2Fgate_eval_2#012e00694f4cf399fe7a42d9cfbfa6cd7a60f876"
dependencies = [
"cmake",
"once_cell",
]
[[package]]
@@ -3470,28 +3346,12 @@ dependencies = [
"spin",
]
[[package]]
name = "lazycell"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
version = "0.2.172"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
[[package]]
name = "libloading"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
dependencies = [
"cfg-if",
"windows-targets 0.52.6",
]
[[package]]
name = "libm"
version = "0.2.13"
@@ -3519,12 +3379,6 @@ dependencies = [
"redox_syscall",
]
[[package]]
name = "linux-raw-sys"
version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
[[package]]
name = "linux-raw-sys"
version = "0.9.4"
@@ -3963,7 +3817,7 @@ dependencies = [
"num-traits",
"pyo3",
"pyo3-build-config",
"rustc-hash 2.1.1",
"rustc-hash",
]
[[package]]
@@ -4394,16 +4248,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
[[package]]
name = "prettyplease"
version = "0.2.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6"
dependencies = [
"proc-macro2",
"syn 2.0.101",
]
[[package]]
name = "primal-check"
version = "0.3.4"
@@ -4656,7 +4500,7 @@ dependencies = [
"pin-project-lite",
"quinn-proto",
"quinn-udp",
"rustc-hash 2.1.1",
"rustc-hash",
"rustls",
"socket2",
"thiserror 2.0.12",
@@ -4675,7 +4519,7 @@ dependencies = [
"getrandom 0.3.2",
"rand 0.9.1",
"ring",
"rustc-hash 2.1.1",
"rustc-hash",
"rustls",
"rustls-pki-types",
"slab",
@@ -5173,12 +5017,6 @@ version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustc-hash"
version = "2.1.1"
@@ -5224,19 +5062,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "rustix"
version = "0.38.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
dependencies = [
"bitflags 2.9.0",
"errno",
"libc",
"linux-raw-sys 0.4.15",
"windows-sys 0.59.0",
]
[[package]]
name = "rustix"
version = "1.0.5"
@@ -5246,7 +5071,7 @@ dependencies = [
"bitflags 2.9.0",
"errno",
"libc",
"linux-raw-sys 0.9.4",
"linux-raw-sys",
"windows-sys 0.59.0",
]
@@ -5494,16 +5319,6 @@ dependencies = [
"serde",
]
[[package]]
name = "serde_cbor"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5"
dependencies = [
"half 1.8.3",
"serde",
]
[[package]]
name = "serde_derive"
version = "1.0.219"
@@ -5950,7 +5765,7 @@ dependencies = [
"fastrand",
"getrandom 0.3.2",
"once_cell",
"rustix 1.0.5",
"rustix",
"windows-sys 0.59.0",
]
@@ -5996,15 +5811,6 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "textwrap"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
dependencies = [
"unicode-width 0.1.14",
]
[[package]]
name = "textwrap"
version = "0.16.2"
@@ -6398,7 +6204,7 @@ dependencies = [
"downcast-rs",
"dyn-clone",
"dyn-hash",
"half 2.6.0",
"half",
"itertools 0.12.1",
"lazy_static",
"maplit",
@@ -6433,7 +6239,7 @@ dependencies = [
"downcast-rs",
"dyn-clone",
"dyn-hash",
"half 2.6.0",
"half",
"lazy_static",
"liquid",
"liquid-core",
@@ -6614,7 +6420,7 @@ dependencies = [
"once_cell",
"paste",
"serde",
"textwrap 0.16.2",
"textwrap",
"toml 0.5.11",
"uniffi_meta",
"uniffi_testing",
@@ -6706,7 +6512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cef408229a3a407fafa4c36dc4f6ece78a6fb258ab28d2b64bddd49c8cb680f6"
dependencies = [
"anyhow",
"textwrap 0.16.2",
"textwrap",
"uniffi_meta",
"uniffi_testing",
"weedle2",
@@ -7046,18 +6852,6 @@ dependencies = [
"nom",
]
[[package]]
name = "which"
version = "4.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
dependencies = [
"either",
"home",
"once_cell",
"rustix 0.38.44",
]
[[package]]
name = "winapi"
version = "0.3.9"
@@ -7435,7 +7229,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e"
dependencies = [
"libc",
"rustix 1.0.5",
"rustix",
]
[[package]]

View File

@@ -16,12 +16,12 @@ crate-type = ["cdylib", "rlib", "staticlib"]
[dependencies]
halo2_gadgets = { git = "https://github.com/zkonduit/halo2" }
halo2_gadgets = { git = "https://github.com/zkonduit/halo2", branch= "ac/conditional-compilation-icicle2" }
halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", rev = "b753a832e92d5c86c5c997327a9cf9de86a18851", features = [
"derive_serde",
] }
halo2_proofs = { git = "https://github.com/zkonduit/halo2", package = "halo2_proofs", features = [
"circuit-params",
halo2_proofs = { git = "https://github.com/zkonduit/halo2", package = "halo2_proofs", branch= "ac/conditional-compilation-icicle2", features = [
"circuit-params", "mv-lookup"
] }
rand = { version = "0.8", default-features = false }
itertools = { version = "0.10.3", default-features = false }
@@ -33,10 +33,10 @@ thiserror = { version = "1.0.38", default-features = false }
hex = { version = "0.4.3", default-features = false }
halo2_wrong_ecc = { git = "https://github.com/zkonduit/halo2wrong", branch = "ac/chunked-mv-lookup", package = "ecc" }
snark-verifier = { git = "https://github.com/zkonduit/snark-verifier", branch = "ac/chunked-mv-lookup", features = [
"derive_serde",
"derive_serde", "mv-lookup"
] }
halo2_solidity_verifier = { git = "https://github.com/zkonduit/ezkl-verifier", branch = "main", optional = true, features = [
"evm",
"evm", "mv-lookup",
] }
maybe-rayon = { version = "0.1.1", default-features = false }
bincode = { version = "1.3.3", default-features = false }
@@ -103,6 +103,10 @@ uniffi_bindgen = { version = "=0.28.0", optional = true }
camino = { version = "^1.1", optional = true }
uuid = { version = "1.10.0", features = ["v4"], optional = true }
# GPU / device related things (optional - only enabled with gpu-accelerated feature)
icicle-runtime = { git = "https://github.com/ingonyama-zk/icicle", branch="emir/gate_eval_2", package="icicle-runtime", optional = true }
[target.'cfg(not(all(target_arch = "wasm32", target_os = "unknown")))'.dependencies]
colored = { version = "2.0.0", default-features = false, optional = true }
env_logger = { version = "0.10.0", default-features = false, optional = true }
@@ -222,11 +226,13 @@ required-features = ["python-bindings"]
[features]
web = ["wasm-bindgen-rayon"]
default = [
"eth-mv-lookup",
"eth",
"dep:halo2_solidity_verifier",
"ezkl",
"precompute-coset",
"no-banner",
"parallel-poly-read",
"reusable-verifier",
]
onnx = ["dep:tract-onnx"]
python-bindings = ["pyo3", "pyo3-log", "pyo3-async-runtimes", "pyo3-stub-gen"]
@@ -235,7 +241,7 @@ universal-bindings = [
"mv-lookup",
"precompute-coset",
"parallel-poly-read",
"solidity-verifier-mv-lookup",
"dep:halo2_solidity_verifier"
]
logging = ["dep:colored", "dep:env_logger", "dep:chrono"]
ios-bindings = ["universal-bindings"]
@@ -261,10 +267,6 @@ ezkl = [
"logging",
]
eth = ["dep:alloy", "dep:foundry-compilers", "dep:ethabi"]
solidity-verifier = ["dep:halo2_solidity_verifier"]
solidity-verifier-mv-lookup = ["halo2_solidity_verifier/mv-lookup"]
eth-mv-lookup = ["solidity-verifier-mv-lookup", "mv-lookup", "eth"]
eth-original-lookup = ["eth", "solidity-verifier"]
parallel-poly-read = [
"halo2_proofs/circuit-params",
"halo2_proofs/parallel-poly-read",
@@ -273,7 +275,7 @@ mv-lookup = ["halo2_proofs/mv-lookup", "snark-verifier/mv-lookup"]
asm = ["halo2curves/asm", "halo2_proofs/asm"]
precompute-coset = ["halo2_proofs/precompute-coset"]
det-prove = []
icicle = ["halo2_proofs/icicle_gpu"]
gpu-accelerated = ["halo2_proofs/gpu-accelerated", "dep:icicle-runtime"]
empty-cmd = []
no-banner = []
no-update = []
@@ -284,9 +286,21 @@ mimalloc = ["dep:mimalloc"]
reusable-verifier = []
[patch.'https://github.com/zkonduit/halo2']
halo2_proofs = { git = "https://github.com/zkonduit/halo2#1dd2090741f006fd031a07da7f3c9dfce5e0015e", package = "halo2_proofs", branch= "ac/conditional-compilation-icicle2", features = [
"circuit-params", "mv-lookup"
] }
[patch.'https://github.com/zkonduit/halo2#f441c920be45f8f05d2c06a173d82e8885a5ed4d']
halo2_proofs = { git = "https://github.com/zkonduit/halo2#1dd2090741f006fd031a07da7f3c9dfce5e0015e", package = "halo2_proofs", branch= "ac/conditional-compilation-icicle2", features = [
"circuit-params", "mv-lookup"
] }
[patch.crates-io]
uniffi_testing = { git = "https://github.com/ElusAegis/uniffi-rs", branch = "feat/testing-feature-build-fix" }
[profile.release]
# debug = true
rustflags = ["-C", "relocation-model=pic"]
@@ -301,3 +315,5 @@ opt-level = 3
[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O4", "--flexible-inline-max-function-size", "4294967295"]

View File

@@ -1,7 +1,7 @@
import ezkl
project = 'ezkl'
release = '0.0.0'
release = '22.2.3'
version = release

View File

@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2025-02-17"
channel = "nightly-2025-05-01"
components = ["rustfmt", "clippy"]

229
setup-gpu.sh Executable file
View File

@@ -0,0 +1,229 @@
#!/bin/bash
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Default installation directory
DEFAULT_INSTALL_DIR="/opt/icicle/lib/backend/halo2"
# Halo2 repository details
HALO2_REPO="https://github.com/zkonduit/halo2"
HALO2_BRANCH="ac/conditional-compilation-icicle2"
# Parse command line arguments
AUTO_YES=false
for arg in "$@"; do
case $arg in
-y|--yes)
AUTO_YES=true
shift
;;
-h|--help)
echo "Usage: $0 [OPTIONS]"
echo "Options:"
echo " -y, --yes Automatically answer 'yes' to all prompts"
echo " -h, --help Show this help message"
exit 0
;;
*)
echo "Unknown option: $arg"
echo "Use -h or --help for usage information"
exit 1
;;
esac
done
echo -e "${GREEN}EZKL GPU Setup Script${NC}"
echo -e "${GREEN}=====================${NC}"
echo ""
# Parse commit hash from Cargo.lock
echo "Parsing halo2 commit hash from Cargo.lock..."
if [ ! -f "Cargo.lock" ]; then
echo -e "${RED}Error: Cargo.lock not found. Please run this script from the project root.${NC}"
exit 1
fi
HALO2_COMMIT=$(grep "github\.com/zkonduit/halo2?" Cargo.lock | grep -v "halo2wrong" | head -1 | grep -o "#[a-f0-9]\{40\}" | cut -c2-)
if [ -z "$HALO2_COMMIT" ]; then
echo -e "${RED}Error: Could not parse halo2 commit hash from Cargo.lock${NC}"
exit 1
fi
echo -e "${GREEN}Found halo2 commit: $HALO2_COMMIT${NC}"
echo ""
echo "This script will:"
echo "1. Sparse checkout the halo2 repository at commit $HALO2_COMMIT"
echo "2. Extract only the icicle/backend/cuda/ directory"
echo "3. Set the ICICLE_BACKEND_INSTALL_DIR environment variable"
echo ""
# Check if user wants to override the default directory
if [ "$AUTO_YES" = true ]; then
INSTALL_DIR="$DEFAULT_INSTALL_DIR"
echo -e "${GREEN}Using default installation directory: ${INSTALL_DIR}${NC}"
else
echo -e "${YELLOW}Default installation directory: ${DEFAULT_INSTALL_DIR}${NC}"
read -p "Do you want to use a different directory? [y/N]: " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
read -p "Enter the installation directory: " INSTALL_DIR
INSTALL_DIR="${INSTALL_DIR/#\~/$HOME}" # Expand ~ to $HOME
else
INSTALL_DIR="$DEFAULT_INSTALL_DIR"
fi
# Confirm the installation directory
echo ""
echo -e "${YELLOW}Installation directory: ${INSTALL_DIR}${NC}"
read -p "Continue with this directory? [y/N]: " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo -e "${RED}Setup cancelled by user.${NC}"
exit 1
fi
fi
# Check if ICICLE_BACKEND_INSTALL_DIR is already set
if [ ! -z "$ICICLE_BACKEND_INSTALL_DIR" ] && [ "$AUTO_YES" = false ]; then
echo ""
echo -e "${YELLOW}Warning: ICICLE_BACKEND_INSTALL_DIR is already set to: $ICICLE_BACKEND_INSTALL_DIR${NC}"
read -p "Do you want to override it? [y/N]: " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo -e "${RED}Setup cancelled by user.${NC}"
exit 1
fi
elif [ ! -z "$ICICLE_BACKEND_INSTALL_DIR" ] && [ "$AUTO_YES" = true ]; then
echo -e "${GREEN}Overriding existing ICICLE_BACKEND_INSTALL_DIR (was: $ICICLE_BACKEND_INSTALL_DIR)${NC}"
fi
echo ""
echo -e "${GREEN}Starting GPU setup...${NC}"
# Create installation directory
echo "Creating installation directory..."
mkdir -p "$INSTALL_DIR"
# Create temporary directory for sparse checkout
TEMP_DIR=$(mktemp -d)
echo "Using temporary directory: $TEMP_DIR"
# Clone with sparse checkout
echo "Cloning halo2 repository with sparse checkout..."
cd "$TEMP_DIR"
git clone --filter=blob:none --sparse "$HALO2_REPO" halo2
cd halo2
# Checkout the specific branch and commit
echo "Checking out branch $HALO2_BRANCH at commit $HALO2_COMMIT..."
git checkout "$HALO2_BRANCH"
git checkout "$HALO2_COMMIT"
# Configure sparse checkout
echo "Configuring sparse checkout for icicle/backend/cuda/..."
git sparse-checkout init --cone
git sparse-checkout set icicle/backend/cuda/
# Copy the icicle directory to the installation location
if [ -d "icicle/backend/cuda" ]; then
echo "Copying icicle/backend/cuda/ to $INSTALL_DIR..."
cp -r icicle/backend/cuda/* "$INSTALL_DIR/"
echo -e "${GREEN}Files copied successfully!${NC}"
else
echo -e "${RED}Error: icicle/backend/cuda directory not found in the repository${NC}"
exit 1
fi
# Clean up temporary directory
echo "Cleaning up temporary files..."
rm -rf "$TEMP_DIR"
# Ask user about setting environment variable permanently
SETUP_PERMANENT_ENV=false
if [ "$AUTO_YES" = true ]; then
SETUP_PERMANENT_ENV=true
echo ""
echo -e "${GREEN}Setting ICICLE_BACKEND_INSTALL_DIR environment variable permanently...${NC}"
else
echo ""
echo -e "${YELLOW}Do you want to set ICICLE_BACKEND_INSTALL_DIR environment variable permanently?${NC}"
echo "This will add 'export ICICLE_BACKEND_INSTALL_DIR=\"$INSTALL_DIR\"' to your shell configuration file."
read -p "Set environment variable permanently? [y/N]: " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
SETUP_PERMANENT_ENV=true
fi
fi
if [ "$SETUP_PERMANENT_ENV" = true ]; then
echo "Setting ICICLE_BACKEND_INSTALL_DIR environment variable..."
# Detect shell and set environment variable accordingly
if [ -n "$ZSH_VERSION" ]; then
SHELL_RC="$HOME/.zshrc"
elif [ -n "$BASH_VERSION" ]; then
SHELL_RC="$HOME/.bashrc"
else
# Try to detect based on $SHELL
case "$SHELL" in
*/zsh)
SHELL_RC="$HOME/.zshrc"
;;
*/bash)
SHELL_RC="$HOME/.bashrc"
;;
*)
SHELL_RC="$HOME/.profile"
;;
esac
fi
# Add environment variable to shell configuration
ENV_EXPORT="export ICICLE_BACKEND_INSTALL_DIR=\"$INSTALL_DIR\""
# Check if the variable is already set in the file
if [ -f "$SHELL_RC" ] && grep -q "ICICLE_BACKEND_INSTALL_DIR" "$SHELL_RC"; then
# Replace existing line
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' "s|export ICICLE_BACKEND_INSTALL_DIR=.*|$ENV_EXPORT|" "$SHELL_RC"
else
# Linux
sed -i "s|export ICICLE_BACKEND_INSTALL_DIR=.*|$ENV_EXPORT|" "$SHELL_RC"
fi
echo "Updated existing ICICLE_BACKEND_INSTALL_DIR in $SHELL_RC"
else
# Add new line
echo "$ENV_EXPORT" >> "$SHELL_RC"
echo "Added ICICLE_BACKEND_INSTALL_DIR to $SHELL_RC"
fi
echo -e "${GREEN}Environment variable set permanently.${NC}"
else
echo "Skipping permanent environment variable setup."
fi
# Export for current session regardless
export ICICLE_BACKEND_INSTALL_DIR="$INSTALL_DIR"
echo "Environment variable set for current session."
echo ""
echo -e "${GREEN}GPU setup completed successfully!${NC}"
echo ""
echo -e "${YELLOW}Important:${NC}"
echo "1. The ICICLE_BACKEND_INSTALL_DIR environment variable has been set to: $INSTALL_DIR"
if [ "$SETUP_PERMANENT_ENV" = true ]; then
echo "2. Please restart your terminal or run: source $SHELL_RC"
else
echo "2. To use GPU features, set: export ICICLE_BACKEND_INSTALL_DIR=\"$INSTALL_DIR\""
fi
echo "3. You can now build with GPU support using: cargo build --features gpu-accelerated"
echo ""
echo -e "${GREEN}Setup complete!${NC}"

View File

@@ -15,9 +15,6 @@ use log::{error, info};
#[cfg(not(any(target_arch = "wasm32", feature = "no-banner")))]
use rand::prelude::SliceRandom;
#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))]
#[cfg(feature = "icicle")]
use std::env;
#[tokio::main(flavor = "current_thread")]
#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))]
pub async fn main() {
@@ -31,12 +28,7 @@ pub async fn main() {
init_logger();
#[cfg(not(any(target_arch = "wasm32", feature = "no-banner")))]
banner();
#[cfg(feature = "icicle")]
if env::var("ENABLE_ICICLE_GPU").is_ok() {
info!("Running with ICICLE GPU");
} else {
info!("Running with CPU");
}
debug!(
"command: \n {}",
&command.as_json().to_colored_json_auto().unwrap()

View File

@@ -93,17 +93,6 @@ impl From<PyG1> for G1 {
}
}
impl pyo3::ToPyObject for PyG1 {
fn to_object(&self, py: pyo3::Python) -> pyo3::PyObject {
let g1_dict = pyo3::types::PyDict::new(py);
g1_dict.set_item("x", self.x.to_object(py)).unwrap();
g1_dict.set_item("y", self.y.to_object(py)).unwrap();
g1_dict.set_item("z", self.z.to_object(py)).unwrap();
g1_dict.into()
}
}
/// pyclass containing the struct used for G1
#[pyclass]
#[derive(Debug, Clone)]
@@ -135,16 +124,6 @@ impl From<PyG1Affine> for G1Affine {
}
}
impl pyo3::ToPyObject for PyG1Affine {
fn to_object(&self, py: pyo3::Python) -> pyo3::PyObject {
let g1_dict = pyo3::types::PyDict::new(py);
g1_dict.set_item("x", self.x.to_object(py)).unwrap();
g1_dict.set_item("y", self.y.to_object(py)).unwrap();
g1_dict.into()
}
}
/// Python class containing the struct used for run_args
///
/// Returns
@@ -161,6 +140,9 @@ struct PyRunArgs {
#[pyo3(get, set)]
/// int: The denominator in the fixed point representation used when quantizing parameters
pub param_scale: crate::Scale,
/// int: The scale to rebase to (optional). If None, we rebase to the max of input_scale and param_scale
/// This is an advanced parameter that should be used with caution
pub rebase_scale: Option<crate::Scale>,
#[pyo3(get, set)]
/// int: If the scale is ever > scale_rebase_multiplier * input_scale then the scale is rebased to input_scale (this a more advanced parameter, use with caution)
pub scale_rebase_multiplier: u32,
@@ -227,6 +209,7 @@ impl From<PyRunArgs> for RunArgs {
bounded_log_lookup: py_run_args.bounded_log_lookup,
input_scale: py_run_args.input_scale,
param_scale: py_run_args.param_scale,
rebase_scale: py_run_args.rebase_scale,
num_inner_cols: py_run_args.num_inner_cols,
scale_rebase_multiplier: py_run_args.scale_rebase_multiplier,
lookup_range: py_run_args.lookup_range,
@@ -253,6 +236,7 @@ impl Into<PyRunArgs> for RunArgs {
bounded_log_lookup: self.bounded_log_lookup,
input_scale: self.input_scale,
param_scale: self.param_scale,
rebase_scale: self.rebase_scale,
num_inner_cols: self.num_inner_cols,
scale_rebase_multiplier: self.scale_rebase_multiplier,
lookup_range: self.lookup_range,
@@ -694,7 +678,7 @@ fn ipa_commit(
.map_err(|_| PyIOError::new_err("Failed to load circuit settings"))?;
let srs_path =
crate::execute::get_srs_path(settings.run_args.logrows, srs_path, Commitments::KZG);
crate::execute::get_srs_path(settings.run_args.logrows, srs_path, Commitments::IPA);
let srs = load_srs_prover::<IPACommitmentScheme<G1Affine>>(srs_path)
.map_err(|_| PyIOError::new_err("Failed to load srs"))?;
@@ -884,7 +868,7 @@ fn gen_srs(srs_path: PathBuf, logrows: usize) -> PyResult<()> {
))]
#[gen_stub_pyfunction]
fn get_srs(
py: Python,
py: Python<'_>,
settings_path: Option<PathBuf>,
logrows: Option<u32>,
srs_path: Option<PathBuf>,
@@ -1101,7 +1085,7 @@ fn gen_witness(
let err_str = format!("Failed to generate witness: {}", e);
PyRuntimeError::new_err(err_str)
})?;
Python::with_gil(|py| Ok(output.to_object(py)))
Python::with_gil(|py| Ok(output.into_pyobject(py).unwrap().into()))
}
/// Mocks the prover
@@ -1283,7 +1267,7 @@ fn prove(
PyRuntimeError::new_err(err_str)
})?;
Python::with_gil(|py| Ok(snark.to_object(py)))
Python::with_gil(|py| Ok(snark.into_pyobject(py).unwrap().into()))
}
/// Verifies a given proof
@@ -1649,7 +1633,7 @@ fn encode_evm_calldata<'a>(
))]
#[gen_stub_pyfunction]
fn create_evm_verifier(
py: Python,
py: Python<'_>,
vk_path: PathBuf,
settings_path: PathBuf,
sol_code_path: PathBuf,
@@ -1710,7 +1694,7 @@ fn create_evm_verifier(
))]
#[gen_stub_pyfunction]
fn create_evm_vka(
py: Python,
py: Python<'_>,
vk_path: PathBuf,
settings_path: PathBuf,
vka_path: PathBuf,
@@ -1740,7 +1724,7 @@ fn create_evm_vka(
))]
#[gen_stub_pyfunction]
fn deploy_evm(
py: Python,
py: Python<'_>,
addr_path: PathBuf,
rpc_url: String,
sol_code_path: PathBuf,
@@ -1924,7 +1908,7 @@ fn verify_evm<'a>(
))]
#[gen_stub_pyfunction]
fn create_evm_verifier_aggr(
py: Python,
py: Python<'_>,
aggregation_settings: Vec<PathBuf>,
vk_path: PathBuf,
sol_code_path: PathBuf,

View File

@@ -7,11 +7,7 @@ use halo2_proofs::{
};
use log::debug;
#[cfg(feature = "python-bindings")]
use pyo3::{
conversion::{FromPyObject, IntoPy},
exceptions::PyValueError,
prelude::*,
};
use pyo3::{conversion::FromPyObject, exceptions::PyValueError, prelude::*, IntoPyObject};
use serde::{Deserialize, Serialize};
#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))]
use tosubcommand::ToFlags;
@@ -86,12 +82,17 @@ impl CheckMode {
#[cfg(feature = "python-bindings")]
/// Converts CheckMode into a PyObject (Required for CheckMode to be compatible with Python)
impl IntoPy<PyObject> for CheckMode {
fn into_py(self, py: Python) -> PyObject {
match self {
CheckMode::SAFE => "safe".to_object(py),
CheckMode::UNSAFE => "unsafe".to_object(py),
}
impl<'py> IntoPyObject<'py> for CheckMode {
type Target = pyo3::PyAny;
type Output = pyo3::Bound<'py, Self::Target>;
type Error = pyo3::PyErr;
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
let result = match self {
CheckMode::SAFE => "safe",
CheckMode::UNSAFE => "unsafe",
};
Ok(result.into_pyobject(py)?.into_any())
}
}

View File

@@ -4626,7 +4626,7 @@ pub(crate) fn rescale<F: PrimeField + TensorType + PartialOrd + std::hash::Hash>
let mut rescaled_inputs = vec![];
for (i, ri) in values.iter().enumerate() {
if scales[i].1 == 1 {
rescaled_inputs.push(ri.clone().clone());
rescaled_inputs.push((*ri).clone());
continue;
}
@@ -5709,13 +5709,13 @@ pub fn ln<F: PrimeField + TensorType + PartialOrd + std::hash::Hash>(
let abs_distance_to_prior_pow2 = l1_distance(config, region, &[&input, &prior_pow2])?;
// because we round up this can be equal
let is_closest_to_0: ValTensor<F> = less(
let is_closest_to_0: ValTensor<F> = less_equal(
config,
region,
&[&abs_distance_to_claimed, &abs_distance_to_next_pow2],
)?;
let is_closest_to_1 = less(
let is_closest_to_1 = less_equal(
config,
region,
&[&abs_distance_to_claimed, &abs_distance_to_prior_pow2],

View File

@@ -364,7 +364,15 @@ impl<
};
Ok(Some(if self.decomp {
log::debug!("constraining constant to be decomp");
super::layouts::decompose(config, region, &[&value], &region.base(), &region.legs(), false)?.1
super::layouts::decompose(
config,
region,
&[&value],
&region.base(),
&region.legs(),
false,
)?
.1
} else {
log::debug!("constraining constant to be identity");
super::layouts::identity(config, region, &[&value])?

View File

@@ -93,12 +93,17 @@ pub const DEFAULT_VKA_DIGEST: &str = "vka.digest";
#[cfg(feature = "python-bindings")]
/// Converts TranscriptType into a PyObject (Required for TranscriptType to be compatible with Python)
impl IntoPy<PyObject> for TranscriptType {
fn into_py(self, py: Python) -> PyObject {
match self {
TranscriptType::Poseidon => "poseidon".to_object(py),
TranscriptType::EVM => "evm".to_object(py),
}
impl<'py> IntoPyObject<'py> for TranscriptType {
type Target = pyo3::PyAny;
type Output = pyo3::Bound<'py, Self::Target>;
type Error = pyo3::PyErr;
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
let result = match self {
TranscriptType::Poseidon => "poseidon",
TranscriptType::EVM => "evm",
};
Ok(result.into_pyobject(py)?.into_any())
}
}
#[cfg(feature = "python-bindings")]
@@ -257,17 +262,20 @@ impl From<&str> for H160Flag {
#[cfg(feature = "python-bindings")]
/// Converts CalibrationTarget into a PyObject (Required for CalibrationTarget to be compatible with Python)
impl IntoPy<PyObject> for CalibrationTarget {
fn into_py(self, py: Python) -> PyObject {
match self {
CalibrationTarget::Resources { col_overflow: true } => {
"resources/col-overflow".to_object(py)
}
impl<'py> IntoPyObject<'py> for CalibrationTarget {
type Target = pyo3::PyAny;
type Output = pyo3::Bound<'py, Self::Target>;
type Error = pyo3::PyErr;
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
let result = match self {
CalibrationTarget::Resources { col_overflow: true } => "resources/col-overflow",
CalibrationTarget::Resources {
col_overflow: false,
} => "resources".to_object(py),
CalibrationTarget::Accuracy => "accuracy".to_object(py),
}
} => "resources",
CalibrationTarget::Accuracy => "accuracy",
};
Ok(result.into_pyobject(py)?.into_any())
}
}
@@ -289,12 +297,17 @@ impl<'source> FromPyObject<'source> for CalibrationTarget {
#[cfg(feature = "python-bindings")]
/// Converts ContractType into a PyObject (Required for ContractType to be compatible with Python)
impl IntoPy<PyObject> for ContractType {
fn into_py(self, py: Python) -> PyObject {
match self {
ContractType::Verifier { reusable: true } => "verifier/reusable".to_object(py),
ContractType::Verifier { reusable: false } => "verifier".to_object(py),
}
impl<'py> IntoPyObject<'py> for ContractType {
type Target = pyo3::PyAny;
type Output = pyo3::Bound<'py, Self::Target>;
type Error = pyo3::PyErr;
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
let result = match self {
ContractType::Verifier { reusable: true } => "verifier/reusable",
ContractType::Verifier { reusable: false } => "verifier",
};
Ok(result.into_pyobject(py)?.into_any())
}
}

View File

@@ -26,6 +26,8 @@ use colored::Colorize;
#[cfg(unix)]
use gag::Gag;
use halo2_proofs::dev::VerifyFailure;
#[cfg(feature = "gpu-accelerated")]
use halo2_proofs::icicle::try_load_and_set_backend_device;
use halo2_proofs::plonk::{self, Circuit};
use halo2_proofs::poly::commitment::{CommitmentScheme, Params};
use halo2_proofs::poly::commitment::{ParamsProver, Verifier};
@@ -46,6 +48,8 @@ use halo2_solidity_verifier;
use halo2curves::bn256::{Bn256, Fr, G1Affine};
use halo2curves::ff::{FromUniformBytes, WithSmallOrderMulGroup};
use halo2curves::serde::SerdeObject;
#[cfg(feature = "gpu-accelerated")]
use icicle_runtime::{stream::IcicleStream, warmup};
use indicatif::{ProgressBar, ProgressStyle};
use instant::Instant;
use itertools::Itertools;
@@ -87,6 +91,22 @@ lazy_static! {
}
/// Set the device used for computation.
#[cfg(feature = "gpu-accelerated")]
pub fn set_device() {
if std::env::var("ICICLE_BACKEND_INSTALL_DIR").is_ok() {
info!("Running with ICICLE GPU");
try_load_and_set_backend_device("CUDA");
match warmup(&IcicleStream::default()) {
Ok(_) => info!("GPU warmed :)"),
Err(e) => log::error!("GPU warmup failed: {:?}", e),
}
} else {
info!("Running with CPU: 'ICICLE_BACKEND_INSTALL_DIR' not set");
try_load_and_set_backend_device("CPU");
}
}
/// A wrapper for execution errors
#[derive(Debug, Error)]
pub enum ExecutionError {
@@ -108,6 +128,8 @@ lazy_static::lazy_static! {
/// Run an ezkl command with given args
pub async fn run(command: Commands) -> Result<String, EZKLError> {
#[cfg(feature = "gpu-accelerated")]
set_device();
// set working dir
std::env::set_current_dir(WORKING_DIR.as_path())?;

View File

@@ -7,9 +7,7 @@ use halo2curves::bn256::Fr as Fp;
#[cfg(feature = "python-bindings")]
use pyo3::prelude::*;
#[cfg(feature = "python-bindings")]
use pyo3::types::PyDict;
#[cfg(feature = "python-bindings")]
use pyo3::ToPyObject;
use pyo3::IntoPyObject;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::io::BufReader;
use std::io::BufWriter;
@@ -429,34 +427,23 @@ mod tests {
}
}
#[cfg(feature = "python-bindings")]
impl ToPyObject for CallToAccount {
fn to_object(&self, py: Python) -> PyObject {
let dict = PyDict::new(py);
dict.set_item("account", &self.address).unwrap();
dict.set_item("call_data", &self.call_data).unwrap();
dict.set_item("decimals", &self.decimals).unwrap();
dict.to_object(py)
}
}
#[cfg(feature = "python-bindings")]
impl ToPyObject for DataSource {
fn to_object(&self, py: Python) -> PyObject {
self.0.to_object(py)
}
}
#[cfg(feature = "python-bindings")]
use crate::pfsys::field_to_string;
#[cfg(feature = "python-bindings")]
impl ToPyObject for FileSourceInner {
fn to_object(&self, py: Python) -> PyObject {
impl<'py> IntoPyObject<'py> for FileSourceInner {
type Target = pyo3::PyAny;
type Output = pyo3::Bound<'py, Self::Target>;
type Error = pyo3::PyErr;
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
match self {
FileSourceInner::Field(data) => field_to_string(data).to_object(py),
FileSourceInner::Bool(data) => data.to_object(py),
FileSourceInner::Float(data) => data.to_object(py),
FileSourceInner::Field(data) => {
let s = field_to_string(&data);
Ok(pyo3::types::PyString::new(py, &s).into_any())
}
FileSourceInner::Bool(data) => Ok(pyo3::types::PyBool::new(py, data).as_any().clone()),
FileSourceInner::Float(data) => Ok(pyo3::types::PyFloat::new(py, data).into_any()),
}
}
}

View File

@@ -61,7 +61,7 @@ use pyo3::types::PyDict;
#[cfg(feature = "python-bindings")]
use pyo3::types::PyDictMethods;
#[cfg(feature = "python-bindings")]
use pyo3::ToPyObject;
use pyo3::IntoPyObject;
use serde::{Deserialize, Serialize};
use std::ops::Deref;
@@ -319,8 +319,12 @@ impl GraphWitness {
}
#[cfg(feature = "python-bindings")]
impl ToPyObject for GraphWitness {
fn to_object(&self, py: Python) -> PyObject {
impl<'py> IntoPyObject<'py> for GraphWitness {
type Target = pyo3::PyAny;
type Output = pyo3::Bound<'py, Self::Target>;
type Error = pyo3::PyErr;
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
// Create a Python dictionary
let dict = PyDict::new(py);
let dict_inputs = PyDict::new(py);
@@ -383,7 +387,7 @@ impl ToPyObject for GraphWitness {
dict.set_item("processed_outputs", dict_outputs).unwrap();
}
dict.to_object(py)
Ok(dict.into_any())
}
}
@@ -435,7 +439,7 @@ pub struct ShuffleParams {
}
/// model parameters
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct GraphSettings {
/// run args
pub run_args: RunArgs,
@@ -445,11 +449,9 @@ pub struct GraphSettings {
pub total_assignments: usize,
/// total const size
pub total_const_size: usize,
/// dynamic lookup parameters, flattened for backwards compatibility
#[serde(flatten)]
/// dynamic lookup parameters, flattened for backwards compatibility, serialize and deserialize flattened for backwards compatibility
pub dynamic_lookup_params: DynamicLookupParams,
/// shuffle parameters, flattened for backwards compatibility
#[serde(flatten)]
pub shuffle_params: ShuffleParams,
/// the shape of public inputs to the model (in order of appearance)
pub model_instance_shapes: Vec<Vec<usize>>,
@@ -477,6 +479,485 @@ pub struct GraphSettings {
pub output_types: Option<Vec<InputType>>,
}
impl Serialize for GraphSettings {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
if serializer.is_human_readable() {
// JSON format - use flattened fields for backwards compatibility
use serde::ser::SerializeStruct;
let mut state = serializer.serialize_struct("GraphSettings", 21)?;
state.serialize_field("run_args", &self.run_args)?;
state.serialize_field("num_rows", &self.num_rows)?;
state.serialize_field("total_assignments", &self.total_assignments)?;
state.serialize_field("total_const_size", &self.total_const_size)?;
// Flatten DynamicLookupParams fields
state.serialize_field(
"total_dynamic_col_size",
&self.dynamic_lookup_params.total_dynamic_col_size,
)?;
state.serialize_field(
"max_dynamic_input_len",
&self.dynamic_lookup_params.max_dynamic_input_len,
)?;
state.serialize_field(
"num_dynamic_lookups",
&self.dynamic_lookup_params.num_dynamic_lookups,
)?;
// Flatten ShuffleParams fields
state.serialize_field("num_shuffles", &self.shuffle_params.num_shuffles)?;
state.serialize_field(
"total_shuffle_col_size",
&self.shuffle_params.total_shuffle_col_size,
)?;
state.serialize_field("model_instance_shapes", &self.model_instance_shapes)?;
state.serialize_field("model_output_scales", &self.model_output_scales)?;
state.serialize_field("model_input_scales", &self.model_input_scales)?;
state.serialize_field("module_sizes", &self.module_sizes)?;
state.serialize_field("required_lookups", &self.required_lookups)?;
state.serialize_field("required_range_checks", &self.required_range_checks)?;
state.serialize_field("check_mode", &self.check_mode)?;
state.serialize_field("version", &self.version)?;
state.serialize_field("num_blinding_factors", &self.num_blinding_factors)?;
state.serialize_field("timestamp", &self.timestamp)?;
state.serialize_field("input_types", &self.input_types)?;
state.serialize_field("output_types", &self.output_types)?;
state.end()
} else {
// Binary format (bincode) - use nested struct format
use serde::ser::SerializeTuple;
let mut state = serializer.serialize_tuple(18)?;
state.serialize_element(&self.run_args)?;
state.serialize_element(&self.num_rows)?;
state.serialize_element(&self.total_assignments)?;
state.serialize_element(&self.total_const_size)?;
state.serialize_element(&self.dynamic_lookup_params)?;
state.serialize_element(&self.shuffle_params)?;
state.serialize_element(&self.model_instance_shapes)?;
state.serialize_element(&self.model_output_scales)?;
state.serialize_element(&self.model_input_scales)?;
state.serialize_element(&self.module_sizes)?;
state.serialize_element(&self.required_lookups)?;
state.serialize_element(&self.required_range_checks)?;
state.serialize_element(&self.check_mode)?;
state.serialize_element(&self.version)?;
state.serialize_element(&self.num_blinding_factors)?;
state.serialize_element(&self.timestamp)?;
state.serialize_element(&self.input_types)?;
state.serialize_element(&self.output_types)?;
state.end()
}
}
}
impl<'de> Deserialize<'de> for GraphSettings {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
use serde::de::{self, MapAccess, Visitor};
use std::fmt;
#[derive(Deserialize)]
#[serde(field_identifier, rename_all = "snake_case")]
enum Field {
RunArgs,
NumRows,
TotalAssignments,
TotalConstSize,
// Flattened DynamicLookupParams fields
TotalDynamicColSize,
MaxDynamicInputLen,
NumDynamicLookups,
// Flattened ShuffleParams fields
NumShuffles,
TotalShuffleColSize,
ModelInstanceShapes,
ModelOutputScales,
ModelInputScales,
ModuleSizes,
RequiredLookups,
RequiredRangeChecks,
CheckMode,
Version,
NumBlindingFactors,
Timestamp,
InputTypes,
OutputTypes,
// Legacy nested struct fields for backwards compatibility
DynamicLookupParams,
ShuffleParams,
}
struct GraphSettingsVisitor;
impl<'de> Visitor<'de> for GraphSettingsVisitor {
type Value = GraphSettings;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("struct GraphSettings")
}
fn visit_map<V>(self, mut map: V) -> Result<GraphSettings, V::Error>
where
V: MapAccess<'de>,
{
let mut run_args = None;
let mut num_rows = None;
let mut total_assignments = None;
let mut total_const_size = None;
let mut total_dynamic_col_size = None;
let mut max_dynamic_input_len = None;
let mut num_dynamic_lookups = None;
let mut num_shuffles = None;
let mut total_shuffle_col_size = None;
let mut model_instance_shapes = None;
let mut model_output_scales = None;
let mut model_input_scales = None;
let mut module_sizes = None;
let mut required_lookups = None;
let mut required_range_checks = None;
let mut check_mode = None;
let mut version = None;
let mut num_blinding_factors = None;
let mut timestamp = None;
let mut input_types = None;
let mut output_types = None;
while let Some(key) = map.next_key()? {
match key {
Field::RunArgs => {
if run_args.is_some() {
return Err(de::Error::duplicate_field("run_args"));
}
run_args = Some(map.next_value()?);
}
Field::NumRows => {
if num_rows.is_some() {
return Err(de::Error::duplicate_field("num_rows"));
}
num_rows = Some(map.next_value()?);
}
Field::TotalAssignments => {
if total_assignments.is_some() {
return Err(de::Error::duplicate_field("total_assignments"));
}
total_assignments = Some(map.next_value()?);
}
Field::TotalConstSize => {
if total_const_size.is_some() {
return Err(de::Error::duplicate_field("total_const_size"));
}
total_const_size = Some(map.next_value()?);
}
Field::TotalDynamicColSize => {
if total_dynamic_col_size.is_some() {
return Err(de::Error::duplicate_field("total_dynamic_col_size"));
}
total_dynamic_col_size = Some(map.next_value()?);
}
Field::MaxDynamicInputLen => {
if max_dynamic_input_len.is_some() {
return Err(de::Error::duplicate_field("max_dynamic_input_len"));
}
max_dynamic_input_len = Some(map.next_value()?);
}
Field::NumDynamicLookups => {
if num_dynamic_lookups.is_some() {
return Err(de::Error::duplicate_field("num_dynamic_lookups"));
}
num_dynamic_lookups = Some(map.next_value()?);
}
Field::NumShuffles => {
if num_shuffles.is_some() {
return Err(de::Error::duplicate_field("num_shuffles"));
}
num_shuffles = Some(map.next_value()?);
}
Field::TotalShuffleColSize => {
if total_shuffle_col_size.is_some() {
return Err(de::Error::duplicate_field("total_shuffle_col_size"));
}
total_shuffle_col_size = Some(map.next_value()?);
}
Field::ModelInstanceShapes => {
if model_instance_shapes.is_some() {
return Err(de::Error::duplicate_field("model_instance_shapes"));
}
model_instance_shapes = Some(map.next_value()?);
}
Field::ModelOutputScales => {
if model_output_scales.is_some() {
return Err(de::Error::duplicate_field("model_output_scales"));
}
model_output_scales = Some(map.next_value()?);
}
Field::ModelInputScales => {
if model_input_scales.is_some() {
return Err(de::Error::duplicate_field("model_input_scales"));
}
model_input_scales = Some(map.next_value()?);
}
Field::ModuleSizes => {
if module_sizes.is_some() {
return Err(de::Error::duplicate_field("module_sizes"));
}
module_sizes = Some(map.next_value()?);
}
Field::RequiredLookups => {
if required_lookups.is_some() {
return Err(de::Error::duplicate_field("required_lookups"));
}
required_lookups = Some(map.next_value()?);
}
Field::RequiredRangeChecks => {
if required_range_checks.is_some() {
return Err(de::Error::duplicate_field("required_range_checks"));
}
required_range_checks = Some(map.next_value()?);
}
Field::CheckMode => {
if check_mode.is_some() {
return Err(de::Error::duplicate_field("check_mode"));
}
check_mode = Some(map.next_value()?);
}
Field::Version => {
if version.is_some() {
return Err(de::Error::duplicate_field("version"));
}
version = Some(map.next_value()?);
}
Field::NumBlindingFactors => {
if num_blinding_factors.is_some() {
return Err(de::Error::duplicate_field("num_blinding_factors"));
}
num_blinding_factors = map.next_value()?;
}
Field::Timestamp => {
if timestamp.is_some() {
return Err(de::Error::duplicate_field("timestamp"));
}
timestamp = Some(map.next_value()?);
}
Field::InputTypes => {
if input_types.is_some() {
return Err(de::Error::duplicate_field("input_types"));
}
input_types = map.next_value()?;
}
Field::OutputTypes => {
if output_types.is_some() {
return Err(de::Error::duplicate_field("output_types"));
}
output_types = map.next_value()?;
}
// Handle legacy nested struct fields for backwards compatibility
Field::DynamicLookupParams => {
let legacy_params: DynamicLookupParams = map.next_value()?;
if total_dynamic_col_size.is_none() {
total_dynamic_col_size = Some(legacy_params.total_dynamic_col_size);
}
if max_dynamic_input_len.is_none() {
max_dynamic_input_len = Some(legacy_params.max_dynamic_input_len);
}
if num_dynamic_lookups.is_none() {
num_dynamic_lookups = Some(legacy_params.num_dynamic_lookups);
}
}
Field::ShuffleParams => {
let legacy_params: ShuffleParams = map.next_value()?;
if num_shuffles.is_none() {
num_shuffles = Some(legacy_params.num_shuffles);
}
if total_shuffle_col_size.is_none() {
total_shuffle_col_size = Some(legacy_params.total_shuffle_col_size);
}
}
}
}
let run_args = run_args.ok_or_else(|| de::Error::missing_field("run_args"))?;
let num_rows = num_rows.ok_or_else(|| de::Error::missing_field("num_rows"))?;
let total_assignments = total_assignments
.ok_or_else(|| de::Error::missing_field("total_assignments"))?;
let total_const_size =
total_const_size.ok_or_else(|| de::Error::missing_field("total_const_size"))?;
let model_instance_shapes = model_instance_shapes
.ok_or_else(|| de::Error::missing_field("model_instance_shapes"))?;
let model_output_scales = model_output_scales
.ok_or_else(|| de::Error::missing_field("model_output_scales"))?;
let model_input_scales = model_input_scales
.ok_or_else(|| de::Error::missing_field("model_input_scales"))?;
let module_sizes =
module_sizes.ok_or_else(|| de::Error::missing_field("module_sizes"))?;
let required_lookups =
required_lookups.ok_or_else(|| de::Error::missing_field("required_lookups"))?;
let required_range_checks = required_range_checks
.ok_or_else(|| de::Error::missing_field("required_range_checks"))?;
let check_mode =
check_mode.ok_or_else(|| de::Error::missing_field("check_mode"))?;
let version = version.ok_or_else(|| de::Error::missing_field("version"))?;
// Build the nested structs from flattened fields, with defaults if missing
let dynamic_lookup_params = DynamicLookupParams {
total_dynamic_col_size: total_dynamic_col_size.unwrap_or_default(),
max_dynamic_input_len: max_dynamic_input_len.unwrap_or_default(),
num_dynamic_lookups: num_dynamic_lookups.unwrap_or_default(),
};
let shuffle_params = ShuffleParams {
num_shuffles: num_shuffles.unwrap_or_default(),
total_shuffle_col_size: total_shuffle_col_size.unwrap_or_default(),
};
Ok(GraphSettings {
run_args,
num_rows,
total_assignments,
total_const_size,
dynamic_lookup_params,
shuffle_params,
model_instance_shapes,
model_output_scales,
model_input_scales,
module_sizes,
required_lookups,
required_range_checks,
check_mode,
version,
num_blinding_factors,
timestamp,
input_types,
output_types,
})
}
fn visit_seq<V>(self, mut seq: V) -> Result<GraphSettings, V::Error>
where
V: serde::de::SeqAccess<'de>,
{
use serde::de::Error;
// For bincode compatibility, deserialize in the same order as tuple serialization
let run_args = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(0, &self))?;
let num_rows = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(1, &self))?;
let total_assignments = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(2, &self))?;
let total_const_size = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(3, &self))?;
let dynamic_lookup_params = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(4, &self))?;
let shuffle_params = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(5, &self))?;
let model_instance_shapes = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(6, &self))?;
let model_output_scales = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(7, &self))?;
let model_input_scales = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(8, &self))?;
let module_sizes = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(9, &self))?;
let required_lookups = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(10, &self))?;
let required_range_checks = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(11, &self))?;
let check_mode = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(12, &self))?;
let version = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(13, &self))?;
let num_blinding_factors = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(14, &self))?;
let timestamp = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(15, &self))?;
let input_types = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(16, &self))?;
let output_types = seq
.next_element()?
.ok_or_else(|| Error::invalid_length(17, &self))?;
Ok(GraphSettings {
run_args,
num_rows,
total_assignments,
total_const_size,
dynamic_lookup_params,
shuffle_params,
model_instance_shapes,
model_output_scales,
model_input_scales,
module_sizes,
required_lookups,
required_range_checks,
check_mode,
version,
num_blinding_factors,
timestamp,
input_types,
output_types,
})
}
}
// Universal deserializer that works with both JSON (map) and bincode (tuple)
if deserializer.is_human_readable() {
// JSON format - use struct/map deserialization with flattened fields
const FIELDS: &'static [&'static str] = &[
"run_args",
"num_rows",
"total_assignments",
"total_const_size",
"total_dynamic_col_size",
"max_dynamic_input_len",
"num_dynamic_lookups",
"num_shuffles",
"total_shuffle_col_size",
"model_instance_shapes",
"model_output_scales",
"model_input_scales",
"module_sizes",
"required_lookups",
"required_range_checks",
"check_mode",
"version",
"num_blinding_factors",
"timestamp",
"input_types",
"output_types",
"dynamic_lookup_params",
"shuffle_params",
];
deserializer.deserialize_struct("GraphSettings", FIELDS, GraphSettingsVisitor)
} else {
// Binary format (bincode) - use tuple deserialization
deserializer.deserialize_tuple(18, GraphSettingsVisitor)
}
}
}
impl GraphSettings {
/// Calc the number of rows required for lookup tables
pub fn lookup_log_rows(&self) -> u32 {
@@ -1674,3 +2155,153 @@ impl Circuit<Fp> for GraphCircuit {
Ok(())
}
}
#[cfg(test)]
/// Tests for the graph module
pub mod tests {
use super::*;
#[test]
fn test_graph_settings_serialization_roundtrip() {
use crate::{CheckMode, RunArgs};
// Create a test GraphSettings with nested structs
let original = GraphSettings {
run_args: RunArgs::default(),
num_rows: 1000,
total_assignments: 500,
total_const_size: 100,
dynamic_lookup_params: DynamicLookupParams {
total_dynamic_col_size: 42,
max_dynamic_input_len: 128,
num_dynamic_lookups: 5,
},
shuffle_params: ShuffleParams {
num_shuffles: 3,
total_shuffle_col_size: 256,
},
model_instance_shapes: vec![vec![1, 2, 3]],
model_output_scales: vec![],
model_input_scales: vec![],
module_sizes: ModuleSizes::default(),
required_lookups: vec![],
required_range_checks: vec![],
check_mode: CheckMode::SAFE,
version: "1.0.0".to_string(),
num_blinding_factors: Some(5),
timestamp: Some(123456789),
input_types: None,
output_types: None,
};
// Test 1: JSON serialization roundtrip with flattened format
let json_str = serde_json::to_string_pretty(&original).unwrap();
println!("JSON serialized (flattened):\n{}", json_str);
// Verify the JSON contains flattened fields
assert!(json_str.contains("\"total_dynamic_col_size\": 42"));
assert!(json_str.contains("\"max_dynamic_input_len\": 128"));
assert!(json_str.contains("\"num_dynamic_lookups\": 5"));
assert!(json_str.contains("\"num_shuffles\": 3"));
assert!(json_str.contains("\"total_shuffle_col_size\": 256"));
// Verify the JSON does NOT contain nested structs
assert!(!json_str.contains("\"dynamic_lookup_params\""));
assert!(!json_str.contains("\"shuffle_params\""));
// Deserialize from JSON
let deserialized: GraphSettings = serde_json::from_str(&json_str).unwrap();
assert_eq!(original, deserialized);
// now do JSON bytes
let json_bytes = serde_json::to_vec(&original).unwrap();
let deserialized_from_bytes: GraphSettings = serde_json::from_slice(&json_bytes).unwrap();
assert_eq!(original, deserialized_from_bytes);
// Test 2: Bincode serialization roundtrip
let bincode_data = bincode::serialize(&original).unwrap();
let bincode_deserialized: GraphSettings = bincode::deserialize(&bincode_data).unwrap();
assert_eq!(original, bincode_deserialized);
// Test 3: Backwards compatibility - deserialize old nested format
let old_format_json = r#"{
"run_args": {
"tolerance": {
"val": 0.0,
"scale": 1.0
},
"input_scale": 0,
"param_scale": 0,
"scale_rebase_multiplier": 10,
"lookup_range": [
0,
0
],
"logrows": 6,
"num_inner_cols": 2,
"variables": [
[
"batch_size",
1
]
],
"input_visibility": "Private",
"output_visibility": "Public",
"param_visibility": "Private",
"rebase_frac_zero_constants": false,
"check_mode": "UNSAFE",
"commitment": "KZG",
"decomp_base": 128,
"decomp_legs": 2,
"bounded_log_lookup": false,
"ignore_range_check_inputs_outputs": false
},
"num_rows": 236,
"total_assignments": 472,
"total_const_size": 4,
"total_dynamic_col_size": 0,
"max_dynamic_input_len": 0,
"num_dynamic_lookups": 0,
"num_shuffles": 0,
"total_shuffle_col_size": 0,
"model_instance_shapes": [
[
1,
4
]
],
"model_output_scales": [
0
],
"model_input_scales": [
0
],
"module_sizes": {
"polycommit": [],
"poseidon": [
0,
[
0
]
]
},
"required_lookups": [],
"required_range_checks": [
[
-1,
1
],
[
0,
127
]
],
"check_mode": "UNSAFE",
"version": "0.0.0",
"num_blinding_factors": null,
"timestamp": 1741214578354
}"#;
let _backwards_compatible: GraphSettings = serde_json::from_str(old_format_json).unwrap();
}
}

View File

@@ -695,8 +695,8 @@ impl Node {
opkind = opkind.homogenous_rescale(in_scales.clone())?.into();
let mut out_scale = opkind.out_scale(in_scales.clone())?;
// rescale the inputs if necessary to get consistent fixed points, we select the largest scale (highest precision)
let global_scale = scales.get_max();
opkind = RebaseScale::rebase(opkind, global_scale, out_scale, scales.rebase_multiplier);
let rebase_scale = scales.get_rebase_scale();
opkind = RebaseScale::rebase(opkind, rebase_scale, out_scale, scales.rebase_multiplier);
out_scale = opkind.out_scale(in_scales)?;

View File

@@ -8,9 +8,7 @@ use halo2curves::ff::PrimeField;
use itertools::Itertools;
use log::debug;
#[cfg(feature = "python-bindings")]
use pyo3::{
exceptions::PyValueError, FromPyObject, IntoPy, PyObject, PyResult, Python, ToPyObject,
};
use pyo3::{exceptions::PyValueError, FromPyObject, IntoPyObject, PyResult, Python};
use serde::{Deserialize, Serialize};
#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))]
use tosubcommand::ToFlags;
@@ -107,27 +105,33 @@ impl<'a> From<&'a str> for Visibility {
}
#[cfg(feature = "python-bindings")]
impl IntoPy<PyObject> for Visibility {
impl<'py> IntoPyObject<'py> for Visibility {
type Target = pyo3::PyAny;
type Output = pyo3::Bound<'py, Self::Target>;
type Error = pyo3::PyErr;
/// Converts Visibility to Python object
fn into_py(self, py: Python) -> PyObject {
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
match self {
Visibility::Private => "private".to_object(py),
Visibility::Public => "public".to_object(py),
Visibility::Fixed => "fixed".to_object(py),
Visibility::KZGCommit => "polycommit".to_object(py),
Visibility::Private => Ok("private".into_pyobject(py)?.into_any()),
Visibility::Public => Ok("public".into_pyobject(py)?.into_any()),
Visibility::Fixed => Ok("fixed".into_pyobject(py)?.into_any()),
Visibility::KZGCommit => Ok("polycommit".into_pyobject(py)?.into_any()),
Visibility::Hashed {
hash_is_public,
outlets,
} => {
if hash_is_public {
"hashed/public".to_object(py)
Ok("hashed/public".into_pyobject(py)?.into_any())
} else {
let outlets = outlets
.iter()
.map(|o| o.to_string())
.collect_vec()
.join(",");
format!("hashed/private/{}", outlets).to_object(py)
Ok(format!("hashed/private/{}", outlets)
.into_pyobject(py)?
.into_any())
}
}
}
@@ -246,6 +250,8 @@ pub struct VarScales {
pub params: crate::Scale,
/// Multiplier for scale rebasing
pub rebase_multiplier: u32,
/// rebase scale factor (optional). if None, we rebase to the max of input_scale and param_scale
pub rebase_scale: Option<crate::Scale>,
}
impl std::fmt::Display for VarScales {
@@ -265,11 +271,21 @@ impl VarScales {
std::cmp::min(self.input, self.params)
}
/// Returns the scale to rebase to, if specified
pub fn get_rebase_scale(&self) -> crate::Scale {
if let Some(rebase_scale) = self.rebase_scale {
rebase_scale
} else {
self.get_max()
}
}
/// Creates VarScales from runtime arguments
pub fn from_args(args: &RunArgs) -> Self {
Self {
input: args.input_scale,
params: args.param_scale,
rebase_scale: args.rebase_scale,
rebase_multiplier: args.scale_rebase_multiplier,
}
}

View File

@@ -288,6 +288,10 @@ pub struct RunArgs {
/// Higher values provide more precision but increase circuit complexity
#[cfg_attr(all(feature = "ezkl", not(target_arch = "wasm32")), arg(long, default_value = "7", value_hint = clap::ValueHint::Other))]
pub param_scale: Scale,
/// Scale to rebase to when the input scale exceeds rebase_scale * multiplier. If None we rebase to the max of input_scale and param_scale
/// This is an advanced parameter that should be used with caution
#[cfg_attr(all(feature = "ezkl", not(target_arch = "wasm32")), arg(long, required = false, value_hint = clap::ValueHint::Other))]
pub rebase_scale: Option<Scale>,
/// Scale rebase threshold multiplier
/// When scale exceeds input_scale * multiplier, it is rebased to input_scale
/// Advanced parameter that should be used with caution
@@ -378,6 +382,7 @@ impl Default for RunArgs {
bounded_log_lookup: false,
input_scale: 7,
param_scale: 7,
rebase_scale: None,
scale_rebase_multiplier: 1,
lookup_range: (-32768, 32768),
logrows: 17,

View File

@@ -187,12 +187,17 @@ impl From<ProofType> for StrategyType {
}
#[cfg(feature = "python-bindings")]
impl ToPyObject for ProofType {
fn to_object(&self, py: Python) -> PyObject {
match self {
ProofType::Single => "Single".to_object(py),
ProofType::ForAggr => "ForAggr".to_object(py),
}
impl<'py> pyo3::IntoPyObject<'py> for ProofType {
type Target = pyo3::PyAny;
type Output = pyo3::Bound<'py, Self::Target>;
type Error = pyo3::PyErr;
fn into_pyobject(self, py: pyo3::Python<'py>) -> Result<Self::Output, Self::Error> {
let result = match self {
ProofType::Single => "Single",
ProofType::ForAggr => "ForAggr",
};
Ok(result.into_pyobject(py)?.into_any())
}
}
@@ -245,12 +250,17 @@ impl std::fmt::Display for StrategyType {
}
#[cfg(feature = "python-bindings")]
/// Converts StrategyType into a PyObject (Required for StrategyType to be compatible with Python)
impl pyo3::IntoPy<PyObject> for StrategyType {
fn into_py(self, py: Python) -> PyObject {
match self {
StrategyType::Single => "single".to_object(py),
StrategyType::Accum => "accum".to_object(py),
}
impl<'py> pyo3::IntoPyObject<'py> for StrategyType {
type Target = pyo3::PyAny;
type Output = pyo3::Bound<'py, Self::Target>;
type Error = pyo3::PyErr;
fn into_pyobject(self, py: pyo3::Python<'py>) -> Result<Self::Output, Self::Error> {
let result = match self {
StrategyType::Single => "single",
StrategyType::Accum => "accum",
};
Ok(result.into_pyobject(py)?.into_any())
}
}
#[cfg(feature = "python-bindings")]
@@ -304,16 +314,6 @@ impl ToFlags for TranscriptType {
}
}
#[cfg(feature = "python-bindings")]
impl ToPyObject for TranscriptType {
fn to_object(&self, py: Python) -> PyObject {
match self {
TranscriptType::Poseidon => "Poseidon".to_object(py),
TranscriptType::EVM => "EVM".to_object(py),
}
}
}
#[cfg(feature = "python-bindings")]
///
pub fn g1affine_to_pydict(g1affine_dict: &pyo3::Bound<'_, PyDict>, g1affine: &G1Affine) {
@@ -401,14 +401,19 @@ where
}
#[cfg(feature = "python-bindings")]
use pyo3::{types::PyDict, PyObject, Python, ToPyObject};
use pyo3::{types::PyDict, IntoPyObject, Python};
#[cfg(feature = "python-bindings")]
impl<F: PrimeField + SerdeObject + Serialize, C: CurveAffine + Serialize> ToPyObject for Snark<F, C>
impl<'py, F: PrimeField + SerdeObject + Serialize, C: CurveAffine + Serialize> IntoPyObject<'py>
for Snark<F, C>
where
C::Scalar: Serialize + DeserializeOwned,
C::ScalarExt: Serialize + DeserializeOwned,
{
fn to_object(&self, py: Python) -> PyObject {
type Target = pyo3::PyAny;
type Output = pyo3::Bound<'py, Self::Target>;
type Error = pyo3::PyErr;
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
let dict = PyDict::new(py);
let field_elems: Vec<Vec<String>> = self
.instances
@@ -418,9 +423,9 @@ where
dict.set_item("instances", field_elems).unwrap();
let hex_proof = hex::encode(&self.proof);
dict.set_item("proof", format!("0x{}", hex_proof)).unwrap();
dict.set_item("transcript_type", self.transcript_type.to_object(py))
dict.set_item("transcript_type", self.transcript_type.into_pyobject(py)?)
.unwrap();
dict.to_object(py)
Ok(dict.into_any())
}
}

View File

@@ -329,7 +329,7 @@ pub fn resize<T: TensorType + Send + Sync>(
let cartesian_coord: Vec<Vec<usize>> = new_shape
.iter()
.map(|d| (0..*d))
.map(|d| 0..*d)
.multi_cartesian_product()
.collect();
@@ -1218,7 +1218,7 @@ pub fn intercalate_values<T: TensorType>(
let cartesian_coord = output
.dims()
.iter()
.map(|d| (0..*d))
.map(|d| 0..*d)
.multi_cartesian_product()
.collect::<Vec<_>>();
@@ -1263,7 +1263,7 @@ pub fn one_hot(
let cartesian_coord = output
.dims()
.iter()
.map(|d| (0..*d))
.map(|d| 0..*d)
.multi_cartesian_product()
.collect::<Vec<_>>();
@@ -1341,7 +1341,7 @@ pub fn pad<T: TensorType>(
let cartesian_coord = image
.dims()
.iter()
.map(|d| (0..*d))
.map(|d| 0..*d)
.multi_cartesian_product()
.collect::<Vec<_>>();

Binary file not shown.

View File

@@ -163,9 +163,18 @@ mod native_tests {
let data = GraphData::from_path(format!("{}/{}/input.json", test_dir, test).into())
.expect("failed to load input data");
let duplicated_input_data = data.input_data;
let duplicated_input_data = data
.input_data
.into_iter()
.map(|input| {
(0..num_batches)
.map(move |_| input.clone())
.flatten()
.collect::<Vec<_>>()
})
.collect::<Vec<_>>();
let duplicated_data = GraphData::new(duplicated_input_data.into());
let duplicated_data = GraphData::new(duplicated_input_data);
let res =
duplicated_data.save(format!("{}/{}/input.json", test_dir, output_dir).into());
@@ -304,63 +313,63 @@ mod native_tests {
"integer_div", // 98
];
const WASM_TESTS: [&str; 46] = [
"1l_mlp",
"1l_slice",
"1l_concat",
"1l_flatten",
const WASM_TESTS: [&str; 44] = [
"1l_mlp", // 0
"1l_slice", // 1
"1l_concat", // 2
"1l_flatten", // 3
// "1l_average",
"1l_div",
"1l_pad",
"1l_reshape",
"1l_eltwise_div",
"1l_sigmoid",
"1l_sqrt",
"1l_softmax",
"1l_div", // 4
"1l_pad", // 5
"1l_reshape", // 6
"1l_eltwise_div", // 7
"1l_sigmoid", // 8
"1l_sqrt", // 9
"1l_softmax", // 10
// "1l_instance_norm",
"1l_batch_norm",
"1l_prelu",
"1l_leakyrelu",
"1l_gelu_noappx",
"1l_batch_norm", // 11
"1l_prelu", // 12
"1l_leakyrelu", // 13
"1l_gelu_noappx", // 14
// "1l_gelu_tanh_appx",
"1l_relu",
"1l_downsample",
"1l_tanh",
"2l_relu_sigmoid_small",
"2l_relu_fc",
"2l_relu_small",
"2l_relu_sigmoid",
"1l_conv",
"2l_sigmoid_small",
"2l_relu_sigmoid_conv",
"3l_relu_conv_fc",
"4l_relu_conv_fc",
"1l_erf",
"1l_var",
"1l_elu",
"min",
"max",
"1l_max_pool",
"1l_conv_transpose",
"1l_upsample",
"1l_identity",
"1l_relu", // 15
"1l_downsample", // 16
"1l_tanh", // 17
"2l_relu_sigmoid_small", // 18
"2l_relu_fc", // 19
"2l_relu_small", // 20
"2l_relu_sigmoid", // 21
"1l_conv", // 22
"2l_sigmoid_small", // 23
"2l_relu_sigmoid_conv", // 24
// "3l_relu_conv_fc",
// "4l_relu_conv_fc",
"1l_erf", // 25
"1l_var", // 26
"1l_elu", // 27
"min", // 28
"max", // 29
"1l_max_pool", // 30
"1l_conv_transpose", // 31
"1l_upsample", // 32
"1l_identity", // 33
// "idolmodel",
"trig",
"prelu_gmm",
"lstm",
"rnn",
"quantize_dequantize",
"1l_where",
"boolean",
"boolean_identity",
"gradient_boosted_trees",
"1l_topk",
// "xgboost",
// "lightgbm",
// "hummingbird_decision_tree",
"trig", // 34
"prelu_gmm", // 35
"lstm", // 36
"rnn", // 37
"quantize_dequantize", // 38
"1l_where", // 39
"boolean", // 40
"boolean_identity", // 41
"gradient_boosted_trees", // 42
"1l_topk", // 43
// "xgboost",
// "lightgbm",
// "hummingbird_decision_tree",
];
#[cfg(not(feature = "icicle"))]
#[cfg(not(feature = "gpu-accelerated"))]
const TESTS_AGGR: [&str; 21] = [
"1l_mlp",
"1l_flatten",
@@ -385,7 +394,7 @@ mod native_tests {
"1l_max_pool",
];
#[cfg(feature = "icicle")]
#[cfg(feature = "gpu-accelerated")]
const TESTS_AGGR: [&str; 3] = ["1l_mlp", "1l_flatten", "1l_average"];
const TESTS_EVM: [&str; 23] = [
@@ -445,11 +454,12 @@ mod native_tests {
use crate::native_tests::TESTS_AGGR;
use test_case::test_case;
use crate::native_tests::aggr_prove_and_verify;
#[cfg(not(feature = "gpu-accelerated"))]
use crate::native_tests::kzg_aggr_mock_prove_and_verify;
use tempdir::TempDir;
use ezkl::Commitments;
#[cfg(not(feature="icicle"))]
#[cfg(not(feature="gpu-accelerated"))]
seq!(N in 0..=20 {
#(#[test_case(TESTS_AGGR[N])])*
@@ -483,7 +493,7 @@ mod native_tests {
});
#[cfg(feature="icicle")]
#[cfg(feature="gpu-accelerated")]
seq!(N in 0..=2 {
#(#[test_case(TESTS_AGGR[N])])*
fn kzg_aggr_prove_and_verify_(test: &str) {
@@ -511,8 +521,8 @@ mod native_tests {
use crate::native_tests::mock;
use crate::native_tests::accuracy_measurement;
use crate::native_tests::prove_and_verify;
use crate::native_tests::run_js_tests;
use crate::native_tests::render_circuit;
// use crate::native_tests::run_js_tests;
// use crate::native_tests::render_circuit;
use crate::native_tests::model_serialization_different_binaries;
use tempdir::TempDir;
@@ -542,15 +552,15 @@ mod native_tests {
seq!(N in 0..=98 {
#(#[test_case(TESTS[N])])*
#[ignore]
fn render_circuit_(test: &str) {
crate::native_tests::init_binary();
let test_dir = TempDir::new(test).unwrap();
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
render_circuit(path, test.to_string());
test_dir.close().unwrap();
}
// #(#[test_case(TESTS[N])])*
// #[ignore]
// fn render_circuit_(test: &str) {
// crate::native_tests::init_binary();
// let test_dir = TempDir::new(test).unwrap();
// let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
// render_circuit(path, test.to_string());
// test_dir.close().unwrap();
// }
@@ -902,7 +912,7 @@ mod native_tests {
});
seq!(N in 0..=45 {
seq!(N in 0..=43 {
#(#[test_case(WASM_TESTS[N])])*
fn kzg_prove_and_verify_with_overflow_(test: &str) {
@@ -912,8 +922,8 @@ mod native_tests {
env_logger::init();
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 1, None, true, "single", Commitments::KZG, 2);
#[cfg(not(feature = "icicle"))]
run_js_tests(path, test.to_string(), "testWasm", false);
// #[cfg(not(feature = "gpu-accelerated"))]
// run_js_tests(path, test.to_string(), "testWasm", false);
test_dir.close().unwrap();
}
@@ -925,8 +935,8 @@ mod native_tests {
env_logger::init();
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
prove_and_verify(path, test.to_string(), "safe", "hashed", "private", "public", 1, None, true, "single", Commitments::KZG, 2);
#[cfg(not(feature = "icicle"))]
run_js_tests(path, test.to_string(), "testWasm", false);
// #[cfg(not(feature = "gpu-accelerated"))]
// run_js_tests(path, test.to_string(), "testWasm", false);
test_dir.close().unwrap();
}
@@ -938,8 +948,8 @@ mod native_tests {
env_logger::init();
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
prove_and_verify(path, test.to_string(), "safe", "private", "fixed", "public", 1, None, true, "single", Commitments::KZG, 2);
#[cfg(not(feature = "icicle"))]
run_js_tests(path, test.to_string(), "testWasm", false);
// #[cfg(not(feature = "gpu-accelerated"))]
// run_js_tests(path, test.to_string(), "testWasm", false);
test_dir.close().unwrap();
}
@@ -986,6 +996,7 @@ mod native_tests {
use crate::native_tests::kzg_evm_aggr_prove_and_verify;
use tempdir::TempDir;
use crate::native_tests::Hardfork;
#[cfg(not(feature = "gpu-accelerated"))]
use crate::native_tests::run_js_tests;
use ezkl::logger::init_logger;
use crate::native_tests::lazy_static;
@@ -1086,7 +1097,7 @@ mod native_tests {
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
let _anvil_child = crate::native_tests::start_anvil(false, Hardfork::Latest);
kzg_evm_prove_and_verify(2, path, test.to_string(), "private", "private", "public");
#[cfg(not(feature = "icicle"))]
#[cfg(not(feature = "gpu-accelerated"))]
run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false);
test_dir.close().unwrap();
@@ -1100,7 +1111,7 @@ mod native_tests {
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
let mut _anvil_child = crate::native_tests::start_anvil(false, Hardfork::Latest);
kzg_evm_prove_and_verify(2, path, test.to_string(), "hashed", "private", "private");
#[cfg(not(feature = "icicle"))]
#[cfg(not(feature = "gpu-accelerated"))]
run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false);
test_dir.close().unwrap();
}
@@ -1117,7 +1128,7 @@ mod native_tests {
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
let mut _anvil_child = crate::native_tests::start_anvil(false, hardfork);
kzg_evm_prove_and_verify(2, path, test.to_string(), "polycommit", "private", "public");
#[cfg(not(feature = "icicle"))]
#[cfg(not(feature = "gpu-accelerated"))]
run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false);
test_dir.close().unwrap();
}
@@ -1130,7 +1141,7 @@ mod native_tests {
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
let _anvil_child = crate::native_tests::start_anvil(false, Hardfork::Latest);
kzg_evm_prove_and_verify(2, path, test.to_string(), "private", "hashed", "public");
#[cfg(not(feature = "icicle"))]
#[cfg(not(feature = "gpu-accelerated"))]
run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false);
test_dir.close().unwrap();
@@ -1143,7 +1154,7 @@ mod native_tests {
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
let _anvil_child = crate::native_tests::start_anvil(false, Hardfork::Latest);
kzg_evm_prove_and_verify(2, path, test.to_string(), "private", "private", "hashed");
#[cfg(not(feature = "icicle"))]
#[cfg(not(feature = "gpu-accelerated"))]
run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false);
test_dir.close().unwrap();
}
@@ -1156,7 +1167,7 @@ mod native_tests {
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
let _anvil_child = crate::native_tests::start_anvil(false, Hardfork::Latest);
kzg_evm_prove_and_verify(2, path, test.to_string(), "private", "polycommit", "public");
#[cfg(not(feature = "icicle"))]
#[cfg(not(feature = "gpu-accelerated"))]
run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false);
test_dir.close().unwrap();
}
@@ -1169,7 +1180,7 @@ mod native_tests {
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
let _anvil_child = crate::native_tests::start_anvil(false, Hardfork::Latest);
kzg_evm_prove_and_verify(2, path, test.to_string(), "private", "private", "polycommit");
#[cfg(not(feature = "icicle"))]
#[cfg(not(feature = "gpu-accelerated"))]
run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false);
test_dir.close().unwrap();
}
@@ -1181,7 +1192,7 @@ mod native_tests {
let path = test_dir.path().to_str().unwrap(); crate::native_tests::mv_test_(path, test);
let _anvil_child = crate::native_tests::start_anvil(false, Hardfork::Latest);
kzg_evm_prove_and_verify(2, path, test.to_string(), "polycommit", "polycommit", "polycommit");
#[cfg(not(feature = "icicle"))]
#[cfg(not(feature = "gpu-accelerated"))]
run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false);
test_dir.close().unwrap();
}
@@ -1548,24 +1559,25 @@ mod native_tests {
assert!(status.success());
}
// Mock prove (fast, but does not cover some potential issues)
fn render_circuit(test_dir: &str, example_name: String) {
let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY))
.args([
"render-circuit",
"-M",
format!("{}/{}/network.onnx", test_dir, example_name).as_str(),
"-O",
format!("{}/{}/render.png", test_dir, example_name).as_str(),
"--lookup-range=-32768->32768",
"-K=17",
])
.status()
.expect("failed to execute process");
assert!(status.success());
}
// // Mock prove (fast, but does not cover some potential issues)
// fn render_circuit(test_dir: &str, example_name: String) {
// let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY))
// .args([
// "render-circuit",
// "-M",
// format!("{}/{}/network.onnx", test_dir, example_name).as_str(),
// "-O",
// format!("{}/{}/render.png", test_dir, example_name).as_str(),
// "--lookup-range=-32768->32768",
// "-K=17",
// ])
// .status()
// .expect("failed to execute process");
// assert!(status.success());
// }
// prove-serialize-verify, the usual full path
#[cfg(not(feature = "gpu-accelerated"))]
fn kzg_aggr_mock_prove_and_verify(test_dir: &str, example_name: String) {
prove_and_verify(
test_dir,
@@ -2222,6 +2234,7 @@ mod native_tests {
}
// run js browser evm verify tests for a given example
#[cfg(not(feature = "gpu-accelerated"))]
fn run_js_tests(test_dir: &str, example_name: String, js_test: &str, vk: bool) {
let example = format!("--example={}", example_name);
let dir = format!("--dir={}", test_dir);
@@ -2238,8 +2251,9 @@ mod native_tests {
assert!(status.success());
}
#[allow(unused_variables)]
fn build_ezkl() {
#[cfg(feature = "icicle")]
#[cfg(feature = "gpu-accelerated")]
let args = [
"build",
"--profile=test-runs",
@@ -2258,18 +2272,8 @@ mod native_tests {
"macos-metal",
];
// not macos-metal and not icicle
#[cfg(all(not(feature = "icicle"), not(feature = "macos-metal")))]
#[cfg(all(not(feature = "gpu-accelerated"), not(feature = "macos-metal")))]
let args = ["build", "--profile=test-runs", "--bin", "ezkl"];
#[cfg(feature = "eth-original-lookup")]
let args = [
"build",
"--profile=test-runs",
"--bin",
"ezkl",
"--no-default-features",
"--features",
"ezkl,solidity-verifier,eth",
];
#[cfg(feature = "reusable-verifier")]
let args = [
"build",

View File

@@ -352,7 +352,7 @@ def test_prove_and_verify():
"for-aggr",
srs_path=srs_path,
)
assert res['transcript_type'] == 'Poseidon'
assert res['transcript_type'] == 'poseidon'
assert os.path.isfile(proof_path)
settings_path = os.path.join(folder_path, 'settings.json')
@@ -388,7 +388,7 @@ def test_prove_evm():
"single",
srs_path=srs_path,
)
assert res['transcript_type'] == 'EVM'
assert res['transcript_type'] == 'evm'
assert os.path.isfile(proof_path)

View File

@@ -42,21 +42,21 @@ mod wasm32 {
pub const SRS1: &[u8] = include_bytes!("assets/kzg1.srs");
pub const VERIFIER_BYTECODE: &[u8] = include_bytes!("assets/wasm.code");
#[wasm_bindgen_test]
async fn can_verify_aggr() {
let value = verifyAggr(
wasm_bindgen::Clamped(PROOF_AGGR.to_vec()),
wasm_bindgen::Clamped(VK_AGGR.to_vec()),
21,
wasm_bindgen::Clamped(SRS1.to_vec()),
"kzg",
)
.map_err(|_| "failed")
.unwrap();
// #[wasm_bindgen_test]
// async fn can_verify_aggr() {
// let value = verifyAggr(
// wasm_bindgen::Clamped(PROOF_AGGR.to_vec()),
// wasm_bindgen::Clamped(VK_AGGR.to_vec()),
// 21,
// wasm_bindgen::Clamped(SRS1.to_vec()),
// "kzg",
// )
// .map_err(|_| "failed")
// .unwrap();
// should not fail
assert!(value);
}
// // should not fail
// assert!(value);
// }
#[wasm_bindgen_test]
async fn verify_encode_verifier_calldata() {