From e70e13a9e372f51da15f6737ad689b2da3ffb9cd Mon Sep 17 00:00:00 2001 From: dante <45801863+alexander-camuto@users.noreply.github.com> Date: Fri, 10 Oct 2025 14:56:41 +0100 Subject: [PATCH] refactor!: rm ios,js,aggregation (#1013) BREAKING CHANGE: removes support for iOS, JS, WASM and removes aggregation circuit. --- .github/workflows/engine.yml | 194 - .github/workflows/rust.yml | 355 +- .github/workflows/swift-pm.yml | 134 - Cargo.lock | 13 - Cargo.toml | 20 +- benches/accum_conv.rs | 2 - benches/accum_dot.rs | 2 - benches/accum_einsum_matmul.rs | 3 +- benches/accum_matmul_sigmoid.rs | 3 +- benches/accum_matmul_sigmoid_overflow.rs | 3 +- benches/accum_sum.rs | 3 +- benches/accum_sumpool.rs | 3 +- benches/pairwise_add.rs | 3 +- benches/pairwise_pow.rs | 3 +- benches/poseidon.rs | 3 +- benches/relu_lookupless.rs | 3 +- benches/sigmoid.rs | 3 +- build.rs | 4 - examples/notebooks/decision_tree.ipynb | 4 +- examples/notebooks/ezkl_demo.ipynb | 4 +- examples/notebooks/ezkl_demo_batch.ipynb | 4 +- examples/notebooks/gcn.ipynb | 5 +- examples/notebooks/generalized_inverse.ipynb | 4 +- .../notebooks/gradient_boosted_trees.ipynb | 6 +- examples/notebooks/hashed_vis.ipynb | 2 +- examples/notebooks/keras_simple_demo.ipynb | 2 +- examples/notebooks/kmeans.ipynb | 2 +- examples/notebooks/kzg_vis.ipynb | 2 +- examples/notebooks/lightgbm.ipynb | 2 +- examples/notebooks/linear_regression.ipynb | 2 +- examples/notebooks/little_transformer.ipynb | 2 +- examples/notebooks/logistic_regression.ipynb | 2 +- examples/notebooks/lstm.ipynb | 2 +- examples/notebooks/mnist_classifier.ipynb | 2 +- examples/notebooks/mnist_gan.ipynb | 2 +- .../notebooks/mnist_gan_proof_splitting.ipynb | 25 +- examples/notebooks/mnist_vae.ipynb | 4 +- .../nbeats_timeseries_forecasting.ipynb | 2 +- examples/notebooks/proof_splitting.ipynb | 25 +- examples/notebooks/random_forest.ipynb | 2 +- examples/notebooks/reusable_verifier.ipynb | 2 +- examples/notebooks/set_membership.ipynb | 6 +- .../simple_demo_aggregated_proofs.ipynb | 407 -- .../notebooks/simple_demo_all_public.ipynb | 2 +- .../simple_demo_public_input_output.ipynb | 2 +- .../simple_demo_public_network_output.ipynb | 2 +- examples/notebooks/sklearn_mlp.ipynb | 2 +- examples/notebooks/solvency.ipynb | 4 +- examples/notebooks/stacked_regression.ipynb | 2 +- examples/notebooks/svm.ipynb | 2 +- .../notebooks/tictactoe_autoencoder.ipynb | 2 +- .../tictactoe_binary_classification.ipynb | 2 +- examples/notebooks/variance.ipynb | 2 +- examples/notebooks/voice_judge.ipynb | 2 +- examples/notebooks/xgboost.ipynb | 2 +- examples/onnx/smallworm/Readme.md | 20 +- ezkl.pyi | 552 ++- jest.config.js | 4 - package.json | 30 - pnpm-lock.yaml | 3596 ----------------- src/bin/ios_gen_bindings.rs | 269 -- src/bindings/mod.rs | 9 - src/bindings/python.rs | 379 +- src/bindings/universal.rs | 606 --- src/bindings/wasm.rs | 398 -- src/circuit/tests.rs | 5 - src/commands.rs | 178 +- src/eth.rs | 11 +- src/execute.rs | 738 +--- src/graph/mod.rs | 13 +- src/lib.rs | 5 - src/pfsys/evm/aggregation_kzg.rs | 442 -- src/pfsys/evm/mod.rs | 24 - src/pfsys/mod.rs | 271 +- tests/integration_tests.rs | 568 +-- tests/ios/can_verify_aggr.swift | 39 - tests/ios/gen_pk_test.swift | 42 - tests/ios/gen_vk_test.swift | 35 - tests/ios/pk_is_valid_test.swift | 69 - .../ios/verify_encode_verifier_calldata.swift | 71 - tests/ios/verify_gen_witness.swift | 45 - tests/ios/verify_kzg_commit.swift | 64 - tests/ios/verify_validations.swift | 103 - tests/ios_integration_tests.rs | 11 - tests/py_integration_tests.rs | 47 +- tests/python/binding_tests.py | 607 +-- tests/wasm.rs | 394 -- tests/wasm/testBrowserEvmVerify.test.ts | 80 - tests/wasm/testWasm.test.ts | 75 - tests/wasm/tsconfig.json | 28 - tests/wasm/utils.ts | 94 - tsconfig.json | 28 - 92 files changed, 588 insertions(+), 10664 deletions(-) delete mode 100644 .github/workflows/engine.yml delete mode 100644 .github/workflows/swift-pm.yml delete mode 100644 examples/notebooks/simple_demo_aggregated_proofs.ipynb delete mode 100644 jest.config.js delete mode 100644 package.json delete mode 100644 pnpm-lock.yaml delete mode 100644 src/bin/ios_gen_bindings.rs delete mode 100644 src/bindings/universal.rs delete mode 100644 src/bindings/wasm.rs delete mode 100644 src/pfsys/evm/aggregation_kzg.rs delete mode 100644 src/pfsys/evm/mod.rs delete mode 100644 tests/ios/can_verify_aggr.swift delete mode 100644 tests/ios/gen_pk_test.swift delete mode 100644 tests/ios/gen_vk_test.swift delete mode 100644 tests/ios/pk_is_valid_test.swift delete mode 100644 tests/ios/verify_encode_verifier_calldata.swift delete mode 100644 tests/ios/verify_gen_witness.swift delete mode 100644 tests/ios/verify_kzg_commit.swift delete mode 100644 tests/ios/verify_validations.swift delete mode 100644 tests/ios_integration_tests.rs delete mode 100644 tests/wasm.rs delete mode 100644 tests/wasm/testBrowserEvmVerify.test.ts delete mode 100644 tests/wasm/testWasm.test.ts delete mode 100644 tests/wasm/tsconfig.json delete mode 100644 tests/wasm/utils.ts delete mode 100644 tsconfig.json diff --git a/.github/workflows/engine.yml b/.github/workflows/engine.yml deleted file mode 100644 index 43942b22..00000000 --- a/.github/workflows/engine.yml +++ /dev/null @@ -1,194 +0,0 @@ -name: Build and Publish EZKL Engine npm package - -on: - workflow_dispatch: - inputs: - tag: - description: "The tag to release" - required: true - push: - tags: - - "*" - -defaults: - run: - working-directory: . -jobs: - publish-wasm-bindings: - permissions: - contents: read - packages: write - id-token: write # Required for provenance - 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-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6 - with: - 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 - version: "v0.12.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-05-01-x86_64-unknown-linux-gnu - - name: Install binaryen - run: | - set -e - curl -L https://github.com/WebAssembly/binaryen/releases/download/version_116/binaryen-version_116-x86_64-linux.tar.gz | tar xzf - - export PATH=$PATH:$PWD/binaryen-version_116/bin - wasm-opt --version - - name: Build wasm files for both web and nodejs compilation targets - run: | - wasm-pack build --release --target nodejs --out-dir ./pkg/nodejs . -- -Z build-std="panic_abort,std" - wasm-pack build --release --target web --out-dir ./pkg/web . -- -Z build-std="panic_abort,std" --features web - - name: Create package.json in pkg folder - shell: bash - run: | - cat > pkg/package.json << EOF - { - "name": "@ezkljs/engine", - "version": "$RELEASE_TAG", - "dependencies": { - "@types/json-bigint": "^1.0.1", - "json-bigint": "^1.0.0" - }, - "files": [ - "nodejs/ezkl_bg.wasm", - "nodejs/ezkl.js", - "nodejs/ezkl.d.ts", - "nodejs/package.json", - "nodejs/utils.js", - "web/ezkl_bg.wasm", - "web/ezkl.js", - "web/ezkl.d.ts", - "web/snippets/**/*", - "web/package.json", - "web/utils.js", - "ezkl.d.ts" - ], - "main": "nodejs/ezkl.js", - "module": "web/ezkl.js", - "types": "nodejs/ezkl.d.ts", - "sideEffects": [ - "web/snippets/*" - ] - } - EOF - - - name: Replace memory definition in nodejs - run: | - sed -i "3s|.*|imports['env'] = {memory: new WebAssembly.Memory({initial:21,maximum:65536,shared:true})}|" pkg/nodejs/ezkl.js - - - name: Replace `import.meta.url` with `import.meta.resolve` definition in workerHelpers.js - run: | - find ./pkg/web/snippets -type f -name "*.js" -exec sed -i "s|import.meta.url|import.meta.resolve|" {} + - - - name: Add serialize and deserialize methods to nodejs bundle - run: | - echo ' - const JSONBig = require("json-bigint"); - - function deserialize(buffer) { // buffer is a Uint8ClampedArray | Uint8Array // return a JSON object - if (buffer instanceof Uint8ClampedArray) { - buffer = new Uint8Array(buffer.buffer); - } - const string = new TextDecoder().decode(buffer); - const jsonObject = JSONBig.parse(string); - return jsonObject; - } - - function serialize(data) { // data is an object // return a Uint8ClampedArray - // Step 1: Stringify the Object with BigInt support - if (typeof data === "object") { - data = JSONBig.stringify(data); - } - // Step 2: Encode the JSON String - const uint8Array = new TextEncoder().encode(data); - - // Step 3: Convert to Uint8ClampedArray - return new Uint8ClampedArray(uint8Array.buffer); - } - - module.exports = { - deserialize, - serialize - }; - ' > pkg/nodejs/utils.js - - name: Add serialize and deserialize methods to web bundle - run: | - echo ' - import { parse, stringify } from "json-bigint"; - - export function deserialize(buffer) { // buffer is a Uint8ClampedArray | Uint8Array // return a JSON object - if (buffer instanceof Uint8ClampedArray) { - buffer = new Uint8Array(buffer.buffer); - } - const string = new TextDecoder().decode(buffer); - const jsonObject = parse(string); - return jsonObject; - } - - export function serialize(data) { // data is an object // return a Uint8ClampedArray - // Step 1: Stringify the Object with BigInt support - if (typeof data === "object") { - data = stringify(data); - } - // Step 2: Encode the JSON String - const uint8Array = new TextEncoder().encode(data); - - // Step 3: Convert to Uint8ClampedArray - return new Uint8ClampedArray(uint8Array.buffer); - } - ' > pkg/web/utils.js - - name: Expose serialize and deserialize imports in nodejs target - run: | - sed -i '53i// import serialize and deserialize from utils.js\nconst { serialize, deserialize } = require(`./utils.js`);\nmodule.exports.serialize = serialize;\nmodule.exports.deserialize = deserialize;' pkg/nodejs/ezkl.js - - name: Expose serialize and deserialize imports in web target - run: | - sed -i '51i\ - // import serialize and deserialize from utils.js\ - import { serialize, deserialize } from '\''./utils.js'\'';\ - export { serialize, deserialize };' pkg/web/ezkl.js - - name: Add serialize and deserialize imports to nodejs ezkl.d.ts - run: | - sed -i '1i\ - export declare function serialize(data: object | string): Uint8ClampedArray;\ - export declare function deserialize(buffer: Uint8ClampedArray | Uint8Array): any;' pkg/nodejs/ezkl.d.ts - - - name: Add serialize and deserialize imports to web ezkl.d.ts - run: | - sed -i '1i\ - export declare function serialize(data: object | string): Uint8ClampedArray;\ - export declare function deserialize(buffer: Uint8ClampedArray | Uint8Array): any;' pkg/web/ezkl.d.ts - - - name: Create README.md in pkg folder - run: | - curl -s "https://raw.githubusercontent.com/zkonduit/ezkljs-engine/main/README.md" > ./pkg/README.md - - # zizmor: ignore cache-poisoning - - name: Set up Node.js - uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 #v3.8.2 - with: - node-version: "18.12.1" - registry-url: "https://registry.npmjs.org" - package-manager-cache: false - - - name: Publish to npm with provenance - run: | - cd pkg - npm publish --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e2c16afa..d0d4543f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,7 +20,7 @@ env: jobs: fr-age-test: - needs: [build, library-tests, docs, python-tests, python-integration-tests] + needs: [build, library-tests, docs] permissions: contents: read runs-on: large-self-hosted @@ -147,9 +147,6 @@ jobs: with: crate: cargo-nextest locked: true - - 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 @@ -201,13 +198,6 @@ jobs: 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 -- --include-ignored - name: Matmul overflow @@ -249,54 +239,6 @@ jobs: - name: Model serialization different binary ID run: cargo nextest run native_tests::tests::model_serialization_different_binaries_ --test-threads 1 - wasm32-tests: - permissions: - contents: read - 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-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6 - with: - 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.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-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 - - name: Run wasm verifier tests - run: | - ulimit -n 65536 - WASM_BINDGEN_TEST_THREADS=1 \ - WASM_BINDGEN_TEST_TIMEOUT=1800 \ - CHROMEDRIVER_ARGS="--log-level=INFO" \ - wasm-pack test --chrome --headless -- -Z build-std="panic_abort,std" --features web -- --nocapture - mock-proving-tests: permissions: contents: read @@ -376,7 +318,7 @@ jobs: permissions: contents: read runs-on: [non-gpu, non-sgx] - needs: [build, library-tests, docs, python-tests, python-integration-tests] + needs: [build, library-tests, docs] env: EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }} RUSTFLAGS: "-C target-feature=+atomics,+bulk-memory" @@ -392,10 +334,6 @@ jobs: 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 @@ -405,27 +343,12 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 with: persist-credentials: false - - name: Use pnpm 8 - uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b #v2.4.1 - with: - version: 8 - - name: Use Node.js 22.17.1 - uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 #v3.8.2 - with: - node-version: "22.17.1" - cache: "pnpm" - name: "Add rust-src" 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 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" - name: KZG prove and verify tests (EVM) run: cargo nextest run --verbose "tests_evm::kzg_evm_prove_and_verify_::" --test-threads 1 # - name: KZG prove and verify tests (EVM + reusable verifier + col-overflow) @@ -443,40 +366,6 @@ jobs: - name: KZG prove and verify tests (EVM + hashed outputs) run: cargo nextest run --verbose tests_evm::kzg_evm_hashed_output_prove_and_verify --test-threads 1 - # prove-and-verify-tests-metal: - # permissions: - # contents: read - # runs-on: macos-13 - # # needs: [build, library-tests, docs] - # 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: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa #v0.4.0 - # with: - # # Pin to version 0.13.1 - # version: 'v0.13.1' - # - name: Add rust-src - # run: rustup component add rust-src --toolchain nightly-2025-05-01 - # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - # with: - # persist-credentials: false - # - name: Use pnpm 8 - # uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b #v2.4.1 - # with: - # version: 8 - # - uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0 - # with: - # crate: cargo-nextest - # locked: true - # - name: KZG prove and verify tests (public outputs) - # run: cargo nextest run --features macos-metal --verbose tests::kzg_prove_and_verify_::t --no-capture - prove-and-verify-tests: permissions: contents: read @@ -494,13 +383,6 @@ jobs: 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" - - 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-05-01-x86_64-unknown-linux-gnu - name: Force rebuild icicle dependencies @@ -508,30 +390,12 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 with: persist-credentials: false - - name: Use pnpm 8 - uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b #v2.4.1 - with: - version: 8 - - name: Use Node.js 22.17.1 - uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 #v3.8.2 - with: - node-version: "22.17.1" - cache: "pnpm" - - name: Install dependencies for js tests - run: | - pnpm install --frozen-lockfile - env: - CI: false - NODE_ENV: development - uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0 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: KZG prove and verify tests (public outputs + column overflow) - run: cargo nextest run --verbose tests::kzg_prove_and_verify_with_overflow_::w + run: cargo nextest run --verbose tests::kzg_prove_and_verify_with_overflow_::t - 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_ - name: KZG prove and verify tests (hashed inputs + column overflow) @@ -593,7 +457,7 @@ jobs: - 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 + run: cargo nextest run --verbose tests::kzg_prove_and_verify_with_overflow_::t --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) @@ -605,119 +469,6 @@ jobs: - 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: - contents: read - runs-on: self-hosted - 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-05-01 - override: true - components: rustfmt, clippy - - uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0 - with: - crate: cargo-nextest - locked: true - - 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: - 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: - contents: read - runs-on: large-self-hosted - 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-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: KZG tests - run: cargo nextest run --verbose tests_aggr::kzg_aggr_prove_and_verify_ --test-threads 4 -- --include-ignored - - prove-and-verify-aggr-evm-tests: - permissions: - contents: read - runs-on: large-self-hosted - 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-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: 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 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 @@ -789,7 +540,7 @@ jobs: permissions: contents: read runs-on: [non-gpu, non-sgx] - needs: [build, library-tests, docs, python-tests, python-integration-tests] + needs: [build, library-tests, docs] env: EVM_VERIFIER_EZKL_TOKEN: ${{ secrets.EVM_VERIFIER_EZKL_TOKEN }} @@ -885,99 +636,3 @@ jobs: # run: source .env/bin/activate; cargo nextest run py_tests::tests::reusable_verifier_ --no-capture - name: Reusable verifier tutorial run: source .env/bin/activate; cargo nextest run py_tests::tests::reusable_verifier_ --no-capture --test-threads 1 - - ios-integration-tests: - permissions: - contents: read - 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-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: 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-05-01-aarch64-apple-darwin cargo test --test ios_integration_tests --features ios-bindings-test --no-default-features - - swift-package-tests: - permissions: - contents: read - runs-on: macos-latest - needs: [ios-integration-tests] - - 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-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6 - with: - 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 - - - name: Clone ezkl-swift- repository - run: | - git clone https://github.com/zkonduit/ezkl-swift-package.git - - - name: Copy EzklCoreBindings - run: | - rm -rf ezkl-swift-package/Sources/EzklCoreBindings - cp -r build/EzklCoreBindings ezkl-swift-package/Sources/ - - - name: Copy Test Files - run: | - rm -rf ezkl-swift-package/Tests/EzklAssets/ - mkdir -p ezkl-swift-package/Tests/EzklAssets/ - cp tests/assets/kzg ezkl-swift-package/Tests/EzklAssets/kzg.srs - cp tests/assets/input.json ezkl-swift-package/Tests/EzklAssets/input.json - cp tests/assets/model.compiled ezkl-swift-package/Tests/EzklAssets/network.ezkl - cp tests/assets/settings.json ezkl-swift-package/Tests/EzklAssets/settings.json - - - name: Set up Xcode environment - run: | - sudo xcode-select -s /Applications/Xcode.app/Contents/Developer - sudo xcodebuild -license accept - - - name: Run Package Tests - run: | - cd ezkl-swift-package - xcodebuild test \ - -scheme EzklPackage \ - -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.4' \ - -resultBundlePath ../testResults - - - name: Run Example App Tests - run: | - cd ezkl-swift-package/Example - xcodebuild test \ - -project Example.xcodeproj \ - -scheme EzklApp \ - -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.4' \ - -parallel-testing-enabled NO \ - -resultBundlePath ../../exampleTestResults \ - -skip-testing:EzklAppUITests/EzklAppUITests/testButtonClicksInOrder diff --git a/.github/workflows/swift-pm.yml b/.github/workflows/swift-pm.yml deleted file mode 100644 index 02e7281b..00000000 --- a/.github/workflows/swift-pm.yml +++ /dev/null @@ -1,134 +0,0 @@ -name: Build and Publish EZKL iOS SPM package - -on: - push: - tags: - # Only support SemVer versioning tags - - 'v[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+' - -jobs: - build-and-update: - permissions: - contents: read - packages: write - runs-on: macos-latest - env: - EZKL_SWIFT_PACKAGE_REPO: github.com/zkonduit/ezkl-swift-package.git - RELEASE_TAG: ${{ github.ref_name }} - - steps: - - name: Checkout EZKL - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - with: - persist-credentials: false - - - name: Extract TAG from github.ref_name - run: | - # github.ref_name is provided by GitHub Actions and contains the tag name directly. - TAG="${RELEASE_TAG}" - echo "Original TAG: $TAG" - # Remove leading 'v' if present to match the Swift Package Manager version format. - NEW_TAG=${TAG#v} - echo "Stripped TAG: $NEW_TAG" - echo "TAG=$NEW_TAG" >> $GITHUB_ENV - - - name: Install Rust (nightly) - uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f #v1.0.6 - with: - toolchain: nightly - override: true - - - name: Build EzklCoreBindings - run: CONFIGURATION=release cargo run --bin ios_gen_bindings --features "ios-bindings uuid camino uniffi_bindgen" --no-default-features - - - name: Clone ezkl-swift-package repository - run: | - git clone https://${{ env.EZKL_SWIFT_PACKAGE_REPO }} - - - name: Copy EzklCoreBindings - run: | - rm -rf ezkl-swift-package/Sources/EzklCoreBindings - cp -r build/EzklCoreBindings ezkl-swift-package/Sources/ - - - name: Copy Test Files - run: | - rm -rf ezkl-swift-package/Tests/EzklAssets/ - mkdir -p ezkl-swift-package/Tests/EzklAssets/ - cp tests/assets/kzg ezkl-swift-package/Tests/EzklAssets/kzg.srs - cp tests/assets/input.json ezkl-swift-package/Tests/EzklAssets/input.json - cp tests/assets/model.compiled ezkl-swift-package/Tests/EzklAssets/network.ezkl - cp tests/assets/settings.json ezkl-swift-package/Tests/EzklAssets/settings.json - - - name: Check for changes - id: check_changes - run: | - cd ezkl-swift-package - if git diff --quiet Sources/EzklCoreBindings Tests/EzklAssets; then - echo "no_changes=true" >> $GITHUB_OUTPUT - else - echo "no_changes=false" >> $GITHUB_OUTPUT - fi - - - name: Set up Xcode environment - if: steps.check_changes.outputs.no_changes == 'false' - run: | - sudo xcode-select -s /Applications/Xcode.app/Contents/Developer - sudo xcodebuild -license accept - - - name: Run Package Tests - if: steps.check_changes.outputs.no_changes == 'false' - run: | - cd ezkl-swift-package - xcodebuild test \ - -scheme EzklPackage \ - -destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5' \ - -resultBundlePath ../testResults - - - name: Run Example App Tests - if: steps.check_changes.outputs.no_changes == 'false' - run: | - cd ezkl-swift-package/Example - xcodebuild test \ - -project Example.xcodeproj \ - -scheme EzklApp \ - -destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5' \ - -parallel-testing-enabled NO \ - -resultBundlePath ../../exampleTestResults \ - -skip-testing:EzklAppUITests/EzklAppUITests/testButtonClicksInOrder - - - name: Setup Git - run: | - cd ezkl-swift-package - git config user.name "GitHub Action" - git config user.email "action@github.com" - git remote set-url origin https://zkonduit:${EZKL_SWIFT_PACKAGE_REPO_TOKEN}@${{ env.EZKL_SWIFT_PACKAGE_REPO }} - env: - EZKL_SWIFT_PACKAGE_REPO_TOKEN: ${{ secrets.EZKL_PORTER_TOKEN }} - - - name: Commit and Push Changes - if: steps.check_changes.outputs.no_changes == 'false' - run: | - cd ezkl-swift-package - git add Sources/EzklCoreBindings Tests/EzklAssets - git commit -m "Automatically updated EzklCoreBindings for EZKL" - if ! git push origin; then - echo "::error::Failed to push changes to ${{ env.EZKL_SWIFT_PACKAGE_REPO }}. Please ensure that EZKL_PORTER_TOKEN has the correct permissions." - exit 1 - fi - - - name: Tag the latest commit - run: | - cd ezkl-swift-package - source $GITHUB_ENV - # Tag the latest commit on the current branch - if git rev-parse "$TAG" >/dev/null 2>&1; then - echo "Tag $TAG already exists locally. Skipping tag creation." - else - git tag "$TAG" - fi - - if ! git push origin "$TAG"; then - echo "::error::Failed to push tag '$TAG' to ${{ env.EZKL_SWIFT_PACKAGE_REPO }}. Please ensure EZKL_PORTER_TOKEN has correct permissions." - exit 1 - fi \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 87a58221..61a18f69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1941,7 +1941,6 @@ version = "0.0.0" dependencies = [ "alloy", "bincode", - "camino", "chrono", "clap", "clap_complete", @@ -1996,9 +1995,7 @@ dependencies = [ "tosubcommand", "tract-onnx", "uniffi", - "uniffi_bindgen", "unzip-n", - "uuid", "wasm-bindgen", "wasm-bindgen-console-logger", "wasm-bindgen-rayon", @@ -6397,7 +6394,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f31bff6daf87277a9014bcdefbc2842b0553392919d1096843c5aad899ca4588" dependencies = [ "anyhow", - "uniffi_bindgen", "uniffi_build", "uniffi_core", "uniffi_macros", @@ -6580,15 +6576,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "uuid" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" -dependencies = [ - "getrandom 0.3.2", -] - [[package]] name = "valuable" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index cc71826a..6eabad06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,13 +96,6 @@ objc = { version = "0.2.4", optional = true } pyo3-stub-gen = { version = "0.6.0", optional = true } jemallocator = { version = "0.5", optional = true } mimalloc = { version = "0.1", optional = true } -# universal bindings -uniffi = { version = "=0.28.0", optional = true } -getrandom = { version = "0.2.8", optional = true } -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 } @@ -215,9 +208,7 @@ test = false bench = false required-features = ["ezkl"] -[[bin]] -name = "ios_gen_bindings" -required-features = ["ios-bindings", "uuid", "camino", "uniffi_bindgen"] + [[bin]] name = "py_stub_gen" @@ -236,16 +227,7 @@ default = [ ] onnx = ["dep:tract-onnx"] python-bindings = ["pyo3", "pyo3-log", "pyo3-async-runtimes", "pyo3-stub-gen"] -universal-bindings = [ - "uniffi", - "mv-lookup", - "precompute-coset", - "parallel-poly-read", - "dep:halo2_solidity_verifier" -] logging = ["dep:colored", "dep:env_logger", "dep:chrono"] -ios-bindings = ["universal-bindings"] -ios-bindings-test = ["ios-bindings", "uniffi/bindgen-tests"] ezkl = [ "onnx", "tabled/color", diff --git a/benches/accum_conv.rs b/benches/accum_conv.rs index 06c23d28..edba83f2 100644 --- a/benches/accum_conv.rs +++ b/benches/accum_conv.rs @@ -4,7 +4,6 @@ use ezkl::circuit::*; use ezkl::pfsys::create_keys; use ezkl::pfsys::create_proof_circuit; use ezkl::pfsys::srs::gen_srs; -use ezkl::pfsys::TranscriptType; use ezkl::tensor::*; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; use halo2_proofs::poly::kzg::multiopen::ProverSHPLONK; @@ -154,7 +153,6 @@ fn runcnvrl(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/accum_dot.rs b/benches/accum_dot.rs index a7bb6414..70190a26 100644 --- a/benches/accum_dot.rs +++ b/benches/accum_dot.rs @@ -2,7 +2,6 @@ use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Through use ezkl::circuit::poly::PolyOp; use ezkl::circuit::*; use ezkl::pfsys::create_proof_circuit; -use ezkl::pfsys::TranscriptType; use ezkl::pfsys::{create_keys, srs::gen_srs}; use ezkl::tensor::*; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; @@ -121,7 +120,6 @@ fn rundot(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/accum_einsum_matmul.rs b/benches/accum_einsum_matmul.rs index 05ae87b2..eaa5d5cc 100644 --- a/benches/accum_einsum_matmul.rs +++ b/benches/accum_einsum_matmul.rs @@ -7,7 +7,7 @@ use ezkl::circuit::einsum::circuit_params::SingleEinsumParams; use ezkl::circuit::poly::PolyOp; use ezkl::circuit::*; use ezkl::pfsys::srs::gen_srs; -use ezkl::pfsys::{create_keys, create_proof_circuit, TranscriptType}; +use ezkl::pfsys::{create_keys, create_proof_circuit}; use ezkl::tensor::*; use halo2_proofs::circuit::floor_planner::V1; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; @@ -175,7 +175,6 @@ fn runmatmul(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/accum_matmul_sigmoid.rs b/benches/accum_matmul_sigmoid.rs index 0020a3f3..e7e264d2 100644 --- a/benches/accum_matmul_sigmoid.rs +++ b/benches/accum_matmul_sigmoid.rs @@ -5,7 +5,7 @@ use ezkl::circuit::*; use ezkl::circuit::lookup::LookupOp; use ezkl::circuit::poly::PolyOp; use ezkl::pfsys::create_proof_circuit; -use ezkl::pfsys::TranscriptType; + use ezkl::pfsys::{create_keys, srs::gen_srs}; use ezkl::tensor::*; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; @@ -155,7 +155,6 @@ fn runmatmul(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/accum_matmul_sigmoid_overflow.rs b/benches/accum_matmul_sigmoid_overflow.rs index 35cb2611..02f08ecf 100644 --- a/benches/accum_matmul_sigmoid_overflow.rs +++ b/benches/accum_matmul_sigmoid_overflow.rs @@ -5,7 +5,7 @@ use ezkl::circuit::lookup::LookupOp; use ezkl::circuit::poly::PolyOp; use ezkl::circuit::table::Range; use ezkl::pfsys::create_proof_circuit; -use ezkl::pfsys::TranscriptType; + use ezkl::pfsys::{create_keys, srs::gen_srs}; use ezkl::tensor::*; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; @@ -158,7 +158,6 @@ fn runmatmul(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/accum_sum.rs b/benches/accum_sum.rs index 608b1a4b..0a0fa945 100644 --- a/benches/accum_sum.rs +++ b/benches/accum_sum.rs @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Through use ezkl::circuit::poly::PolyOp; use ezkl::circuit::*; use ezkl::pfsys::create_proof_circuit; -use ezkl::pfsys::TranscriptType; + use ezkl::pfsys::{create_keys, srs::gen_srs}; use ezkl::tensor::*; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; @@ -117,7 +117,6 @@ fn runsum(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/accum_sumpool.rs b/benches/accum_sumpool.rs index be2451e4..e2c43fa0 100644 --- a/benches/accum_sumpool.rs +++ b/benches/accum_sumpool.rs @@ -4,7 +4,7 @@ use ezkl::circuit::*; use ezkl::pfsys::create_keys; use ezkl::pfsys::create_proof_circuit; use ezkl::pfsys::srs::gen_srs; -use ezkl::pfsys::TranscriptType; + use ezkl::tensor::*; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; use halo2_proofs::poly::kzg::multiopen::ProverSHPLONK; @@ -132,7 +132,6 @@ fn runsumpool(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/pairwise_add.rs b/benches/pairwise_add.rs index ce4737dc..bb1cd94b 100644 --- a/benches/pairwise_add.rs +++ b/benches/pairwise_add.rs @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Through use ezkl::circuit::poly::PolyOp; use ezkl::circuit::*; use ezkl::pfsys::create_proof_circuit; -use ezkl::pfsys::TranscriptType; + use ezkl::pfsys::{create_keys, srs::gen_srs}; use ezkl::tensor::*; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; @@ -119,7 +119,6 @@ fn runadd(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/pairwise_pow.rs b/benches/pairwise_pow.rs index 40d9c9a6..6c13e73c 100644 --- a/benches/pairwise_pow.rs +++ b/benches/pairwise_pow.rs @@ -3,7 +3,7 @@ use ezkl::circuit::poly::PolyOp; use ezkl::circuit::region::RegionCtx; use ezkl::circuit::*; use ezkl::pfsys::create_proof_circuit; -use ezkl::pfsys::TranscriptType; + use ezkl::pfsys::{create_keys, srs::gen_srs}; use ezkl::tensor::*; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; @@ -118,7 +118,6 @@ fn runpow(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/poseidon.rs b/benches/poseidon.rs index 14a8d6d8..be6861c6 100644 --- a/benches/poseidon.rs +++ b/benches/poseidon.rs @@ -8,7 +8,7 @@ use ezkl::circuit::*; use ezkl::pfsys::create_keys; use ezkl::pfsys::create_proof_circuit; use ezkl::pfsys::srs::gen_srs; -use ezkl::pfsys::TranscriptType; + use ezkl::tensor::*; use halo2_proofs::circuit::Value; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; @@ -105,7 +105,6 @@ fn runposeidon(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/relu_lookupless.rs b/benches/relu_lookupless.rs index f3ccb189..9d769c7e 100644 --- a/benches/relu_lookupless.rs +++ b/benches/relu_lookupless.rs @@ -4,7 +4,7 @@ use ezkl::circuit::region::RegionCtx; use ezkl::circuit::{BaseConfig as Config, CheckMode}; use ezkl::fieldutils::IntegerRep; use ezkl::pfsys::create_proof_circuit; -use ezkl::pfsys::TranscriptType; + use ezkl::pfsys::{create_keys, srs::gen_srs}; use ezkl::tensor::*; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; @@ -131,7 +131,6 @@ fn runrelu(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/benches/sigmoid.rs b/benches/sigmoid.rs index d28c37a3..d52f47fb 100644 --- a/benches/sigmoid.rs +++ b/benches/sigmoid.rs @@ -4,7 +4,7 @@ use ezkl::circuit::table::Range; use ezkl::circuit::{ops::lookup::LookupOp, BaseConfig as Config, CheckMode}; use ezkl::fieldutils::IntegerRep; use ezkl::pfsys::create_proof_circuit; -use ezkl::pfsys::TranscriptType; + use ezkl::pfsys::{create_keys, srs::gen_srs}; use ezkl::tensor::*; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; @@ -125,7 +125,6 @@ fn runrelu(c: &mut Criterion) { &pk, CheckMode::UNSAFE, ezkl::Commitments::KZG, - TranscriptType::EVM, None, None, ); diff --git a/build.rs b/build.rs index 31bdb681..9233dfa3 100644 --- a/build.rs +++ b/build.rs @@ -1,7 +1,3 @@ fn main() { - if cfg!(feature = "ios-bindings-test") { - println!("cargo::rustc-env=UNIFFI_CARGO_BUILD_EXTRA_ARGS=--features=ios-bindings --no-default-features"); - } - println!("cargo::rerun-if-changed=build.rs"); } diff --git a/examples/notebooks/decision_tree.ipynb b/examples/notebooks/decision_tree.ipynb index 2ec03547..840d5870 100644 --- a/examples/notebooks/decision_tree.ipynb +++ b/examples/notebooks/decision_tree.ipynb @@ -253,8 +253,6 @@ " compiled_model_path,\n", " pk_path,\n", " proof_path,\n", - " \n", - " \"single\",\n", " )\n", "\n", "print(res)\n", @@ -303,4 +301,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/examples/notebooks/ezkl_demo.ipynb b/examples/notebooks/ezkl_demo.ipynb index 6ccdb3fb..075c4755 100644 --- a/examples/notebooks/ezkl_demo.ipynb +++ b/examples/notebooks/ezkl_demo.ipynb @@ -546,7 +546,7 @@ "\n", "proof_path = os.path.join('proof.json')\n", "\n", - "proof = ezkl.prove(proof_type=\"single\", proof_path=proof_path)\n", + "proof = ezkl.prove(proof_path=proof_path)\n", "\n", "print(proof)\n", "assert os.path.isfile(proof_path)" @@ -736,4 +736,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/examples/notebooks/ezkl_demo_batch.ipynb b/examples/notebooks/ezkl_demo_batch.ipynb index 915370fe..4747ee55 100644 --- a/examples/notebooks/ezkl_demo_batch.ipynb +++ b/examples/notebooks/ezkl_demo_batch.ipynb @@ -574,7 +574,7 @@ "\n", "proof_path = os.path.join('proof.json')\n", "\n", - "proof = ezkl.prove(proof_type=\"single\", proof_path=proof_path)\n", + "proof = ezkl.prove(proof_path=proof_path)\n", "\n", "print(proof)\n", "assert os.path.isfile(proof_path)" @@ -768,4 +768,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/examples/notebooks/gcn.ipynb b/examples/notebooks/gcn.ipynb index d0520e7b..7db5bb36 100644 --- a/examples/notebooks/gcn.ipynb +++ b/examples/notebooks/gcn.ipynb @@ -105,7 +105,7 @@ "\n", "class GCNConv(Module):\n", " def __init__(self, in_channels, out_channels):\n", - " super(GCNConv, self).__init__() # \"Add\" aggregation.\n", + " super(GCNConv, self).__init__() \n", " self.lin = torch.nn.Linear(in_channels, out_channels)\n", "\n", " self.reset_parameters()\n", @@ -563,7 +563,6 @@ " compiled_model_path,\n", " pk_path,\n", " proof_path,\n", - " \"single\",\n", " )\n", "\n", "print(res)\n", @@ -625,4 +624,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/examples/notebooks/generalized_inverse.ipynb b/examples/notebooks/generalized_inverse.ipynb index 545c53a7..ddd87dcd 100644 --- a/examples/notebooks/generalized_inverse.ipynb +++ b/examples/notebooks/generalized_inverse.ipynb @@ -286,8 +286,6 @@ " compiled_model_path,\n", " pk_path,\n", " proof_path,\n", - " \n", - " \"single\",\n", " )\n", "\n", "print(res)\n", @@ -341,4 +339,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/examples/notebooks/gradient_boosted_trees.ipynb b/examples/notebooks/gradient_boosted_trees.ipynb index e0a892cb..da3acb33 100644 --- a/examples/notebooks/gradient_boosted_trees.ipynb +++ b/examples/notebooks/gradient_boosted_trees.ipynb @@ -248,7 +248,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "c384cbc8", "metadata": {}, "outputs": [], @@ -263,8 +263,6 @@ " compiled_model_path,\n", " pk_path,\n", " proof_path,\n", - " \n", - " \"single\",\n", " )\n", "\n", "print(res)\n", @@ -313,4 +311,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/examples/notebooks/hashed_vis.ipynb b/examples/notebooks/hashed_vis.ipynb index e14e58ed..8cdc85b1 100644 --- a/examples/notebooks/hashed_vis.ipynb +++ b/examples/notebooks/hashed_vis.ipynb @@ -368,7 +368,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/keras_simple_demo.ipynb b/examples/notebooks/keras_simple_demo.ipynb index c5779903..9180f5e5 100644 --- a/examples/notebooks/keras_simple_demo.ipynb +++ b/examples/notebooks/keras_simple_demo.ipynb @@ -236,7 +236,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/kmeans.ipynb b/examples/notebooks/kmeans.ipynb index a5837e6a..2a3ddb6e 100644 --- a/examples/notebooks/kmeans.ipynb +++ b/examples/notebooks/kmeans.ipynb @@ -240,7 +240,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/kzg_vis.ipynb b/examples/notebooks/kzg_vis.ipynb index 3c93e2ec..d1dc8194 100644 --- a/examples/notebooks/kzg_vis.ipynb +++ b/examples/notebooks/kzg_vis.ipynb @@ -358,7 +358,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/lightgbm.ipynb b/examples/notebooks/lightgbm.ipynb index d6e78b5a..b1ca82e2 100644 --- a/examples/notebooks/lightgbm.ipynb +++ b/examples/notebooks/lightgbm.ipynb @@ -278,7 +278,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/linear_regression.ipynb b/examples/notebooks/linear_regression.ipynb index 60016dc8..4764d2f4 100644 --- a/examples/notebooks/linear_regression.ipynb +++ b/examples/notebooks/linear_regression.ipynb @@ -232,7 +232,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/little_transformer.ipynb b/examples/notebooks/little_transformer.ipynb index c9f67eab..7d460047 100644 --- a/examples/notebooks/little_transformer.ipynb +++ b/examples/notebooks/little_transformer.ipynb @@ -442,7 +442,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/logistic_regression.ipynb b/examples/notebooks/logistic_regression.ipynb index 7d731119..d0db4141 100644 --- a/examples/notebooks/logistic_regression.ipynb +++ b/examples/notebooks/logistic_regression.ipynb @@ -227,7 +227,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/lstm.ipynb b/examples/notebooks/lstm.ipynb index d22dc957..857b2256 100644 --- a/examples/notebooks/lstm.ipynb +++ b/examples/notebooks/lstm.ipynb @@ -252,7 +252,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/mnist_classifier.ipynb b/examples/notebooks/mnist_classifier.ipynb index 7bdcc886..e4434633 100644 --- a/examples/notebooks/mnist_classifier.ipynb +++ b/examples/notebooks/mnist_classifier.ipynb @@ -422,7 +422,7 @@ " compiled_model_path,\n", " pk_path,\n", " proof_path,\n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/mnist_gan.ipynb b/examples/notebooks/mnist_gan.ipynb index 2ac2c70f..42d5dec1 100644 --- a/examples/notebooks/mnist_gan.ipynb +++ b/examples/notebooks/mnist_gan.ipynb @@ -378,7 +378,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/mnist_gan_proof_splitting.ipynb b/examples/notebooks/mnist_gan_proof_splitting.ipynb index a47c04f0..e59e4ba2 100644 --- a/examples/notebooks/mnist_gan_proof_splitting.ipynb +++ b/examples/notebooks/mnist_gan_proof_splitting.ipynb @@ -399,7 +399,6 @@ " compiled_model_path,\n", " pk_path,\n", " proof_path,\n", - " \"for-aggr\",\n", " )\n", "\n", " print(res)\n", @@ -438,28 +437,6 @@ " print(\"----- proving split \"+str(i))\n", " prove_model(i)" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "You can also mock aggregate the split proofs into a single proof. This is useful if you want to verify the proof on chain at a lower cost. Here we mock aggregate the proofs to save time. You can use other notebooks to see how to aggregate in full ! " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# now mock aggregate the proofs\n", - "# proofs = []\n", - "# for i in range(3):\n", - "# proof_path = os.path.join('proof_split_'+str(i)+'.json')\n", - "# proofs.append(proof_path)\n", - "\n", - "# ezkl.mock_aggregate(proofs, logrows=26, split_proofs = True)" - ] } ], "metadata": { @@ -484,4 +461,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} diff --git a/examples/notebooks/mnist_vae.ipynb b/examples/notebooks/mnist_vae.ipynb index 7c58bc3a..7a67166f 100644 --- a/examples/notebooks/mnist_vae.ipynb +++ b/examples/notebooks/mnist_vae.ipynb @@ -303,7 +303,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", @@ -543,7 +543,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/nbeats_timeseries_forecasting.ipynb b/examples/notebooks/nbeats_timeseries_forecasting.ipynb index dfa6dd60..63dde31c 100644 --- a/examples/notebooks/nbeats_timeseries_forecasting.ipynb +++ b/examples/notebooks/nbeats_timeseries_forecasting.ipynb @@ -939,7 +939,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/proof_splitting.ipynb b/examples/notebooks/proof_splitting.ipynb index 0c473f86..b7f803fb 100644 --- a/examples/notebooks/proof_splitting.ipynb +++ b/examples/notebooks/proof_splitting.ipynb @@ -330,7 +330,6 @@ " compiled_model_path,\n", " pk_path,\n", " proof_path,\n", - " \"for-aggr\",\n", " )\n", "\n", " print(res)\n", @@ -426,28 +425,6 @@ "for i in range(2):\n", " prove_model(i)" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "You can also mock aggregate the split proofs into a single proof. This is useful if you want to verify the proof on chain at a lower cost. Here we mock aggregate the proofs to save time. You can use other notebooks to see how to aggregate in full ! " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# now mock aggregate the proofs\n", - "proofs = []\n", - "for i in range(2):\n", - " proof_path = os.path.join('proof_split_'+str(i)+'.json')\n", - " proofs.append(proof_path)\n", - "\n", - "ezkl.mock_aggregate(proofs, logrows=22, split_proofs = True)" - ] } ], "metadata": { @@ -472,4 +449,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} diff --git a/examples/notebooks/random_forest.ipynb b/examples/notebooks/random_forest.ipynb index 55f27cf0..be8e3b32 100644 --- a/examples/notebooks/random_forest.ipynb +++ b/examples/notebooks/random_forest.ipynb @@ -260,7 +260,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/reusable_verifier.ipynb b/examples/notebooks/reusable_verifier.ipynb index c67d62c4..a752b405 100644 --- a/examples/notebooks/reusable_verifier.ipynb +++ b/examples/notebooks/reusable_verifier.ipynb @@ -173,7 +173,7 @@ " assert os.path.isfile(settings_path)\n", "\n", " # GENERATE A PROOF\n", - " res = ezkl.prove(witness_path, compiled_model_path, pk_path, proof_path, \"single\")\n", + " res = ezkl.prove(witness_path, compiled_model_path, pk_path, proof_path)\n", " assert os.path.isfile(proof_path)\n", "\n", " res = await ezkl.create_evm_verifier(vk_path, settings_path, sol_code_path, abi_path, reusable=True)\n", diff --git a/examples/notebooks/set_membership.ipynb b/examples/notebooks/set_membership.ipynb index 61926595..add5aef4 100644 --- a/examples/notebooks/set_membership.ipynb +++ b/examples/notebooks/set_membership.ipynb @@ -384,7 +384,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", @@ -411,7 +411,7 @@ " pk_path,\n", " proof_path_faulty,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", @@ -438,7 +438,7 @@ " pk_path,\n", " proof_path_truthy,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/simple_demo_aggregated_proofs.ipynb b/examples/notebooks/simple_demo_aggregated_proofs.ipynb deleted file mode 100644 index 9065ab91..00000000 --- a/examples/notebooks/simple_demo_aggregated_proofs.ipynb +++ /dev/null @@ -1,407 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "id": "cf69bb3f-94e6-4dba-92cd-ce08df117d67", - "metadata": {}, - "source": [ - "## EZKL Jupyter Notebook Demo (Aggregated Proofs) \n", - "\n", - "Demonstrates how to use EZKL with aggregated proofs" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "95613ee9", - "metadata": {}, - "outputs": [], - "source": [ - "# check if notebook is in colab\n", - "try:\n", - " # install ezkl\n", - " import google.colab\n", - " import subprocess\n", - " import sys\n", - " subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"ezkl\"])\n", - " subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"onnx\"])\n", - "\n", - "# rely on local installation of ezkl if the notebook is not in colab\n", - "except:\n", - " pass\n", - "\n", - "\n", - "# here we create and (potentially train a model)\n", - "\n", - "# make sure you have the dependencies required here already installed\n", - "from torch import nn\n", - "import ezkl\n", - "import os\n", - "import json\n", - "import torch\n", - "\n", - "\n", - "# Defines the model\n", - "# we got convs, we got relu, we got linear layers\n", - "# What else could one want ????\n", - "\n", - "class MyModel(nn.Module):\n", - " def __init__(self):\n", - " super(MyModel, self).__init__()\n", - "\n", - " self.conv1 = nn.Conv2d(in_channels=1, out_channels=2, kernel_size=5, stride=2)\n", - " self.conv2 = nn.Conv2d(in_channels=2, out_channels=3, kernel_size=5, stride=2)\n", - "\n", - " self.relu = nn.ReLU()\n", - "\n", - " self.d1 = nn.Linear(48, 48)\n", - " self.d2 = nn.Linear(48, 10)\n", - "\n", - " def forward(self, x):\n", - " # 32x1x28x28 => 32x32x26x26\n", - " x = self.conv1(x)\n", - " x = self.relu(x)\n", - " x = self.conv2(x)\n", - " x = self.relu(x)\n", - "\n", - " # flatten => 32 x (32*26*26)\n", - " x = x.flatten(start_dim = 1)\n", - "\n", - " # 32 x (32*26*26) => 32x128\n", - " x = self.d1(x)\n", - " x = self.relu(x)\n", - "\n", - " # logits => 32x10\n", - " logits = self.d2(x)\n", - "\n", - " return logits\n", - "\n", - "\n", - "circuit = MyModel()\n", - "\n", - "# Train the model as you like here (skipped for brevity)\n", - "\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b37637c4", - "metadata": {}, - "outputs": [], - "source": [ - "model_path = os.path.join('network.onnx')\n", - "compiled_model_path = os.path.join('network.compiled')\n", - "pk_path = os.path.join('test.pk')\n", - "vk_path = os.path.join('test.vk')\n", - "proof_path = os.path.join('test.pf')\n", - "settings_path = os.path.join('settings.json')\n", - "srs_path = os.path.join('kzg.srs')\n", - "witness_path = os.path.join('witness.json')\n", - "data_path = os.path.join('input.json')\n", - "aggregate_proof_path = os.path.join('aggr.pf')\n", - "aggregate_vk_path = os.path.join('aggr.vk')\n", - "aggregate_pk_path = os.path.join('aggr.pk')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "82db373a", - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "shape = [1, 28, 28]\n", - "# After training, export to onnx (network.onnx) and create a data file (input.json)\n", - "x = 0.1*torch.rand(1,*shape, requires_grad=True)\n", - "\n", - "# Flips the neural net into inference mode\n", - "circuit.eval()\n", - "\n", - " # Export the model\n", - "torch.onnx.export(circuit, # model being run\n", - " x, # model input (or a tuple for multiple inputs)\n", - " model_path, # where to save the model (can be a file or file-like object)\n", - " export_params=True, # store the trained parameter weights inside the model file\n", - " opset_version=10, # the ONNX version to export the model to\n", - " do_constant_folding=True, # whether to execute constant folding for optimization\n", - " input_names = ['input'], # the model's input names\n", - " output_names = ['output'], # the model's output names\n", - " dynamic_axes={'input' : {0 : 'batch_size'}, # variable length axes\n", - " 'output' : {0 : 'batch_size'}})\n", - "\n", - "data_array = ((x).detach().numpy()).reshape([-1]).tolist()\n", - "\n", - "data = dict(input_data = [data_array])\n", - "\n", - " # Serialize data into file:\n", - "json.dump( data, open(data_path, 'w' ))\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "d5e374a2", - "metadata": {}, - "outputs": [], - "source": [ - "!RUST_LOG=trace\n", - "# TODO: Dictionary outputs\n", - "res = ezkl.gen_settings(model_path, settings_path)\n", - "assert res == True\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "cal_path = os.path.join(\"calibration.json\")\n", - "\n", - "data_array = (torch.rand(20, *shape, requires_grad=True).detach().numpy()).reshape([-1]).tolist()\n", - "\n", - "data = dict(input_data = [data_array])\n", - "\n", - "# Serialize data into file:\n", - "json.dump(data, open(cal_path, 'w'))\n", - "\n", - "\n", - "ezkl.calibrate_settings(cal_path, model_path, settings_path, \"resources\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3aa4f090", - "metadata": {}, - "outputs": [], - "source": [ - "res = ezkl.compile_circuit(model_path, compiled_model_path, settings_path)\n", - "assert res == True" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8b74dcee", - "metadata": {}, - "outputs": [], - "source": [ - "# srs path\n", - "res = await ezkl.get_srs( settings_path)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "18c8b7c7", - "metadata": {}, - "outputs": [], - "source": [ - "# now generate the witness file \n", - "\n", - "res = ezkl.gen_witness(data_path, compiled_model_path, witness_path)\n", - "assert os.path.isfile(witness_path)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b1c561a8", - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "# HERE WE SETUP THE CIRCUIT PARAMS\n", - "# WE GOT KEYS\n", - "# WE GOT CIRCUIT PARAMETERS\n", - "# EVERYTHING ANYONE HAS EVER NEEDED FOR ZK\n", - "\n", - "\n", - "\n", - "res = ezkl.setup(\n", - " compiled_model_path,\n", - " vk_path,\n", - " pk_path,\n", - " \n", - " )\n", - "\n", - "assert res == True\n", - "assert os.path.isfile(vk_path)\n", - "assert os.path.isfile(pk_path)\n", - "assert os.path.isfile(settings_path)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c384cbc8", - "metadata": {}, - "outputs": [], - "source": [ - "# GENERATE A PROOF\n", - "\n", - "\n", - "proof_path = os.path.join('test.pf')\n", - "\n", - "res = ezkl.prove(\n", - " witness_path,\n", - " compiled_model_path,\n", - " pk_path,\n", - " proof_path,\n", - " \n", - " \"for-aggr\", # IMPORTANT NOTE: To produce an aggregated EVM proof you will want to use poseidon for the smaller proofs\n", - " )\n", - "\n", - "print(res)\n", - "assert os.path.isfile(proof_path)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "76f00d41", - "metadata": {}, - "outputs": [], - "source": [ - "# VERIFY IT\n", - "\n", - "res = ezkl.verify(\n", - " proof_path,\n", - " settings_path,\n", - " vk_path,\n", - " )\n", - "\n", - "assert res == True\n", - "print(\"verified\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0832b909", - "metadata": {}, - "outputs": [], - "source": [ - "# Generate a larger SRS. This is needed for the aggregated proof\n", - "\n", - "res = await ezkl.get_srs(settings_path=None, logrows=21, commitment=ezkl.PyCommitments.KZG)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c5a64be6", - "metadata": {}, - "outputs": [], - "source": [ - "# Run mock aggregate to check whether the proof works\n", - "# Use mock to check for validity as it takes a shorter time to check compared to a full aggregated proof\n", - "\n", - "res = ezkl.mock_aggregate([proof_path], 21)\n", - "assert res == True" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fee8acc6", - "metadata": {}, - "outputs": [], - "source": [ - "# Setup the vk and pk for aggregate\n", - "res = ezkl.setup_aggregate(\n", - " [proof_path],\n", - " aggregate_vk_path,\n", - " aggregate_pk_path,\n", - " 21\n", - ")\n", - "\n", - "assert os.path.isfile(aggregate_vk_path)\n", - "assert os.path.isfile(aggregate_pk_path)" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "id": "171702d3", - "metadata": {}, - "outputs": [], - "source": [ - "# Run aggregate proof\n", - "res = ezkl.aggregate(\n", - " [proof_path],\n", - " aggregate_proof_path,\n", - " aggregate_pk_path,\n", - " \"evm\",\n", - " 21,\n", - " \"safe\"\n", - ")\n", - "\n", - "assert os.path.isfile(aggregate_proof_path)" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "id": "671dfdd5", - "metadata": {}, - "outputs": [], - "source": [ - "# Check if the proof is valid\n", - "res = ezkl.verify_aggr(\n", - " aggregate_proof_path,\n", - " aggregate_vk_path,\n", - " 21,\n", - ")\n", - "assert res == True" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "id": "50eba2f4", - "metadata": {}, - "outputs": [], - "source": [ - "# Create a smart contract verifier for the aggregated proof\n", - "\n", - "sol_code_path = os.path.join(\"Verifier.sol\")\n", - "abi_path = os.path.join(\"Verifier_ABI.json\")\n", - "\n", - "res = await ezkl.create_evm_verifier_aggr(\n", - " [settings_path],\n", - " aggregate_vk_path,\n", - " sol_code_path,\n", - " abi_path,\n", - " logrows=21)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.7" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} \ No newline at end of file diff --git a/examples/notebooks/simple_demo_all_public.ipynb b/examples/notebooks/simple_demo_all_public.ipynb index 72a8c83c..df507e09 100644 --- a/examples/notebooks/simple_demo_all_public.ipynb +++ b/examples/notebooks/simple_demo_all_public.ipynb @@ -255,7 +255,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/simple_demo_public_input_output.ipynb b/examples/notebooks/simple_demo_public_input_output.ipynb index 64c4cc77..de58278b 100644 --- a/examples/notebooks/simple_demo_public_input_output.ipynb +++ b/examples/notebooks/simple_demo_public_input_output.ipynb @@ -253,7 +253,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/simple_demo_public_network_output.ipynb b/examples/notebooks/simple_demo_public_network_output.ipynb index ce6e8462..33900b52 100644 --- a/examples/notebooks/simple_demo_public_network_output.ipynb +++ b/examples/notebooks/simple_demo_public_network_output.ipynb @@ -254,7 +254,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/sklearn_mlp.ipynb b/examples/notebooks/sklearn_mlp.ipynb index a6fd80e5..344cdc30 100644 --- a/examples/notebooks/sklearn_mlp.ipynb +++ b/examples/notebooks/sklearn_mlp.ipynb @@ -233,7 +233,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/solvency.ipynb b/examples/notebooks/solvency.ipynb index 69dabfed..157d1bcb 100644 --- a/examples/notebooks/solvency.ipynb +++ b/examples/notebooks/solvency.ipynb @@ -323,7 +323,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "assert os.path.isfile(proof_path)\n", @@ -442,7 +442,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/stacked_regression.ipynb b/examples/notebooks/stacked_regression.ipynb index bdc1a5a5..6601800d 100644 --- a/examples/notebooks/stacked_regression.ipynb +++ b/examples/notebooks/stacked_regression.ipynb @@ -271,7 +271,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/svm.ipynb b/examples/notebooks/svm.ipynb index 11662353..07602892 100644 --- a/examples/notebooks/svm.ipynb +++ b/examples/notebooks/svm.ipynb @@ -236,7 +236,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/tictactoe_autoencoder.ipynb b/examples/notebooks/tictactoe_autoencoder.ipynb index 6f88e3d9..ff0f6aa6 100644 --- a/examples/notebooks/tictactoe_autoencoder.ipynb +++ b/examples/notebooks/tictactoe_autoencoder.ipynb @@ -707,7 +707,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/tictactoe_binary_classification.ipynb b/examples/notebooks/tictactoe_binary_classification.ipynb index 322928b2..1db1d74b 100644 --- a/examples/notebooks/tictactoe_binary_classification.ipynb +++ b/examples/notebooks/tictactoe_binary_classification.ipynb @@ -596,7 +596,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/variance.ipynb b/examples/notebooks/variance.ipynb index a672d6c0..d276d543 100644 --- a/examples/notebooks/variance.ipynb +++ b/examples/notebooks/variance.ipynb @@ -580,7 +580,7 @@ " compiled_filename,\n", " pk_path,\n", " proof_path,\n", - " \"single\",\n", + " ", " )\n", "\n", "\n", diff --git a/examples/notebooks/voice_judge.ipynb b/examples/notebooks/voice_judge.ipynb index ac1f7d5e..0c179d6f 100644 --- a/examples/notebooks/voice_judge.ipynb +++ b/examples/notebooks/voice_judge.ipynb @@ -759,7 +759,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/notebooks/xgboost.ipynb b/examples/notebooks/xgboost.ipynb index dc97393d..a668e297 100644 --- a/examples/notebooks/xgboost.ipynb +++ b/examples/notebooks/xgboost.ipynb @@ -277,7 +277,7 @@ " pk_path,\n", " proof_path,\n", " \n", - " \"single\",\n", + " ", " )\n", "\n", "print(res)\n", diff --git a/examples/onnx/smallworm/Readme.md b/examples/onnx/smallworm/Readme.md index 9ef64860..08504eae 100644 --- a/examples/onnx/smallworm/Readme.md +++ b/examples/onnx/smallworm/Readme.md @@ -1,23 +1,23 @@ -## The worm +## The worm This is an onnx file for a [WormVAE](https://github.com/TuragaLab/wormvae?tab=readme-ov-file) model, which is a VAE / latent-space representation of the C. elegans connectome. The model "is a large-scale latent variable model with a very high-dimensional latent space consisting of voltage dynamics of 300 neurons over 5 minutes of time at the simulation frequency of 160 Hz. The generative model for these latent variables is described by stochastic differential -equations modeling the nonlinear dynamics of the network activity." (see [here](https://openreview.net/pdf?id=CJzi3dRlJE-)). +equations modeling the nonlinear dynamics of the network activity." (see [here](https://openreview.net/pdf?id=CJzi3dRlJE-)). In effect this is a generative model for a worm's voltage dynamics, which can be used to generate new worm-like voltage dynamics given previous connectome state. -Using ezkl you can create a zk circuit equivalent to the wormvae model, allowing you to "prove" execution of the worm model. If you're feeling particularly adventurous, you can also use the zk circuit to generate new worm-state that can be verified on chain. +Using ezkl you can create a zk circuit equivalent to the wormvae model, allowing you to "prove" execution of the worm model. If you're feeling particularly adventurous, you can also use the zk circuit to generate new worm-state that can be verified on chain. -To do so you'll first want to fetch the files using git-lfs (as the onnx file is too large to be stored in git). +To do so you'll first want to fetch the files using git-lfs (as the onnx file is too large to be stored in git). ```bash git lfs fetch --all ``` -You'll then want to use the usual ezkl loop to generate the zk circuit. We recommend using fixed visibility for the model parameters, as the model is quite large and this will prune the circuit significantly. +You'll then want to use the usual ezkl loop to generate the zk circuit. We recommend using fixed visibility for the model parameters, as the model is quite large and this will prune the circuit significantly. ```bash ezkl gen-settings --param-visibility=fixed @@ -28,17 +28,7 @@ ezkl gen-witness ezkl prove ``` -You might also need to aggregate the proof to get it to fit on chain. -```bash -ezkl aggregate -``` - -You can then create a smart contract that verifies this aggregate proof - -```bash -ezkl create-evm-verifier-aggr -``` This can then be deployed on the chain of your choice. diff --git a/ezkl.pyi b/ezkl.pyi index d7077415..12c4b481 100644 --- a/ezkl.pyi +++ b/ezkl.pyi @@ -10,28 +10,32 @@ class PyG1: r""" pyclass containing the struct used for G1, this is mostly a helper class """ + ... class PyG1Affine: r""" pyclass containing the struct used for G1 """ + ... class PyRunArgs: r""" Python class containing the struct used for run_args - + Returns ------- PyRunArgs """ + ... class PyCommitments(Enum): r""" pyclass representing an enum, denoting the type of commitment """ + KZG = auto() IPA = auto() @@ -47,57 +51,19 @@ class PyTestDataSource(Enum): r""" pyclass representing an enum """ + File = auto() OnChain = auto() -def aggregate(aggregation_snarks:typing.Sequence[str | os.PathLike | pathlib.Path],proof_path:str | os.PathLike | pathlib.Path,vk_path:str | os.PathLike | pathlib.Path,transcript:str,logrows:int,check_mode:str,split_proofs:bool,srs_path:typing.Optional[str | os.PathLike | pathlib.Path],commitment:PyCommitments) -> bool: - r""" - Creates an aggregated proof - - Arguments - --------- - aggregation_snarks: list[str] - List of paths to the various proofs - - proof_path: str - Path to output the aggregated proof - - vk_path: str - Path to the VK file - - transcript: - Proof transcript type to be used. `evm` used by default. `poseidon` is also supported - - logrows: - Logrows used for aggregation circuit - - check_mode: str - Run sanity checks during calculations. Accepts `safe` or `unsafe` - - split-proofs: bool - Whether the accumulated proofs are segments of a larger circuit - - srs_path: str - Path to the SRS used - - commitment: str - Accepts "kzg" or "ipa" - - Returns - ------- - bool - """ - ... - -def buffer_to_felts(buffer:typing.Sequence[int]) -> list[str]: +def buffer_to_felts(buffer: typing.Sequence[int]) -> list[str]: r""" Converts a buffer to vector of field elements - + Arguments ------- buffer: list[int] List of integers representing a buffer - + Returns ------- list[str] @@ -105,173 +71,175 @@ def buffer_to_felts(buffer:typing.Sequence[int]) -> list[str]: """ ... -def calibrate_settings(data:str | os.PathLike | pathlib.Path,model:str | os.PathLike | pathlib.Path,settings:str | os.PathLike | pathlib.Path,target:str,lookup_safety_margin:float,scales:typing.Optional[typing.Sequence[int]],scale_rebase_multiplier:typing.Sequence[int],max_logrows:typing.Optional[int]) -> typing.Any: +def calibrate_settings( + data: str | os.PathLike | pathlib.Path, + model: str | os.PathLike | pathlib.Path, + settings: str | os.PathLike | pathlib.Path, + target: str, + lookup_safety_margin: float, + scales: typing.Optional[typing.Sequence[int]], + scale_rebase_multiplier: typing.Sequence[int], + max_logrows: typing.Optional[int], +) -> typing.Any: r""" Calibrates the circuit settings - + Arguments --------- data: str Path to the calibration data - + model: str Path to the onnx file - + settings: str Path to the settings file - + lookup_safety_margin: int the lookup safety margin to use for calibration. if the max lookup is 2^k, then the max lookup will be 2^k * lookup_safety_margin. larger = safer but slower - + scales: list[int] Optional scales to specifically try for calibration - + scale_rebase_multiplier: list[int] Optional scale rebase multipliers to specifically try for calibration. This is the multiplier at which we divide to return to the input scale. - + max_logrows: int Optional max logrows to use for calibration - - + + Returns ------- bool """ ... -def compile_circuit(model:str | os.PathLike | pathlib.Path,compiled_circuit:str | os.PathLike | pathlib.Path,settings_path:str | os.PathLike | pathlib.Path) -> bool: +def compile_circuit( + model: str | os.PathLike | pathlib.Path, + compiled_circuit: str | os.PathLike | pathlib.Path, + settings_path: str | os.PathLike | pathlib.Path, +) -> bool: r""" Compiles the circuit for use in other steps - + Arguments --------- model: str Path to the onnx model file - + compiled_circuit: str Path to output the compiled circuit - + settings_path: str Path to the settings files - + Returns ------- bool """ ... -def create_evm_verifier(vk_path:str | os.PathLike | pathlib.Path,settings_path:str | os.PathLike | pathlib.Path,sol_code_path:str | os.PathLike | pathlib.Path,abi_path:str | os.PathLike | pathlib.Path,srs_path:typing.Optional[str | os.PathLike | pathlib.Path],reusable:bool) -> typing.Any: +def create_evm_verifier( + vk_path: str | os.PathLike | pathlib.Path, + settings_path: str | os.PathLike | pathlib.Path, + sol_code_path: str | os.PathLike | pathlib.Path, + abi_path: str | os.PathLike | pathlib.Path, + srs_path: typing.Optional[str | os.PathLike | pathlib.Path], + reusable: bool, +) -> typing.Any: r""" Creates an EVM compatible verifier, you will need solc installed in your environment to run this - + Arguments --------- vk_path: str The path to the verification key file - + settings_path: str The path to the settings file - + sol_code_path: str The path to the create the solidity verifier - + abi_path: str The path to create the ABI for the solidity verifier - + srs_path: str The path to the SRS file - + reusable: bool Whether the verifier should be rendered as a reusable contract. If so, then you will need to deploy the VK artifact separately which you can generate using the create_evm_vka command - + Returns ------- bool """ ... -def create_evm_verifier_aggr(aggregation_settings:typing.Sequence[str | os.PathLike | pathlib.Path],vk_path:str | os.PathLike | pathlib.Path,sol_code_path:str | os.PathLike | pathlib.Path,abi_path:str | os.PathLike | pathlib.Path,logrows:int,srs_path:typing.Optional[str | os.PathLike | pathlib.Path],reusable:bool) -> typing.Any: - r""" - Creates an evm compatible aggregate verifier, you will need solc installed in your environment to run this - - Arguments - --------- - aggregation_settings: str - path to the settings file - - vk_path: str - The path to load the desired verification key file - - sol_code_path: str - The path to the Solidity code - - abi_path: str - The path to output the Solidity verifier ABI - - logrows: int - Number of logrows used during aggregated setup - - srs_path: str - The path to the SRS file - - reusable: bool - Whether the verifier should be rendered as a reusable contract. If so, then you will need to deploy the VK artifact separately which you can generate using the create_evm_vka command - - Returns - ------- - bool - """ - ... - -def create_evm_vka(vk_path:str | os.PathLike | pathlib.Path,settings_path:str | os.PathLike | pathlib.Path,vka_path:str | os.PathLike | pathlib.Path,srs_path:typing.Optional[str | os.PathLike | pathlib.Path]) -> typing.Any: +def create_evm_vka( + vk_path: str | os.PathLike | pathlib.Path, + settings_path: str | os.PathLike | pathlib.Path, + vka_path: str | os.PathLike | pathlib.Path, + srs_path: typing.Optional[str | os.PathLike | pathlib.Path], +) -> typing.Any: r""" Creates an Evm VK artifact. This command generated a VK with circuit specific meta data encoding in memory for use by the reusable H2 verifier. - This is useful for deploying verifier that were otherwise too big to fit on chain and required aggregation. - + Arguments --------- vk_path: str The path to the verification key file - + settings_path: str The path to the settings file - + vka_path: str The path to the create the vka calldata. - + abi_path: str The path to create the ABI for the solidity verifier - + srs_path: str The path to the SRS file - + Returns ------- bool """ ... -def deploy_evm(addr_path:str | os.PathLike | pathlib.Path,sol_code_path:str | os.PathLike | pathlib.Path,rpc_url:typing.Optional[str],contract_type:str,optimizer_runs:int,private_key:typing.Optional[str]) -> typing.Any: +def deploy_evm( + addr_path: str | os.PathLike | pathlib.Path, + sol_code_path: str | os.PathLike | pathlib.Path, + rpc_url: typing.Optional[str], + contract_type: str, + optimizer_runs: int, + private_key: typing.Optional[str], +) -> typing.Any: r""" deploys the solidity verifier """ ... -def encode_evm_calldata(proof:str | os.PathLike | pathlib.Path,calldata:str | os.PathLike | pathlib.Path,addr_vk:typing.Optional[str]) -> list[int]: +def encode_evm_calldata( + proof: str | os.PathLike | pathlib.Path, + calldata: str | os.PathLike | pathlib.Path, + addr_vk: typing.Optional[str], +) -> list[int]: r""" Creates encoded evm calldata from a proof file - + Arguments --------- proof: str Path to the proof file - + calldata: str Path to the calldata file to save - + addr_vk: str The address of the verification key contract (if the verifier key is to be rendered as a separate contract) - + Returns ------- vec[u8] @@ -279,16 +247,16 @@ def encode_evm_calldata(proof:str | os.PathLike | pathlib.Path,calldata:str | os """ ... -def felt_to_big_endian(felt:str) -> str: +def felt_to_big_endian(felt: str) -> str: r""" Converts a field element hex string to big endian - + Arguments ------- felt: str The field element represented as a string - - + + Returns ------- str @@ -296,54 +264,54 @@ def felt_to_big_endian(felt:str) -> str: """ ... -def felt_to_float(felt:str,scale:int) -> float: +def felt_to_float(felt: str, scale: int) -> float: r""" Converts a field element hex string to a floating point number - + Arguments ------- felt: str The field element represented as a string - + scale: float The scaling factor used to convert the field element into a floating point representation - + Returns ------- float """ ... -def felt_to_int(felt:str) -> int: +def felt_to_int(felt: str) -> int: r""" Converts a field element hex string to an integer - + Arguments ------- felt: str The field element represented as a string - + Returns ------- int """ ... -def float_to_felt(input:float,scale:int,input_type:PyInputType) -> str: +def float_to_felt(input: float, scale: int, input_type: PyInputType) -> str: r""" Converts a floating point element to a field element hex string - + Arguments ------- input: float The field element represented as a string - + scale: float The scaling factor used to quantize the float into a field element - + input_type: PyInputType The type of the input - + Returns ------- str @@ -351,101 +319,97 @@ def float_to_felt(input:float,scale:int,input_type:PyInputType) -> str: """ ... -def gen_settings(model:str | os.PathLike | pathlib.Path,output:str | os.PathLike | pathlib.Path,py_run_args:typing.Optional[PyRunArgs]) -> bool: +def gen_settings( + model: str | os.PathLike | pathlib.Path, + output: str | os.PathLike | pathlib.Path, + py_run_args: typing.Optional[PyRunArgs], +) -> bool: r""" Generates the circuit settings - + Arguments --------- model: str Path to the onnx file - + output: str Path to create the settings file - + py_run_args: PyRunArgs PyRunArgs object to initialize the settings - + Returns ------- bool """ ... -def gen_srs(srs_path:str | os.PathLike | pathlib.Path,logrows:int) -> None: +def gen_srs(srs_path: str | os.PathLike | pathlib.Path, logrows: int) -> None: r""" Generates the Structured Reference String (SRS), use this only for testing purposes - + Arguments --------- srs_path: str Path to the create the SRS file - + logrows: int The number of logrows for the SRS file """ ... -def gen_vk_from_pk_aggr(path_to_pk:str | os.PathLike | pathlib.Path,vk_output_path:str | os.PathLike | pathlib.Path) -> bool: - r""" - Generates a vk from a pk for an aggregate circuit and saves it to a file - - Arguments - ------- - path_to_pk: str - Path to the proving key - - vk_output_path: str - Path to create the vk file - - Returns - ------- - bool - """ - ... - -def gen_vk_from_pk_single(path_to_pk:str | os.PathLike | pathlib.Path,circuit_settings_path:str | os.PathLike | pathlib.Path,vk_output_path:str | os.PathLike | pathlib.Path) -> bool: +def gen_vk_from_pk_single( + path_to_pk: str | os.PathLike | pathlib.Path, + circuit_settings_path: str | os.PathLike | pathlib.Path, + vk_output_path: str | os.PathLike | pathlib.Path, +) -> bool: r""" Generates a vk from a pk for a model circuit and saves it to a file - + Arguments ------- path_to_pk: str Path to the proving key - + circuit_settings_path: str Path to the witness file - + vk_output_path: str Path to create the vk file - + Returns ------- bool """ ... -def gen_witness(data:str | os.PathLike | pathlib.Path,model:str | os.PathLike | pathlib.Path,output:typing.Optional[str | os.PathLike | pathlib.Path],vk_path:typing.Optional[str | os.PathLike | pathlib.Path],srs_path:typing.Optional[str | os.PathLike | pathlib.Path]) -> typing.Any: +def gen_witness( + data: str | os.PathLike | pathlib.Path, + model: str | os.PathLike | pathlib.Path, + output: typing.Optional[str | os.PathLike | pathlib.Path], + vk_path: typing.Optional[str | os.PathLike | pathlib.Path], + srs_path: typing.Optional[str | os.PathLike | pathlib.Path], +) -> typing.Any: r""" Runs the forward pass operation to generate a witness - + Arguments --------- data: str Path to the data file - + model: str Path to the compiled model file - + output: str Path to create the witness file - + vk_path: str Path to the verification key - + srs_path: str Path to the SRS file - + Returns ------- dict @@ -453,126 +417,122 @@ def gen_witness(data:str | os.PathLike | pathlib.Path,model:str | os.PathLike | """ ... -def get_srs(settings_path:typing.Optional[str | os.PathLike | pathlib.Path],logrows:typing.Optional[int],srs_path:typing.Optional[str | os.PathLike | pathlib.Path],commitment:typing.Optional[PyCommitments]) -> typing.Any: +def get_srs( + settings_path: typing.Optional[str | os.PathLike | pathlib.Path], + logrows: typing.Optional[int], + srs_path: typing.Optional[str | os.PathLike | pathlib.Path], + commitment: typing.Optional[PyCommitments], +) -> typing.Any: r""" Gets a public srs - + Arguments --------- settings_path: str Path to the settings file - + logrows: int The number of logrows for the SRS file - + srs_path: str Path to the create the SRS file - + commitment: str Specify the commitment used ("kzg", "ipa") - + Returns ------- bool """ ... -def ipa_commit(message:typing.Sequence[str],vk_path:str | os.PathLike | pathlib.Path,settings_path:str | os.PathLike | pathlib.Path,srs_path:typing.Optional[str | os.PathLike | pathlib.Path]) -> list[PyG1Affine]: +def ipa_commit( + message: typing.Sequence[str], + vk_path: str | os.PathLike | pathlib.Path, + settings_path: str | os.PathLike | pathlib.Path, + srs_path: typing.Optional[str | os.PathLike | pathlib.Path], +) -> list[PyG1Affine]: r""" Generate an ipa commitment. - + Arguments ------- message: list[str] List of field elements represnted as strings - + vk_path: str Path to the verification key - + settings_path: str Path to the settings file - + srs_path: str Path to the Structure Reference String (SRS) file - + Returns ------- list[PyG1Affine] """ ... -def kzg_commit(message:typing.Sequence[str],vk_path:str | os.PathLike | pathlib.Path,settings_path:str | os.PathLike | pathlib.Path,srs_path:typing.Optional[str | os.PathLike | pathlib.Path]) -> list[PyG1Affine]: +def kzg_commit( + message: typing.Sequence[str], + vk_path: str | os.PathLike | pathlib.Path, + settings_path: str | os.PathLike | pathlib.Path, + srs_path: typing.Optional[str | os.PathLike | pathlib.Path], +) -> list[PyG1Affine]: r""" Generate a kzg commitment. - + Arguments ------- message: list[str] List of field elements represnted as strings - + vk_path: str Path to the verification key - + settings_path: str Path to the settings file - + srs_path: str Path to the Structure Reference String (SRS) file - + Returns ------- list[PyG1Affine] """ ... -def mock(witness:str | os.PathLike | pathlib.Path,model:str | os.PathLike | pathlib.Path) -> bool: +def mock( + witness: str | os.PathLike | pathlib.Path, model: str | os.PathLike | pathlib.Path +) -> bool: r""" Mocks the prover - + Arguments --------- witness: str Path to the witness file - + model: str Path to the compiled model file - + Returns ------- bool """ ... -def mock_aggregate(aggregation_snarks:typing.Sequence[str | os.PathLike | pathlib.Path],logrows:int,split_proofs:bool) -> bool: - r""" - Mocks the aggregate prover - - Arguments - --------- - aggregation_snarks: list[str] - List of paths to the relevant proof files - - logrows: int - Number of logrows to use for the aggregation circuit - - split_proofs: bool - Indicates whether the accumulated are segments of a larger proof - - Returns - ------- - bool - """ - ... - -def poseidon_hash(message:typing.Sequence[str]) -> list[str]: +def poseidon_hash(message: typing.Sequence[str]) -> list[str]: r""" Generate a poseidon hash. - + Arguments ------- message: list[str] List of field elements represented as strings - + Returns ------- list[str] @@ -580,126 +540,104 @@ def poseidon_hash(message:typing.Sequence[str]) -> list[str]: """ ... -def prove(witness:str | os.PathLike | pathlib.Path,model:str | os.PathLike | pathlib.Path,pk_path:str | os.PathLike | pathlib.Path,proof_path:typing.Optional[str | os.PathLike | pathlib.Path],proof_type:str,srs_path:typing.Optional[str | os.PathLike | pathlib.Path]) -> typing.Any: +def prove( + witness: str | os.PathLike | pathlib.Path, + model: str | os.PathLike | pathlib.Path, + pk_path: str | os.PathLike | pathlib.Path, + proof_path: typing.Optional[str | os.PathLike | pathlib.Path], + srs_path: typing.Optional[str | os.PathLike | pathlib.Path], +) -> typing.Any: r""" Runs the prover on a set of inputs - + Arguments --------- witness: str Path to the witness file - + model: str Path to the compiled model file - + pk_path: str Path to the proving key file - + proof_path: str Path to create the proof file - - proof_type: str - Accepts `single`, `for-aggr` - + srs_path: str Path to the SRS file - + Returns ------- bool """ ... -def setup(model:str | os.PathLike | pathlib.Path,vk_path:str | os.PathLike | pathlib.Path,pk_path:str | os.PathLike | pathlib.Path,srs_path:typing.Optional[str | os.PathLike | pathlib.Path],witness_path:typing.Optional[str | os.PathLike | pathlib.Path],disable_selector_compression:bool) -> bool: +def setup( + model: str | os.PathLike | pathlib.Path, + vk_path: str | os.PathLike | pathlib.Path, + pk_path: str | os.PathLike | pathlib.Path, + srs_path: typing.Optional[str | os.PathLike | pathlib.Path], + witness_path: typing.Optional[str | os.PathLike | pathlib.Path], + disable_selector_compression: bool, +) -> bool: r""" Runs the setup process - + Arguments --------- model: str Path to the compiled model file - + vk_path: str Path to create the verification key file - + pk_path: str Path to create the proving key file - + srs_path: str Path to the SRS file - + witness_path: str Path to the witness file - + disable_selector_compression: bool Whether to compress the selectors or not - + Returns ------- bool """ ... -def setup_aggregate(sample_snarks:typing.Sequence[str | os.PathLike | pathlib.Path],vk_path:str | os.PathLike | pathlib.Path,pk_path:str | os.PathLike | pathlib.Path,logrows:int,split_proofs:bool,srs_path:typing.Optional[str | os.PathLike | pathlib.Path],disable_selector_compression:bool,commitment:PyCommitments) -> bool: - r""" - Runs the setup process for an aggregate setup - - Arguments - --------- - sample_snarks: list[str] - List of paths to the various proofs - - vk_path: str - Path to create the aggregated VK - - pk_path: str - Path to create the aggregated PK - - logrows: int - Number of logrows to use - - split_proofs: bool - Whether the accumulated are segments of a larger proof - - srs_path: str - Path to the SRS file - - disable_selector_compression: bool - Whether to compress selectors - - commitment: str - Accepts `kzg`, `ipa` - - Returns - ------- - bool - """ - ... - - -def swap_proof_commitments(proof_path:str | os.PathLike | pathlib.Path,witness_path:str | os.PathLike | pathlib.Path) -> None: +def swap_proof_commitments( + proof_path: str | os.PathLike | pathlib.Path, + witness_path: str | os.PathLike | pathlib.Path, +) -> None: r""" Swap the commitments in a proof - + Arguments ------- proof_path: str Path to the proof file - + witness_path: str Path to the witness file """ ... -def table(model:str | os.PathLike | pathlib.Path,py_run_args:typing.Optional[PyRunArgs]) -> str: +def table( + model: str | os.PathLike | pathlib.Path, py_run_args: typing.Optional[PyRunArgs] +) -> str: r""" Displays the table as a string in python - + Arguments --------- model: str Path to the onnx file - + Returns --------- str @@ -707,78 +645,59 @@ def table(model:str | os.PathLike | pathlib.Path,py_run_args:typing.Optional[PyR """ ... -def verify(proof_path:str | os.PathLike | pathlib.Path,settings_path:str | os.PathLike | pathlib.Path,vk_path:str | os.PathLike | pathlib.Path,srs_path:typing.Optional[str | os.PathLike | pathlib.Path],reduced_srs:bool) -> bool: +def verify( + proof_path: str | os.PathLike | pathlib.Path, + settings_path: str | os.PathLike | pathlib.Path, + vk_path: str | os.PathLike | pathlib.Path, + srs_path: typing.Optional[str | os.PathLike | pathlib.Path], + reduced_srs: bool, +) -> bool: r""" Verifies a given proof - + Arguments --------- proof_path: str Path to create the proof file - + settings_path: str Path to the settings file - + vk_path: str Path to the verification key file - + srs_path: str Path to the SRS file - + non_reduced_srs: bool Whether to reduce the number of SRS logrows to the number of instances rather than the number of logrows used for proofs (only works if the srs were generated in the same ceremony) - + Returns ------- bool """ ... -def verify_aggr(proof_path:str | os.PathLike | pathlib.Path,vk_path:str | os.PathLike | pathlib.Path,logrows:int,commitment:PyCommitments,reduced_srs:bool,srs_path:typing.Optional[str | os.PathLike | pathlib.Path]) -> bool: - r""" - Verifies and aggregate proof - - Arguments - --------- - proof_path: str - The path to the proof file - - vk_path: str - The path to the verification key file - - logrows: int - logrows used for aggregation circuit - - commitment: str - Accepts "kzg" or "ipa" - - reduced_srs: bool - Whether to reduce the number of SRS logrows to the number of instances rather than the number of logrows used for proofs (only works if the srs were generated in the same ceremony) - - srs_path: str - The path to the SRS file - - Returns - ------- - bool - """ - ... - -def verify_evm(addr_verifier:str,proof_path:str | os.PathLike | pathlib.Path,rpc_url:typing.Optional[str],vka_path:typing.Optional[str]) -> typing.Any: +def verify_evm( + addr_verifier: str, + proof_path: str | os.PathLike | pathlib.Path, + rpc_url: typing.Optional[str], + vka_path: typing.Optional[str], +) -> typing.Any: r""" verifies an evm compatible proof, you will need solc installed in your environment to run this - + Arguments --------- addr_verifier: str The verifier contract's address as a hex string - + proof_path: str The path to the proof file (generated using the prove command) - + rpc_url: str RPC URL for an Ethereum node, if None will use Anvil but WON'T persist state - + vka_path: str The path to the VKA calldata bytes file (generated using the create_evm_vka command) Returns @@ -786,4 +705,3 @@ def verify_evm(addr_verifier:str,proof_path:str | os.PathLike | pathlib.Path,rpc bool """ ... - diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index 9f81f01c..00000000 --- a/jest.config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - }; \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index 0759ea55..00000000 --- a/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "ezkljs-tests", - "version": "0.1.0", - "author": "Ethan Cemer", - "private": true, - "scripts": { - "test": "jest" - }, - "devDependencies": { - "@ezkljs/engine": "^9.4.4", - "@ezkljs/verify": "^0.0.6", - "@jest/types": "^29.6.3", - "@types/file-saver": "^2.0.5", - "@types/jest": "^29.5.3", - "@types/json-bigint": "^1.0.1", - "@types/node": "20.4.5", - "buffer": "^6.0.3", - "env": "^0.0.2", - "fs": "0.0.1-security", - "jest": "^29.6.3", - "json-bigint": "^1.0.0", - "minimist": "^1.2.8", - "solc": "^0.8.21", - "ts-jest": "^29.1.1", - "ts-loader": "^9.4.4", - "ts-node": "^10.9.1", - "tsconfig-paths": "^4.2.0", - "typescript": "5.1.6" - } -} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 13ea5abc..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,3596 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - '@ezkljs/engine': - specifier: ^9.4.4 - version: 9.4.4 - '@ezkljs/verify': - specifier: ^0.0.6 - version: 0.0.6(buffer@6.0.3) - '@jest/types': - specifier: ^29.6.3 - version: 29.6.3 - '@types/file-saver': - specifier: ^2.0.5 - version: 2.0.5 - '@types/jest': - specifier: ^29.5.3 - version: 29.5.3 - '@types/json-bigint': - specifier: ^1.0.1 - version: 1.0.1 - '@types/node': - specifier: 20.4.5 - version: 20.4.5 - buffer: - specifier: ^6.0.3 - version: 6.0.3 - env: - specifier: ^0.0.2 - version: 0.0.2 - fs: - specifier: 0.0.1-security - version: 0.0.1-security - jest: - specifier: ^29.6.3 - version: 29.6.3(@types/node@20.4.5)(ts-node@10.9.1) - json-bigint: - specifier: ^1.0.0 - version: 1.0.0 - minimist: - specifier: ^1.2.8 - version: 1.2.8 - solc: - specifier: ^0.8.21 - version: 0.8.21 - ts-jest: - specifier: ^29.1.1 - version: 29.1.1(@babel/core@7.22.19)(@jest/types@29.6.3)(jest@29.6.3)(typescript@5.1.6) - ts-loader: - specifier: ^9.4.4 - version: 9.5.0(typescript@5.1.6)(webpack@5.88.2) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.4.5)(typescript@5.1.6) - tsconfig-paths: - specifier: ^4.2.0 - version: 4.2.0 - typescript: - specifier: 5.1.6 - version: 5.1.6 - -packages: - - /@adraffy/ens-normalize@1.9.2: - resolution: {integrity: sha512-0h+FrQDqe2Wn+IIGFkTCd4aAwTJ+7834Ek1COohCyV26AXhwQ7WQaz+4F/nLOeVl/3BtWHOHLPsq46V8YB46Eg==} - dev: true - - /@ampproject/remapping@2.2.1: - resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} - engines: {node: '>=6.0.0'} - dependencies: - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.19 - dev: true - - /@babel/code-frame@7.22.13: - resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/highlight': 7.22.13 - chalk: 2.4.2 - dev: true - - /@babel/compat-data@7.22.9: - resolution: {integrity: sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/core@7.22.19: - resolution: {integrity: sha512-Q8Yj5X4LHVYTbLCKVz0//2D2aDmHF4xzCdEttYvKOnWvErGsa6geHXD6w46x64n5tP69VfeH+IfSrdyH3MLhwA==} - engines: {node: '>=6.9.0'} - dependencies: - '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.22.13 - '@babel/generator': 7.22.15 - '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-module-transforms': 7.22.19(@babel/core@7.22.19) - '@babel/helpers': 7.22.15 - '@babel/parser': 7.22.16 - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.2 - '@babel/types': 7.22.19 - convert-source-map: 1.9.0 - debug: 4.3.4 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/generator@7.22.15: - resolution: {integrity: sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.19 - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.19 - jsesc: 2.5.2 - dev: true - - /@babel/generator@7.23.0: - resolution: {integrity: sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.0 - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.19 - jsesc: 2.5.2 - dev: true - - /@babel/helper-compilation-targets@7.22.15: - resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/compat-data': 7.22.9 - '@babel/helper-validator-option': 7.22.15 - browserslist: 4.21.10 - lru-cache: 5.1.1 - semver: 6.3.1 - dev: true - - /@babel/helper-environment-visitor@7.22.20: - resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-environment-visitor@7.22.5: - resolution: {integrity: sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-function-name@7.23.0: - resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.22.15 - '@babel/types': 7.23.0 - dev: true - - /@babel/helper-hoist-variables@7.22.5: - resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.0 - dev: true - - /@babel/helper-module-imports@7.22.15: - resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.19 - dev: true - - /@babel/helper-module-transforms@7.22.19(@babel/core@7.22.19): - resolution: {integrity: sha512-m6h1cJvn+OJ+R3jOHp30faq5xKJ7VbjwDj5RGgHuRlU9hrMeKsGC+JpihkR5w1g7IfseCPPtZ0r7/hB4UKaYlA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-environment-visitor': 7.22.5 - '@babel/helper-module-imports': 7.22.15 - '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.19 - dev: true - - /@babel/helper-plugin-utils@7.22.5: - resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-simple-access@7.22.5: - resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.19 - dev: true - - /@babel/helper-split-export-declaration@7.22.6: - resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.0 - dev: true - - /@babel/helper-string-parser@7.22.5: - resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-validator-identifier@7.22.19: - resolution: {integrity: sha512-Tinq7ybnEPFFXhlYOYFiSjespWQk0dq2dRNAiMdRTOYQzEGqnnNyrTxPYHP5r6wGjlF1rFgABdDV0g8EwD6Qbg==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-validator-identifier@7.22.20: - resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-validator-option@7.22.15: - resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helpers@7.22.15: - resolution: {integrity: sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.2 - '@babel/types': 7.22.19 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/highlight@7.22.13: - resolution: {integrity: sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-validator-identifier': 7.22.19 - chalk: 2.4.2 - js-tokens: 4.0.0 - dev: true - - /@babel/parser@7.22.16: - resolution: {integrity: sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.22.19 - dev: true - - /@babel/parser@7.23.0: - resolution: {integrity: sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.23.0 - dev: true - - /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.19): - resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.22.19): - resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.22.19): - resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.22.19): - resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.22.19): - resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.22.19): - resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.22.19): - resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.22.19): - resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.22.19): - resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.22.19): - resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.22.19): - resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.22.19): - resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.22.19): - resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.22.19): - resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.19 - '@babel/helper-plugin-utils': 7.22.5 - dev: true - - /@babel/template@7.22.15: - resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.22.13 - '@babel/parser': 7.23.0 - '@babel/types': 7.23.0 - dev: true - - /@babel/traverse@7.23.2: - resolution: {integrity: sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.22.13 - '@babel/generator': 7.23.0 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.23.0 - '@babel/types': 7.23.0 - debug: 4.3.4 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/types@7.22.19: - resolution: {integrity: sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.22.5 - '@babel/helper-validator-identifier': 7.22.19 - to-fast-properties: 2.0.0 - dev: true - - /@babel/types@7.23.0: - resolution: {integrity: sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.22.5 - '@babel/helper-validator-identifier': 7.22.20 - to-fast-properties: 2.0.0 - dev: true - - /@bcoe/v8-coverage@0.2.3: - resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - dev: true - - /@cspotcode/source-map-support@0.8.1: - resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/trace-mapping': 0.3.9 - dev: true - - /@ethereumjs/block@5.0.0(buffer@6.0.3): - resolution: {integrity: sha512-2HAe9BKRYStMG/WmJY7ePwmXGELrp0dirvXNUIFwb8+BU/QOTzuIO+XLlcJhuF+EWukOv8muKAyUvGLDdZHIKQ==} - engines: {node: '>=18'} - dependencies: - '@ethereumjs/common': 4.0.0(buffer@6.0.3) - '@ethereumjs/rlp': 5.0.0 - '@ethereumjs/trie': 6.0.0 - '@ethereumjs/tx': 5.0.0(buffer@6.0.3) - '@ethereumjs/util': 9.0.0 - ethereum-cryptography: 2.1.2 - transitivePeerDependencies: - - buffer - - c-kzg - dev: true - - /@ethereumjs/blockchain@7.0.0(buffer@6.0.3): - resolution: {integrity: sha512-ouyzn0YO6v5iKikNln97XEtQKgYL97TkQ06qnB9cR41iPR5BWr+lEF79mKYJeubpv39aKZnGji3hBDnjIRlgZA==} - engines: {node: '>=18'} - dependencies: - '@ethereumjs/block': 5.0.0(buffer@6.0.3) - '@ethereumjs/common': 4.0.0(buffer@6.0.3) - '@ethereumjs/ethash': 3.0.0(buffer@6.0.3) - '@ethereumjs/rlp': 5.0.0 - '@ethereumjs/trie': 6.0.0 - '@ethereumjs/tx': 5.0.0(buffer@6.0.3) - '@ethereumjs/util': 9.0.0 - debug: 4.3.4 - ethereum-cryptography: 2.1.2 - lru-cache: 10.0.1 - transitivePeerDependencies: - - buffer - - c-kzg - - supports-color - dev: true - - /@ethereumjs/common@4.0.0(buffer@6.0.3): - resolution: {integrity: sha512-eVa0/nC15mpotD8HOq6jB883SCWUkLjibr2jLPmPrx4FfmewXqFeh4drgR2sHjq3qWKxpCLK+5qsSJgtXwIzJQ==} - dependencies: - '@ethereumjs/util': 9.0.0 - crc: 4.3.2(buffer@6.0.3) - transitivePeerDependencies: - - buffer - - c-kzg - dev: true - - /@ethereumjs/ethash@3.0.0(buffer@6.0.3): - resolution: {integrity: sha512-FEk+Xze5zah3SHMNsN3ktHCFa3z0kMm6A78zTD6De1fY0RqL2omzXfEDBlBsNS6S/J2c8B42/QVf7EX6DtApbA==} - engines: {node: '>=18'} - dependencies: - '@ethereumjs/block': 5.0.0(buffer@6.0.3) - '@ethereumjs/rlp': 5.0.0 - '@ethereumjs/util': 9.0.0 - bigint-crypto-utils: 3.3.0 - ethereum-cryptography: 2.1.2 - transitivePeerDependencies: - - buffer - - c-kzg - dev: true - - /@ethereumjs/evm@2.0.0(buffer@6.0.3): - resolution: {integrity: sha512-BP/3qWGW8Z7zcQTtP1onlOmh3QbwW7SOHiSoEQkkMdy1TPjyOAV7HS3sHFG4dxgRLx5jiIIiz1Bf1eoDuBxfbQ==} - engines: {node: '>=18'} - dependencies: - '@ethereumjs/common': 4.0.0(buffer@6.0.3) - '@ethereumjs/statemanager': 2.0.0(buffer@6.0.3) - '@ethereumjs/tx': 5.0.0(buffer@6.0.3) - '@ethereumjs/util': 9.0.0 - debug: 4.3.4 - ethereum-cryptography: 2.1.2 - rustbn-wasm: 0.2.0 - transitivePeerDependencies: - - buffer - - bufferutil - - c-kzg - - supports-color - - utf-8-validate - dev: true - - /@ethereumjs/rlp@5.0.0: - resolution: {integrity: sha512-WuS1l7GJmB0n0HsXLozCoEFc9IwYgf3l0gCkKVYgR67puVF1O4OpEaN0hWmm1c+iHUHFCKt1hJrvy5toLg+6ag==} - engines: {node: '>=18'} - hasBin: true - dev: true - - /@ethereumjs/statemanager@2.0.0(buffer@6.0.3): - resolution: {integrity: sha512-dA70PTc3BaCPsVNSOXleR4jqUjVPrbZPlDPVssM4L2d15pl0wVnW3KyEsXwqmG6DqsiwD2JfZiFtDPOsNX0c3A==} - dependencies: - '@ethereumjs/common': 4.0.0(buffer@6.0.3) - '@ethereumjs/rlp': 5.0.0 - debug: 4.3.4 - ethereum-cryptography: 2.1.2 - ethers: 6.7.1 - js-sdsl: 4.4.2 - lru-cache: 10.0.1 - transitivePeerDependencies: - - buffer - - bufferutil - - c-kzg - - supports-color - - utf-8-validate - dev: true - - /@ethereumjs/trie@6.0.0: - resolution: {integrity: sha512-twcOoPwqBNHruMcaAL577J+uIiO0TqEIGfKou4ss+5Yx3y0KCYusvJ7ZTCWp3yYvrvcF9OkF55yjiWx0nVn6pg==} - engines: {node: '>=18'} - dependencies: - '@ethereumjs/rlp': 5.0.0 - '@ethereumjs/util': 9.0.0 - '@types/readable-stream': 2.3.15 - ethereum-cryptography: 2.1.2 - lru-cache: 10.0.1 - readable-stream: 3.6.2 - transitivePeerDependencies: - - c-kzg - dev: true - - /@ethereumjs/tx@5.0.0(buffer@6.0.3): - resolution: {integrity: sha512-bJBC/jHVIbwvZBVsK0Ls70NzxJ8Q3UvPwskG1LO6+ryVGKY0y1bhRreo0/gR3vTkuRjD+x5QTYV6fIY16tswJA==} - engines: {node: '>=18'} - peerDependencies: - c-kzg: ^2.1.0 - peerDependenciesMeta: - c-kzg: - optional: true - dependencies: - '@ethereumjs/common': 4.0.0(buffer@6.0.3) - '@ethereumjs/rlp': 5.0.0 - '@ethereumjs/util': 9.0.0 - ethereum-cryptography: 2.1.2 - transitivePeerDependencies: - - buffer - dev: true - - /@ethereumjs/util@9.0.0: - resolution: {integrity: sha512-V8062I+ZXfFxtFLp7xsPeiT1IxDaVOZaM78nGj1gsWUFeZ8SgADMLDKWehp+muTy1JRbVoXFljZ1qoyv9ji/2g==} - engines: {node: '>=18'} - peerDependencies: - c-kzg: ^2.1.0 - peerDependenciesMeta: - c-kzg: - optional: true - dependencies: - '@ethereumjs/rlp': 5.0.0 - ethereum-cryptography: 2.1.2 - dev: true - - /@ethereumjs/vm@7.0.0(buffer@6.0.3): - resolution: {integrity: sha512-3oQM5AQHUoFKIuJZ6w7wHVgu91i3ViTfOKtTDKRFjf7zGJNrrT6QzGFm5Jr6Seu3NuaEYcPJDvPPm6Wx/ACZKw==} - engines: {node: '>=18'} - dependencies: - '@ethereumjs/block': 5.0.0(buffer@6.0.3) - '@ethereumjs/blockchain': 7.0.0(buffer@6.0.3) - '@ethereumjs/common': 4.0.0(buffer@6.0.3) - '@ethereumjs/evm': 2.0.0(buffer@6.0.3) - '@ethereumjs/rlp': 5.0.0 - '@ethereumjs/statemanager': 2.0.0(buffer@6.0.3) - '@ethereumjs/trie': 6.0.0 - '@ethereumjs/tx': 5.0.0(buffer@6.0.3) - '@ethereumjs/util': 9.0.0 - debug: 4.3.4 - ethereum-cryptography: 2.1.2 - transitivePeerDependencies: - - buffer - - bufferutil - - c-kzg - - supports-color - - utf-8-validate - dev: true - - /@ethersproject/abi@5.7.0: - resolution: {integrity: sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==} - dependencies: - '@ethersproject/address': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/strings': 5.7.0 - dev: true - - /@ethersproject/abstract-provider@5.7.0: - resolution: {integrity: sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==} - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/networks': 5.7.1 - '@ethersproject/properties': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/web': 5.7.1 - dev: true - - /@ethersproject/abstract-signer@5.7.0: - resolution: {integrity: sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==} - dependencies: - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - dev: true - - /@ethersproject/address@5.7.0: - resolution: {integrity: sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==} - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/rlp': 5.7.0 - dev: true - - /@ethersproject/base64@5.7.0: - resolution: {integrity: sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==} - dependencies: - '@ethersproject/bytes': 5.7.0 - dev: true - - /@ethersproject/bignumber@5.7.0: - resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - bn.js: 5.2.1 - dev: true - - /@ethersproject/bytes@5.7.0: - resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} - dependencies: - '@ethersproject/logger': 5.7.0 - dev: true - - /@ethersproject/constants@5.7.0: - resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==} - dependencies: - '@ethersproject/bignumber': 5.7.0 - dev: true - - /@ethersproject/hash@5.7.0: - resolution: {integrity: sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==} - dependencies: - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/base64': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/strings': 5.7.0 - dev: true - - /@ethersproject/keccak256@5.7.0: - resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} - dependencies: - '@ethersproject/bytes': 5.7.0 - js-sha3: 0.8.0 - dev: true - - /@ethersproject/logger@5.7.0: - resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} - dev: true - - /@ethersproject/networks@5.7.1: - resolution: {integrity: sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==} - dependencies: - '@ethersproject/logger': 5.7.0 - dev: true - - /@ethersproject/properties@5.7.0: - resolution: {integrity: sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==} - dependencies: - '@ethersproject/logger': 5.7.0 - dev: true - - /@ethersproject/rlp@5.7.0: - resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==} - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - dev: true - - /@ethersproject/signing-key@5.7.0: - resolution: {integrity: sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==} - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - bn.js: 5.2.1 - elliptic: 6.5.4 - hash.js: 1.1.7 - dev: true - - /@ethersproject/strings@5.7.0: - resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/logger': 5.7.0 - dev: true - - /@ethersproject/transactions@5.7.0: - resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==} - dependencies: - '@ethersproject/address': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/rlp': 5.7.0 - '@ethersproject/signing-key': 5.7.0 - dev: true - - /@ethersproject/web@5.7.1: - resolution: {integrity: sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==} - dependencies: - '@ethersproject/base64': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/strings': 5.7.0 - dev: true - - /@ezkljs/engine@2.4.5: - resolution: {integrity: sha512-brUP3RvsRiyLbwLX01/Fi7+nMZohE2fPjWmUSTNfwJMBu+ENH0dYxoC9eBdzTVWBaiCo7N4lEfd1/XQYymwtnw==} - dependencies: - '@types/json-bigint': 1.0.1 - json-bigint: 1.0.0 - dev: true - - /@ezkljs/engine@9.4.4: - resolution: {integrity: sha512-kNsTmDQa8mIiQ6yjJmBMwVgAAxh4nfs4NCtnewJifonyA8Mfhs+teXwwW8WhERRDoQPUofKO2pT8BPvV/XGIDA==} - dependencies: - '@types/json-bigint': 1.0.1 - json-bigint: 1.0.0 - dev: true - - /@ezkljs/verify@0.0.6(buffer@6.0.3): - resolution: {integrity: sha512-9DHoEhLKl1DBGuUVseXLThuMyYceY08Zymr/OsLH0zbdA9OoISYhb77j4QPm4ANRKEm5dCi8oHDqkwGbFc2xFQ==} - dependencies: - '@ethereumjs/common': 4.0.0(buffer@6.0.3) - '@ethereumjs/evm': 2.0.0(buffer@6.0.3) - '@ethereumjs/statemanager': 2.0.0(buffer@6.0.3) - '@ethereumjs/tx': 5.0.0(buffer@6.0.3) - '@ethereumjs/util': 9.0.0 - '@ethereumjs/vm': 7.0.0(buffer@6.0.3) - '@ethersproject/abi': 5.7.0 - '@ezkljs/engine': 2.4.5 - ethers: 6.7.1 - json-bigint: 1.0.0 - transitivePeerDependencies: - - buffer - - bufferutil - - c-kzg - - supports-color - - utf-8-validate - dev: true - - /@istanbuljs/load-nyc-config@1.1.0: - resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} - engines: {node: '>=8'} - dependencies: - camelcase: 5.3.1 - find-up: 4.1.0 - get-package-type: 0.1.0 - js-yaml: 3.14.1 - resolve-from: 5.0.0 - dev: true - - /@istanbuljs/schema@0.1.3: - resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} - engines: {node: '>=8'} - dev: true - - /@jest/console@29.7.0: - resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - chalk: 4.1.2 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - slash: 3.0.0 - dev: true - - /@jest/core@29.7.0(ts-node@10.9.1): - resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - dependencies: - '@jest/console': 29.7.0 - '@jest/reporters': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - ci-info: 3.8.0 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.4.5)(ts-node@10.9.1) - jest-haste-map: 29.7.0 - jest-message-util: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-resolve-dependencies: 29.7.0 - jest-runner: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - jest-watcher: 29.7.0 - micromatch: 4.0.5 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - ts-node - dev: true - - /@jest/environment@29.7.0: - resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/fake-timers': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - jest-mock: 29.7.0 - dev: true - - /@jest/expect-utils@29.7.0: - resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - jest-get-type: 29.6.3 - dev: true - - /@jest/expect@29.7.0: - resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - expect: 29.7.0 - jest-snapshot: 29.7.0 - transitivePeerDependencies: - - supports-color - dev: true - - /@jest/fake-timers@29.7.0: - resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.6.3 - '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.4.5 - jest-message-util: 29.7.0 - jest-mock: 29.7.0 - jest-util: 29.7.0 - dev: true - - /@jest/globals@29.7.0: - resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/environment': 29.7.0 - '@jest/expect': 29.7.0 - '@jest/types': 29.6.3 - jest-mock: 29.7.0 - transitivePeerDependencies: - - supports-color - dev: true - - /@jest/reporters@29.7.0: - resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - dependencies: - '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.19 - '@types/node': 20.4.5 - chalk: 4.1.2 - collect-v8-coverage: 1.0.2 - exit: 0.1.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - istanbul-lib-coverage: 3.2.0 - istanbul-lib-instrument: 6.0.0 - istanbul-lib-report: 3.0.1 - istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.6 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - jest-worker: 29.7.0 - slash: 3.0.0 - string-length: 4.0.2 - strip-ansi: 6.0.1 - v8-to-istanbul: 9.1.0 - transitivePeerDependencies: - - supports-color - dev: true - - /@jest/schemas@29.6.3: - resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@sinclair/typebox': 0.27.8 - dev: true - - /@jest/source-map@29.6.3: - resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jridgewell/trace-mapping': 0.3.19 - callsites: 3.1.0 - graceful-fs: 4.2.11 - dev: true - - /@jest/test-result@29.7.0: - resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/console': 29.7.0 - '@jest/types': 29.6.3 - '@types/istanbul-lib-coverage': 2.0.4 - collect-v8-coverage: 1.0.2 - dev: true - - /@jest/test-sequencer@29.7.0: - resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/test-result': 29.7.0 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - slash: 3.0.0 - dev: true - - /@jest/transform@29.7.0: - resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@babel/core': 7.22.19 - '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.19 - babel-plugin-istanbul: 6.1.1 - chalk: 4.1.2 - convert-source-map: 2.0.0 - fast-json-stable-stringify: 2.1.0 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - jest-regex-util: 29.6.3 - jest-util: 29.7.0 - micromatch: 4.0.5 - pirates: 4.0.6 - slash: 3.0.0 - write-file-atomic: 4.0.2 - transitivePeerDependencies: - - supports-color - dev: true - - /@jest/types@29.6.3: - resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/schemas': 29.6.3 - '@types/istanbul-lib-coverage': 2.0.4 - '@types/istanbul-reports': 3.0.1 - '@types/node': 20.4.5 - '@types/yargs': 17.0.24 - chalk: 4.1.2 - dev: true - - /@jridgewell/gen-mapping@0.3.3: - resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} - engines: {node: '>=6.0.0'} - dependencies: - '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.19 - dev: true - - /@jridgewell/resolve-uri@3.1.1: - resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} - engines: {node: '>=6.0.0'} - dev: true - - /@jridgewell/set-array@1.1.2: - resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} - engines: {node: '>=6.0.0'} - dev: true - - /@jridgewell/source-map@0.3.5: - resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==} - dependencies: - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.19 - dev: true - - /@jridgewell/sourcemap-codec@1.4.15: - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - dev: true - - /@jridgewell/trace-mapping@0.3.19: - resolution: {integrity: sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==} - dependencies: - '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - - /@jridgewell/trace-mapping@0.3.9: - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - dependencies: - '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - - /@noble/curves@1.1.0: - resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==} - dependencies: - '@noble/hashes': 1.3.1 - dev: true - - /@noble/hashes@1.1.2: - resolution: {integrity: sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==} - dev: true - - /@noble/hashes@1.3.1: - resolution: {integrity: sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==} - engines: {node: '>= 16'} - dev: true - - /@noble/secp256k1@1.7.1: - resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} - dev: true - - /@scure/base@1.1.3: - resolution: {integrity: sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==} - dev: true - - /@scure/bip32@1.3.1: - resolution: {integrity: sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==} - dependencies: - '@noble/curves': 1.1.0 - '@noble/hashes': 1.3.1 - '@scure/base': 1.1.3 - dev: true - - /@scure/bip39@1.2.1: - resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} - dependencies: - '@noble/hashes': 1.3.1 - '@scure/base': 1.1.3 - dev: true - - /@sinclair/typebox@0.27.8: - resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} - dev: true - - /@sinonjs/commons@3.0.0: - resolution: {integrity: sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==} - dependencies: - type-detect: 4.0.8 - dev: true - - /@sinonjs/fake-timers@10.3.0: - resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} - dependencies: - '@sinonjs/commons': 3.0.0 - dev: true - - /@tsconfig/node10@1.0.9: - resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} - dev: true - - /@tsconfig/node12@1.0.11: - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} - dev: true - - /@tsconfig/node14@1.0.3: - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} - dev: true - - /@tsconfig/node16@1.0.4: - resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - dev: true - - /@types/babel__core@7.20.1: - resolution: {integrity: sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==} - dependencies: - '@babel/parser': 7.22.16 - '@babel/types': 7.22.19 - '@types/babel__generator': 7.6.4 - '@types/babel__template': 7.4.1 - '@types/babel__traverse': 7.20.1 - dev: true - - /@types/babel__generator@7.6.4: - resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} - dependencies: - '@babel/types': 7.22.19 - dev: true - - /@types/babel__template@7.4.1: - resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} - dependencies: - '@babel/parser': 7.22.16 - '@babel/types': 7.22.19 - dev: true - - /@types/babel__traverse@7.20.1: - resolution: {integrity: sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==} - dependencies: - '@babel/types': 7.22.19 - dev: true - - /@types/eslint-scope@3.7.5: - resolution: {integrity: sha512-JNvhIEyxVW6EoMIFIvj93ZOywYFatlpu9deeH6eSx6PE3WHYvHaQtmHmQeNw7aA81bYGBPPQqdtBm6b1SsQMmA==} - dependencies: - '@types/eslint': 8.44.3 - '@types/estree': 1.0.2 - dev: true - - /@types/eslint@8.44.3: - resolution: {integrity: sha512-iM/WfkwAhwmPff3wZuPLYiHX18HI24jU8k1ZSH7P8FHwxTjZ2P6CoX2wnF43oprR+YXJM6UUxATkNvyv/JHd+g==} - dependencies: - '@types/estree': 1.0.2 - '@types/json-schema': 7.0.13 - dev: true - - /@types/estree@1.0.2: - resolution: {integrity: sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==} - dev: true - - /@types/file-saver@2.0.5: - resolution: {integrity: sha512-zv9kNf3keYegP5oThGLaPk8E081DFDuwfqjtiTzm6PoxChdJ1raSuADf2YGCVIyrSynLrgc8JWv296s7Q7pQSQ==} - dev: true - - /@types/graceful-fs@4.1.6: - resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} - dependencies: - '@types/node': 20.4.5 - dev: true - - /@types/istanbul-lib-coverage@2.0.4: - resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} - dev: true - - /@types/istanbul-lib-report@3.0.0: - resolution: {integrity: sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==} - dependencies: - '@types/istanbul-lib-coverage': 2.0.4 - dev: true - - /@types/istanbul-reports@3.0.1: - resolution: {integrity: sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==} - dependencies: - '@types/istanbul-lib-report': 3.0.0 - dev: true - - /@types/jest@29.5.3: - resolution: {integrity: sha512-1Nq7YrO/vJE/FYnqYyw0FS8LdrjExSgIiHyKg7xPpn+yi8Q4huZryKnkJatN1ZRH89Kw2v33/8ZMB7DuZeSLlA==} - dependencies: - expect: 29.7.0 - pretty-format: 29.7.0 - dev: true - - /@types/json-bigint@1.0.1: - resolution: {integrity: sha512-zpchZLNsNuzJHi6v64UBoFWAvQlPhch7XAi36FkH6tL1bbbmimIF+cS7vwkzY4u5RaSWMoflQfu+TshMPPw8uw==} - dev: true - - /@types/json-schema@7.0.13: - resolution: {integrity: sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==} - dev: true - - /@types/node@18.15.13: - resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} - dev: true - - /@types/node@20.4.5: - resolution: {integrity: sha512-rt40Nk13II9JwQBdeYqmbn2Q6IVTA5uPhvSO+JVqdXw/6/4glI6oR9ezty/A9Hg5u7JH4OmYmuQ+XvjKm0Datg==} - dev: true - - /@types/readable-stream@2.3.15: - resolution: {integrity: sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==} - dependencies: - '@types/node': 20.4.5 - safe-buffer: 5.1.2 - dev: true - - /@types/stack-utils@2.0.1: - resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} - dev: true - - /@types/yargs-parser@21.0.0: - resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} - dev: true - - /@types/yargs@17.0.24: - resolution: {integrity: sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==} - dependencies: - '@types/yargs-parser': 21.0.0 - dev: true - - /@webassemblyjs/ast@1.11.6: - resolution: {integrity: sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==} - dependencies: - '@webassemblyjs/helper-numbers': 1.11.6 - '@webassemblyjs/helper-wasm-bytecode': 1.11.6 - dev: true - - /@webassemblyjs/floating-point-hex-parser@1.11.6: - resolution: {integrity: sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==} - dev: true - - /@webassemblyjs/helper-api-error@1.11.6: - resolution: {integrity: sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==} - dev: true - - /@webassemblyjs/helper-buffer@1.11.6: - resolution: {integrity: sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==} - dev: true - - /@webassemblyjs/helper-numbers@1.11.6: - resolution: {integrity: sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==} - dependencies: - '@webassemblyjs/floating-point-hex-parser': 1.11.6 - '@webassemblyjs/helper-api-error': 1.11.6 - '@xtuc/long': 4.2.2 - dev: true - - /@webassemblyjs/helper-wasm-bytecode@1.11.6: - resolution: {integrity: sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==} - dev: true - - /@webassemblyjs/helper-wasm-section@1.11.6: - resolution: {integrity: sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==} - dependencies: - '@webassemblyjs/ast': 1.11.6 - '@webassemblyjs/helper-buffer': 1.11.6 - '@webassemblyjs/helper-wasm-bytecode': 1.11.6 - '@webassemblyjs/wasm-gen': 1.11.6 - dev: true - - /@webassemblyjs/ieee754@1.11.6: - resolution: {integrity: sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==} - dependencies: - '@xtuc/ieee754': 1.2.0 - dev: true - - /@webassemblyjs/leb128@1.11.6: - resolution: {integrity: sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==} - dependencies: - '@xtuc/long': 4.2.2 - dev: true - - /@webassemblyjs/utf8@1.11.6: - resolution: {integrity: sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==} - dev: true - - /@webassemblyjs/wasm-edit@1.11.6: - resolution: {integrity: sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==} - dependencies: - '@webassemblyjs/ast': 1.11.6 - '@webassemblyjs/helper-buffer': 1.11.6 - '@webassemblyjs/helper-wasm-bytecode': 1.11.6 - '@webassemblyjs/helper-wasm-section': 1.11.6 - '@webassemblyjs/wasm-gen': 1.11.6 - '@webassemblyjs/wasm-opt': 1.11.6 - '@webassemblyjs/wasm-parser': 1.11.6 - '@webassemblyjs/wast-printer': 1.11.6 - dev: true - - /@webassemblyjs/wasm-gen@1.11.6: - resolution: {integrity: sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==} - dependencies: - '@webassemblyjs/ast': 1.11.6 - '@webassemblyjs/helper-wasm-bytecode': 1.11.6 - '@webassemblyjs/ieee754': 1.11.6 - '@webassemblyjs/leb128': 1.11.6 - '@webassemblyjs/utf8': 1.11.6 - dev: true - - /@webassemblyjs/wasm-opt@1.11.6: - resolution: {integrity: sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==} - dependencies: - '@webassemblyjs/ast': 1.11.6 - '@webassemblyjs/helper-buffer': 1.11.6 - '@webassemblyjs/wasm-gen': 1.11.6 - '@webassemblyjs/wasm-parser': 1.11.6 - dev: true - - /@webassemblyjs/wasm-parser@1.11.6: - resolution: {integrity: sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==} - dependencies: - '@webassemblyjs/ast': 1.11.6 - '@webassemblyjs/helper-api-error': 1.11.6 - '@webassemblyjs/helper-wasm-bytecode': 1.11.6 - '@webassemblyjs/ieee754': 1.11.6 - '@webassemblyjs/leb128': 1.11.6 - '@webassemblyjs/utf8': 1.11.6 - dev: true - - /@webassemblyjs/wast-printer@1.11.6: - resolution: {integrity: sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==} - dependencies: - '@webassemblyjs/ast': 1.11.6 - '@xtuc/long': 4.2.2 - dev: true - - /@xtuc/ieee754@1.2.0: - resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} - dev: true - - /@xtuc/long@4.2.2: - resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} - dev: true - - /acorn-import-assertions@1.9.0(acorn@8.10.0): - resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==} - peerDependencies: - acorn: ^8 - dependencies: - acorn: 8.10.0 - dev: true - - /acorn-walk@8.2.0: - resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} - engines: {node: '>=0.4.0'} - dev: true - - /acorn@8.10.0: - resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true - - /aes-js@4.0.0-beta.5: - resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} - dev: true - - /ajv-keywords@3.5.2(ajv@6.12.6): - resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==} - peerDependencies: - ajv: ^6.9.1 - dependencies: - ajv: 6.12.6 - dev: true - - /ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - dev: true - - /ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.21.3 - dev: true - - /ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - dev: true - - /ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} - dependencies: - color-convert: 1.9.3 - dev: true - - /ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - dependencies: - color-convert: 2.0.1 - dev: true - - /ansi-styles@5.2.0: - resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} - dev: true - - /anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - dev: true - - /arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - dev: true - - /argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - dependencies: - sprintf-js: 1.0.3 - dev: true - - /babel-jest@29.7.0(@babel/core@7.22.19): - resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@babel/core': ^7.8.0 - dependencies: - '@babel/core': 7.22.19 - '@jest/transform': 29.7.0 - '@types/babel__core': 7.20.1 - babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.6.3(@babel/core@7.22.19) - chalk: 4.1.2 - graceful-fs: 4.2.11 - slash: 3.0.0 - transitivePeerDependencies: - - supports-color - dev: true - - /babel-plugin-istanbul@6.1.1: - resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} - engines: {node: '>=8'} - dependencies: - '@babel/helper-plugin-utils': 7.22.5 - '@istanbuljs/load-nyc-config': 1.1.0 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-instrument: 5.2.1 - test-exclude: 6.0.0 - transitivePeerDependencies: - - supports-color - dev: true - - /babel-plugin-jest-hoist@29.6.3: - resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@babel/template': 7.22.15 - '@babel/types': 7.22.19 - '@types/babel__core': 7.20.1 - '@types/babel__traverse': 7.20.1 - dev: true - - /babel-preset-current-node-syntax@1.0.1(@babel/core@7.22.19): - resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.22.19 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.19) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.22.19) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.22.19) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.22.19) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.19) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.19) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.19) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.19) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.19) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.19) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.19) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.22.19) - dev: true - - /babel-preset-jest@29.6.3(@babel/core@7.22.19): - resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.22.19 - babel-plugin-jest-hoist: 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.19) - dev: true - - /balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - dev: true - - /base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - dev: true - - /bigint-crypto-utils@3.3.0: - resolution: {integrity: sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==} - engines: {node: '>=14.0.0'} - dev: true - - /bignumber.js@9.1.2: - resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} - dev: true - - /bn.js@4.12.0: - resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} - dev: true - - /bn.js@5.2.1: - resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} - dev: true - - /brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - dev: true - - /braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - dependencies: - fill-range: 7.0.1 - dev: true - - /brorand@1.1.0: - resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} - dev: true - - /browserslist@4.21.10: - resolution: {integrity: sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - dependencies: - caniuse-lite: 1.0.30001534 - electron-to-chromium: 1.4.520 - node-releases: 2.0.13 - update-browserslist-db: 1.0.11(browserslist@4.21.10) - dev: true - - /bs-logger@0.2.6: - resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} - engines: {node: '>= 6'} - dependencies: - fast-json-stable-stringify: 2.1.0 - dev: true - - /bser@2.1.1: - resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} - dependencies: - node-int64: 0.4.0 - dev: true - - /buffer-from@1.1.2: - resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - dev: true - - /buffer@6.0.3: - resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - dev: true - - /callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - dev: true - - /camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - dev: true - - /camelcase@6.3.0: - resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} - engines: {node: '>=10'} - dev: true - - /caniuse-lite@1.0.30001534: - resolution: {integrity: sha512-vlPVrhsCS7XaSh2VvWluIQEzVhefrUQcEsQWSS5A5V+dM07uv1qHeQzAOTGIMy9i3e9bH15+muvI/UHojVgS/Q==} - dev: true - - /chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - dev: true - - /chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - dev: true - - /char-regex@1.0.2: - resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} - engines: {node: '>=10'} - dev: true - - /chrome-trace-event@1.0.3: - resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==} - engines: {node: '>=6.0'} - dev: true - - /ci-info@3.8.0: - resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} - engines: {node: '>=8'} - dev: true - - /cjs-module-lexer@1.2.3: - resolution: {integrity: sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==} - dev: true - - /cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - dev: true - - /co@4.6.0: - resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} - engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - dev: true - - /collect-v8-coverage@1.0.2: - resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} - dev: true - - /color-convert@1.9.3: - resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} - dependencies: - color-name: 1.1.3 - dev: true - - /color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - dependencies: - color-name: 1.1.4 - dev: true - - /color-name@1.1.3: - resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - dev: true - - /color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - dev: true - - /command-exists@1.2.9: - resolution: {integrity: sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==} - dev: true - - /commander@2.20.3: - resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} - dev: true - - /commander@8.3.0: - resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} - engines: {node: '>= 12'} - dev: true - - /concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - dev: true - - /convert-source-map@1.9.0: - resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} - dev: true - - /convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - dev: true - - /crc@4.3.2(buffer@6.0.3): - resolution: {integrity: sha512-uGDHf4KLLh2zsHa8D8hIQ1H/HtFQhyHrc0uhHBcoKGol/Xnb+MPYfUMw7cvON6ze/GUESTudKayDcJC5HnJv1A==} - engines: {node: '>=12'} - peerDependencies: - buffer: '>=6.0.3' - peerDependenciesMeta: - buffer: - optional: true - dependencies: - buffer: 6.0.3 - dev: true - - /create-jest@29.7.0(@types/node@20.4.5)(ts-node@10.9.1): - resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.4.5)(ts-node@10.9.1) - jest-util: 29.7.0 - prompts: 2.4.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - dev: true - - /create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - dev: true - - /cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} - engines: {node: '>= 8'} - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - dev: true - - /debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: true - - /dedent@1.5.1: - resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} - peerDependencies: - babel-plugin-macros: ^3.1.0 - peerDependenciesMeta: - babel-plugin-macros: - optional: true - dev: true - - /deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} - dev: true - - /detect-newline@3.1.0: - resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} - engines: {node: '>=8'} - dev: true - - /diff-sequences@29.6.3: - resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dev: true - - /diff@4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} - dev: true - - /electron-to-chromium@1.4.520: - resolution: {integrity: sha512-Frfus2VpYADsrh1lB3v/ft/WVFlVzOIm+Q0p7U7VqHI6qr7NWHYKe+Wif3W50n7JAFoBsWVsoU0+qDks6WQ60g==} - dev: true - - /elliptic@6.5.4: - resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} - dependencies: - bn.js: 4.12.0 - brorand: 1.1.0 - hash.js: 1.1.7 - hmac-drbg: 1.0.1 - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - dev: true - - /emittery@0.13.1: - resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} - engines: {node: '>=12'} - dev: true - - /emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - dev: true - - /enhanced-resolve@5.15.0: - resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==} - engines: {node: '>=10.13.0'} - dependencies: - graceful-fs: 4.2.11 - tapable: 2.2.1 - dev: true - - /env@0.0.2: - resolution: {integrity: sha512-yP8LfjO4ughSHD/3HgLPinWzexmaOGvRfs2TFx0SZhOm7j1xPi9evjuGcLiNVHIGLmcsgMak4eDbBzlYqGIVxw==} - engines: {node: '>= 0.5.9'} - dev: true - - /error-ex@1.3.2: - resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - dependencies: - is-arrayish: 0.2.1 - dev: true - - /es-module-lexer@1.3.1: - resolution: {integrity: sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==} - dev: true - - /escalade@3.1.1: - resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} - engines: {node: '>=6'} - dev: true - - /escape-string-regexp@1.0.5: - resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} - engines: {node: '>=0.8.0'} - dev: true - - /escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - dev: true - - /eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - dev: true - - /esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - dev: true - - /esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - dependencies: - estraverse: 5.3.0 - dev: true - - /estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - dev: true - - /estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - dev: true - - /ethereum-cryptography@2.1.2: - resolution: {integrity: sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==} - dependencies: - '@noble/curves': 1.1.0 - '@noble/hashes': 1.3.1 - '@scure/bip32': 1.3.1 - '@scure/bip39': 1.2.1 - dev: true - - /ethers@6.7.1: - resolution: {integrity: sha512-qX5kxIFMfg1i+epfgb0xF4WM7IqapIIu50pOJ17aebkxxa4BacW5jFrQRmCJpDEg2ZK2oNtR5QjrQ1WDBF29dA==} - engines: {node: '>=14.0.0'} - dependencies: - '@adraffy/ens-normalize': 1.9.2 - '@noble/hashes': 1.1.2 - '@noble/secp256k1': 1.7.1 - '@types/node': 18.15.13 - aes-js: 4.0.0-beta.5 - tslib: 2.4.0 - ws: 8.5.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - dev: true - - /events@3.3.0: - resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} - engines: {node: '>=0.8.x'} - dev: true - - /execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 2.1.0 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - dev: true - - /exit@0.1.2: - resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} - engines: {node: '>= 0.8.0'} - dev: true - - /expect@29.7.0: - resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/expect-utils': 29.7.0 - jest-get-type: 29.6.3 - jest-matcher-utils: 29.7.0 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - dev: true - - /fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: true - - /fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - dev: true - - /fb-watchman@2.0.2: - resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} - dependencies: - bser: 2.1.1 - dev: true - - /fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - dependencies: - to-regex-range: 5.0.1 - dev: true - - /find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} - dependencies: - locate-path: 5.0.0 - path-exists: 4.0.0 - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - dev: true - - /fs@0.0.1-security: - resolution: {integrity: sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==} - dev: true - - /fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /function-bind@1.1.1: - resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: true - - /gensync@1.0.0-beta.2: - resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} - engines: {node: '>=6.9.0'} - dev: true - - /get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - dev: true - - /get-package-type@0.1.0: - resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} - engines: {node: '>=8.0.0'} - dev: true - - /get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} - dev: true - - /glob-to-regexp@0.4.1: - resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} - dev: true - - /glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - - /globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - dev: true - - /graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - dev: true - - /has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - dev: true - - /has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - dev: true - - /has@1.0.3: - resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} - engines: {node: '>= 0.4.0'} - dependencies: - function-bind: 1.1.1 - dev: true - - /hash.js@1.1.7: - resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} - dependencies: - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - dev: true - - /hmac-drbg@1.0.1: - resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} - dependencies: - hash.js: 1.1.7 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - dev: true - - /html-escaper@2.0.2: - resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - dev: true - - /human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - dev: true - - /ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - dev: true - - /import-local@3.1.0: - resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} - engines: {node: '>=8'} - hasBin: true - dependencies: - pkg-dir: 4.2.0 - resolve-cwd: 3.0.0 - dev: true - - /imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - dev: true - - /inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - dev: true - - /inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: true - - /is-arrayish@0.2.1: - resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - dev: true - - /is-core-module@2.13.0: - resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} - dependencies: - has: 1.0.3 - dev: true - - /is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - dev: true - - /is-generator-fn@2.1.0: - resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} - engines: {node: '>=6'} - dev: true - - /is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - dev: true - - /is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} - dev: true - - /isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: true - - /istanbul-lib-coverage@3.2.0: - resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} - engines: {node: '>=8'} - dev: true - - /istanbul-lib-instrument@5.2.1: - resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} - engines: {node: '>=8'} - dependencies: - '@babel/core': 7.22.19 - '@babel/parser': 7.22.16 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.0 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - dev: true - - /istanbul-lib-instrument@6.0.0: - resolution: {integrity: sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==} - engines: {node: '>=10'} - dependencies: - '@babel/core': 7.22.19 - '@babel/parser': 7.22.16 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.0 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - dev: true - - /istanbul-lib-report@3.0.1: - resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} - engines: {node: '>=10'} - dependencies: - istanbul-lib-coverage: 3.2.0 - make-dir: 4.0.0 - supports-color: 7.2.0 - dev: true - - /istanbul-lib-source-maps@4.0.1: - resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} - engines: {node: '>=10'} - dependencies: - debug: 4.3.4 - istanbul-lib-coverage: 3.2.0 - source-map: 0.6.1 - transitivePeerDependencies: - - supports-color - dev: true - - /istanbul-reports@3.1.6: - resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} - engines: {node: '>=8'} - dependencies: - html-escaper: 2.0.2 - istanbul-lib-report: 3.0.1 - dev: true - - /jest-changed-files@29.7.0: - resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - execa: 5.1.1 - jest-util: 29.7.0 - p-limit: 3.1.0 - dev: true - - /jest-circus@29.7.0: - resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/environment': 29.7.0 - '@jest/expect': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - chalk: 4.1.2 - co: 4.6.0 - dedent: 1.5.1 - is-generator-fn: 2.1.0 - jest-each: 29.7.0 - jest-matcher-utils: 29.7.0 - jest-message-util: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - p-limit: 3.1.0 - pretty-format: 29.7.0 - pure-rand: 6.0.3 - slash: 3.0.0 - stack-utils: 2.0.6 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - dev: true - - /jest-cli@29.7.0(@types/node@20.4.5)(ts-node@10.9.1): - resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - dependencies: - '@jest/core': 29.7.0(ts-node@10.9.1) - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.4.5)(ts-node@10.9.1) - exit: 0.1.2 - import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.4.5)(ts-node@10.9.1) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - dev: true - - /jest-config@29.7.0(@types/node@20.4.5)(ts-node@10.9.1): - resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true - dependencies: - '@babel/core': 7.22.19 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - babel-jest: 29.7.0(@babel/core@7.22.19) - chalk: 4.1.2 - ci-info: 3.8.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.7.0 - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.5 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - ts-node: 10.9.1(@types/node@20.4.5)(typescript@5.1.6) - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - dev: true - - /jest-diff@29.7.0: - resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - chalk: 4.1.2 - diff-sequences: 29.6.3 - jest-get-type: 29.6.3 - pretty-format: 29.7.0 - dev: true - - /jest-docblock@29.7.0: - resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - detect-newline: 3.1.0 - dev: true - - /jest-each@29.7.0: - resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - jest-get-type: 29.6.3 - jest-util: 29.7.0 - pretty-format: 29.7.0 - dev: true - - /jest-environment-node@29.7.0: - resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/environment': 29.7.0 - '@jest/fake-timers': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - jest-mock: 29.7.0 - jest-util: 29.7.0 - dev: true - - /jest-get-type@29.6.3: - resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dev: true - - /jest-haste-map@29.7.0: - resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.6.3 - '@types/graceful-fs': 4.1.6 - '@types/node': 20.4.5 - anymatch: 3.1.3 - fb-watchman: 2.0.2 - graceful-fs: 4.2.11 - jest-regex-util: 29.6.3 - jest-util: 29.7.0 - jest-worker: 29.7.0 - micromatch: 4.0.5 - walker: 1.0.8 - optionalDependencies: - fsevents: 2.3.3 - dev: true - - /jest-leak-detector@29.7.0: - resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - jest-get-type: 29.6.3 - pretty-format: 29.7.0 - dev: true - - /jest-matcher-utils@29.7.0: - resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - chalk: 4.1.2 - jest-diff: 29.7.0 - jest-get-type: 29.6.3 - pretty-format: 29.7.0 - dev: true - - /jest-message-util@29.7.0: - resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@babel/code-frame': 7.22.13 - '@jest/types': 29.6.3 - '@types/stack-utils': 2.0.1 - chalk: 4.1.2 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - pretty-format: 29.7.0 - slash: 3.0.0 - stack-utils: 2.0.6 - dev: true - - /jest-mock@29.7.0: - resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - jest-util: 29.7.0 - dev: true - - /jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): - resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} - engines: {node: '>=6'} - peerDependencies: - jest-resolve: '*' - peerDependenciesMeta: - jest-resolve: - optional: true - dependencies: - jest-resolve: 29.7.0 - dev: true - - /jest-regex-util@29.6.3: - resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dev: true - - /jest-resolve-dependencies@29.7.0: - resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - jest-regex-util: 29.6.3 - jest-snapshot: 29.7.0 - transitivePeerDependencies: - - supports-color - dev: true - - /jest-resolve@29.7.0: - resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - chalk: 4.1.2 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - jest-pnp-resolver: 1.2.3(jest-resolve@29.7.0) - jest-util: 29.7.0 - jest-validate: 29.7.0 - resolve: 1.22.5 - resolve.exports: 2.0.2 - slash: 3.0.0 - dev: true - - /jest-runner@29.7.0: - resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/console': 29.7.0 - '@jest/environment': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - chalk: 4.1.2 - emittery: 0.13.1 - graceful-fs: 4.2.11 - jest-docblock: 29.7.0 - jest-environment-node: 29.7.0 - jest-haste-map: 29.7.0 - jest-leak-detector: 29.7.0 - jest-message-util: 29.7.0 - jest-resolve: 29.7.0 - jest-runtime: 29.7.0 - jest-util: 29.7.0 - jest-watcher: 29.7.0 - jest-worker: 29.7.0 - p-limit: 3.1.0 - source-map-support: 0.5.13 - transitivePeerDependencies: - - supports-color - dev: true - - /jest-runtime@29.7.0: - resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/environment': 29.7.0 - '@jest/fake-timers': 29.7.0 - '@jest/globals': 29.7.0 - '@jest/source-map': 29.6.3 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - chalk: 4.1.2 - cjs-module-lexer: 1.2.3 - collect-v8-coverage: 1.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - jest-message-util: 29.7.0 - jest-mock: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - slash: 3.0.0 - strip-bom: 4.0.0 - transitivePeerDependencies: - - supports-color - dev: true - - /jest-snapshot@29.7.0: - resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@babel/core': 7.22.19 - '@babel/generator': 7.22.15 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.19) - '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.19) - '@babel/types': 7.22.19 - '@jest/expect-utils': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.19) - chalk: 4.1.2 - expect: 29.7.0 - graceful-fs: 4.2.11 - jest-diff: 29.7.0 - jest-get-type: 29.6.3 - jest-matcher-utils: 29.7.0 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - natural-compare: 1.4.0 - pretty-format: 29.7.0 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - dev: true - - /jest-util@29.7.0: - resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - chalk: 4.1.2 - ci-info: 3.8.0 - graceful-fs: 4.2.11 - picomatch: 2.3.1 - dev: true - - /jest-validate@29.7.0: - resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.6.3 - camelcase: 6.3.0 - chalk: 4.1.2 - jest-get-type: 29.6.3 - leven: 3.1.0 - pretty-format: 29.7.0 - dev: true - - /jest-watcher@29.7.0: - resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.4.5 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - emittery: 0.13.1 - jest-util: 29.7.0 - string-length: 4.0.2 - dev: true - - /jest-worker@27.5.1: - resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} - engines: {node: '>= 10.13.0'} - dependencies: - '@types/node': 20.4.5 - merge-stream: 2.0.0 - supports-color: 8.1.1 - dev: true - - /jest-worker@29.7.0: - resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@types/node': 20.4.5 - jest-util: 29.7.0 - merge-stream: 2.0.0 - supports-color: 8.1.1 - dev: true - - /jest@29.6.3(@types/node@20.4.5)(ts-node@10.9.1): - resolution: {integrity: sha512-alueLuoPCDNHFcFGmgETR4KpQ+0ff3qVaiJwxQM4B5sC0CvXcgg4PEi7xrDkxuItDmdz/FVc7SSit4KEu8GRvw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - dependencies: - '@jest/core': 29.7.0(ts-node@10.9.1) - '@jest/types': 29.6.3 - import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@20.4.5)(ts-node@10.9.1) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - dev: true - - /js-sdsl@4.4.2: - resolution: {integrity: sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==} - dev: true - - /js-sha3@0.8.0: - resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - dev: true - - /jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} - hasBin: true - dev: true - - /json-bigint@1.0.0: - resolution: {integrity: sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==} - dependencies: - bignumber.js: 9.1.2 - dev: true - - /json-parse-even-better-errors@2.3.1: - resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - dev: true - - /json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - dev: true - - /json5@2.2.3: - resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} - engines: {node: '>=6'} - hasBin: true - dev: true - - /kleur@3.0.3: - resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} - engines: {node: '>=6'} - dev: true - - /leven@3.1.0: - resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} - engines: {node: '>=6'} - dev: true - - /lines-and-columns@1.2.4: - resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - dev: true - - /loader-runner@4.3.0: - resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} - engines: {node: '>=6.11.5'} - dev: true - - /locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} - dependencies: - p-locate: 4.1.0 - dev: true - - /lodash.memoize@4.1.2: - resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} - dev: true - - /lru-cache@10.0.1: - resolution: {integrity: sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==} - engines: {node: 14 || >=16.14} - dev: true - - /lru-cache@5.1.1: - resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - dependencies: - yallist: 3.1.1 - dev: true - - /lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - dependencies: - yallist: 4.0.0 - dev: true - - /make-dir@4.0.0: - resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} - engines: {node: '>=10'} - dependencies: - semver: 7.5.4 - dev: true - - /make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - dev: true - - /makeerror@1.0.12: - resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} - dependencies: - tmpl: 1.0.5 - dev: true - - /memorystream@0.3.1: - resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} - engines: {node: '>= 0.10.0'} - dev: true - - /merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - dev: true - - /micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - dev: true - - /minimalistic-assert@1.0.1: - resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} - dev: true - - /minimalistic-crypto-utils@1.0.1: - resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} - dev: true - - /minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - dependencies: - brace-expansion: 1.1.11 - dev: true - - /minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - dev: true - - /ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: true - - /natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - dev: true - - /neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - dev: true - - /node-int64@0.4.0: - resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} - dev: true - - /node-releases@2.0.13: - resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} - dev: true - - /normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - dev: true - - /npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} - dependencies: - path-key: 3.1.1 - dev: true - - /once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - dependencies: - wrappy: 1.0.2 - dev: true - - /onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - dependencies: - mimic-fn: 2.1.0 - dev: true - - /os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - dev: true - - /p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} - dependencies: - p-try: 2.2.0 - dev: true - - /p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} - dependencies: - yocto-queue: 0.1.0 - dev: true - - /p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} - dependencies: - p-limit: 2.3.0 - dev: true - - /p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - dev: true - - /parse-json@5.2.0: - resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} - engines: {node: '>=8'} - dependencies: - '@babel/code-frame': 7.22.13 - error-ex: 1.3.2 - json-parse-even-better-errors: 2.3.1 - lines-and-columns: 1.2.4 - dev: true - - /path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - dev: true - - /path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - dev: true - - /path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - dev: true - - /path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - dev: true - - /pirates@4.0.6: - resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} - engines: {node: '>= 6'} - dev: true - - /pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} - dependencies: - find-up: 4.1.0 - dev: true - - /pretty-format@29.7.0: - resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/schemas': 29.6.3 - ansi-styles: 5.2.0 - react-is: 18.2.0 - dev: true - - /prompts@2.4.2: - resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} - engines: {node: '>= 6'} - dependencies: - kleur: 3.0.3 - sisteransi: 1.0.5 - dev: true - - /punycode@2.3.0: - resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} - engines: {node: '>=6'} - dev: true - - /pure-rand@6.0.3: - resolution: {integrity: sha512-KddyFewCsO0j3+np81IQ+SweXLDnDQTs5s67BOnrYmYe/yNmUhttQyGsYzy8yUnoljGAQ9sl38YB4vH8ur7Y+w==} - dev: true - - /randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - dependencies: - safe-buffer: 5.2.1 - dev: true - - /react-is@18.2.0: - resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} - dev: true - - /readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - dev: true - - /require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - dev: true - - /resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - dependencies: - resolve-from: 5.0.0 - dev: true - - /resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - dev: true - - /resolve.exports@2.0.2: - resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} - engines: {node: '>=10'} - dev: true - - /resolve@1.22.5: - resolution: {integrity: sha512-qWhv7PF1V95QPvRoUGHxOtnAlEvlXBylMZcjUR9pAumMmveFtcHJRXGIr+TkjfNJVQypqv2qcDiiars2y1PsSg==} - hasBin: true - dependencies: - is-core-module: 2.13.0 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - dev: true - - /rustbn-wasm@0.2.0: - resolution: {integrity: sha512-FThvYFNTqrEKGqXuseeg0zR7yROh/6U1617mCHF68OVqrN1tNKRN7Tdwy4WayPVsCmmK+eMxtIZX1qL6JxTkMg==} - dependencies: - '@scure/base': 1.1.3 - dev: true - - /safe-buffer@5.1.2: - resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - dev: true - - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: true - - /schema-utils@3.3.0: - resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} - engines: {node: '>= 10.13.0'} - dependencies: - '@types/json-schema': 7.0.13 - ajv: 6.12.6 - ajv-keywords: 3.5.2(ajv@6.12.6) - dev: true - - /semver@5.7.2: - resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} - hasBin: true - dev: true - - /semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - dev: true - - /semver@7.5.4: - resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - dev: true - - /serialize-javascript@6.0.1: - resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} - dependencies: - randombytes: 2.1.0 - dev: true - - /shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - dependencies: - shebang-regex: 3.0.0 - dev: true - - /shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - dev: true - - /signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - dev: true - - /sisteransi@1.0.5: - resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} - dev: true - - /slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - dev: true - - /solc@0.8.21: - resolution: {integrity: sha512-N55ogy2dkTRwiONbj4e6wMZqUNaLZkiRcjGyeafjLYzo/tf/IvhHY5P5wpe+H3Fubh9idu071i8eOGO31s1ylg==} - engines: {node: '>=10.0.0'} - hasBin: true - dependencies: - command-exists: 1.2.9 - commander: 8.3.0 - follow-redirects: 1.15.3 - js-sha3: 0.8.0 - memorystream: 0.3.1 - semver: 5.7.2 - tmp: 0.0.33 - transitivePeerDependencies: - - debug - dev: true - - /source-map-support@0.5.13: - resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} - dependencies: - buffer-from: 1.1.2 - source-map: 0.6.1 - dev: true - - /source-map-support@0.5.21: - resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} - dependencies: - buffer-from: 1.1.2 - source-map: 0.6.1 - dev: true - - /source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - dev: true - - /source-map@0.7.4: - resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} - engines: {node: '>= 8'} - dev: true - - /sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - dev: true - - /stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - dependencies: - escape-string-regexp: 2.0.0 - dev: true - - /string-length@4.0.2: - resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} - engines: {node: '>=10'} - dependencies: - char-regex: 1.0.2 - strip-ansi: 6.0.1 - dev: true - - /string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - dev: true - - /string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - dependencies: - safe-buffer: 5.2.1 - dev: true - - /strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - dependencies: - ansi-regex: 5.0.1 - dev: true - - /strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} - dev: true - - /strip-bom@4.0.0: - resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} - engines: {node: '>=8'} - dev: true - - /strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} - dev: true - - /strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - dev: true - - /supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} - dependencies: - has-flag: 3.0.0 - dev: true - - /supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - dependencies: - has-flag: 4.0.0 - dev: true - - /supports-color@8.1.1: - resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} - engines: {node: '>=10'} - dependencies: - has-flag: 4.0.0 - dev: true - - /supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - dev: true - - /tapable@2.2.1: - resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} - engines: {node: '>=6'} - dev: true - - /terser-webpack-plugin@5.3.9(webpack@5.88.2): - resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} - engines: {node: '>= 10.13.0'} - peerDependencies: - '@swc/core': '*' - esbuild: '*' - uglify-js: '*' - webpack: ^5.1.0 - peerDependenciesMeta: - '@swc/core': - optional: true - esbuild: - optional: true - uglify-js: - optional: true - dependencies: - '@jridgewell/trace-mapping': 0.3.19 - jest-worker: 27.5.1 - schema-utils: 3.3.0 - serialize-javascript: 6.0.1 - terser: 5.21.0 - webpack: 5.88.2 - dev: true - - /terser@5.21.0: - resolution: {integrity: sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==} - engines: {node: '>=10'} - hasBin: true - dependencies: - '@jridgewell/source-map': 0.3.5 - acorn: 8.10.0 - commander: 2.20.3 - source-map-support: 0.5.21 - dev: true - - /test-exclude@6.0.0: - resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} - engines: {node: '>=8'} - dependencies: - '@istanbuljs/schema': 0.1.3 - glob: 7.2.3 - minimatch: 3.1.2 - dev: true - - /tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - dependencies: - os-tmpdir: 1.0.2 - dev: true - - /tmpl@1.0.5: - resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} - dev: true - - /to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - dev: true - - /to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - dependencies: - is-number: 7.0.0 - dev: true - - /ts-jest@29.1.1(@babel/core@7.22.19)(@jest/types@29.6.3)(jest@29.6.3)(typescript@5.1.6): - resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - '@babel/core': '>=7.0.0-beta.0 <8' - '@jest/types': ^29.0.0 - babel-jest: ^29.0.0 - esbuild: '*' - jest: ^29.0.0 - typescript: '>=4.3 <6' - peerDependenciesMeta: - '@babel/core': - optional: true - '@jest/types': - optional: true - babel-jest: - optional: true - esbuild: - optional: true - dependencies: - '@babel/core': 7.22.19 - '@jest/types': 29.6.3 - bs-logger: 0.2.6 - fast-json-stable-stringify: 2.1.0 - jest: 29.6.3(@types/node@20.4.5)(ts-node@10.9.1) - jest-util: 29.7.0 - json5: 2.2.3 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.5.4 - typescript: 5.1.6 - yargs-parser: 21.1.1 - dev: true - - /ts-loader@9.5.0(typescript@5.1.6)(webpack@5.88.2): - resolution: {integrity: sha512-LLlB/pkB4q9mW2yLdFMnK3dEHbrBjeZTYguaaIfusyojBgAGf5kF+O6KcWqiGzWqHk0LBsoolrp4VftEURhybg==} - engines: {node: '>=12.0.0'} - peerDependencies: - typescript: '*' - webpack: ^5.0.0 - dependencies: - chalk: 4.1.2 - enhanced-resolve: 5.15.0 - micromatch: 4.0.5 - semver: 7.5.4 - source-map: 0.7.4 - typescript: 5.1.6 - webpack: 5.88.2 - dev: true - - /ts-node@10.9.1(@types/node@20.4.5)(typescript@5.1.6): - resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.9 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 20.4.5 - acorn: 8.10.0 - acorn-walk: 8.2.0 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.1.6 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: true - - /tsconfig-paths@4.2.0: - resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==} - engines: {node: '>=6'} - dependencies: - json5: 2.2.3 - minimist: 1.2.8 - strip-bom: 3.0.0 - dev: true - - /tslib@2.4.0: - resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} - dev: true - - /type-detect@4.0.8: - resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} - engines: {node: '>=4'} - dev: true - - /type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - dev: true - - /typescript@5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} - engines: {node: '>=14.17'} - hasBin: true - dev: true - - /update-browserslist-db@1.0.11(browserslist@4.21.10): - resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - dependencies: - browserslist: 4.21.10 - escalade: 3.1.1 - picocolors: 1.0.0 - dev: true - - /uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - dependencies: - punycode: 2.3.0 - dev: true - - /util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: true - - /v8-compile-cache-lib@3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - dev: true - - /v8-to-istanbul@9.1.0: - resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} - engines: {node: '>=10.12.0'} - dependencies: - '@jridgewell/trace-mapping': 0.3.19 - '@types/istanbul-lib-coverage': 2.0.4 - convert-source-map: 1.9.0 - dev: true - - /walker@1.0.8: - resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} - dependencies: - makeerror: 1.0.12 - dev: true - - /watchpack@2.4.0: - resolution: {integrity: sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==} - engines: {node: '>=10.13.0'} - dependencies: - glob-to-regexp: 0.4.1 - graceful-fs: 4.2.11 - dev: true - - /webpack-sources@3.2.3: - resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} - engines: {node: '>=10.13.0'} - dev: true - - /webpack@5.88.2: - resolution: {integrity: sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==} - engines: {node: '>=10.13.0'} - hasBin: true - peerDependencies: - webpack-cli: '*' - peerDependenciesMeta: - webpack-cli: - optional: true - dependencies: - '@types/eslint-scope': 3.7.5 - '@types/estree': 1.0.2 - '@webassemblyjs/ast': 1.11.6 - '@webassemblyjs/wasm-edit': 1.11.6 - '@webassemblyjs/wasm-parser': 1.11.6 - acorn: 8.10.0 - acorn-import-assertions: 1.9.0(acorn@8.10.0) - browserslist: 4.21.10 - chrome-trace-event: 1.0.3 - enhanced-resolve: 5.15.0 - es-module-lexer: 1.3.1 - eslint-scope: 5.1.1 - events: 3.3.0 - glob-to-regexp: 0.4.1 - graceful-fs: 4.2.11 - json-parse-even-better-errors: 2.3.1 - loader-runner: 4.3.0 - mime-types: 2.1.35 - neo-async: 2.6.2 - schema-utils: 3.3.0 - tapable: 2.2.1 - terser-webpack-plugin: 5.3.9(webpack@5.88.2) - watchpack: 2.4.0 - webpack-sources: 3.2.3 - transitivePeerDependencies: - - '@swc/core' - - esbuild - - uglify-js - dev: true - - /which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - dependencies: - isexe: 2.0.0 - dev: true - - /wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - dev: true - - /wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - dev: true - - /write-file-atomic@4.0.2: - resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - dependencies: - imurmurhash: 0.1.4 - signal-exit: 3.0.7 - dev: true - - /ws@8.5.0: - resolution: {integrity: sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: true - - /y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - dev: true - - /yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - dev: true - - /yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - dev: true - - /yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - dev: true - - /yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - dependencies: - cliui: 8.0.1 - escalade: 3.1.1 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - dev: true - - /yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} - dev: true - - /yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - dev: true diff --git a/src/bin/ios_gen_bindings.rs b/src/bin/ios_gen_bindings.rs deleted file mode 100644 index e1bdd6b8..00000000 --- a/src/bin/ios_gen_bindings.rs +++ /dev/null @@ -1,269 +0,0 @@ -use camino::Utf8Path; -use std::fs; -use std::fs::remove_dir_all; -use std::path::{Path, PathBuf}; -use std::process::Command; -use uniffi_bindgen::bindings::SwiftBindingGenerator; -use uniffi_bindgen::library_mode::generate_bindings; -use uuid::Uuid; - -fn main() { - let library_name = std::env::var("CARGO_PKG_NAME").expect("CARGO_PKG_NAME is not set"); - let mode = determine_build_mode(); - build_bindings(&library_name, mode); -} - -/// Determines the build mode based on the CONFIGURATION environment variable. -/// Defaults to "release" if not set or unrecognized. -/// "release" mode takes longer to build but produces optimized code, which has smaller size and is faster. -fn determine_build_mode() -> &'static str { - match std::env::var("CONFIGURATION").map(|s| s.to_lowercase()) { - Ok(ref config) if config == "debug" => "debug", - _ => "release", - } -} - -/// Builds the Swift bindings and XCFramework for the specified library and build mode. -fn build_bindings(library_name: &str, mode: &str) { - // Get the root directory of this Cargo project - let manifest_dir = std::env::var_os("CARGO_MANIFEST_DIR") - .map(PathBuf::from) - .unwrap_or_else(|| std::env::current_dir().unwrap()); - - // Define the build directory inside the manifest directory - let build_dir = manifest_dir.join("build"); - - // Create a temporary directory to store the bindings and combined library - let tmp_dir = mktemp_local(&build_dir); - - // Define directories for Swift bindings and output bindings - let swift_bindings_dir = tmp_dir.join("SwiftBindings"); - let bindings_out = create_bindings_out_dir(&tmp_dir); - let framework_out = bindings_out.join("EzklCore.xcframework"); - - // Define target architectures for building - // We currently only support iOS devices and simulators running on ARM Macs - // This is due to limiting the library size to under 100MB for GitHub Commit Size Limit - // To support older Macs (Intel), follow the instructions in the comments below - #[allow(clippy::useless_vec)] - let target_archs = vec![ - vec!["aarch64-apple-ios"], // iOS device - vec!["aarch64-apple-ios-sim"], // iOS simulator ARM Mac - // vec!["aarch64-apple-ios-sim", "x86_64-apple-ios"], // TODO - replace the above line with this line to allow running on older Macs (Intel) - ]; - - // Build the library for each architecture and combine them - let out_lib_paths: Vec = target_archs - .iter() - .map(|archs| build_combined_archs(library_name, archs, &build_dir, mode)) - .collect(); - - // Generate the path to the built dynamic library (.dylib) - let out_dylib_path = build_dir.join(format!( - "{}/{}/lib{}.dylib", - target_archs[0][0], mode, library_name - )); - - // Generate Swift bindings using uniffi_bindgen - generate_ios_bindings(&out_dylib_path, &swift_bindings_dir) - .expect("Failed to generate iOS bindings"); - - // Move the generated Swift file to the bindings output directory - fs::rename( - swift_bindings_dir.join(format!("{}.swift", library_name)), - bindings_out.join("EzklCore.swift"), - ) - .expect("Failed to copy swift bindings file"); - - // Rename the `ios_ezklFFI.modulemap` file to `module.modulemap` - fs::rename( - swift_bindings_dir.join(format!("{}FFI.modulemap", library_name)), - swift_bindings_dir.join("module.modulemap"), - ) - .expect("Failed to rename modulemap file"); - - // Create the XCFramework from the combined libraries and Swift bindings - create_xcframework(&out_lib_paths, &swift_bindings_dir, &framework_out); - - // Define the destination directory for the bindings - let bindings_dest = build_dir.join("EzklCoreBindings"); - if bindings_dest.exists() { - fs::remove_dir_all(&bindings_dest).expect("Failed to remove existing bindings directory"); - } - - // Move the bindings output to the destination directory - fs::rename(&bindings_out, &bindings_dest).expect("Failed to move framework into place"); - - // Clean up temporary directories - cleanup_temp_dirs(&build_dir); -} - -/// Creates the output directory for the bindings. -/// Returns the path to the bindings output directory. -fn create_bindings_out_dir(base_dir: &Path) -> PathBuf { - let bindings_out = base_dir.join("EzklCoreBindings"); - fs::create_dir_all(&bindings_out).expect("Failed to create bindings output directory"); - bindings_out -} - -/// Builds the library for each architecture and combines them into a single library using lipo. -/// Returns the path to the combined library. -fn build_combined_archs( - library_name: &str, - archs: &[&str], - build_dir: &Path, - mode: &str, -) -> PathBuf { - // Build the library for each architecture - let out_lib_paths: Vec = archs - .iter() - .map(|&arch| { - build_for_arch(arch, build_dir, mode); - build_dir - .join(arch) - .join(mode) - .join(format!("lib{}.a", library_name)) - }) - .collect(); - - // Create a unique temporary directory for the combined library - let lib_out = mktemp_local(build_dir).join(format!("lib{}.a", library_name)); - - // Combine the libraries using lipo - let mut lipo_cmd = Command::new("lipo"); - lipo_cmd - .arg("-create") - .arg("-output") - .arg(lib_out.to_str().unwrap()); - for lib_path in &out_lib_paths { - lipo_cmd.arg(lib_path.to_str().unwrap()); - } - - let status = lipo_cmd.status().expect("Failed to run lipo command"); - if !status.success() { - panic!("lipo command failed with status: {}", status); - } - - lib_out -} - -/// Builds the library for a specific architecture. -fn build_for_arch(arch: &str, build_dir: &Path, mode: &str) { - // Ensure the target architecture is installed - install_arch(arch); - - // Run cargo build for the specified architecture and mode - let mut build_cmd = Command::new("cargo"); - build_cmd - .arg("build") - .arg("--no-default-features") - .arg("--features") - .arg("ios-bindings"); - - if mode == "release" { - build_cmd.arg("--release"); - } - build_cmd - .arg("--lib") - .env("CARGO_BUILD_TARGET_DIR", build_dir) - .env("CARGO_BUILD_TARGET", arch); - - let status = build_cmd.status().expect("Failed to run cargo build"); - if !status.success() { - panic!("cargo build failed for architecture: {}", arch); - } -} - -/// Installs the specified target architecture using rustup. -fn install_arch(arch: &str) { - let status = Command::new("rustup") - .arg("target") - .arg("add") - .arg(arch) - .status() - .expect("Failed to run rustup command"); - - if !status.success() { - panic!("Failed to install target architecture: {}", arch); - } -} - -/// Generates Swift bindings for the iOS library using uniffi_bindgen. -fn generate_ios_bindings(dylib_path: &Path, binding_dir: &Path) -> Result<(), std::io::Error> { - // Remove existing binding directory if it exists - if binding_dir.exists() { - remove_dir_all(binding_dir)?; - } - - // Generate the Swift bindings using uniffi_bindgen - generate_bindings( - Utf8Path::from_path(dylib_path).ok_or_else(|| { - std::io::Error::new(std::io::ErrorKind::InvalidInput, "Invalid dylib path") - })?, - None, - &SwiftBindingGenerator, - None, - Utf8Path::from_path(binding_dir).ok_or_else(|| { - std::io::Error::new( - std::io::ErrorKind::InvalidInput, - "Invalid Swift bindings directory", - ) - })?, - true, - ) - .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?; - - Ok(()) -} - -/// Creates an XCFramework from the combined libraries and Swift bindings. -fn create_xcframework(lib_paths: &[PathBuf], swift_bindings_dir: &Path, framework_out: &Path) { - let mut xcbuild_cmd = Command::new("xcodebuild"); - xcbuild_cmd.arg("-create-xcframework"); - - // Add each library and its corresponding headers to the xcodebuild command - for lib_path in lib_paths { - println!("Including library: {:?}", lib_path); - xcbuild_cmd.arg("-library"); - xcbuild_cmd.arg(lib_path.to_str().unwrap()); - xcbuild_cmd.arg("-headers"); - xcbuild_cmd.arg(swift_bindings_dir.to_str().unwrap()); - } - - xcbuild_cmd.arg("-output"); - xcbuild_cmd.arg(framework_out.to_str().unwrap()); - - let status = xcbuild_cmd.status().expect("Failed to run xcodebuild"); - if !status.success() { - panic!("xcodebuild failed with status: {}", status); - } -} - -/// Creates a temporary directory inside the build path with a unique UUID. -/// This ensures unique build artifacts for concurrent builds. -fn mktemp_local(build_path: &Path) -> PathBuf { - let dir = tmp_local(build_path).join(Uuid::new_v4().to_string()); - fs::create_dir(&dir).expect("Failed to create temporary directory"); - dir -} - -/// Gets the path to the local temporary directory inside the build path. -fn tmp_local(build_path: &Path) -> PathBuf { - let tmp_path = build_path.join("tmp"); - if let Ok(metadata) = fs::metadata(&tmp_path) { - if !metadata.is_dir() { - panic!("Expected 'tmp' to be a directory"); - } - } else { - fs::create_dir_all(&tmp_path).expect("Failed to create local temporary directory"); - } - tmp_path -} - -/// Cleans up temporary directories inside the build path. -fn cleanup_temp_dirs(build_dir: &Path) { - let tmp_dir = build_dir.join("tmp"); - if tmp_dir.exists() { - fs::remove_dir_all(tmp_dir).expect("Failed to remove temporary directories"); - } -} diff --git a/src/bindings/mod.rs b/src/bindings/mod.rs index ea914ba7..93f0c38d 100644 --- a/src/bindings/mod.rs +++ b/src/bindings/mod.rs @@ -1,12 +1,3 @@ /// Python bindings #[cfg(feature = "python-bindings")] pub mod python; -/// Universal bindings for all platforms -#[cfg(any( - feature = "universal-bindings", - all(target_arch = "wasm32", target_os = "unknown") -))] -pub mod universal; -/// wasm prover and verifier -#[cfg(all(target_arch = "wasm32", target_os = "unknown"))] -pub mod wasm; diff --git a/src/bindings/python.rs b/src/bindings/python.rs index 0683df19..1e120319 100644 --- a/src/bindings/python.rs +++ b/src/bindings/python.rs @@ -12,10 +12,8 @@ use crate::graph::TestDataSource; use crate::graph::{ quantize_float, scale_to_multiplier, GraphCircuit, GraphSettings, Model, Visibility, }; -use crate::pfsys::evm::aggregation_kzg::AggregationCircuit; use crate::pfsys::{ load_pk, load_vk, save_params, save_vk, srs::gen_srs as ezkl_gen_srs, srs::load_srs_prover, - ProofType, TranscriptType, }; use crate::Commitments; use crate::RunArgs; @@ -765,37 +763,6 @@ fn gen_vk_from_pk_single( Ok(true) } -/// Generates a vk from a pk for an aggregate circuit and saves it to a file -/// -/// Arguments -/// ------- -/// path_to_pk: str -/// Path to the proving key -/// -/// vk_output_path: str -/// Path to create the vk file -/// -/// Returns -/// ------- -/// bool -#[pyfunction(signature = ( - path_to_pk=PathBuf::from(DEFAULT_PK_AGGREGATED), - vk_output_path=PathBuf::from(DEFAULT_VK_AGGREGATED), -))] -#[gen_stub_pyfunction] -fn gen_vk_from_pk_aggr(path_to_pk: PathBuf, vk_output_path: PathBuf) -> PyResult { - let pk = load_pk::, AggregationCircuit>(path_to_pk, ()) - .map_err(|_| PyIOError::new_err("Failed to load pk"))?; - - let vk = pk.get_vk(); - - // now save - save_vk::(&vk_output_path, vk) - .map_err(|_| PyIOError::new_err("Failed to save vk"))?; - - Ok(true) -} - /// Displays the table as a string in python /// /// Arguments @@ -1120,42 +1087,6 @@ fn mock(witness: PathBuf, model: PathBuf) -> PyResult { Ok(true) } -/// Mocks the aggregate prover -/// -/// Arguments -/// --------- -/// aggregation_snarks: list[str] -/// List of paths to the relevant proof files -/// -/// logrows: int -/// Number of logrows to use for the aggregation circuit -/// -/// split_proofs: bool -/// Indicates whether the accumulated are segments of a larger proof -/// -/// Returns -/// ------- -/// bool -/// -#[pyfunction(signature = ( - aggregation_snarks=vec![PathBuf::from(DEFAULT_PROOF)], - logrows=DEFAULT_AGGREGATED_LOGROWS.parse().unwrap(), - split_proofs = false, -))] -#[gen_stub_pyfunction] -fn mock_aggregate( - aggregation_snarks: Vec, - logrows: u32, - split_proofs: bool, -) -> PyResult { - crate::execute::mock_aggregate(aggregation_snarks, logrows, split_proofs).map_err(|e| { - let err_str = format!("Failed to run mock: {}", e); - PyRuntimeError::new_err(err_str) - })?; - - Ok(true) -} - /// Runs the setup process /// /// Arguments @@ -1231,8 +1162,6 @@ fn setup( /// proof_path: str /// Path to create the proof file /// -/// proof_type: str -/// Accepts `single`, `for-aggr` /// /// srs_path: str /// Path to the SRS file @@ -1246,7 +1175,6 @@ fn setup( model=PathBuf::from(DEFAULT_COMPILED_CIRCUIT), pk_path=PathBuf::from(DEFAULT_PK), proof_path=None, - proof_type=ProofType::default(), srs_path=None, ))] #[gen_stub_pyfunction] @@ -1255,7 +1183,6 @@ fn prove( model: PathBuf, pk_path: PathBuf, proof_path: Option, - proof_type: ProofType, srs_path: Option, ) -> PyResult { let snark = crate::execute::prove( @@ -1264,7 +1191,6 @@ fn prove( pk_path, proof_path, srs_path, - proof_type, CheckMode::UNSAFE, ) .map_err(|e| { @@ -1323,77 +1249,6 @@ fn verify( Ok(true) } -/// Runs the setup process for an aggregate setup -/// -/// Arguments -/// --------- -/// sample_snarks: list[str] -/// List of paths to the various proofs -/// -/// vk_path: str -/// Path to create the aggregated VK -/// -/// pk_path: str -/// Path to create the aggregated PK -/// -/// logrows: int -/// Number of logrows to use -/// -/// split_proofs: bool -/// Whether the accumulated are segments of a larger proof -/// -/// srs_path: str -/// Path to the SRS file -/// -/// disable_selector_compression: bool -/// Whether to compress selectors -/// -/// commitment: str -/// Accepts `kzg`, `ipa` -/// -/// Returns -/// ------- -/// bool -/// -#[pyfunction(signature = ( - sample_snarks=vec![PathBuf::from(DEFAULT_PROOF)], - vk_path=PathBuf::from(DEFAULT_VK_AGGREGATED), - pk_path=PathBuf::from(DEFAULT_PK_AGGREGATED), - logrows=DEFAULT_AGGREGATED_LOGROWS.parse().unwrap(), - split_proofs = false, - srs_path = None, - disable_selector_compression=DEFAULT_DISABLE_SELECTOR_COMPRESSION.parse().unwrap(), - commitment=DEFAULT_COMMITMENT.parse().unwrap(), -))] -#[gen_stub_pyfunction] -fn setup_aggregate( - sample_snarks: Vec, - vk_path: PathBuf, - pk_path: PathBuf, - logrows: u32, - split_proofs: bool, - srs_path: Option, - disable_selector_compression: bool, - commitment: PyCommitments, -) -> Result { - crate::execute::setup_aggregate( - sample_snarks, - vk_path, - pk_path, - srs_path, - logrows, - split_proofs, - disable_selector_compression, - commitment.into(), - ) - .map_err(|e| { - let err_str = format!("Failed to setup aggregate: {}", e); - PyRuntimeError::new_err(err_str) - })?; - - Ok(true) -} - /// Compiles the circuit for use in other steps /// /// Arguments @@ -1423,144 +1278,7 @@ fn compile_circuit( settings_path: PathBuf, ) -> Result { crate::execute::compile_circuit(model, compiled_circuit, settings_path).map_err(|e| { - let err_str = format!("Failed to setup aggregate: {}", e); - PyRuntimeError::new_err(err_str) - })?; - - Ok(true) -} - -/// Creates an aggregated proof -/// -/// Arguments -/// --------- -/// aggregation_snarks: list[str] -/// List of paths to the various proofs -/// -/// proof_path: str -/// Path to output the aggregated proof -/// -/// vk_path: str -/// Path to the VK file -/// -/// transcript: -/// Proof transcript type to be used. `evm` used by default. `poseidon` is also supported -/// -/// logrows: -/// Logrows used for aggregation circuit -/// -/// check_mode: str -/// Run sanity checks during calculations. Accepts `safe` or `unsafe` -/// -/// split-proofs: bool -/// Whether the accumulated proofs are segments of a larger circuit -/// -/// srs_path: str -/// Path to the SRS used -/// -/// commitment: str -/// Accepts "kzg" or "ipa" -/// -/// Returns -/// ------- -/// bool -/// -#[pyfunction(signature = ( - aggregation_snarks=vec![PathBuf::from(DEFAULT_PROOF)], - proof_path=PathBuf::from(DEFAULT_PROOF_AGGREGATED), - vk_path=PathBuf::from(DEFAULT_VK_AGGREGATED), - transcript=TranscriptType::default(), - logrows=DEFAULT_AGGREGATED_LOGROWS.parse().unwrap(), - check_mode=CheckMode::UNSAFE, - split_proofs = false, - srs_path=None, - commitment=DEFAULT_COMMITMENT.parse().unwrap(), -))] -#[gen_stub_pyfunction] -fn aggregate( - aggregation_snarks: Vec, - proof_path: PathBuf, - vk_path: PathBuf, - transcript: TranscriptType, - logrows: u32, - check_mode: CheckMode, - split_proofs: bool, - srs_path: Option, - commitment: PyCommitments, -) -> Result { - // the K used for the aggregation circuit - crate::execute::aggregate( - proof_path, - aggregation_snarks, - vk_path, - srs_path, - transcript, - logrows, - check_mode, - split_proofs, - commitment.into(), - ) - .map_err(|e| { - let err_str = format!("Failed to run aggregate: {}", e); - PyRuntimeError::new_err(err_str) - })?; - - Ok(true) -} - -/// Verifies and aggregate proof -/// -/// Arguments -/// --------- -/// proof_path: str -/// The path to the proof file -/// -/// vk_path: str -/// The path to the verification key file -/// -/// logrows: int -/// logrows used for aggregation circuit -/// -/// commitment: str -/// Accepts "kzg" or "ipa" -/// -/// reduced_srs: bool -/// Whether to reduce the number of SRS logrows to the number of instances rather than the number of logrows used for proofs (only works if the srs were generated in the same ceremony) -/// -/// srs_path: str -/// The path to the SRS file -/// -/// Returns -/// ------- -/// bool -/// -#[pyfunction(signature = ( - proof_path=PathBuf::from(DEFAULT_PROOF_AGGREGATED), - vk_path=PathBuf::from(DEFAULT_VK), - logrows=DEFAULT_AGGREGATED_LOGROWS.parse().unwrap(), - commitment=DEFAULT_COMMITMENT.parse().unwrap(), - reduced_srs=DEFAULT_USE_REDUCED_SRS_FOR_VERIFICATION.parse().unwrap(), - srs_path=None, -))] -#[gen_stub_pyfunction] -fn verify_aggr( - proof_path: PathBuf, - vk_path: PathBuf, - logrows: u32, - commitment: PyCommitments, - reduced_srs: bool, - srs_path: Option, -) -> Result { - crate::execute::verify_aggr( - proof_path, - vk_path, - srs_path, - logrows, - reduced_srs, - commitment.into(), - ) - .map_err(|e| { - let err_str = format!("Failed to run verify_aggr: {}", e); + let err_str = format!("Failed to compile circuit: {}", e); PyRuntimeError::new_err(err_str) })?; @@ -1667,7 +1385,7 @@ fn create_evm_verifier( #[cfg(feature = "reusable-verifier")] /// Creates an Evm VK artifact. This command generated a VK with circuit specific meta data encoding in memory for use by the reusable H2 verifier. -/// This is useful for deploying verifier that were otherwise too big to fit on chain and required aggregation. +/// This is useful for deploying verifier that were otherwise too big to fit on chain . /// /// Arguments /// --------- @@ -1873,75 +1591,6 @@ fn verify_evm<'a>( }) } -/// Creates an evm compatible aggregate verifier, you will need solc installed in your environment to run this -/// -/// Arguments -/// --------- -/// aggregation_settings: str -/// path to the settings file -/// -/// vk_path: str -/// The path to load the desired verification key file -/// -/// sol_code_path: str -/// The path to the Solidity code -/// -/// abi_path: str -/// The path to output the Solidity verifier ABI -/// -/// logrows: int -/// Number of logrows used during aggregated setup -/// -/// srs_path: str -/// The path to the SRS file -/// -/// reusable: bool -/// Whether the verifier should be rendered as a reusable contract. If so, then you will need to deploy the VK artifact separately which you can generate using the create_evm_vka command -/// -/// Returns -/// ------- -/// bool -/// -#[pyfunction(signature = ( - aggregation_settings=vec![PathBuf::from(DEFAULT_PROOF)], - vk_path=PathBuf::from(DEFAULT_VK_AGGREGATED), - sol_code_path=PathBuf::from(DEFAULT_SOL_CODE), - abi_path=PathBuf::from(DEFAULT_VERIFIER_ABI), - logrows=DEFAULT_AGGREGATED_LOGROWS.parse().unwrap(), - srs_path=None, - reusable = DEFAULT_RENDER_REUSABLE.parse().unwrap(), -))] -#[gen_stub_pyfunction] -fn create_evm_verifier_aggr( - py: Python<'_>, - aggregation_settings: Vec, - vk_path: PathBuf, - sol_code_path: PathBuf, - abi_path: PathBuf, - logrows: u32, - srs_path: Option, - reusable: bool, -) -> PyResult> { - pyo3_async_runtimes::tokio::future_into_py(py, async move { - crate::execute::create_evm_aggregate_verifier( - vk_path, - srs_path, - sol_code_path, - abi_path, - aggregation_settings, - logrows, - reusable, - ) - .await - .map_err(|e| { - let err_str = format!("Failed to run create_evm_verifier_aggr: {}", e); - PyRuntimeError::new_err(err_str) - })?; - - Ok(true) - }) -} - // Define a function to gather stub information. define_stub_info_gatherer!(stub_info); @@ -1965,7 +1614,6 @@ fn ezkl(m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_function(wrap_pyfunction!(poseidon_hash, m)?)?; m.add_function(wrap_pyfunction!(float_to_felt, m)?)?; m.add_function(wrap_pyfunction!(buffer_to_felts, m)?)?; - m.add_function(wrap_pyfunction!(gen_vk_from_pk_aggr, m)?)?; m.add_function(wrap_pyfunction!(gen_vk_from_pk_single, m)?)?; m.add_function(wrap_pyfunction!(table, m)?)?; m.add_function(wrap_pyfunction!(mock, m)?)?; @@ -1978,17 +1626,12 @@ fn ezkl(m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_function(wrap_pyfunction!(gen_settings, m)?)?; m.add_function(wrap_pyfunction!(gen_random_data, m)?)?; m.add_function(wrap_pyfunction!(calibrate_settings, m)?)?; - m.add_function(wrap_pyfunction!(aggregate, m)?)?; - m.add_function(wrap_pyfunction!(mock_aggregate, m)?)?; - m.add_function(wrap_pyfunction!(setup_aggregate, m)?)?; m.add_function(wrap_pyfunction!(compile_circuit, m)?)?; - m.add_function(wrap_pyfunction!(verify_aggr, m)?)?; m.add_function(wrap_pyfunction!(create_evm_verifier, m)?)?; #[cfg(feature = "reusable-verifier")] m.add_function(wrap_pyfunction!(create_evm_vka, m)?)?; m.add_function(wrap_pyfunction!(deploy_evm, m)?)?; m.add_function(wrap_pyfunction!(verify_evm, m)?)?; - m.add_function(wrap_pyfunction!(create_evm_verifier_aggr, m)?)?; m.add_function(wrap_pyfunction!(encode_evm_calldata, m)?)?; #[cfg(feature = "reusable-verifier")] m.add_function(wrap_pyfunction!(register_vka, m)?)?; @@ -2004,24 +1647,6 @@ impl pyo3_stub_gen::PyStubType for CalibrationTarget { } } -impl pyo3_stub_gen::PyStubType for ProofType { - fn type_output() -> TypeInfo { - TypeInfo { - name: "str".to_string(), - import: HashSet::new(), - } - } -} - -impl pyo3_stub_gen::PyStubType for TranscriptType { - fn type_output() -> TypeInfo { - TypeInfo { - name: "str".to_string(), - import: HashSet::new(), - } - } -} - impl pyo3_stub_gen::PyStubType for CheckMode { fn type_output() -> TypeInfo { TypeInfo { diff --git a/src/bindings/universal.rs b/src/bindings/universal.rs deleted file mode 100644 index a58bf203..00000000 --- a/src/bindings/universal.rs +++ /dev/null @@ -1,606 +0,0 @@ -use halo2_proofs::{ - plonk::*, - poly::{ - commitment::{CommitmentScheme, ParamsProver}, - ipa::{ - commitment::{IPACommitmentScheme, ParamsIPA}, - multiopen::{ProverIPA, VerifierIPA}, - strategy::SingleStrategy as IPASingleStrategy, - }, - kzg::{ - commitment::{KZGCommitmentScheme, ParamsKZG}, - multiopen::{ProverSHPLONK, VerifierSHPLONK}, - strategy::SingleStrategy as KZGSingleStrategy, - }, - VerificationStrategy, - }, -}; -use std::fmt::Display; -use std::io::BufReader; -use std::str::FromStr; - -use crate::{ - circuit::region::RegionSettings, - graph::GraphSettings, - pfsys::{ - create_proof_circuit, encode_calldata, - evm::aggregation_kzg::{AggregationCircuit, PoseidonTranscript}, - verify_proof_circuit, TranscriptType, - }, - tensor::TensorType, - CheckMode, Commitments, EZKLError as InnerEZKLError, -}; - -use crate::circuit::modules::poseidon::{ - spec::{PoseidonSpec, POSEIDON_RATE, POSEIDON_WIDTH}, - PoseidonChip, -}; -use crate::circuit::modules::Module; -use crate::graph::{GraphCircuit, GraphWitness}; -use halo2curves::{ - bn256::{Bn256, Fr, G1Affine}, - ff::{FromUniformBytes, PrimeField}, -}; -use snark_verifier::{loader::native::NativeLoader, system::halo2::transcript::evm::EvmTranscript}; - -/// Wrapper around the Error Message -#[cfg_attr(feature = "ios-bindings", derive(uniffi::Error))] -#[derive(Debug)] -pub enum EZKLError { - /// Some Comment - InternalError(String), -} - -impl Display for EZKLError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - EZKLError::InternalError(e) => write!(f, "Internal error: {}", e), - } - } -} - -impl From for EZKLError { - fn from(e: InnerEZKLError) -> Self { - EZKLError::InternalError(e.to_string()) - } -} - -/// Hash the input message with poseidon -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn poseidon_hash(message: Vec) -> Result, EZKLError> { - let message: Vec = serde_json::from_slice(&message[..]).map_err(InnerEZKLError::from)?; - - let output = PoseidonChip::::run(message.clone()) - .map_err(InnerEZKLError::from)?; - - Ok(serde_json::to_vec(&output).map_err(InnerEZKLError::from)?) -} - -/// Hash the input message with poseidon without converting to Fr -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn poseidon_hash_no_felt(message: Vec) -> Result, EZKLError> { - let message: Vec = message.iter().map(|x| Fr::from(*x as u64)).collect(); - - let output = PoseidonChip::::run(message.clone()) - .map_err(InnerEZKLError::from)?; - - Ok(serde_json::to_vec(&output).map_err(InnerEZKLError::from)?) -} - -/// Encode verifier calldata from proof and ethereum vk_address -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn encode_verifier_calldata( - // TODO - shuold it be pub or pub or pub(super)? - proof: Vec, - vka: Option>, -) -> Result, EZKLError> { - let snark: crate::pfsys::Snark = - serde_json::from_slice(&proof[..]).map_err(InnerEZKLError::from)?; - - let vka_buf: Option> = if let Some(vka) = vka { - let array: Vec<[u8; 32]> = - serde_json::from_slice(&vka[..]).map_err(InnerEZKLError::from)?; - Some(array) - } else { - None - }; - - let vka: Option<&[[u8; 32]]> = vka_buf.as_deref(); - - let flattened_instances = snark.instances.into_iter().flatten(); - - let encoded = encode_calldata(vka, &snark.proof, &flattened_instances.collect::>()); - - Ok(encoded) -} - -/// Generate witness from compiled circuit and input json -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn gen_witness(compiled_circuit: Vec, input: Vec) -> Result, EZKLError> { - println!("[circuit]"); - let mut circuit: crate::graph::GraphCircuit = bincode::deserialize(&compiled_circuit[..]) - .map_err(|e| { - EZKLError::InternalError(format!("Failed to deserialize compiled model: {}", e)) - })?; - - println!("[input]"); - let input: crate::graph::input::GraphData = serde_json::from_slice(&input[..]) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize input: {}", e)))?; - - println!("[load graph input]"); - let mut input = circuit - .load_graph_input(&input) - .map_err(|e| EZKLError::InternalError(format!("{}", e)))?; - - println!("[load graph witness]"); - let witness = circuit - .forward::>( - &mut input, - None, - None, - RegionSettings::all_true( - circuit.settings().run_args.decomp_base, - circuit.settings().run_args.decomp_legs, - ), - ) - .map_err(|e| EZKLError::InternalError(format!("{}", e)))?; - - println!("[serialize witness]"); - serde_json::to_vec(&witness) - .map_err(|e| EZKLError::InternalError(format!("Failed to serialize witness: {}", e))) -} - -/// Generate verifying key from compiled circuit, and parameters srs -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn gen_vk( - compiled_circuit: Vec, - srs: Vec, - compress_selectors: bool, -) -> Result, EZKLError> { - let mut reader = BufReader::new(&srs[..]); - let params: ParamsKZG = get_params(&mut reader)?; - - let circuit: GraphCircuit = bincode::deserialize(&compiled_circuit[..]) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize circuit: {}", e)))?; - - let vk = create_vk_lean::, Fr, GraphCircuit>( - &circuit, - ¶ms, - compress_selectors, - ) - .map_err(|e| EZKLError::InternalError(format!("Failed to create verifying key: {}", e)))?; - - let mut serialized_vk = Vec::new(); - vk.write( - &mut serialized_vk, - halo2_proofs::SerdeFormat::RawBytesUnchecked, - ) - .map_err(|e| EZKLError::InternalError(format!("Failed to serialize verifying key: {}", e)))?; - - Ok(serialized_vk) -} - -/// Generate proving key from vk, compiled circuit and parameters srs -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn gen_pk(vk: Vec, compiled_circuit: Vec, srs: Vec) -> Result, EZKLError> { - let mut reader = BufReader::new(&srs[..]); - let params: ParamsKZG = get_params(&mut reader)?; - - let circuit: GraphCircuit = bincode::deserialize(&compiled_circuit[..]) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize circuit: {}", e)))?; - - let mut reader = BufReader::new(&vk[..]); - let vk = VerifyingKey::::read::<_, GraphCircuit>( - &mut reader, - halo2_proofs::SerdeFormat::RawBytesUnchecked, - circuit.settings().clone(), - ) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize verifying key: {}", e)))?; - - let pk = create_pk_lean::, Fr, GraphCircuit>(vk, &circuit, ¶ms) - .map_err(|e| EZKLError::InternalError(format!("Failed to create proving key: {}", e)))?; - - let mut serialized_pk = Vec::new(); - pk.write(&mut serialized_pk, halo2_proofs::SerdeFormat::RawBytes) - .map_err(|e| EZKLError::InternalError(format!("Failed to serialize proving key: {}", e)))?; - - Ok(serialized_pk) -} - -/// Verify proof with vk, proof json, circuit settings json and srs -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn verify( - proof: Vec, - vk: Vec, - settings: Vec, - srs: Vec, -) -> Result { - let circuit_settings: GraphSettings = serde_json::from_slice(&settings[..]) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize settings: {}", e)))?; - - let proof: crate::pfsys::Snark = serde_json::from_slice(&proof[..]) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize proof: {}", e)))?; - - let mut reader = BufReader::new(&vk[..]); - let vk = VerifyingKey::::read::<_, GraphCircuit>( - &mut reader, - halo2_proofs::SerdeFormat::RawBytesUnchecked, - circuit_settings.clone(), - ) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize vk: {}", e)))?; - - let orig_n = 1 << circuit_settings.run_args.logrows; - let commitment = circuit_settings.run_args.commitment.into(); - - let mut reader = BufReader::new(&srs[..]); - let result = match commitment { - Commitments::KZG => { - let params: ParamsKZG = get_params(&mut reader)?; - let strategy = KZGSingleStrategy::new(params.verifier_params()); - match proof.transcript_type { - TranscriptType::EVM => verify_proof_circuit::< - VerifierSHPLONK<'_, Bn256>, - KZGCommitmentScheme, - KZGSingleStrategy<_>, - _, - EvmTranscript, - >(&proof, ¶ms, &vk, strategy, orig_n), - TranscriptType::Poseidon => { - verify_proof_circuit::< - VerifierSHPLONK<'_, Bn256>, - KZGCommitmentScheme, - KZGSingleStrategy<_>, - _, - PoseidonTranscript, - >(&proof, ¶ms, &vk, strategy, orig_n) - } - } - } - Commitments::IPA => { - let params: ParamsIPA<_> = get_params(&mut reader)?; - let strategy = IPASingleStrategy::new(params.verifier_params()); - match proof.transcript_type { - TranscriptType::EVM => verify_proof_circuit::< - VerifierIPA<_>, - IPACommitmentScheme, - IPASingleStrategy<_>, - _, - EvmTranscript, - >(&proof, ¶ms, &vk, strategy, orig_n), - TranscriptType::Poseidon => { - verify_proof_circuit::< - VerifierIPA<_>, - IPACommitmentScheme, - IPASingleStrategy<_>, - _, - PoseidonTranscript, - >(&proof, ¶ms, &vk, strategy, orig_n) - } - } - } - }; - - match result { - Ok(_) => Ok(true), - Err(e) => Err(EZKLError::InternalError(format!( - "Verification failed: {}", - e - ))), - } -} - -/// Verify aggregate proof with vk, proof, circuit settings and srs -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn verify_aggr( - proof: Vec, - vk: Vec, - logrows: u64, - srs: Vec, - commitment: &str, -) -> Result { - let proof: crate::pfsys::Snark = serde_json::from_slice(&proof[..]) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize proof: {}", e)))?; - - let mut reader = BufReader::new(&vk[..]); - let vk = VerifyingKey::::read::<_, AggregationCircuit>( - &mut reader, - halo2_proofs::SerdeFormat::RawBytesUnchecked, - (), - ) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize vk: {}", e)))?; - - let commit = Commitments::from_str(commitment) - .map_err(|e| EZKLError::InternalError(format!("Invalid commitment: {}", e)))?; - - let orig_n = 1 << logrows; - - let mut reader = BufReader::new(&srs[..]); - let result = match commit { - Commitments::KZG => { - let params: ParamsKZG = get_params(&mut reader)?; - let strategy = KZGSingleStrategy::new(params.verifier_params()); - match proof.transcript_type { - TranscriptType::EVM => verify_proof_circuit::< - VerifierSHPLONK<'_, Bn256>, - KZGCommitmentScheme, - KZGSingleStrategy<_>, - _, - EvmTranscript, - >(&proof, ¶ms, &vk, strategy, orig_n), - - TranscriptType::Poseidon => { - verify_proof_circuit::< - VerifierSHPLONK<'_, Bn256>, - KZGCommitmentScheme, - KZGSingleStrategy<_>, - _, - PoseidonTranscript, - >(&proof, ¶ms, &vk, strategy, orig_n) - } - } - } - Commitments::IPA => { - let params: ParamsIPA<_> = - halo2_proofs::poly::commitment::Params::<'_, G1Affine>::read(&mut reader).map_err( - |e| EZKLError::InternalError(format!("Failed to deserialize params: {}", e)), - )?; - let strategy = IPASingleStrategy::new(params.verifier_params()); - match proof.transcript_type { - TranscriptType::EVM => verify_proof_circuit::< - VerifierIPA<_>, - IPACommitmentScheme, - IPASingleStrategy<_>, - _, - EvmTranscript, - >(&proof, ¶ms, &vk, strategy, orig_n), - TranscriptType::Poseidon => { - verify_proof_circuit::< - VerifierIPA<_>, - IPACommitmentScheme, - IPASingleStrategy<_>, - _, - PoseidonTranscript, - >(&proof, ¶ms, &vk, strategy, orig_n) - } - } - } - }; - - result - .map(|_| true) - .map_err(|e| EZKLError::InternalError(format!("{}", e))) -} - -/// Prove in browser with compiled circuit, witness json, proving key, and srs -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn prove( - witness: Vec, - pk: Vec, - compiled_circuit: Vec, - srs: Vec, -) -> Result, EZKLError> { - #[cfg(feature = "det-prove")] - log::set_max_level(log::LevelFilter::Debug); - #[cfg(not(feature = "det-prove"))] - log::set_max_level(log::LevelFilter::Info); - - let mut circuit: GraphCircuit = bincode::deserialize(&compiled_circuit[..]) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize circuit: {}", e)))?; - - let data: GraphWitness = serde_json::from_slice(&witness[..]).map_err(InnerEZKLError::from)?; - - let mut reader = BufReader::new(&pk[..]); - let pk = ProvingKey::::read::<_, GraphCircuit>( - &mut reader, - halo2_proofs::SerdeFormat::RawBytesUnchecked, - circuit.settings().clone(), - ) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize proving key: {}", e)))?; - - circuit - .load_graph_witness(&data) - .map_err(InnerEZKLError::from)?; - let public_inputs = circuit - .prepare_public_inputs(&data) - .map_err(InnerEZKLError::from)?; - let proof_split_commits: Option = data.into(); - - let mut reader = BufReader::new(&srs[..]); - let commitment = circuit.settings().run_args.commitment.into(); - - let proof = match commitment { - Commitments::KZG => { - let params: ParamsKZG = - halo2_proofs::poly::commitment::Params::<'_, G1Affine>::read(&mut reader).map_err( - |e| EZKLError::InternalError(format!("Failed to deserialize srs: {}", e)), - )?; - - create_proof_circuit::< - KZGCommitmentScheme, - _, - ProverSHPLONK<_>, - VerifierSHPLONK<_>, - KZGSingleStrategy<_>, - _, - EvmTranscript<_, _, _, _>, - EvmTranscript<_, _, _, _>, - >( - circuit, - vec![public_inputs], - ¶ms, - &pk, - CheckMode::UNSAFE, - Commitments::KZG, - TranscriptType::EVM, - proof_split_commits, - None, - ) - } - Commitments::IPA => { - let params: ParamsIPA<_> = - halo2_proofs::poly::commitment::Params::<'_, G1Affine>::read(&mut reader).map_err( - |e| EZKLError::InternalError(format!("Failed to deserialize srs: {}", e)), - )?; - - create_proof_circuit::< - IPACommitmentScheme, - _, - ProverIPA<_>, - VerifierIPA<_>, - IPASingleStrategy<_>, - _, - EvmTranscript<_, _, _, _>, - EvmTranscript<_, _, _, _>, - >( - circuit, - vec![public_inputs], - ¶ms, - &pk, - CheckMode::UNSAFE, - Commitments::IPA, - TranscriptType::EVM, - proof_split_commits, - None, - ) - } - } - .map_err(InnerEZKLError::from)?; - - Ok(serde_json::to_vec(&proof).map_err(InnerEZKLError::from)?) -} - -/// Validate the witness json -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn witness_validation(witness: Vec) -> Result { - let _: GraphWitness = serde_json::from_slice(&witness[..]).map_err(InnerEZKLError::from)?; - - Ok(true) -} - -/// Validate the compiled circuit -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn compiled_circuit_validation(compiled_circuit: Vec) -> Result { - let _: GraphCircuit = bincode::deserialize(&compiled_circuit[..]).map_err(|e| { - EZKLError::InternalError(format!("Failed to deserialize compiled circuit: {}", e)) - })?; - - Ok(true) -} - -/// Validate the input json -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn input_validation(input: Vec) -> Result { - let _: crate::graph::input::GraphData = - serde_json::from_slice(&input[..]).map_err(InnerEZKLError::from)?; - - Ok(true) -} - -/// Validate the proof json -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn proof_validation(proof: Vec) -> Result { - let _: crate::pfsys::Snark = - serde_json::from_slice(&proof[..]).map_err(InnerEZKLError::from)?; - - Ok(true) -} - -/// Validate the verifying key given the settings json -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn vk_validation(vk: Vec, settings: Vec) -> Result { - let circuit_settings: GraphSettings = - serde_json::from_slice(&settings[..]).map_err(InnerEZKLError::from)?; - - let mut reader = BufReader::new(&vk[..]); - let _ = VerifyingKey::::read::<_, GraphCircuit>( - &mut reader, - halo2_proofs::SerdeFormat::RawBytesUnchecked, - circuit_settings, - ) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize verifying key: {}", e)))?; - - Ok(true) -} - -/// Validate the proving key given the settings json -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn pk_validation(pk: Vec, settings: Vec) -> Result { - let circuit_settings: GraphSettings = - serde_json::from_slice(&settings[..]).map_err(InnerEZKLError::from)?; - - let mut reader = BufReader::new(&pk[..]); - let _ = ProvingKey::::read::<_, GraphCircuit>( - &mut reader, - halo2_proofs::SerdeFormat::RawBytesUnchecked, - circuit_settings, - ) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize proving key: {}", e)))?; - - Ok(true) -} - -/// Validate the settings json -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn settings_validation(settings: Vec) -> Result { - let _: GraphSettings = serde_json::from_slice(&settings[..]).map_err(InnerEZKLError::from)?; - - Ok(true) -} - -/// Validate the srs -#[cfg_attr(feature = "ios-bindings", uniffi::export)] -pub fn srs_validation(srs: Vec) -> Result { - let mut reader = BufReader::new(&srs[..]); - let _: ParamsKZG = - halo2_proofs::poly::commitment::Params::<'_, G1Affine>::read(&mut reader).map_err(|e| { - EZKLError::InternalError(format!("Failed to deserialize params: {}", e)) - })?; - - Ok(true) -} - -// HELPER FUNCTIONS - -fn get_params< - Scheme: for<'a> halo2_proofs::poly::commitment::Params<'a, halo2curves::bn256::G1Affine>, ->( - mut reader: &mut BufReader<&[u8]>, -) -> Result { - halo2_proofs::poly::commitment::Params::::read(&mut reader) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize params: {}", e))) -} - -/// Creates a [ProvingKey] for a [GraphCircuit] (`circuit`) with specific [CommitmentScheme] parameters (`params`) for the WASM target -pub fn create_vk_lean>( - circuit: &C, - params: &'_ Scheme::ParamsProver, - compress_selectors: bool, -) -> Result, halo2_proofs::plonk::Error> -where - C: Circuit, - ::Scalar: FromUniformBytes<64>, -{ - // Real proof - let empty_circuit = >::without_witnesses(circuit); - - // Initialize the verifying key - let vk = keygen_vk_custom(params, &empty_circuit, compress_selectors)?; - Ok(vk) -} -/// Creates a [ProvingKey] from a [VerifyingKey] for a [GraphCircuit] (`circuit`) with specific [CommitmentScheme] parameters (`params`) for the WASM target -pub fn create_pk_lean>( - vk: VerifyingKey, - circuit: &C, - params: &'_ Scheme::ParamsProver, -) -> Result, halo2_proofs::plonk::Error> -where - C: Circuit, - ::Scalar: FromUniformBytes<64>, -{ - // Real proof - let empty_circuit = >::without_witnesses(circuit); - - // Initialize the proving key - let pk = keygen_pk(params, vk, &empty_circuit)?; - Ok(pk) -} diff --git a/src/bindings/wasm.rs b/src/bindings/wasm.rs deleted file mode 100644 index 37afb327..00000000 --- a/src/bindings/wasm.rs +++ /dev/null @@ -1,398 +0,0 @@ -use crate::{ - circuit::modules::polycommit::PolyCommitChip, - fieldutils::{felt_to_integer_rep, integer_rep_to_felt}, - graph::{quantize_float, scale_to_multiplier, GraphCircuit, GraphSettings}, -}; -use console_error_panic_hook; -use halo2_proofs::{ - plonk::*, - poly::kzg::commitment::{KZGCommitmentScheme, ParamsKZG}, -}; -use halo2_solidity_verifier::Evm; -use halo2curves::{ - bn256::{Bn256, Fr, G1Affine}, - ff::PrimeField, -}; -use std::str::FromStr; -use wasm_bindgen::prelude::*; -use wasm_bindgen_console_logger::DEFAULT_LOGGER; - -use crate::bindings::universal::{ - compiled_circuit_validation, encode_verifier_calldata, gen_pk, gen_vk, gen_witness, - input_validation, pk_validation, proof_validation, settings_validation, srs_validation, - verify_aggr, vk_validation, witness_validation, EZKLError as ExternalEZKLError, -}; -#[cfg(feature = "web")] -pub use wasm_bindgen_rayon::init_thread_pool; - -impl From for JsError { - fn from(e: ExternalEZKLError) -> Self { - JsError::new(&format!("{}", e)) - } -} - -#[wasm_bindgen] -/// Initialize logger for wasm -pub fn init_logger() { - log::set_logger(&DEFAULT_LOGGER).unwrap(); -} - -#[wasm_bindgen] -/// Initialize panic hook for wasm -pub fn init_panic_hook() { - console_error_panic_hook::set_once(); -} - -/// Wrapper around the halo2 encode call data method -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn encodeVerifierCalldata( - proof: wasm_bindgen::Clamped>, - vk_address: Option>, -) -> Result, JsError> { - encode_verifier_calldata(proof.0, vk_address).map_err(JsError::from) -} - -/// Converts a hex string to a byte array -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn feltToBigEndian(array: wasm_bindgen::Clamped>) -> Result { - let felt: Fr = serde_json::from_slice(&array[..]) - .map_err(|e| JsError::new(&format!("Failed to deserialize field element: {}", e)))?; - Ok(format!("{:?}", felt)) -} - -/// Converts a felt to a little endian string -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn feltToLittleEndian(array: wasm_bindgen::Clamped>) -> Result { - let felt: Fr = serde_json::from_slice(&array[..]) - .map_err(|e| JsError::new(&format!("Failed to deserialize field element: {}", e)))?; - let repr = serde_json::to_string(&felt).unwrap(); - let b: String = serde_json::from_str(&repr).unwrap(); - Ok(b) -} - -/// Converts a hex string to a byte array -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn feltToInt( - array: wasm_bindgen::Clamped>, -) -> Result>, JsError> { - let felt: Fr = serde_json::from_slice(&array[..]) - .map_err(|e| JsError::new(&format!("Failed to deserialize field element: {}", e)))?; - Ok(wasm_bindgen::Clamped( - serde_json::to_vec(&felt_to_integer_rep(felt)) - .map_err(|e| JsError::new(&format!("Failed to serialize integer: {}", e)))?, - )) -} - -/// Converts felts to a floating point element -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn feltToFloat( - array: wasm_bindgen::Clamped>, - scale: crate::Scale, -) -> Result { - let felt: Fr = serde_json::from_slice(&array[..]) - .map_err(|e| JsError::new(&format!("Failed to deserialize field element: {}", e)))?; - let int_rep = felt_to_integer_rep(felt); - let multiplier = scale_to_multiplier(scale); - Ok(int_rep as f64 / multiplier) -} - -/// Converts a floating point number to a hex string representing a fixed point field element -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn floatToFelt( - mut input: f64, - scale: crate::Scale, - input_type: &str, -) -> Result>, JsError> { - crate::circuit::InputType::roundtrip( - &crate::circuit::InputType::from_str(input_type) - .map_err(|e| JsError::new(&format!("{}", e)))?, - &mut input, - ); - let int_rep = - quantize_float(&input, 0.0, scale).map_err(|e| JsError::new(&format!("{}", e)))?; - let felt = integer_rep_to_felt(int_rep); - let vec = crate::pfsys::field_to_string::(&felt); - Ok(wasm_bindgen::Clamped(serde_json::to_vec(&vec).map_err( - |e| JsError::new(&format!("Failed to serialize a float to felt{}", e)), - )?)) -} - -/// Generate a kzg commitment. -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn kzgCommit( - message: wasm_bindgen::Clamped>, - vk: wasm_bindgen::Clamped>, - settings: wasm_bindgen::Clamped>, - params_ser: wasm_bindgen::Clamped>, -) -> Result>, JsError> { - let message: Vec = serde_json::from_slice(&message[..]) - .map_err(|e| JsError::new(&format!("Failed to deserialize message: {}", e)))?; - - let mut reader = std::io::BufReader::new(¶ms_ser[..]); - let params: ParamsKZG = - halo2_proofs::poly::commitment::Params::<'_, G1Affine>::read(&mut reader) - .map_err(|e| JsError::new(&format!("Failed to deserialize params: {}", e)))?; - - let mut reader = std::io::BufReader::new(&vk[..]); - let circuit_settings: GraphSettings = serde_json::from_slice(&settings[..]) - .map_err(|e| JsError::new(&format!("Failed to deserialize settings: {}", e)))?; - let vk = VerifyingKey::::read::<_, GraphCircuit>( - &mut reader, - halo2_proofs::SerdeFormat::RawBytes, - circuit_settings, - ) - .map_err(|e| JsError::new(&format!("Failed to deserialize vk: {}", e)))?; - - let output = PolyCommitChip::commit::>( - message, - (vk.cs().blinding_factors() + 1) as u32, - ¶ms, - ); - - Ok(wasm_bindgen::Clamped( - serde_json::to_vec(&output).map_err(|e| JsError::new(&format!("{}", e)))?, - )) -} - -/// Converts a buffer to vector of 4 u64s representing a fixed point field element -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn bufferToVecOfFelt( - buffer: wasm_bindgen::Clamped>, -) -> Result>, JsError> { - // Convert the buffer to a slice - let buffer: &[u8] = &buffer; - - // Divide the buffer into chunks of 64 bytes - let chunks = buffer.chunks_exact(16); - - // Get the remainder - let remainder = chunks.remainder(); - - // Add 0s to the remainder to make it 64 bytes - let mut remainder = remainder.to_vec(); - - // Collect chunks into a Vec<[u8; 16]>. - let chunks: Result, JsError> = chunks - .map(|slice| { - let array: [u8; 16] = slice - .try_into() - .map_err(|_| JsError::new("failed to slice input chunks"))?; - Ok(array) - }) - .collect(); - - let mut chunks = chunks?; - - if remainder.len() != 0 { - remainder.resize(16, 0); - // Convert the Vec to [u8; 16] - let remainder_array: [u8; 16] = remainder - .try_into() - .map_err(|_| JsError::new("failed to slice remainder"))?; - // append the remainder to the chunks - chunks.push(remainder_array); - } - - // Convert each chunk to a field element - let field_elements: Vec = chunks - .iter() - .map(|x| PrimeField::from_u128(u8_array_to_u128_le(*x))) - .collect(); - - Ok(wasm_bindgen::Clamped( - serde_json::to_vec(&field_elements) - .map_err(|e| JsError::new(&format!("Failed to serialize field elements: {}", e)))?, - )) -} - -/// Generate a poseidon hash in browser. Input message -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn poseidonHash( - message: wasm_bindgen::Clamped>, -) -> Result>, JsError> { - super::universal::poseidon_hash(message.0) - .map_err(JsError::from) - .map(|x| wasm_bindgen::Clamped(x.clone())) -} - -/// Generate a witness file from input.json, compiled model and a settings.json file. -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn genWitness( - compiled_circuit: wasm_bindgen::Clamped>, - input: wasm_bindgen::Clamped>, -) -> Result, JsError> { - gen_witness(compiled_circuit.0, input.0).map_err(JsError::from) -} - -/// Generate verifying key in browser -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn genVk( - compiled_circuit: wasm_bindgen::Clamped>, - params_ser: wasm_bindgen::Clamped>, - compress_selectors: bool, -) -> Result, JsError> { - gen_vk(compiled_circuit.0, params_ser.0, compress_selectors).map_err(JsError::from) -} - -/// Generate proving key in browser -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn genPk( - vk: wasm_bindgen::Clamped>, - compiled_circuit: wasm_bindgen::Clamped>, - params_ser: wasm_bindgen::Clamped>, -) -> Result, JsError> { - gen_pk(vk.0, compiled_circuit.0, params_ser.0).map_err(JsError::from) -} - -/// Verify proof in browser using wasm -#[wasm_bindgen] -pub fn verify( - proof_js: wasm_bindgen::Clamped>, - vk: wasm_bindgen::Clamped>, - settings: wasm_bindgen::Clamped>, - srs: wasm_bindgen::Clamped>, -) -> Result { - super::universal::verify(proof_js.0, vk.0, settings.0, srs.0).map_err(JsError::from) -} - -/// Verify proof in browser evm using wasm -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn verifyEVM( - proof_js: wasm_bindgen::Clamped>, - bytecode_verifier: Vec, - bytecode_vka: Option>, -) -> Result { - let mut evm = Evm::unlimited(); - let decoded_verifier = utf8_bytes_to_hex_decoded(&bytecode_verifier)?; - let (verifier_address, _) = evm.create(decoded_verifier); - // if bytecode_vk is Some, then create the vk contract - let vk_address = if let Some(bytecode_vka) = bytecode_vka { - let decoded_vka = utf8_bytes_to_hex_decoded(&bytecode_vka)?; - let (address, _) = evm.create(decoded_vka); - Some(address.as_slice().to_vec()) - // check if bytecode_verifier is none and if so then generate the - // reusable verifier - } else { - None - }; - let calldata = encode_verifier_calldata(proof_js.0, vk_address).map_err(JsError::from); - let output = evm.call(verifier_address, calldata?).1; - let true_word = [vec![0; 31], vec![1]].concat(); - Ok(output == true_word) -} - -/// Verify aggregate proof in browser using wasm -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn verifyAggr( - proof_js: wasm_bindgen::Clamped>, - vk: wasm_bindgen::Clamped>, - logrows: u64, - srs: wasm_bindgen::Clamped>, - commitment: &str, -) -> Result { - verify_aggr(proof_js.0, vk.0, logrows, srs.0, commitment).map_err(JsError::from) -} - -/// Prove in browser using wasm -#[wasm_bindgen] -pub fn prove( - witness: wasm_bindgen::Clamped>, - pk: wasm_bindgen::Clamped>, - compiled_circuit: wasm_bindgen::Clamped>, - srs: wasm_bindgen::Clamped>, -) -> Result, JsError> { - super::universal::prove(witness.0, pk.0, compiled_circuit.0, srs.0).map_err(JsError::from) -} - -// VALIDATION FUNCTIONS - -/// Witness file validation -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn witnessValidation(witness: wasm_bindgen::Clamped>) -> Result { - witness_validation(witness.0).map_err(JsError::from) -} -/// Compiled circuit validation -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn compiledCircuitValidation( - compiled_circuit: wasm_bindgen::Clamped>, -) -> Result { - compiled_circuit_validation(compiled_circuit.0).map_err(JsError::from) -} -/// Input file validation -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn inputValidation(input: wasm_bindgen::Clamped>) -> Result { - input_validation(input.0).map_err(JsError::from) -} -/// Proof file validation -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn proofValidation(proof: wasm_bindgen::Clamped>) -> Result { - proof_validation(proof.0).map_err(JsError::from) -} -/// Vk file validation -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn vkValidation( - vk: wasm_bindgen::Clamped>, - settings: wasm_bindgen::Clamped>, -) -> Result { - vk_validation(vk.0, settings.0).map_err(JsError::from) -} -/// Pk file validation -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn pkValidation( - pk: wasm_bindgen::Clamped>, - settings: wasm_bindgen::Clamped>, -) -> Result { - pk_validation(pk.0, settings.0).map_err(JsError::from) -} -/// Settings file validation -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn settingsValidation(settings: wasm_bindgen::Clamped>) -> Result { - settings_validation(settings.0).map_err(JsError::from) -} -/// Srs file validation -#[wasm_bindgen] -#[allow(non_snake_case)] -pub fn srsValidation(srs: wasm_bindgen::Clamped>) -> Result { - srs_validation(srs.0).map_err(JsError::from) -} - -/// HELPER FUNCTIONS -pub fn u8_array_to_u128_le(arr: [u8; 16]) -> u128 { - let mut n: u128 = 0; - for &b in arr.iter().rev() { - n <<= 8; - n |= b as u128; - } - n -} -/// -pub fn utf8_bytes_to_hex_decoded(input: &[u8]) -> Result, JsError> { - let string = std::str::from_utf8(input)?.trim(); - let hex_string = if string.starts_with("0x") { - &string[2..] - } else { - string - }; - hex::decode(hex_string).map_err(JsError::from) -} diff --git a/src/circuit/tests.rs b/src/circuit/tests.rs index 986c0d1b..d9cf1393 100644 --- a/src/circuit/tests.rs +++ b/src/circuit/tests.rs @@ -360,7 +360,6 @@ mod matmul_col_ultra_overflow_double_col { // use safe mode to verify that the proof is correct CheckMode::SAFE, crate::Commitments::KZG, - crate::pfsys::TranscriptType::EVM, None, None, ); @@ -481,7 +480,6 @@ mod matmul_col_ultra_overflow { // use safe mode to verify that the proof is correct CheckMode::SAFE, crate::Commitments::KZG, - crate::pfsys::TranscriptType::EVM, None, None, ); @@ -1299,7 +1297,6 @@ mod conv_col_ultra_overflow { // use safe mode to verify that the proof is correct CheckMode::SAFE, crate::Commitments::KZG, - crate::pfsys::TranscriptType::EVM, None, None, ); @@ -1468,7 +1465,6 @@ mod conv_relu_col_ultra_overflow { &pk, CheckMode::SAFE, crate::Commitments::KZG, - crate::pfsys::TranscriptType::EVM, // use safe mode to verify that the proof is correct None, None, @@ -2644,7 +2640,6 @@ mod lookup_ultra_overflow { // use safe mode to verify that the proof is correct CheckMode::SAFE, crate::Commitments::KZG, - crate::pfsys::TranscriptType::EVM, None, None, ); diff --git a/src/commands.rs b/src/commands.rs index d5fc5fb2..942e4ee8 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -9,10 +9,9 @@ use std::path::PathBuf; use std::str::FromStr; use tosubcommand::{ToFlags, ToSubcommand}; -use crate::{pfsys::ProofType, Commitments, RunArgs}; +use crate::{Commitments, RunArgs}; use crate::circuit::CheckMode; -use crate::pfsys::TranscriptType; /// The default path to the .json data file pub const DEFAULT_DATA: &str = "input.json"; @@ -28,26 +27,16 @@ pub const DEFAULT_SETTINGS: &str = "settings.json"; pub const DEFAULT_PK: &str = "pk.key"; /// The default path to the verification key file pub const DEFAULT_VK: &str = "vk.key"; -/// The default path to the proving key file for aggregated proofs -pub const DEFAULT_PK_AGGREGATED: &str = "pk_aggr.key"; -/// The default path to the verification key file for aggregated proofs -pub const DEFAULT_VK_AGGREGATED: &str = "vk_aggr.key"; /// The default path to the proof file pub const DEFAULT_PROOF: &str = "proof.json"; -/// The default path to the proof file for aggregated proofs -pub const DEFAULT_PROOF_AGGREGATED: &str = "proof_aggr.json"; /// Default for whether to split proofs pub const DEFAULT_SPLIT: &str = "false"; /// Default verifier abi pub const DEFAULT_VERIFIER_ABI: &str = "verifier_abi.json"; -/// Default verifier abi for aggregated proofs -pub const DEFAULT_VERIFIER_AGGREGATED_ABI: &str = "verifier_aggr_abi.json"; /// Default solidity code pub const DEFAULT_SOL_CODE: &str = "evm_deploy.sol"; /// Default calldata path pub const DEFAULT_CALLDATA: &str = "calldata.bytes"; -/// Default solidity code for aggregated proofs -pub const DEFAULT_SOL_CODE_AGGREGATED: &str = "evm_deploy_aggr.sol"; /// Default contract address pub const DEFAULT_CONTRACT_ADDRESS: &str = "contract.address"; /// Default contract address for vk @@ -56,8 +45,6 @@ pub const DEFAULT_CONTRACT_ADDRESS_VK: &str = "contract_vk.address"; pub const DEFAULT_CHECKMODE: &str = "safe"; /// Default calibration target pub const DEFAULT_CALIBRATION_TARGET: &str = "resources"; -/// Default logrows for aggregated proofs -pub const DEFAULT_AGGREGATED_LOGROWS: &str = "23"; /// Default optimizer runs pub const DEFAULT_OPTIMIZER_RUNS: &str = "1"; /// Default fuzz runs @@ -91,35 +78,6 @@ pub const DEFAULT_DECIMALS: &str = "18"; /// Default path for the vka digest file 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<'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 { - let result = match self { - TranscriptType::Poseidon => "poseidon", - TranscriptType::EVM => "evm", - }; - Ok(result.into_pyobject(py)?.into_any()) - } -} -#[cfg(feature = "python-bindings")] -/// Obtains TranscriptType from PyObject (Required for TranscriptType to be compatible with Python) -impl<'source> FromPyObject<'source> for TranscriptType { - fn extract_bound(ob: &pyo3::Bound<'source, pyo3::PyAny>) -> PyResult { - let trystr = String::extract_bound(ob)?; - let strval = trystr.to_string(); - match strval.to_lowercase().as_str() { - "poseidon" => Ok(TranscriptType::Poseidon), - "evm" => Ok(TranscriptType::EVM), - _ => Err(PyValueError::new_err("Invalid value for TranscriptType")), - } - } -} - #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq, PartialOrd)] /// Determines what the calibration pass should optimize for pub enum CalibrationTarget { @@ -187,7 +145,6 @@ pub enum ContractType { /// Deploys a verifier contrat tailored to the circuit and not reusable Verifier { /// Whether to deploy a reusable verifier. This can reduce state bloat on-chain since you need only deploy a verifying key artifact (vka) for a given circuit which is significantly smaller than the verifier contract (up to 4 times smaller for large circuits) - /// Can also be used as an alternative to aggregation for verifiers that are otherwise too large to fit on-chain. reusable: bool, }, } @@ -566,82 +523,6 @@ pub enum Commands { model: Option, }, - /// Mock aggregate proofs - MockAggregate { - /// The path to the snarks to aggregate over (generated using the prove command with the --proof-type=for-aggr flag) - #[arg(long, default_value = DEFAULT_PROOF, value_delimiter = ',', allow_hyphen_values = true, value_hint = clap::ValueHint::FilePath)] - aggregation_snarks: Vec, - /// logrows used for aggregation circuit - #[arg(long, default_value = DEFAULT_AGGREGATED_LOGROWS, value_hint = clap::ValueHint::Other)] - logrows: Option, - /// whether the accumulated are segments of a larger proof - #[arg(long, default_value = DEFAULT_SPLIT, action = clap::ArgAction::SetTrue)] - split_proofs: Option, - }, - - /// Setup aggregation circuit and generate pk and vk - SetupAggregate { - /// The path to samples of snarks that will be aggregated over (generated using the prove command with the --proof-type=for-aggr flag) - #[arg(long, default_value = DEFAULT_PROOF, value_delimiter = ',', allow_hyphen_values = true, value_hint = clap::ValueHint::FilePath)] - sample_snarks: Vec, - /// The path to save the desired verification key file to - #[arg(long, default_value = DEFAULT_VK_AGGREGATED, value_hint = clap::ValueHint::FilePath)] - vk_path: Option, - /// The path to save the proving key to - #[arg(long, default_value = DEFAULT_PK_AGGREGATED, value_hint = clap::ValueHint::FilePath)] - pk_path: Option, - /// The path to SRS, if None will use ~/.ezkl/srs/kzg{logrows}.srs - #[arg(long, value_hint = clap::ValueHint::FilePath)] - srs_path: Option, - /// logrows used for aggregation circuit - #[arg(long, default_value = DEFAULT_AGGREGATED_LOGROWS, value_hint = clap::ValueHint::Other)] - logrows: Option, - /// whether the accumulated are segments of a larger proof - #[arg(long, default_value = DEFAULT_SPLIT, action = clap::ArgAction::SetTrue)] - split_proofs: Option, - /// compress selectors - #[arg(long, default_value = DEFAULT_DISABLE_SELECTOR_COMPRESSION, action = clap::ArgAction::SetTrue)] - disable_selector_compression: Option, - /// commitment used - #[arg(long, default_value = DEFAULT_COMMITMENT, value_hint = clap::ValueHint::Other)] - commitment: Option, - }, - /// Aggregates proofs - Aggregate { - /// The path to the snarks to aggregate over (generated using the prove command with the --proof-type=for-aggr flag) - #[arg(long, default_value = DEFAULT_PROOF, value_delimiter = ',', allow_hyphen_values = true, value_hint = clap::ValueHint::FilePath)] - aggregation_snarks: Vec, - /// The path to load the desired proving key file (generated using the setup-aggregate command) - #[arg(long, default_value = DEFAULT_PK_AGGREGATED, value_hint = clap::ValueHint::FilePath)] - pk_path: Option, - /// The path to output the proof file to - #[arg(long, default_value = DEFAULT_PROOF_AGGREGATED, value_hint = clap::ValueHint::FilePath)] - proof_path: Option, - /// The path to SRS, if None will use ~/.ezkl/srs/kzg{logrows}.srs - #[arg(long)] - srs_path: Option, - #[arg( - long, - require_equals = true, - num_args = 0..=1, - default_value_t = TranscriptType::default(), - value_enum, - value_hint = clap::ValueHint::Other - )] - transcript: TranscriptType, - /// logrows used for aggregation circuit - #[arg(long, default_value = DEFAULT_AGGREGATED_LOGROWS, value_hint = clap::ValueHint::Other)] - logrows: Option, - /// run sanity checks during calculations (safe or unsafe) - #[arg(long, default_value = DEFAULT_CHECKMODE, value_hint = clap::ValueHint::Other)] - check_mode: Option, - /// whether the accumulated proofs are segments of a larger circuit - #[arg(long, default_value = DEFAULT_SPLIT, action = clap::ArgAction::SetTrue)] - split_proofs: Option, - /// commitment used - #[arg(long, default_value = DEFAULT_COMMITMENT, value_hint = clap::ValueHint::Other)] - commitment: Option, - }, /// Compiles a circuit from onnx to a simplified graph (einsum + other ops) and parameters as sets of field elements CompileCircuit { /// The path to the .onnx model file @@ -702,15 +583,6 @@ pub enum Commands { /// The path to SRS, if None will use ~/.ezkl/srs/kzg{logrows}.srs #[arg(long, value_hint = clap::ValueHint::FilePath)] srs_path: Option, - #[arg( - long, - require_equals = true, - num_args = 0..=1, - default_value_t = ProofType::Single, - value_enum, - value_hint = clap::ValueHint::Other - )] - proof_type: ProofType, /// run sanity checks during calculations (safe or unsafe) #[arg(long, default_value = DEFAULT_CHECKMODE, value_hint = clap::ValueHint::Other)] check_mode: Option, @@ -778,32 +650,6 @@ pub enum Commands { decimals: Option, }, - /// Creates an Evm verifier for an aggregate proof - #[command(name = "create-evm-verifier-aggr")] - #[cfg(all(feature = "eth", not(target_arch = "wasm32")))] - CreateEvmVerifierAggr { - /// The path to SRS, if None will use ~/.ezkl/srs/kzg{logrows}.srs - #[arg(long, value_hint = clap::ValueHint::FilePath)] - srs_path: Option, - /// The path to load the desired verification key file - #[arg(long, default_value = DEFAULT_VK_AGGREGATED, value_hint = clap::ValueHint::FilePath)] - vk_path: Option, - /// The path to the Solidity code - #[arg(long, default_value = DEFAULT_SOL_CODE_AGGREGATED, value_hint = clap::ValueHint::FilePath)] - sol_code_path: Option, - /// The path to output the Solidity verifier ABI - #[arg(long, default_value = DEFAULT_VERIFIER_AGGREGATED_ABI, value_hint = clap::ValueHint::FilePath)] - abi_path: Option, - // aggregated circuit settings paths, used to calculate the number of instances in the aggregate proof - #[arg(long, default_value = DEFAULT_SETTINGS, value_delimiter = ',', allow_hyphen_values = true, value_hint = clap::ValueHint::FilePath)] - aggregation_settings: Vec, - // logrows used for aggregation circuit - #[arg(long, default_value = DEFAULT_AGGREGATED_LOGROWS, value_hint = clap::ValueHint::Other)] - logrows: Option, - /// Whether to render the verifier as reusable or not. If true, you will need to deploy a VK artifact, passing it as part of the calldata to the verifier. - #[cfg_attr(all(feature = "reusable-verifier", not(target_arch = "wasm32")), arg(short = 'R', long, action = clap::ArgAction::SetTrue))] - reusable: Option, - }, /// Verifies a proof, returning accept or reject Verify { /// The path to load circuit settings .json file from (generated using the gen-settings command) @@ -822,27 +668,7 @@ pub enum Commands { #[arg(long, default_value = DEFAULT_USE_REDUCED_SRS_FOR_VERIFICATION, action = clap::ArgAction::SetTrue)] reduced_srs: Option, }, - /// Verifies an aggregate proof, returning accept or reject - VerifyAggr { - /// The path to the proof file (generated using the prove command) - #[arg(long, default_value = DEFAULT_PROOF_AGGREGATED, value_hint = clap::ValueHint::FilePath)] - proof_path: Option, - /// The path to the verification key file (generated using the setup-aggregate command) - #[arg(long, default_value = DEFAULT_VK_AGGREGATED, value_hint = clap::ValueHint::FilePath)] - vk_path: Option, - /// reduced srs - #[arg(long, default_value = DEFAULT_USE_REDUCED_SRS_FOR_VERIFICATION, action = clap::ArgAction::SetTrue)] - reduced_srs: Option, - /// The path to SRS, if None will use ~/.ezkl/srs/kzg{logrows}.srs - #[arg(long, value_hint = clap::ValueHint::FilePath)] - srs_path: Option, - /// logrows used for aggregation circuit - #[arg(long, default_value = DEFAULT_AGGREGATED_LOGROWS, value_hint = clap::ValueHint::Other)] - logrows: Option, - /// commitment - #[arg(long, default_value = DEFAULT_COMMITMENT, value_hint = clap::ValueHint::Other)] - commitment: Option, - }, + /// Deploys an evm contract (verifier, reusable verifier, or vk artifact) that is generated by ezkl #[cfg(all(feature = "eth", not(target_arch = "wasm32")))] DeployEvm { diff --git a/src/eth.rs b/src/eth.rs index bd7998dc..7ce6285e 100644 --- a/src/eth.rs +++ b/src/eth.rs @@ -1,4 +1,3 @@ -use crate::pfsys::evm::EvmVerificationError; use crate::pfsys::{encode_calldata, Snark}; use alloy::contract::CallBuilder; use alloy::core::primitives::Address as H160; @@ -57,8 +56,6 @@ pub enum EthError { Wallet(#[from] WalletError), #[error("failed to parse url {0}")] UrlParse(String), - #[error("evm verification error: {0}")] - EvmVerification(#[from] EvmVerificationError), #[error("Private key must be in hex format, 64 chars, without 0x prefix")] PrivateKeyFormat, #[error("failed to parse hex: {0}")] @@ -100,6 +97,8 @@ pub enum EthError { VkaData(String), #[error("rescaled‑instance mismatch: {0}")] RescaleCheckError(#[from] RescaleCheckError), + #[error("evm verification error: {0}")] + EvmVerificationError(String), } pub type EthersClient = Arc< @@ -198,7 +197,7 @@ pub async fn register_vka_via_rv( let result = client.call(&tx).await; if let Err(e) = result { - return Err(EvmVerificationError::SolidityExecution(e.to_string()).into()); + return Err(EthError::EvmVerificationError(e.to_string()).into()); } let result = result?; debug!("result: {:#?}", result.to_vec()); @@ -270,7 +269,7 @@ pub async fn verify_proof_via_solidity( let result = client.call(&tx).await; if let Err(e) = result { - return Err(EvmVerificationError::SolidityExecution(e.to_string()).into()); + return Err(EthError::EvmVerificationError(e.to_string()).into()); } let result = result?; debug!("result: {:#?}", result.to_vec()); @@ -306,7 +305,7 @@ pub async fn verify_proof_via_solidity( .ok_or(EthError::NoContractOutput)? == &1u8; if !result { - return Err(EvmVerificationError::InvalidProof.into()); + return Err(EthError::EvmVerificationError("Invalid proof".into())); } let gas = client.estimate_gas(&tx).await?; diff --git a/src/execute.rs b/src/execute.rs index e6887382..63804c00 100644 --- a/src/execute.rs +++ b/src/execute.rs @@ -10,10 +10,7 @@ use crate::eth::register_vka_via_rv; use crate::eth::{get_contract_artifacts, verify_proof_via_solidity}; use crate::graph::input::GraphData; use crate::graph::{GraphCircuit, GraphSettings, GraphWitness, Model}; -use crate::pfsys::evm::aggregation_kzg::{AggregationCircuit, PoseidonTranscript}; -use crate::pfsys::{ - create_keys, load_pk, load_vk, save_params, save_pk, Snark, StrategyType, TranscriptType, -}; +use crate::pfsys::{create_keys, load_pk, load_vk, save_params, save_pk, Snark}; use crate::pfsys::{ create_proof_circuit, swap_proof_commitments_polycommit, verify_proof_circuit, ProofSplitCommit, }; @@ -29,15 +26,13 @@ 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::Verifier; use halo2_proofs::poly::commitment::{CommitmentScheme, Params}; -use halo2_proofs::poly::commitment::{ParamsProver, Verifier}; use halo2_proofs::poly::ipa::commitment::{IPACommitmentScheme, ParamsIPA}; use halo2_proofs::poly::ipa::multiopen::{ProverIPA, VerifierIPA}; -use halo2_proofs::poly::ipa::strategy::AccumulatorStrategy as IPAAccumulatorStrategy; use halo2_proofs::poly::ipa::strategy::SingleStrategy as IPASingleStrategy; use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; use halo2_proofs::poly::kzg::multiopen::{ProverSHPLONK, VerifierSHPLONK}; -use halo2_proofs::poly::kzg::strategy::AccumulatorStrategy as KZGAccumulatorStrategy; use halo2_proofs::poly::kzg::{ commitment::ParamsKZG, strategy::SingleStrategy as KZGSingleStrategy, }; @@ -58,10 +53,7 @@ use log::debug; use log::{info, trace, warn}; use serde::de::DeserializeOwned; use serde::Serialize; -use snark_verifier::loader::native::NativeLoader; -use snark_verifier::system::halo2::compile; use snark_verifier::system::halo2::transcript::evm::EvmTranscript; -use snark_verifier::system::halo2::Config; #[cfg(all(feature = "eth", not(target_arch = "wasm32")))] use std::fs::File; use std::io::BufWriter; @@ -265,27 +257,7 @@ pub async fn run(command: Commands) -> Result { ) .await } - #[cfg(all(feature = "eth", not(target_arch = "wasm32")))] - Commands::CreateEvmVerifierAggr { - vk_path, - srs_path, - sol_code_path, - abi_path, - aggregation_settings, - logrows, - reusable, - } => { - create_evm_aggregate_verifier( - vk_path.unwrap_or(DEFAULT_VK.into()), - srs_path, - sol_code_path.unwrap_or(DEFAULT_SOL_CODE_AGGREGATED.into()), - abi_path.unwrap_or(DEFAULT_VERIFIER_AGGREGATED_ABI.into()), - aggregation_settings, - logrows.unwrap_or(DEFAULT_AGGREGATED_LOGROWS.parse().unwrap()), - reusable.unwrap_or(DEFAULT_RENDER_REUSABLE.parse().unwrap()), - ) - .await - } + Commands::CompileCircuit { model, compiled_circuit, @@ -326,7 +298,6 @@ pub async fn run(command: Commands) -> Result { pk_path, proof_path, srs_path, - proof_type, check_mode, } => prove( witness.unwrap_or(DEFAULT_WITNESS.into()), @@ -334,61 +305,9 @@ pub async fn run(command: Commands) -> Result { pk_path.unwrap_or(DEFAULT_PK.into()), Some(proof_path.unwrap_or(DEFAULT_PROOF.into())), srs_path, - proof_type, check_mode.unwrap_or(DEFAULT_CHECKMODE.parse().unwrap()), ) .map(|e| serde_json::to_string(&e).unwrap()), - Commands::MockAggregate { - aggregation_snarks, - logrows, - split_proofs, - } => mock_aggregate( - aggregation_snarks, - logrows.unwrap_or(DEFAULT_AGGREGATED_LOGROWS.parse().unwrap()), - split_proofs.unwrap_or(DEFAULT_SPLIT.parse().unwrap()), - ), - Commands::SetupAggregate { - sample_snarks, - vk_path, - pk_path, - srs_path, - logrows, - split_proofs, - disable_selector_compression, - commitment, - } => setup_aggregate( - sample_snarks, - vk_path.unwrap_or(DEFAULT_VK_AGGREGATED.into()), - pk_path.unwrap_or(DEFAULT_PK_AGGREGATED.into()), - srs_path, - logrows.unwrap_or(DEFAULT_AGGREGATED_LOGROWS.parse().unwrap()), - split_proofs.unwrap_or(DEFAULT_SPLIT.parse().unwrap()), - disable_selector_compression - .unwrap_or(DEFAULT_DISABLE_SELECTOR_COMPRESSION.parse().unwrap()), - commitment.into(), - ), - Commands::Aggregate { - proof_path, - aggregation_snarks, - pk_path, - srs_path, - transcript, - logrows, - check_mode, - split_proofs, - commitment, - } => aggregate( - proof_path.unwrap_or(DEFAULT_PROOF_AGGREGATED.into()), - aggregation_snarks, - pk_path.unwrap_or(DEFAULT_PK_AGGREGATED.into()), - srs_path, - transcript, - logrows.unwrap_or(DEFAULT_AGGREGATED_LOGROWS.parse().unwrap()), - check_mode.unwrap_or(DEFAULT_CHECKMODE.parse().unwrap()), - split_proofs.unwrap_or(DEFAULT_SPLIT.parse().unwrap()), - commitment.into(), - ) - .map(|e| serde_json::to_string(&e).unwrap()), Commands::Verify { proof_path, settings_path, @@ -403,22 +322,6 @@ pub async fn run(command: Commands) -> Result { reduced_srs.unwrap_or(DEFAULT_USE_REDUCED_SRS_FOR_VERIFICATION.parse().unwrap()), ) .map(|e| serde_json::to_string(&e).unwrap()), - Commands::VerifyAggr { - proof_path, - vk_path, - srs_path, - reduced_srs, - logrows, - commitment, - } => verify_aggr( - proof_path.unwrap_or(DEFAULT_PROOF_AGGREGATED.into()), - vk_path.unwrap_or(DEFAULT_VK_AGGREGATED.into()), - srs_path, - logrows.unwrap_or(DEFAULT_AGGREGATED_LOGROWS.parse().unwrap()), - reduced_srs.unwrap_or(DEFAULT_USE_REDUCED_SRS_FOR_VERIFICATION.parse().unwrap()), - commitment.into(), - ) - .map(|e| serde_json::to_string(&e).unwrap()), #[cfg(all(feature = "eth", not(target_arch = "wasm32")))] Commands::DeployEvm { sol_code_path, @@ -1642,7 +1545,7 @@ pub(crate) async fn register_vka( Ok(String::new()) } -/// Encodes the calldata for the EVM verifier (both aggregated and single proof) +/// Encodes the calldata for the EVM verifier /// TODO: Add a "RV address param" which will query the "RegisteredVKA" events to fetch the /// VKA from the vka_digest. #[cfg(all(feature = "eth", not(target_arch = "wasm32")))] @@ -1707,71 +1610,6 @@ pub(crate) async fn verify_evm( Ok(String::new()) } -#[cfg(all(feature = "eth", not(target_arch = "wasm32")))] -pub(crate) async fn create_evm_aggregate_verifier( - vk_path: PathBuf, - srs_path: Option, - sol_code_path: PathBuf, - abi_path: PathBuf, - circuit_settings: Vec, - logrows: u32, - reusable: bool, -) -> Result { - let srs_path = get_srs_path(logrows, srs_path, Commitments::KZG); - let params: ParamsKZG = load_srs_verifier::>(srs_path)?; - - let mut settings: Vec = vec![]; - - for path in circuit_settings.iter() { - let s = GraphSettings::load(path)?; - settings.push(s); - } - - let num_instance: usize = settings - .iter() - .map(|s| s.total_instances().iter().sum::()) - .sum(); - - let num_instance = AggregationCircuit::num_instance(num_instance); - let scales = vec![0; num_instance.len()]; - assert_eq!(num_instance.len(), 1); - - let agg_vk = load_vk::, AggregationCircuit>(vk_path, ())?; - - let mut generator = halo2_solidity_verifier::SolidityGenerator::new( - ¶ms, - &agg_vk, - halo2_solidity_verifier::BatchOpenScheme::Bdfg21, - &num_instance, - &scales, - 0, - 0, - ); - - let acc_encoding = halo2_solidity_verifier::AccumulatorEncoding::new( - 0, - AggregationCircuit::num_limbs(), - AggregationCircuit::num_bits(), - ); - - generator = generator.set_acc_encoding(Some(acc_encoding)); - - let verifier_solidity = if reusable { - generator.render_separately()?.0 // ignore the rendered vk artifact for now and generate it in create_evm_vka - } else { - generator.render()? - }; - - File::create(sol_code_path.clone())?.write_all(verifier_solidity.as_bytes())?; - - // fetch abi of the contract - let (abi, _, _) = get_contract_artifacts(sol_code_path, "Halo2Verifier", 0).await?; - // save abi to file - serde_json::to_writer(std::fs::File::create(abi_path)?, &abi)?; - - Ok(String::new()) -} - pub(crate) fn compile_circuit( model_path: PathBuf, compiled_circuit: PathBuf, @@ -1834,8 +1672,6 @@ pub(crate) fn setup( Ok(String::new()) } -use crate::pfsys::ProofType; - #[allow(clippy::too_many_arguments)] pub(crate) fn prove( data_path: PathBuf, @@ -1843,7 +1679,6 @@ pub(crate) fn prove( pk_path: PathBuf, proof_path: Option, srs_path: Option, - proof_type: ProofType, check_mode: CheckMode, ) -> Result, EZKLError> { let data = GraphWitness::from_path(data_path)?; @@ -1856,8 +1691,6 @@ pub(crate) fn prove( let circuit_settings = circuit.settings().clone(); - let strategy: StrategyType = proof_type.into(); - let transcript: TranscriptType = proof_type.into(); let proof_split_commits: Option = data.into(); let commitment = circuit_settings.run_args.commitment.into(); @@ -1873,56 +1706,25 @@ pub(crate) fn prove( logrows, Commitments::KZG, )?; - match strategy { - StrategyType::Single => create_proof_circuit::< - KZGCommitmentScheme, - _, - ProverSHPLONK<_>, - VerifierSHPLONK<_>, - KZGSingleStrategy<_>, - _, - EvmTranscript<_, _, _, _>, - EvmTranscript<_, _, _, _>, - >( - circuit, - vec![public_inputs], - ¶ms, - &pk, - check_mode, - commitment, - transcript, - proof_split_commits, - None, - ), - StrategyType::Accum => { - let protocol = Some(compile( - ¶ms, - pk.get_vk(), - Config::kzg().with_num_instance(vec![public_inputs.len()]), - )); - - create_proof_circuit::< - KZGCommitmentScheme, - _, - ProverSHPLONK<_>, - VerifierSHPLONK<_>, - KZGAccumulatorStrategy<_>, - _, - PoseidonTranscript, - PoseidonTranscript, - >( - circuit, - vec![public_inputs], - ¶ms, - &pk, - check_mode, - commitment, - transcript, - proof_split_commits, - protocol, - ) - } - } + create_proof_circuit::< + KZGCommitmentScheme, + _, + ProverSHPLONK<_>, + VerifierSHPLONK<_>, + KZGSingleStrategy<_>, + _, + EvmTranscript<_, _, _, _>, + EvmTranscript<_, _, _, _>, + >( + circuit, + vec![public_inputs], + ¶ms, + &pk, + check_mode, + commitment, + proof_split_commits, + None, + ) } Commitments::IPA => { let pk = @@ -1933,55 +1735,25 @@ pub(crate) fn prove( circuit_settings.run_args.logrows, Commitments::IPA, )?; - match strategy { - StrategyType::Single => create_proof_circuit::< - IPACommitmentScheme, - _, - ProverIPA<_>, - VerifierIPA<_>, - IPASingleStrategy<_>, - _, - EvmTranscript<_, _, _, _>, - EvmTranscript<_, _, _, _>, - >( - circuit, - vec![public_inputs], - ¶ms, - &pk, - check_mode, - commitment, - transcript, - proof_split_commits, - None, - ), - StrategyType::Accum => { - let protocol = Some(compile( - ¶ms, - pk.get_vk(), - Config::ipa().with_num_instance(vec![public_inputs.len()]), - )); - create_proof_circuit::< - IPACommitmentScheme, - _, - ProverIPA<_>, - VerifierIPA<_>, - IPAAccumulatorStrategy<_>, - _, - PoseidonTranscript, - PoseidonTranscript, - >( - circuit, - vec![public_inputs], - ¶ms, - &pk, - check_mode, - commitment, - transcript, - proof_split_commits, - protocol, - ) - } - } + create_proof_circuit::< + IPACommitmentScheme, + _, + ProverIPA<_>, + VerifierIPA<_>, + IPASingleStrategy<_>, + _, + EvmTranscript<_, _, _, _>, + EvmTranscript<_, _, _, _>, + >( + circuit, + vec![public_inputs], + ¶ms, + &pk, + check_mode, + commitment, + proof_split_commits, + None, + ) } }?; @@ -2012,287 +1784,6 @@ pub(crate) fn swap_proof_commitments_cmd( Ok(snark_new) } -pub(crate) fn mock_aggregate( - aggregation_snarks: Vec, - logrows: u32, - split_proofs: bool, -) -> Result { - let mut snarks = vec![]; - for proof_path in aggregation_snarks.iter() { - match Snark::load::>(proof_path) { - Ok(snark) => { - snarks.push(snark); - } - Err(_) => { - return Err( - "invalid sample commitment type for aggregation, must be KZG" - .to_string() - .into(), - ); - } - } - } - // proof aggregation - let pb = { - let pb = init_spinner(); - pb.set_message("Aggregating (may take a while)..."); - pb - }; - - let circuit = AggregationCircuit::new(&G1Affine::generator().into(), snarks, split_proofs)?; - - let prover = halo2_proofs::dev::MockProver::run(logrows, &circuit, vec![circuit.instances()]) - .map_err(|e| ExecutionError::MockProverError(e.to_string()))?; - prover.verify().map_err(ExecutionError::VerifyError)?; - pb.finish_with_message("Done."); - Ok(String::new()) -} - -#[allow(clippy::too_many_arguments)] -pub(crate) fn setup_aggregate( - sample_snarks: Vec, - vk_path: PathBuf, - pk_path: PathBuf, - srs_path: Option, - logrows: u32, - split_proofs: bool, - disable_selector_compression: bool, - commitment: Commitments, -) -> Result { - let mut snarks = vec![]; - for proof_path in sample_snarks.iter() { - match Snark::load::>(proof_path) { - Ok(snark) => { - snarks.push(snark); - } - Err(_) => { - return Err( - "invalid sample commitment type for aggregation, must be KZG" - .to_string() - .into(), - ); - } - } - } - - let circuit = AggregationCircuit::new(&G1Affine::generator().into(), snarks, split_proofs)?; - - let pk = match commitment { - Commitments::KZG => { - let params = load_params_prover::>( - srs_path, - logrows, - Commitments::KZG, - )?; - - create_keys::, AggregationCircuit>( - &circuit, - ¶ms, - disable_selector_compression, - )? - } - Commitments::IPA => { - let params = load_params_prover::>( - srs_path, - logrows, - Commitments::IPA, - )?; - create_keys::, AggregationCircuit>( - &circuit, - ¶ms, - disable_selector_compression, - )? - } - }; - save_vk::(&vk_path, pk.get_vk())?; - save_pk::(&pk_path, &pk)?; - - Ok(String::new()) -} - -#[allow(clippy::too_many_arguments)] -pub(crate) fn aggregate( - proof_path: PathBuf, - aggregation_snarks: Vec, - pk_path: PathBuf, - srs_path: Option, - transcript: TranscriptType, - logrows: u32, - check_mode: CheckMode, - split_proofs: bool, - commitment: Commitments, -) -> Result, EZKLError> { - let mut snarks = vec![]; - for proof_path in aggregation_snarks.iter() { - match Snark::load::>(proof_path) { - Ok(snark) => { - snarks.push(snark); - } - Err(_) => { - return Err( - "invalid sample commitment type for aggregation, must be KZG" - .to_string() - .into(), - ); - } - } - } - - // proof aggregation - let pb = { - let pb = init_spinner(); - pb.set_message("Aggregating (may take a while)..."); - pb - }; - - let now = Instant::now(); - - let snark = match commitment { - Commitments::KZG => { - let pk = load_pk::, AggregationCircuit>(pk_path, ())?; - let params: ParamsKZG = load_params_prover::>( - srs_path.clone(), - logrows, - Commitments::KZG, - )?; - let circuit = AggregationCircuit::new( - &ParamsProver::::get_g(¶ms)[0].into(), - snarks, - split_proofs, - )?; - let public_inputs = circuit.instances(); - match transcript { - TranscriptType::EVM => create_proof_circuit::< - KZGCommitmentScheme, - _, - ProverSHPLONK<_>, - VerifierSHPLONK<_>, - KZGSingleStrategy<_>, - _, - EvmTranscript<_, _, _, _>, - EvmTranscript<_, _, _, _>, - >( - circuit, - vec![public_inputs], - ¶ms, - &pk, - check_mode, - commitment, - transcript, - None, - None, - ), - TranscriptType::Poseidon => { - let protocol = Some(compile( - ¶ms, - pk.get_vk(), - Config::kzg().with_num_instance(vec![public_inputs.len()]), - )); - - create_proof_circuit::< - KZGCommitmentScheme, - _, - ProverSHPLONK<_>, - VerifierSHPLONK<_>, - KZGAccumulatorStrategy<_>, - _, - PoseidonTranscript, - PoseidonTranscript, - >( - circuit, - vec![public_inputs], - ¶ms, - &pk, - check_mode, - commitment, - transcript, - None, - protocol, - ) - } - } - } - Commitments::IPA => { - let pk = load_pk::, AggregationCircuit>(pk_path, ())?; - let params: ParamsIPA<_> = load_params_prover::>( - srs_path.clone(), - logrows, - Commitments::IPA, - )?; - let circuit = AggregationCircuit::new( - &ParamsProver::::get_g(¶ms)[0].into(), - snarks, - split_proofs, - )?; - let public_inputs = circuit.instances(); - - match transcript { - TranscriptType::EVM => create_proof_circuit::< - IPACommitmentScheme, - _, - ProverIPA<_>, - VerifierIPA<_>, - IPASingleStrategy<_>, - _, - EvmTranscript<_, _, _, _>, - EvmTranscript<_, _, _, _>, - >( - circuit, - vec![public_inputs], - ¶ms, - &pk, - check_mode, - commitment, - transcript, - None, - None, - ), - TranscriptType::Poseidon => { - let protocol = Some(compile( - ¶ms, - pk.get_vk(), - Config::ipa().with_num_instance(vec![public_inputs.len()]), - )); - - create_proof_circuit::< - IPACommitmentScheme, - _, - ProverIPA<_>, - VerifierIPA<_>, - IPAAccumulatorStrategy<_>, - _, - PoseidonTranscript, - PoseidonTranscript, - >( - circuit, - vec![public_inputs], - ¶ms, - &pk, - check_mode, - commitment, - transcript, - None, - protocol, - ) - } - } - } - }?; - // the K used for the aggregation circuit - - let elapsed = now.elapsed(); - info!( - "Aggregation proof took {}.{}", - elapsed.as_secs(), - elapsed.subsec_millis() - ); - snark.save(&proof_path)?; - - pb.finish_with_message("Done."); - - Ok(snark) -} - pub(crate) fn verify( proof_path: PathBuf, settings_path: PathBuf, @@ -2307,7 +1798,6 @@ pub(crate) fn verify( match commitment { Commitments::KZG => { - let proof = Snark::load::>(&proof_path)?; let params: ParamsKZG = if reduced_srs { // only need G_0 for the verification with shplonk load_params_verifier::>(srs_path, 1, Commitments::KZG)? @@ -2318,61 +1808,34 @@ pub(crate) fn verify( Commitments::KZG, )? }; - match proof.transcript_type { - TranscriptType::EVM => { - verify_commitment::< - KZGCommitmentScheme, - VerifierSHPLONK<'_, Bn256>, - _, - KZGSingleStrategy<_>, - EvmTranscript, - GraphCircuit, - _, - >(proof_path, circuit_settings, vk_path, ¶ms, logrows) - } - TranscriptType::Poseidon => { - verify_commitment::< - KZGCommitmentScheme, - VerifierSHPLONK<'_, Bn256>, - _, - KZGSingleStrategy<_>, - PoseidonTranscript, - GraphCircuit, - _, - >(proof_path, circuit_settings, vk_path, ¶ms, logrows) - } + { + verify_commitment::< + KZGCommitmentScheme, + VerifierSHPLONK<'_, Bn256>, + _, + KZGSingleStrategy<_>, + EvmTranscript, + GraphCircuit, + _, + >(proof_path, circuit_settings, vk_path, ¶ms, logrows) } } Commitments::IPA => { - let proof = Snark::load::>(&proof_path)?; let params: ParamsIPA<_> = load_params_verifier::>( srs_path, logrows, Commitments::IPA, )?; - match proof.transcript_type { - TranscriptType::EVM => { - verify_commitment::< - IPACommitmentScheme, - VerifierIPA<_>, - _, - IPASingleStrategy<_>, - EvmTranscript, - GraphCircuit, - _, - >(proof_path, circuit_settings, vk_path, ¶ms, logrows) - } - TranscriptType::Poseidon => { - verify_commitment::< - IPACommitmentScheme, - VerifierIPA<_>, - _, - IPASingleStrategy<_>, - PoseidonTranscript, - GraphCircuit, - _, - >(proof_path, circuit_settings, vk_path, ¶ms, logrows) - } + { + verify_commitment::< + IPACommitmentScheme, + VerifierIPA<_>, + _, + IPASingleStrategy<_>, + EvmTranscript, + GraphCircuit, + _, + >(proof_path, circuit_settings, vk_path, ¶ms, logrows) } } } @@ -2422,83 +1885,6 @@ where result.map_err(|e: plonk::Error| e.into()).map(|_| true) } -pub(crate) fn verify_aggr( - proof_path: PathBuf, - vk_path: PathBuf, - srs_path: Option, - logrows: u32, - reduced_srs: bool, - commitment: Commitments, -) -> Result { - match commitment { - Commitments::KZG => { - let proof = Snark::load::>(&proof_path)?; - let params: ParamsKZG = if reduced_srs { - // only need G_0 for the verification with shplonk - load_params_verifier::>(srs_path, 1, Commitments::KZG)? - } else { - load_params_verifier::>( - srs_path, - logrows, - Commitments::KZG, - )? - }; - match proof.transcript_type { - TranscriptType::EVM => verify_commitment::< - KZGCommitmentScheme, - VerifierSHPLONK<'_, Bn256>, - _, - KZGSingleStrategy<_>, - EvmTranscript<_, _, _, _>, - AggregationCircuit, - _, - >(proof_path, (), vk_path, ¶ms, logrows), - TranscriptType::Poseidon => { - verify_commitment::< - KZGCommitmentScheme, - VerifierSHPLONK<'_, Bn256>, - _, - KZGAccumulatorStrategy<_>, - PoseidonTranscript, - AggregationCircuit, - _, - >(proof_path, (), vk_path, ¶ms, logrows) - } - } - } - Commitments::IPA => { - let proof = Snark::load::>(&proof_path)?; - let params: ParamsIPA<_> = load_params_verifier::>( - srs_path, - logrows, - Commitments::IPA, - )?; - match proof.transcript_type { - TranscriptType::EVM => verify_commitment::< - IPACommitmentScheme, - VerifierIPA<_>, - _, - IPASingleStrategy<_>, - EvmTranscript<_, _, _, _>, - AggregationCircuit, - _, - >(proof_path, (), vk_path, ¶ms, logrows), - TranscriptType::Poseidon => { - verify_commitment::< - IPACommitmentScheme, - VerifierIPA<_>, - _, - IPAAccumulatorStrategy<_>, - PoseidonTranscript, - AggregationCircuit, - _, - >(proof_path, (), vk_path, ¶ms, logrows) - } - } - } - } -} - /// helper function for load_params pub(crate) fn load_params_verifier( srs_path: Option, diff --git a/src/graph/mod.rs b/src/graph/mod.rs index 5e7e3a41..da4f9b0b 100644 --- a/src/graph/mod.rs +++ b/src/graph/mod.rs @@ -1635,10 +1635,15 @@ impl GraphCircuit { max_logrows = std::cmp::min( max_logrows, // max of the model constraint logrows, min_bits, and the constants logrows is the upper limit - *[model_constraint_logrows, min_bits, constants_logrows, einsum_logrows] - .iter() - .max() - .unwrap(), + *[ + model_constraint_logrows, + min_bits, + constants_logrows, + einsum_logrows, + ] + .iter() + .max() + .unwrap(), ); // we now have a min and max logrows diff --git a/src/lib.rs b/src/lib.rs index 4e5f79f0..37f82051 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,8 +42,6 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; #[derive(thiserror::Error, Debug)] #[allow(missing_docs)] pub enum EZKLError { - #[error("[aggregation] {0}")] - AggregationError(#[from] pfsys::evm::aggregation_kzg::AggregationError), #[cfg(all( feature = "ezkl", not(all(target_arch = "wasm32", target_os = "unknown")) @@ -130,7 +128,6 @@ pub fn version() -> &'static str { /// Bindings management #[cfg(any( - feature = "universal-bindings", all(target_arch = "wasm32", target_os = "unknown"), feature = "python-bindings" ))] @@ -171,8 +168,6 @@ pub mod pfsys; pub mod srs_sha; /// An implementation of multi-dimensional tensors. pub mod tensor; -#[cfg(feature = "ios-bindings")] -uniffi::setup_scaffolding!(); #[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))] use lazy_static::lazy_static; diff --git a/src/pfsys/evm/aggregation_kzg.rs b/src/pfsys/evm/aggregation_kzg.rs deleted file mode 100644 index 26a418e2..00000000 --- a/src/pfsys/evm/aggregation_kzg.rs +++ /dev/null @@ -1,442 +0,0 @@ -#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))] -use crate::graph::CircuitSize; -use crate::pfsys::{Snark, SnarkWitness}; -#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))] -use colored_json::ToColoredJson; -use halo2_proofs::circuit::AssignedCell; -use halo2_proofs::plonk::{self}; -use halo2_proofs::{ - circuit::{Layouter, SimpleFloorPlanner, Value}, - plonk::{Circuit, ConstraintSystem}, -}; -use halo2_wrong_ecc::{ - integer::rns::Rns, - maingate::{ - MainGate, MainGateConfig, MainGateInstructions, RangeChip, RangeConfig, RangeInstructions, - RegionCtx, - }, - EccConfig, -}; -use halo2curves::bn256::{Bn256, Fq, Fr, G1Affine}; -use halo2curves::ff::PrimeField; -use itertools::Itertools; -#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))] -use log::debug; -use log::trace; -use rand::rngs::OsRng; -use snark_verifier::loader::native::NativeLoader; -use snark_verifier::loader::EcPointLoader; -use snark_verifier::{ - loader, - pcs::{ - kzg::{ - Bdfg21, KzgAccumulator, KzgAs, KzgSuccinctVerifyingKey, LimbsEncoding, - LimbsEncodingInstructions, - }, - AccumulationScheme, AccumulationSchemeProver, - }, - system, - util::arithmetic::fe_to_limbs, - verifier::{self, SnarkVerifier}, -}; -use std::rc::Rc; -use thiserror::Error; - -const LIMBS: usize = 4; -const BITS: usize = 68; -type As = KzgAs; -/// Type for aggregator verification -type PlonkSuccinctVerifier = verifier::plonk::PlonkSuccinctVerifier>; - -const T: usize = 5; -const RATE: usize = 4; -const R_F: usize = 8; -const R_P: usize = 60; - -type Svk = KzgSuccinctVerifyingKey; -type BaseFieldEccChip = halo2_wrong_ecc::BaseFieldEccChip; -/// The loader type used in the transcript definition -type Halo2Loader<'a> = loader::halo2::Halo2Loader<'a, G1Affine, BaseFieldEccChip>; -/// Application snark transcript -pub type PoseidonTranscript = - system::halo2::transcript::halo2::PoseidonTranscript; - -#[derive(Error, Debug)] -/// Errors related to proof aggregation -pub enum AggregationError { - /// A KZG proof could not be verified - #[error("failed to verify KZG proof")] - KZGProofVerification, - /// proof read errors - #[error("Failed to read proof")] - ProofRead, - /// proof verification errors - #[error("Failed to verify proof")] - ProofVerify, - /// proof creation errors - #[error("Failed to create proof")] - ProofCreate, -} - -type AggregationResult<'a> = ( - // accumulator - KzgAccumulator>>, - // the set of assigned cells - Vec>>, -); - -type LoadedProof<'a> = verifier::plonk::PlonkProof< - G1Affine, - Rc< - loader::halo2::Halo2Loader< - 'a, - G1Affine, - halo2_wrong_ecc::BaseFieldEccChip, - >, - >, - KzgAs, ->; - -/// Aggregate one or more application snarks of the same shape into a KzgAccumulator -pub fn aggregate<'a>( - svk: &Svk, - loader: &Rc>, - snarks: &[SnarkWitness], - as_proof: Value<&'_ [u8]>, - split_proofs: bool, -) -> Result, plonk::Error> { - let assign_instances = |instances: &[Vec>]| { - instances - .iter() - .map(|instances| { - instances - .iter() - .map(|instance| loader.assign_scalar(*instance)) - .collect_vec() - }) - .collect_vec() - }; - - let mut accumulators = vec![]; - let mut snark_instances = vec![]; - let mut proofs: Vec> = vec![]; - - for snark in snarks.iter() { - let protocol = snark.protocol.as_ref().unwrap().loaded(loader); - let instances = assign_instances(&snark.instances); - - // get assigned cells - snark_instances.extend(instances.iter().map(|instance| { - instance - .iter() - .map(|v| v.clone().into_assigned()) - .collect_vec() - })); - - let mut transcript = PoseidonTranscript::, _>::new(loader, snark.proof()); - let proof = PlonkSuccinctVerifier::read_proof(svk, &protocol, &instances, &mut transcript) - .map_err(|_| plonk::Error::Synthesis)?; - - if split_proofs { - let previous_proof = proofs.last(); - let split_commit = match snark.clone().split { - Some(split) => split, - None => { - log::error!("Failed to split KZG commit for sequential proofs"); - return Err(plonk::Error::Synthesis); - } - }; - if let Some(previous_proof) = previous_proof { - // output of previous proof - let output = &previous_proof.witnesses[split_commit.start..split_commit.end]; - // input of current proof - let split_commit_len = split_commit.end - split_commit.start; - let input = &proof.witnesses[..split_commit_len]; - // these points were already assigned previously when loading the transcript so this is safe - // and equivalent to a copy constraint and an equality constraint - for (output, input) in output.iter().zip(input.iter()) { - loader - .ec_point_assert_eq("assert commits match", output, input) - .map_err(|e| { - log::error!( - "Failed to match KZG commits for sequential proofs: {:?}", - e - ); - plonk::Error::Synthesis - })?; - } - } - proofs.push(proof.clone()); - } - - let mut accum = PlonkSuccinctVerifier::verify(svk, &protocol, &instances, &proof) - .map_err(|_| plonk::Error::Synthesis)?; - accumulators.append(&mut accum); - } - let accumulator = { - let mut transcript = PoseidonTranscript::, _>::new(loader, as_proof); - let proof = As::read_proof(&Default::default(), &accumulators, &mut transcript).unwrap(); - As::verify(&Default::default(), &accumulators, &proof).map_err(|_| plonk::Error::Synthesis) - }?; - Ok((accumulator, snark_instances)) -} - -/// The Halo2 Config for the aggregation circuit -#[derive(Clone, Debug)] -pub struct AggregationConfig { - main_gate_config: MainGateConfig, - range_config: RangeConfig, -} - -impl AggregationConfig { - /// Configure the aggregation circuit - pub fn configure( - meta: &mut ConstraintSystem, - composition_bits: Vec, - overflow_bits: Vec, - ) -> Self { - let main_gate_config = MainGate::::configure(meta); - let range_config = - RangeChip::::configure(meta, &main_gate_config, composition_bits, overflow_bits); - - #[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))] - { - let circuit_size = CircuitSize::from_cs(meta, 23); - - // not wasm - - debug!( - "circuit size: \n {}", - circuit_size - .as_json() - .unwrap() - .to_colored_json_auto() - .unwrap() - ); - } - - AggregationConfig { - main_gate_config, - range_config, - } - } - - /// Create a MainGate from the aggregation approach - pub fn main_gate(&self) -> MainGate { - MainGate::new(self.main_gate_config.clone()) - } - - /// Create a range chip to decompose and range check inputs - pub fn range_chip(&self) -> RangeChip { - RangeChip::new(self.range_config.clone()) - } - - /// Create an ecc chip for ec ops - pub fn ecc_chip(&self) -> BaseFieldEccChip { - BaseFieldEccChip::new(EccConfig::new( - self.range_config.clone(), - self.main_gate_config.clone(), - )) - } -} - -/// Aggregation Circuit with a SuccinctVerifyingKey, application snark witnesses (each with a proof and instance variables), and the instance variables and the resulting aggregation circuit proof. -#[derive(Clone, Debug)] -pub struct AggregationCircuit { - svk: Svk, - snarks: Vec>, - instances: Vec, - as_proof: Value>, - split_proof: bool, -} - -impl AggregationCircuit { - /// Create a new Aggregation Circuit with a SuccinctVerifyingKey, application snark witnesses (each with a proof and instance variables), and the instance variables and the resulting aggregation circuit proof. - pub fn new( - svk: &KzgSuccinctVerifyingKey, - snarks: impl IntoIterator>, - split_proof: bool, - ) -> Result { - let snarks = snarks.into_iter().collect_vec(); - - let mut accumulators = vec![]; - - for snark in snarks.iter() { - trace!("Aggregating with snark instances {:?}", snark.instances); - let mut transcript = PoseidonTranscript::::new(snark.proof.as_slice()); - let proof = PlonkSuccinctVerifier::read_proof( - svk, - snark.protocol.as_ref().unwrap(), - &snark.instances, - &mut transcript, - ) - .map_err(|e| { - log::error!("{:?}", e); - AggregationError::ProofRead - })?; - let mut accum = PlonkSuccinctVerifier::verify( - svk, - snark.protocol.as_ref().unwrap(), - &snark.instances, - &proof, - ) - .map_err(|_| AggregationError::ProofVerify)?; - accumulators.append(&mut accum); - } - - trace!("Accumulator"); - let (accumulator, as_proof) = { - let mut transcript = PoseidonTranscript::::new(Vec::new()); - let accumulator = - As::create_proof(&Default::default(), &accumulators, &mut transcript, OsRng) - .map_err(|_| AggregationError::ProofCreate)?; - (accumulator, transcript.finalize()) - }; - - trace!("KzgAccumulator"); - let KzgAccumulator { lhs, rhs } = accumulator; - let instances = [lhs.x, lhs.y, rhs.x, rhs.y] - .map(fe_to_limbs::<_, _, LIMBS, BITS>) - .concat(); - - Ok(Self { - svk: *svk, - snarks: snarks.into_iter().map_into().collect(), - instances, - as_proof: Value::known(as_proof), - split_proof, - }) - } - - /// Number of limbs used for decomposition - pub fn num_limbs() -> usize { - LIMBS - } - /// Number of bits used for decomposition - pub fn num_bits() -> usize { - BITS - } - - /// Accumulator indices used in generating verifier. - pub fn accumulator_indices() -> Vec<(usize, usize)> { - (0..4 * LIMBS).map(|idx| (0, idx)).collect() - } - - /// Number of instance variables for the aggregation circuit, used in generating verifier. - pub fn num_instance(orginal_circuit_instances: usize) -> Vec { - let accumulation_instances = 4 * LIMBS; - vec![accumulation_instances + orginal_circuit_instances] - } - - /// Instance variables for the aggregation circuit, fed to verifier. - pub fn instances(&self) -> Vec { - // also get snark instances here - let mut snark_instances: Vec>>> = self - .snarks - .iter() - .map(|snark| snark.instances.clone()) - .collect_vec(); - - // reduce from Vec>>> to Vec>> - let mut instances: Vec = self.instances.clone(); - for snark_instance in snark_instances.iter_mut() { - for instance in snark_instance.iter_mut() { - let mut felt_evals = vec![]; - for value in instance.iter_mut() { - value.map(|v| felt_evals.push(v)); - } - instances.extend(felt_evals); - } - } - - instances - } - - fn as_proof(&self) -> Value<&[u8]> { - self.as_proof.as_ref().map(Vec::as_slice) - } -} - -impl Circuit for AggregationCircuit { - type Config = AggregationConfig; - type FloorPlanner = SimpleFloorPlanner; - type Params = (); - - fn without_witnesses(&self) -> Self { - Self { - svk: self.svk, - snarks: self - .snarks - .iter() - .map(SnarkWitness::without_witnesses) - .collect(), - instances: Vec::new(), - as_proof: Value::unknown(), - split_proof: self.split_proof, - } - } - - fn configure(meta: &mut ConstraintSystem) -> Self::Config { - AggregationConfig::configure( - meta, - vec![BITS / LIMBS], - Rns::::construct().overflow_lengths(), - ) - } - - fn synthesize( - &self, - config: Self::Config, - mut layouter: impl Layouter, - ) -> Result<(), plonk::Error> { - let main_gate = config.main_gate(); - let range_chip = config.range_chip(); - - range_chip.load_table(&mut layouter)?; - - let (accumulator_limbs, snark_instances) = layouter.assign_region( - || "", - |region| { - let ctx = RegionCtx::new(region, 0); - - let ecc_chip = config.ecc_chip(); - let loader = Halo2Loader::new(ecc_chip, ctx); - let (accumulator, snark_instances) = aggregate( - &self.svk, - &loader, - &self.snarks, - self.as_proof(), - self.split_proof, - )?; - - let accumulator_limbs = [accumulator.lhs, accumulator.rhs] - .iter() - .map(|ec_point| { - loader - .ecc_chip() - .assign_ec_point_to_limbs(&mut loader.ctx_mut(), ec_point.assigned()) - }) - .collect::, plonk::Error>>()? - .into_iter() - .flatten(); - - Ok((accumulator_limbs, snark_instances)) - }, - )?; - - let mut instance_offset = 0; - for limb in accumulator_limbs { - main_gate.expose_public(layouter.namespace(|| ""), limb, instance_offset)?; - instance_offset += 1; - } - - for instance in snark_instances.into_iter() { - for elem in instance.into_iter() { - main_gate.expose_public(layouter.namespace(|| ""), elem, instance_offset)?; - instance_offset += 1; - } - } - - Ok(()) - } -} diff --git a/src/pfsys/evm/mod.rs b/src/pfsys/evm/mod.rs deleted file mode 100644 index a185301c..00000000 --- a/src/pfsys/evm/mod.rs +++ /dev/null @@ -1,24 +0,0 @@ -use thiserror::Error; - -/// Aggregate proof generation for EVM using KZG -pub mod aggregation_kzg; - -#[derive(Error, Debug)] -/// Errors related to evm verification -pub enum EvmVerificationError { - /// If the Solidity verifier worked but returned false - #[error("Solidity verifier found the proof invalid")] - InvalidProof, - /// If the Solidity verifier threw and error (e.g. OutOfGas) - #[error("Execution of Solidity code failed: {0}")] - SolidityExecution(String), - /// EVM verify errors - #[error("evm verification reverted: {0}")] - Reverted(String), - /// EVM verify errors - #[error("evm deployment failed: {0}")] - DeploymentFailed(String), - /// Invalid Visibility - #[error("Invalid visibility")] - InvalidVisibility, -} diff --git a/src/pfsys/mod.rs b/src/pfsys/mod.rs index de6b97ce..bf10f262 100644 --- a/src/pfsys/mod.rs +++ b/src/pfsys/mod.rs @@ -1,6 +1,3 @@ -/// EVM related proving and verification -pub mod evm; - /// SRS generation, processing, verification and downloading pub mod srs; @@ -13,11 +10,7 @@ use std::borrow::Borrow; use crate::circuit::CheckMode; use crate::graph::GraphWitness; -use crate::pfsys::evm::aggregation_kzg::PoseidonTranscript; use crate::{Commitments, EZKL_BUF_CAPACITY, EZKL_KEY_FORMAT}; -#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))] -use clap::ValueEnum; -use halo2_proofs::circuit::Value; use halo2_proofs::plonk::{ create_proof, keygen_pk, keygen_vk_custom, verify_proof, Circuit, ProvingKey, VerifyingKey, }; @@ -37,7 +30,6 @@ use rand::rngs::OsRng; use rand::rngs::StdRng; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; -use snark_verifier::loader::native::NativeLoader; use snark_verifier::system::halo2::transcript::evm::EvmTranscript; use snark_verifier::verifier::plonk::PlonkProtocol; use std::fs::File; @@ -45,8 +37,6 @@ use std::io::{self, BufReader, BufWriter, Cursor, Write}; use std::ops::Deref; use std::path::PathBuf; use thiserror::Error as thisError; -#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))] -use tosubcommand::ToFlags; #[cfg(feature = "python-bindings")] use pyo3::types::PyDictMethods; @@ -140,144 +130,6 @@ where bytes } -#[allow(missing_docs)] -#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, Deserialize, Serialize, PartialOrd)] -#[cfg_attr(all(feature = "ezkl", not(target_arch = "wasm32")), derive(ValueEnum))] -pub enum ProofType { - #[default] - Single, - ForAggr, -} - -impl std::fmt::Display for ProofType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - match self { - ProofType::Single => "single", - ProofType::ForAggr => "for-aggr", - } - ) - } -} -#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))] -impl ToFlags for ProofType { - fn to_flags(&self) -> Vec { - vec![format!("{}", self)] - } -} - -impl From for TranscriptType { - fn from(val: ProofType) -> Self { - match val { - ProofType::Single => TranscriptType::EVM, - ProofType::ForAggr => TranscriptType::Poseidon, - } - } -} - -impl From for StrategyType { - fn from(val: ProofType) -> Self { - match val { - ProofType::Single => StrategyType::Single, - ProofType::ForAggr => StrategyType::Accum, - } - } -} - -#[cfg(feature = "python-bindings")] -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 { - let result = match self { - ProofType::Single => "Single", - ProofType::ForAggr => "ForAggr", - }; - Ok(result.into_pyobject(py)?.into_any()) - } -} - -#[cfg(feature = "python-bindings")] -/// Obtains StrategyType from PyObject (Required for StrategyType to be compatible with Python) -impl<'source> pyo3::FromPyObject<'source> for ProofType { - fn extract_bound(ob: &pyo3::Bound<'source, pyo3::PyAny>) -> pyo3::PyResult { - let strval = String::extract_bound(ob)?; - match strval.to_lowercase().as_str() { - "single" => Ok(ProofType::Single), - "for-aggr" => Ok(ProofType::ForAggr), - _ => Err(pyo3::exceptions::PyValueError::new_err( - "Invalid value for ProofType", - )), - } - } -} - -#[allow(missing_docs)] -#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] -#[cfg_attr(all(feature = "ezkl", not(target_arch = "wasm32")), derive(ValueEnum))] -pub enum StrategyType { - Single, - Accum, -} -impl std::fmt::Display for StrategyType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - // When the `ezkl` feature is disabled or we're targeting `wasm32`, use basic string representation. - #[cfg(any(not(feature = "ezkl"), target_arch = "wasm32"))] - { - write!( - f, - "{}", - match self { - StrategyType::Single => "single", - StrategyType::Accum => "accum", - } - ) - } - - // When the `ezkl` feature is enabled and we're not targeting `wasm32`, use `to_possible_value`. - #[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))] - { - self.to_possible_value() - .expect("no values are skipped") - .get_name() - .fmt(f) - } - } -} -#[cfg(feature = "python-bindings")] -/// Converts StrategyType into a PyObject (Required for StrategyType to be compatible with Python) -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 { - let result = match self { - StrategyType::Single => "single", - StrategyType::Accum => "accum", - }; - Ok(result.into_pyobject(py)?.into_any()) - } -} -#[cfg(feature = "python-bindings")] -/// Obtains StrategyType from PyObject (Required for StrategyType to be compatible with Python) -impl<'source> pyo3::FromPyObject<'source> for StrategyType { - fn extract_bound(ob: &pyo3::Bound<'source, pyo3::PyAny>) -> pyo3::PyResult { - let strval = String::extract_bound(ob)?; - match strval.to_lowercase().as_str() { - "single" => Ok(StrategyType::Single), - "accum" => Ok(StrategyType::Accum), - _ => Err(pyo3::exceptions::PyValueError::new_err( - "Invalid value for StrategyType", - )), - } - } -} - #[derive(thisError, Debug)] /// Errors related to pfsys pub enum PfSysError { @@ -286,34 +138,6 @@ pub enum PfSysError { PackingExponent, } -#[allow(missing_docs)] -#[derive(Default, Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize, PartialOrd)] -#[cfg_attr(all(feature = "ezkl", not(target_arch = "wasm32")), derive(ValueEnum))] -pub enum TranscriptType { - Poseidon, - #[default] - EVM, -} - -impl std::fmt::Display for TranscriptType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - match self { - TranscriptType::Poseidon => "poseidon", - TranscriptType::EVM => "evm", - } - ) - } -} -#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))] -impl ToFlags for TranscriptType { - fn to_flags(&self) -> Vec { - vec![format!("{}", self)] - } -} - #[cfg(feature = "python-bindings")] /// pub fn g1affine_to_pydict(g1affine_dict: &pyo3::Bound<'_, PyDict>, g1affine: &G1Affine) { @@ -371,7 +195,7 @@ pub struct PrettyElements { pub outputs: Vec>, } -/// An application snark with proof and instance variables ready for aggregation (raw field element) +/// An application snark with proof and instance variables #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Snark where @@ -386,8 +210,6 @@ where pub proof: Vec, /// hex encoded proof pub hex_proof: Option, - /// transcript type - pub transcript_type: TranscriptType, /// the split proof pub split: Option, /// the proof instances as rescaled floats @@ -423,8 +245,6 @@ 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.into_pyobject(py)?) - .unwrap(); Ok(dict.into_any()) } } @@ -437,14 +257,13 @@ where C::Scalar: Serialize + DeserializeOwned, C::ScalarExt: Serialize + DeserializeOwned, { - /// Create a new application snark from proof and instance variables ready for aggregation + /// Create a new application snark from proof and instance variables #[allow(clippy::too_many_arguments)] pub fn new( protocol: Option>, instances: Vec>, proof: Vec, hex_proof: Option, - transcript_type: TranscriptType, split: Option, pretty_public_inputs: Option, commitment: Option, @@ -454,7 +273,6 @@ where instances, proof, hex_proof, - transcript_type, split, pretty_public_inputs, // unix timestamp @@ -560,53 +378,6 @@ impl From for Option { } } -/// An application snark with proof and instance variables ready for aggregation (wrapped field element) -#[derive(Clone, Debug)] -pub struct SnarkWitness { - protocol: Option>, - instances: Vec>>, - proof: Value>, - split: Option, -} - -impl SnarkWitness { - fn without_witnesses(&self) -> Self { - SnarkWitness { - protocol: self.protocol.clone(), - instances: self - .instances - .iter() - .map(|instances| vec![Value::unknown(); instances.len()]) - .collect(), - proof: Value::unknown(), - split: self.split.clone(), - } - } - - fn proof(&self) -> Value<&[u8]> { - self.proof.as_ref().map(Vec::as_slice) - } -} - -impl From> for SnarkWitness -where - C::Scalar: Serialize + DeserializeOwned, - C::ScalarExt: Serialize + DeserializeOwned, -{ - fn from(snark: Snark) -> Self { - Self { - protocol: snark.protocol, - instances: snark - .instances - .into_iter() - .map(|instances| instances.into_iter().map(Value::known).collect()) - .collect(), - proof: Value::known(snark.proof), - split: snark.split, - } - } -} - /// Creates a [VerifyingKey] and [ProvingKey] for a [crate::graph::GraphCircuit] (`circuit`) with specific [CommitmentScheme] parameters (`params`). pub fn create_keys>( circuit: &C, @@ -653,7 +424,6 @@ pub fn create_proof_circuit< pk: &ProvingKey, check_mode: CheckMode, commitment: Commitments, - transcript_type: TranscriptType, split: Option, protocol: Option>, ) -> Result, PfsysError> @@ -706,7 +476,6 @@ where instances, proof, Some(hex_proof), - transcript_type, split, None, Some(commitment), @@ -805,30 +574,16 @@ pub fn swap_proof_commitments_polycommit( commitments: &[G1Affine], ) -> Result, PfsysError> { let proof = match snark.commitment { - Some(Commitments::KZG) => match snark.transcript_type { - TranscriptType::EVM => swap_proof_commitments::< - KZGCommitmentScheme, - _, - EvmTranscript, - >(snark, commitments)?, - TranscriptType::Poseidon => swap_proof_commitments::< - KZGCommitmentScheme, - _, - PoseidonTranscript, - >(snark, commitments)?, - }, - Some(Commitments::IPA) => match snark.transcript_type { - TranscriptType::EVM => swap_proof_commitments::< - IPACommitmentScheme, - _, - EvmTranscript, - >(snark, commitments)?, - TranscriptType::Poseidon => swap_proof_commitments::< - IPACommitmentScheme, - _, - PoseidonTranscript, - >(snark, commitments)?, - }, + Some(Commitments::KZG) => swap_proof_commitments::< + KZGCommitmentScheme, + _, + EvmTranscript, + >(snark, commitments)?, + Some(Commitments::IPA) => swap_proof_commitments::< + IPACommitmentScheme, + _, + EvmTranscript, + >(snark, commitments)?, None => { return Err(PfsysError::InvalidCommitmentScheme); } @@ -993,7 +748,6 @@ mod tests { let snark = Snark:: { proof: vec![1, 2, 3, 4, 5, 6, 7, 8], instances: vec![vec![Fr::from(1)], vec![Fr::from(2)]], - transcript_type: TranscriptType::EVM, protocol: None, hex_proof: None, split: None, @@ -1012,6 +766,5 @@ mod tests { .unwrap(); assert_eq!(snark.instances, snark2.instances); assert_eq!(snark.proof, snark2.proof); - assert_eq!(snark.transcript_type, snark2.transcript_type); } } diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index caead5ed..c2de6c07 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -17,8 +17,6 @@ mod native_tests { use std::process::{Child, Command}; use std::sync::Once; static COMPILE: Once = Once::new(); - #[allow(dead_code)] - static COMPILE_WASM: Once = Once::new(); static ENV_SETUP: Once = Once::new(); const TEST_BINARY: &str = "test-runs/ezkl"; @@ -75,13 +73,6 @@ mod native_tests { }); } - #[allow(dead_code)] - fn init_wasm() { - COMPILE_WASM.call_once(|| { - build_wasm_ezkl(); - }); - } - fn setup_py_env() { ENV_SETUP.call_once(|| { // supposes that you have a virtualenv called .env and have run the following @@ -185,8 +176,6 @@ mod native_tests { const PF_FAILURE: &str = "examples/test_failure_proof.json"; - const PF_FAILURE_AGGR: &str = "examples/test_failure_aggr_proof.json"; - const LARGE_TESTS: [&str; 8] = [ "self_attention", "nanoGPT", @@ -314,90 +303,6 @@ mod native_tests { "large_mlp", // 99 ]; - const WASM_TESTS: [&str; 44] = [ - "1l_mlp", // 0 - "1l_slice", // 1 - "1l_concat", // 2 - "1l_flatten", // 3 - // "1l_average", - "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", // 11 - "1l_prelu", // 12 - "1l_leakyrelu", // 13 - "1l_gelu_noappx", // 14 - // "1l_gelu_tanh_appx", - "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", // 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 = "gpu-accelerated"))] - const TESTS_AGGR: [&str; 21] = [ - "1l_mlp", - "1l_flatten", - "1l_average", - "1l_reshape", - "1l_div", - "1l_pad", - "1l_sigmoid", - "1l_gelu_noappx", - "1l_sqrt", - "1l_prelu", - "1l_var", - "1l_leakyrelu", - "1l_relu", - "1l_tanh", - "2l_relu_fc", - "2l_relu_sigmoid_small", - "2l_relu_small", - "1l_conv", - "min", - "max", - "1l_max_pool", - ]; - - #[cfg(feature = "gpu-accelerated")] - const TESTS_AGGR: [&str; 3] = ["1l_mlp", "1l_flatten", "1l_average"]; - const TESTS_EVM: [&str; 23] = [ "1l_mlp", // 0 "1l_flatten", // 1 @@ -424,106 +329,20 @@ mod native_tests { "quantize_dequantize", // 22 ]; - const TESTS_EVM_AGGR: [&str; 18] = [ - "1l_mlp", - "1l_reshape", - "1l_sigmoid", - "1l_div", - "1l_sqrt", - "1l_prelu", - "1l_var", - "1l_leakyrelu", - "1l_gelu_noappx", - "1l_relu", - "1l_tanh", - "2l_relu_sigmoid_small", - "2l_relu_small", - "2l_relu_fc", - "min", - "max", - "idolmodel", - "1l_identity", - ]; - const EXAMPLES: [&str; 2] = ["mlp_4d_einsum", "conv2d_mnist"]; - macro_rules! test_func_aggr { - () => { - #[cfg(test)] - mod tests_aggr { - use seq_macro::seq; - 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="gpu-accelerated"))] - seq!(N in 0..=20 { - - #(#[test_case(TESTS_AGGR[N])])* - fn kzg_aggr_mock_prove_and_verify_(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); - kzg_aggr_mock_prove_and_verify(path, test.to_string()); - test_dir.close().unwrap(); - } - - - - #(#[test_case(TESTS_AGGR[N])])* - fn kzg_aggr_prove_and_verify_(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); - aggr_prove_and_verify(path, test.to_string(), "private", "private", "public", Commitments::KZG); - test_dir.close().unwrap(); - } - - #(#[test_case(TESTS_AGGR[N])])* - fn ipa_aggr_prove_and_verify_(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); - aggr_prove_and_verify(path, test.to_string(), "private", "private", "public", Commitments::IPA); - test_dir.close().unwrap(); - } - - }); - - #[cfg(feature="gpu-accelerated")] - seq!(N in 0..=2 { - #(#[test_case(TESTS_AGGR[N])])* - fn kzg_aggr_prove_and_verify_(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_(test_dir.path().to_str().unwrap(), test); - aggr_prove_and_verify(path, test.to_string(), "private", "private", "public", Commitments::KZG); - test_dir.close().unwrap(); - } - }); - } - }; -} - macro_rules! test_func { () => { #[cfg(test)] mod tests { use seq_macro::seq; use crate::native_tests::TESTS; - use crate::native_tests::WASM_TESTS; use crate::native_tests::ACCURACY_CAL_TESTS; use crate::native_tests::LARGE_TESTS; use test_case::test_case; 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::model_serialization_different_binaries; use tempdir::TempDir; @@ -806,7 +625,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 1, None, false, "single", Commitments::KZG, 2); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 1, None, false, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -815,7 +634,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 3, None, false, "single", Commitments::KZG, 2); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 3, None, false, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -824,7 +643,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 4, None, false, "single", Commitments::KZG, 2); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 4, None, false, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -833,7 +652,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 8, None, false, "single", Commitments::KZG, 2); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 8, None, false, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -842,7 +661,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 1, None, false, "single", Commitments::KZG, 2); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 1, None, false, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -853,7 +672,7 @@ mod native_tests { let path = test_dir.into_path(); let path = path.to_str().unwrap(); crate::native_tests::mv_test_(path, test); - prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 1, None, false, "single", Commitments::KZG, 1); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 1, None, false, Commitments::KZG, 1); // test_dir.close().unwrap(); } @@ -862,7 +681,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 1, None, false, "single", Commitments::IPA, 2); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 1, None, false, Commitments::IPA, 2); test_dir.close().unwrap(); } @@ -871,7 +690,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "public", "private", "public", 1, None, false, "single", Commitments::KZG, 2); + prove_and_verify(path, test.to_string(), "safe", "public", "private", "public", 1, None, false, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -880,7 +699,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "private", "fixed", "public", 1, None, false, "single", Commitments::KZG, 2); + prove_and_verify(path, test.to_string(), "safe", "private", "fixed", "public", 1, None, false, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -889,7 +708,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "private", "private", "hashed", 1, None, false, "single", Commitments::KZG, 2); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "hashed", 1, None, false, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -898,7 +717,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "private", "private", "polycommit", 1, None, false, "single", Commitments::KZG, 2); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "polycommit", 1, None, false, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -907,7 +726,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "safe", "private", "private", "polycommit", 1, None, false, "single", Commitments::IPA, 2); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "polycommit", 1, None, false, Commitments::IPA, 2); test_dir.close().unwrap(); } @@ -915,42 +734,33 @@ mod native_tests { seq!(N in 0..=43 { - #(#[test_case(WASM_TESTS[N])])* + #(#[test_case(TESTS[N])])* fn kzg_prove_and_verify_with_overflow_(test: &str) { crate::native_tests::init_binary(); - // crate::native_tests::init_wasm(); let test_dir = TempDir::new(test).unwrap(); 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 = "gpu-accelerated"))] - // run_js_tests(path, test.to_string(), "testWasm", false); + prove_and_verify(path, test.to_string(), "safe", "private", "private", "public", 1, None, true, Commitments::KZG, 2); test_dir.close().unwrap(); } - #(#[test_case(WASM_TESTS[N])])* + #(#[test_case(TESTS[N])])* fn kzg_prove_and_verify_with_overflow_hashed_inputs_(test: &str) { crate::native_tests::init_binary(); - // crate::native_tests::init_wasm(); let test_dir = TempDir::new(test).unwrap(); 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 = "gpu-accelerated"))] - // run_js_tests(path, test.to_string(), "testWasm", false); + prove_and_verify(path, test.to_string(), "safe", "hashed", "private", "public", 1, None, true, Commitments::KZG, 2); test_dir.close().unwrap(); } - #(#[test_case(WASM_TESTS[N])])* + #(#[test_case(TESTS[N])])* fn kzg_prove_and_verify_with_overflow_fixed_params_(test: &str) { crate::native_tests::init_binary(); - // crate::native_tests::init_wasm(); let test_dir = TempDir::new(test).unwrap(); 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 = "gpu-accelerated"))] - // run_js_tests(path, test.to_string(), "testWasm", false); + prove_and_verify(path, test.to_string(), "safe", "private", "fixed", "public", 1, None, true, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -964,7 +774,7 @@ mod native_tests { 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); - prove_and_verify(path, test.to_string(), "unsafe", "private", "fixed", "public", 1, None, false, "single", Commitments::KZG, 2); + prove_and_verify(path, test.to_string(), "unsafe", "private", "fixed", "public", 1, None, false, Commitments::KZG, 2); test_dir.close().unwrap(); } @@ -989,16 +799,11 @@ mod native_tests { use seq_macro::seq; use crate::native_tests::TESTS_EVM; use crate::native_tests::TESTS; - use crate::native_tests::TESTS_EVM_AGGR; use test_case::test_case; use crate::native_tests::kzg_evm_prove_and_verify; use crate::native_tests::kzg_evm_prove_and_verify_reusable_verifier; - - 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; @@ -1009,20 +814,7 @@ mod native_tests { } - seq!(N in 0..=17 { - // these take a particularly long time to run - #(#[test_case(TESTS_EVM_AGGR[N])])* - #[ignore] - fn kzg_evm_aggr_prove_and_verify_(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); - let _anvil_child = crate::native_tests::start_anvil(false, Hardfork::Latest); - kzg_evm_aggr_prove_and_verify(path, test.to_string(), "private", "private", "public"); - test_dir.close().unwrap(); - } - }); seq!(N in 0..=99 { #(#[test_case(TESTS[N])])* @@ -1098,8 +890,6 @@ 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 = "gpu-accelerated"))] - run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false); test_dir.close().unwrap(); } @@ -1112,8 +902,6 @@ 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 = "gpu-accelerated"))] - run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false); test_dir.close().unwrap(); } @@ -1129,8 +917,6 @@ 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 = "gpu-accelerated"))] - run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false); test_dir.close().unwrap(); } @@ -1142,8 +928,6 @@ 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 = "gpu-accelerated"))] - run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false); test_dir.close().unwrap(); } @@ -1155,8 +939,6 @@ 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 = "gpu-accelerated"))] - run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false); test_dir.close().unwrap(); } @@ -1168,8 +950,6 @@ 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 = "gpu-accelerated"))] - run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false); test_dir.close().unwrap(); } @@ -1181,8 +961,6 @@ 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 = "gpu-accelerated"))] - run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false); test_dir.close().unwrap(); } @@ -1193,8 +971,6 @@ 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 = "gpu-accelerated"))] - run_js_tests(path, test.to_string(), "testBrowserEvmVerify", false); test_dir.close().unwrap(); } @@ -1204,6 +980,8 @@ mod native_tests { }); } }; + + } macro_rules! test_func_examples { @@ -1222,13 +1000,21 @@ mod native_tests { }); } }; -} + } test_func!(); - test_func_aggr!(); test_func_evm!(); test_func_examples!(); + // Mock prove (fast, but does not cover some potential issues) + fn run_example(example_name: String) { + let status = Command::new("cargo") + .args(["run", "--release", "--example", example_name.as_str()]) + .status() + .expect("failed to execute process"); + assert!(status.success()); + } + fn model_serialization_different_binaries(test_dir: &str, example_name: String) { let status = Command::new("cargo") .args([ @@ -1335,15 +1121,6 @@ mod native_tests { assert!(status.success()); } - // Mock prove (fast, but does not cover some potential issues) - fn run_example(example_name: String) { - let status = Command::new("cargo") - .args(["run", "--release", "--example", example_name.as_str()]) - .status() - .expect("failed to execute process"); - assert!(status.success()); - } - // Mock prove (fast, but does not cover some potential issues) #[allow(clippy::too_many_arguments)] fn mock( @@ -1560,233 +1337,6 @@ 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()); - // } - - // 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, - example_name.clone(), - "safe", - "private", - "private", - "public", - 2, - None, - false, - "for-aggr", - Commitments::KZG, - 2, - ); - let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY)) - .args([ - "mock-aggregate", - "--logrows=23", - "--aggregation-snarks", - &format!("{}/{}/proof.pf", test_dir, example_name), - ]) - .status() - .expect("failed to execute process"); - assert!(status.success()); - } - - // prove-serialize-verify, the usual full path - fn aggr_prove_and_verify( - test_dir: &str, - example_name: String, - input_visibility: &str, - param_visibility: &str, - output_visibility: &str, - commitment: Commitments, - ) { - prove_and_verify( - test_dir, - example_name.clone(), - "safe", - input_visibility, - param_visibility, - output_visibility, - 2, - None, - false, - "for-aggr", - Commitments::KZG, - 2, - ); - - download_srs(23, commitment); - // now setup-aggregate - let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY)) - .args([ - "setup-aggregate", - "--sample-snarks", - &format!("{}/{}/proof.pf", test_dir, example_name), - "--logrows=23", - "--vk-path", - &format!("{}/{}/aggr.vk", test_dir, example_name), - "--pk-path", - &format!("{}/{}/aggr.pk", test_dir, example_name), - &format!("--commitment={}", commitment), - ]) - .status() - .expect("failed to execute process"); - assert!(status.success()); - - let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY)) - .args([ - "aggregate", - "--logrows=23", - "--aggregation-snarks", - &format!("{}/{}/proof.pf", test_dir, example_name), - "--proof-path", - &format!("{}/{}/aggr.pf", test_dir, example_name), - "--pk-path", - &format!("{}/{}/aggr.pk", test_dir, example_name), - &format!("--commitment={}", commitment), - ]) - .status() - .expect("failed to execute process"); - assert!(status.success()); - let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY)) - .args([ - "verify-aggr", - "--logrows=23", - "--proof-path", - &format!("{}/{}/aggr.pf", test_dir, example_name), - "--vk-path", - &format!("{}/{}/aggr.vk", test_dir, example_name), - ]) - .status() - .expect("failed to execute process"); - assert!(status.success()); - } - - // prove-serialize-verify, the usual full path - fn kzg_evm_aggr_prove_and_verify( - test_dir: &str, - example_name: String, - input_visibility: &str, - param_visibility: &str, - output_visibility: &str, - ) { - aggr_prove_and_verify( - test_dir, - example_name.clone(), - input_visibility, - param_visibility, - output_visibility, - Commitments::KZG, - ); - - download_srs(23, Commitments::KZG); - - let vk_arg = &format!("{}/{}/aggr.vk", test_dir, example_name); - - fn build_args<'a>(base_args: Vec<&'a str>, sol_arg: &'a str) -> Vec<&'a str> { - let mut args = base_args; - - args.push("--sol-code-path"); - args.push(sol_arg); - args - } - - let sol_arg = format!("{}/{}/kzg_aggr.sol", test_dir, example_name); - let addr_path_arg = format!("--addr-path={}/{}/addr.txt", test_dir, example_name); - let rpc_arg = format!("--rpc-url={}", *ANVIL_URL); - let settings_arg = format!("{}/{}/settings.json", test_dir, example_name); - let private_key = format!("--private-key={}", *ANVIL_DEFAULT_PRIVATE_KEY); - - // create encoded calldata - let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY)) - .args([ - "encode-evm-calldata", - "--proof-path", - &format!("{}/{}/aggr.pf", test_dir, example_name), - ]) - .status() - .expect("failed to execute process"); - - assert!(status.success()); - - let base_args = vec![ - "create-evm-verifier-aggr", - "--vk-path", - vk_arg.as_str(), - "--aggregation-settings", - settings_arg.as_str(), - "--logrows=23", - ]; - - let args = build_args(base_args, &sol_arg); - - let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY)) - .args(args) - .status() - .expect("failed to execute process"); - assert!(status.success()); - - // deploy the verifier - let args = vec![ - "deploy-evm", - rpc_arg.as_str(), - addr_path_arg.as_str(), - "--sol-code-path", - sol_arg.as_str(), - private_key.as_str(), - ]; - - let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY)) - .args(&args) - .status() - .expect("failed to execute process"); - assert!(status.success()); - - // read in the address - let addr = std::fs::read_to_string(format!("{}/{}/addr.txt", test_dir, example_name)) - .expect("failed to read address file"); - - let deployed_addr_arg = format!("--addr-verifier={}", addr); - - let pf_arg = format!("{}/{}/aggr.pf", test_dir, example_name); - - let mut base_args = vec![ - "verify-evm", - "--proof-path", - pf_arg.as_str(), - deployed_addr_arg.as_str(), - rpc_arg.as_str(), - ]; - - let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY)) - .args(&base_args) - .status() - .expect("failed to execute process"); - assert!(status.success()); - // As sanity check, add example that should fail. - base_args[2] = PF_FAILURE_AGGR; - let status = Command::new(format!("{}/{}", *CARGO_TARGET_DIR, TEST_BINARY)) - .args(base_args) - .status() - .expect("failed to execute process"); - assert!(!status.success()); - } - // prove-serialize-verify, the usual full path #[allow(clippy::too_many_arguments)] fn prove_and_verify( @@ -1799,7 +1349,6 @@ mod native_tests { num_inner_columns: usize, scales_to_use: Option>, overflow: bool, - proof_type: &str, commitment: Commitments, lookup_safety_margin: usize, ) { @@ -1857,7 +1406,6 @@ mod native_tests { "--pk-path", &format!("{}/{}/key.pk", test_dir, example_name), &format!("--check-mode={}", checkmode), - &format!("--proof-type={}", proof_type), ]) .status() .expect("failed to execute process"); @@ -1934,7 +1482,6 @@ mod native_tests { num_inner_columns, None, false, - "single", Commitments::KZG, 2, ); @@ -2061,7 +1608,6 @@ mod native_tests { num_inner_columns, None, overflow, - "single", Commitments::KZG, 2, ); @@ -2234,24 +1780,6 @@ mod native_tests { deployed_addr_arg } - // 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); - let mut args = vec!["run", "test", js_test, &example, &dir]; - let vk_string: String; - if vk { - vk_string = format!("--vk={}", vk); - args.push(&vk_string); - }; - let status = Command::new("pnpm") - .args(&args) - .status() - .expect("failed to execute process"); - assert!(status.success()); - } - #[allow(unused_variables)] fn build_ezkl() { #[cfg(feature = "gpu-accelerated")] @@ -2291,38 +1819,4 @@ mod native_tests { .expect("failed to execute process"); assert!(status.success()); } - - #[allow(dead_code)] - fn build_wasm_ezkl() { - // wasm-pack build --target nodejs --out-dir ./tests/wasm/nodejs . -- -Z build-std="panic_abort,std" - let status = Command::new("wasm-pack") - .args([ - "build", - "--profile=test-runs", - "--target", - "nodejs", - "--out-dir", - "./tests/wasm/nodejs", - ".", - "--", - "-Z", - "build-std=panic_abort,std", - ]) - .status() - .expect("failed to execute process"); - assert!(status.success()); - // fix the memory size - // sed -i "3s|.*|imports['env'] = {memory: new WebAssembly.Memory({initial:20,maximum:65536,shared:true})}|" tests/wasm/nodejs/ezkl.js - let status = Command::new("sed") - .args([ - "-i", - // is required on macos - // "\".js\"", - "3s|.*|imports['env'] = {memory: new WebAssembly.Memory({initial:20,maximum:65536,shared:true})}|", - "./tests/wasm/nodejs/ezkl.js", - ]) - .status() - .expect("failed to execute process"); - assert!(status.success()); - } } diff --git a/tests/ios/can_verify_aggr.swift b/tests/ios/can_verify_aggr.swift deleted file mode 100644 index b5986058..00000000 --- a/tests/ios/can_verify_aggr.swift +++ /dev/null @@ -1,39 +0,0 @@ -// Write a simple swift test -import ezkl -import Foundation - -let pathToFile = "../../../../tests/assets/" - - -func loadFileAsBytes(from path: String) -> Data? { - let url = URL(fileURLWithPath: path) - return try? Data(contentsOf: url) -} - -do { - let proofAggrPath = pathToFile + "proof_aggr.json" - let vkAggrPath = pathToFile + "vk_aggr.key" - let srs1Path = pathToFile + "kzg1.srs" - - guard let proofAggr = loadFileAsBytes(from: proofAggrPath) else { - fatalError("Failed to load proofAggr file") - } - guard let vkAggr = loadFileAsBytes(from: vkAggrPath) else { - fatalError("Failed to load vkAggr file") - } - guard let srs1 = loadFileAsBytes(from: srs1Path) else { - fatalError("Failed to load srs1 file") - } - - let value = try verifyAggr( - proof: proofAggr, - vk: vkAggr, - logrows: 21, - srs: srs1, - commitment: "kzg" - ) - - // should not fail - assert(value == true, "Failed the test") - -} \ No newline at end of file diff --git a/tests/ios/gen_pk_test.swift b/tests/ios/gen_pk_test.swift deleted file mode 100644 index d51173fe..00000000 --- a/tests/ios/gen_pk_test.swift +++ /dev/null @@ -1,42 +0,0 @@ -// Swift version of gen_pk_test -import ezkl -import Foundation - -func loadFileAsBytes(from path: String) -> Data? { - let url = URL(fileURLWithPath: path) - return try? Data(contentsOf: url) -} - -do { - let pathToFile = "../../../../tests/assets/" - let networkCompiledPath = pathToFile + "model.compiled" - let srsPath = pathToFile + "kzg" - - // Load necessary files - guard let compiledCircuit = loadFileAsBytes(from: networkCompiledPath) else { - fatalError("Failed to load network compiled file") - } - guard let srs = loadFileAsBytes(from: srsPath) else { - fatalError("Failed to load SRS file") - } - - // Generate the vk (Verifying Key) - let vk = try genVk( - compiledCircuit: compiledCircuit, - srs: srs, - compressSelectors: true // Corresponds to the `true` boolean in the Rust code - ) - - // Generate the pk (Proving Key) - let pk = try genPk( - vk: vk, - compiledCircuit: compiledCircuit, - srs: srs - ) - - // Ensure that the proving key is not empty - assert(pk.count > 0, "Proving key generation failed, pk is empty") - -} catch { - fatalError("Test failed with error: \(error)") -} \ No newline at end of file diff --git a/tests/ios/gen_vk_test.swift b/tests/ios/gen_vk_test.swift deleted file mode 100644 index 51b10be8..00000000 --- a/tests/ios/gen_vk_test.swift +++ /dev/null @@ -1,35 +0,0 @@ -// Swift version of gen_vk_test -import ezkl -import Foundation - -func loadFileAsBytes(from path: String) -> Data? { - let url = URL(fileURLWithPath: path) - return try? Data(contentsOf: url) -} - -do { - let pathToFile = "../../../../tests/assets/" - let networkCompiledPath = pathToFile + "model.compiled" - let srsPath = pathToFile + "kzg" - - // Load necessary files - guard let compiledCircuit = loadFileAsBytes(from: networkCompiledPath) else { - fatalError("Failed to load network compiled file") - } - guard let srs = loadFileAsBytes(from: srsPath) else { - fatalError("Failed to load SRS file") - } - - // Generate the vk (Verifying Key) - let vk = try genVk( - compiledCircuit: compiledCircuit, - srs: srs, - compressSelectors: true // Corresponds to the `true` boolean in the Rust code - ) - - // Ensure that the verifying key is not empty - assert(vk.count > 0, "Verifying key generation failed, vk is empty") - -} catch { - fatalError("Test failed with error: \(error)") -} \ No newline at end of file diff --git a/tests/ios/pk_is_valid_test.swift b/tests/ios/pk_is_valid_test.swift deleted file mode 100644 index deffdc18..00000000 --- a/tests/ios/pk_is_valid_test.swift +++ /dev/null @@ -1,69 +0,0 @@ -// Swift version of pk_is_valid_test -import ezkl -import Foundation - -func loadFileAsBytes(from path: String) -> Data? { - let url = URL(fileURLWithPath: path) - return try? Data(contentsOf: url) -} - -do { - let pathToFile = "../../../../tests/assets/" - let networkCompiledPath = pathToFile + "model.compiled" - let srsPath = pathToFile + "kzg" - let witnessPath = pathToFile + "witness.json" - let settingsPath = pathToFile + "settings.json" - - // Load necessary files - guard let compiledCircuit = loadFileAsBytes(from: networkCompiledPath) else { - fatalError("Failed to load network compiled file") - } - guard let srs = loadFileAsBytes(from: srsPath) else { - fatalError("Failed to load SRS file") - } - guard let witness = loadFileAsBytes(from: witnessPath) else { - fatalError("Failed to load witness file") - } - guard let settings = loadFileAsBytes(from: settingsPath) else { - fatalError("Failed to load settings file") - } - - // Generate the vk (Verifying Key) - let vk = try genVk( - compiledCircuit: compiledCircuit, - srs: srs, - compressSelectors: true // Corresponds to the `true` boolean in the Rust code - ) - - // Generate the pk (Proving Key) - let pk = try genPk( - vk: vk, - compiledCircuit: compiledCircuit, - srs: srs - ) - - // Prove using the witness and proving key - let proof = try prove( - witness: witness, - pk: pk, - compiledCircuit: compiledCircuit, - srs: srs - ) - - // Ensure that the proof is not empty - assert(proof.count > 0, "Proof generation failed, proof is empty") - - // Verify the proof - let value = try verify( - proof: proof, - vk: vk, - settings: settings, - srs: srs - ) - - // Ensure that the verification passed - assert(value == true, "Verification failed") - -} catch { - fatalError("Test failed with error: \(error)") -} \ No newline at end of file diff --git a/tests/ios/verify_encode_verifier_calldata.swift b/tests/ios/verify_encode_verifier_calldata.swift deleted file mode 100644 index db9308a8..00000000 --- a/tests/ios/verify_encode_verifier_calldata.swift +++ /dev/null @@ -1,71 +0,0 @@ -// Swift version of verify_encode_verifier_calldata test -import ezkl -import Foundation - -func loadFileAsBytes(from path: String) -> Data? { - let url = URL(fileURLWithPath: path) - return try? Data(contentsOf: url) -} - -do { - let pathToFile = "../../../../tests/assets/" - let proofPath = pathToFile + "proof.json" - - guard let proof = loadFileAsBytes(from: proofPath) else { - fatalError("Failed to load proof file") - } - - // Test without vk address - let calldataNoVk = try encodeVerifierCalldata( - proof: proof, - vkAddress: nil - ) - - // Deserialize the proof data - struct Snark: Decodable { - let proof: Data - let instances: Data - } - - let snark = try JSONDecoder().decode(Snark.self, from: proof) - - let flattenedInstances = snark.instances.flatMap { $0 } - let referenceCalldataNoVk = try encodeCalldata( - vk: nil, - proof: snark.proof, - instances: flattenedInstances - ) - - // Check if the encoded calldata matches the reference - assert(calldataNoVk == referenceCalldataNoVk, "Calldata without vk does not match") - - // Test with vk address - let vkAddressString = "0000000000000000000000000000000000000000" - let vkAddressData = Data(hexString: vkAddressString) - - guard vkAddressData.count == 20 else { - fatalError("Invalid VK address length") - } - - let vkAddressArray = [UInt8](vkAddressData) - - // Serialize vkAddress to match JSON serialization in Rust - let serializedVkAddress = try JSONEncoder().encode(vkAddressArray) - - let calldataWithVk = try encodeVerifierCalldata( - proof: proof, - vk: serializedVkAddress - ) - - let referenceCalldataWithVk = try encodeCalldata( - vk: vkAddressArray, - proof: snark.proof, - instances: flattenedInstances - ) - - // Check if the encoded calldata matches the reference - assert(calldataWithVk == referenceCalldataWithVk, "Calldata with vk does not match") - -} catch { - fatalError("Test failed with error: \(error)") -} \ No newline at end of file diff --git a/tests/ios/verify_gen_witness.swift b/tests/ios/verify_gen_witness.swift deleted file mode 100644 index 894a1a7e..00000000 --- a/tests/ios/verify_gen_witness.swift +++ /dev/null @@ -1,45 +0,0 @@ -// Swift version of verify_gen_witness test -import ezkl -import Foundation - -func loadFileAsBytes(from path: String) -> Data? { - let url = URL(fileURLWithPath: path) - return try? Data(contentsOf: url) -} - -do { - let pathToFile = "../../../../tests/assets/" - let networkCompiledPath = pathToFile + "model.compiled" - let inputPath = pathToFile + "input.json" - let witnessPath = pathToFile + "witness.json" - - // Load necessary files - guard let networkCompiled = loadFileAsBytes(from: networkCompiledPath) else { - fatalError("Failed to load network compiled file") - } - guard let input = loadFileAsBytes(from: inputPath) else { - fatalError("Failed to load input file") - } - guard let referenceWitnessData = loadFileAsBytes(from: witnessPath) else { - fatalError("Failed to load witness file") - } - - // Generate witness using genWitness function - let witnessData = try genWitness( - compiledCircuit: networkCompiled, - input: input - ) - - // Deserialize the witness - struct GraphWitness: Decodable, Equatable {} - let witness = try JSONDecoder().decode(GraphWitness.self, from: witnessData) - - // Deserialize the reference witness - let referenceWitness = try JSONDecoder().decode(GraphWitness.self, from: referenceWitnessData) - - // Check if the witness matches the reference witness - assert(witness == referenceWitness, "Witnesses do not match") - -} catch { - fatalError("Test failed with error: \(error)") -} \ No newline at end of file diff --git a/tests/ios/verify_kzg_commit.swift b/tests/ios/verify_kzg_commit.swift deleted file mode 100644 index 0d9cc3d5..00000000 --- a/tests/ios/verify_kzg_commit.swift +++ /dev/null @@ -1,64 +0,0 @@ -// Swift version of verify_kzg_commit test -import ezkl -import Foundation - -func loadFileAsBytes(from path: String) -> Data? { - let url = URL(fileURLWithPath: path) - return try? Data(contentsOf: url) -} - -do { - let pathToFile = "../../../../tests/assets/" - let vkPath = pathToFile + "vk.key" - let srsPath = pathToFile + "kzg" - let settingsPath = pathToFile + "settings.json" - - guard let vk = loadFileAsBytes(from: vkPath) else { - fatalError("Failed to load vk file") - } - guard let srs = loadFileAsBytes(from: srsPath) else { - fatalError("Failed to load srs file") - } - guard let settings = loadFileAsBytes(from: settingsPath) else { - fatalError("Failed to load settings file") - } - - // Create a vector of field elements - var message: [UInt64] = [] - for i in 0..<32 { - message.append(UInt64(i)) - } - - // Serialize the message array - let messageData = try JSONEncoder().encode(message) - - // Deserialize settings - struct GraphSettings: Decodable {} - let settingsDecoded = try JSONDecoder().decode(GraphSettings.self, from: settings) - - // Generate commitment - let commitmentData = try kzgCommit( - message: messageData, - vk: vk, - settings: settings, - srs: srs - ) - - // Deserialize the resulting commitment - struct G1Affine: Decodable {} - let commitment = try JSONDecoder().decode([G1Affine].self, from: commitmentData) - - // Reference commitment using params and vk - // For Swift, you'd need to implement or link the corresponding methods like in Rust - let referenceCommitment = try polyCommit( - message: message, - vk: vk, - srs: srs - ) - - // Check if the commitment matches the reference - assert(commitment == referenceCommitment, "Commitments do not match") - -} catch { - fatalError("Test failed with error: \(error)") -} \ No newline at end of file diff --git a/tests/ios/verify_validations.swift b/tests/ios/verify_validations.swift deleted file mode 100644 index a7497755..00000000 --- a/tests/ios/verify_validations.swift +++ /dev/null @@ -1,103 +0,0 @@ -// Swift version of verify_validations test -import ezkl -import Foundation - -func loadFileAsBytes(from path: String) -> Data? { - let url = URL(fileURLWithPath: path) - return try? Data(contentsOf: url) -} - -do { - let pathToFile = "../../../../tests/assets/" - let compiledCircuitPath = pathToFile + "model.compiled" - let networkPath = pathToFile + "network.onnx" - let witnessPath = pathToFile + "witness.json" - let inputPath = pathToFile + "input.json" - let proofPath = pathToFile + "proof.json" - let vkPath = pathToFile + "vk.key" - let pkPath = pathToFile + "pk.key" - let settingsPath = pathToFile + "settings.json" - let srsPath = pathToFile + "kzg" - - // Load necessary files - guard let compiledCircuit = loadFileAsBytes(from: compiledCircuitPath) else { - fatalError("Failed to load network compiled file") - } - guard let network = loadFileAsBytes(from: networkPath) else { - fatalError("Failed to load network file") - } - guard let witness = loadFileAsBytes(from: witnessPath) else { - fatalError("Failed to load witness file") - } - guard let input = loadFileAsBytes(from: inputPath) else { - fatalError("Failed to load input file") - } - guard let proof = loadFileAsBytes(from: proofPath) else { - fatalError("Failed to load proof file") - } - guard let vk = loadFileAsBytes(from: vkPath) else { - fatalError("Failed to load vk file") - } - guard let pk = loadFileAsBytes(from: pkPath) else { - fatalError("Failed to load pk file") - } - guard let settings = loadFileAsBytes(from: settingsPath) else { - fatalError("Failed to load settings file") - } - guard let srs = loadFileAsBytes(from: srsPath) else { - fatalError("Failed to load srs file") - } - - // Witness validation (should fail for network compiled) - let witnessValidationResult1 = try? witnessValidation(witness:compiledCircuit) - assert(witnessValidationResult1 == nil, "Witness validation should fail for network compiled") - - // Witness validation (should pass for witness) - let witnessValidationResult2 = try? witnessValidation(witness:witness) - assert(witnessValidationResult2 != nil, "Witness validation should pass for witness") - - // Compiled circuit validation (should fail for onnx network) - let circuitValidationResult1 = try? compiledCircuitValidation(compiledCircuit:network) - assert(circuitValidationResult1 == nil, "Compiled circuit validation should fail for onnx network") - - // Compiled circuit validation (should pass for compiled network) - let circuitValidationResult2 = try? compiledCircuitValidation(compiledCircuit:compiledCircuit) - assert(circuitValidationResult2 != nil, "Compiled circuit validation should pass for compiled network") - - // Input validation (should fail for witness) - let inputValidationResult1 = try? inputValidation(input:witness) - assert(inputValidationResult1 == nil, "Input validation should fail for witness") - - // Input validation (should pass for input) - let inputValidationResult2 = try? inputValidation(input:input) - assert(inputValidationResult2 != nil, "Input validation should pass for input") - - // Proof validation (should fail for witness) - let proofValidationResult1 = try? proofValidation(proof:witness) - assert(proofValidationResult1 == nil, "Proof validation should fail for witness") - - // Proof validation (should pass for proof) - let proofValidationResult2 = try? proofValidation(proof:proof) - assert(proofValidationResult2 != nil, "Proof validation should pass for proof") - - // Verifying key (vk) validation (should pass) - let vkValidationResult = try? vkValidation(vk:vk, settings:settings) - assert(vkValidationResult != nil, "VK validation should pass for vk") - - // Proving key (pk) validation (should pass) - let pkValidationResult = try? pkValidation(pk:pk, settings:settings) - assert(pkValidationResult != nil, "PK validation should pass for pk") - - // Settings validation (should fail for proof) - let settingsValidationResult1 = try? settingsValidation(settings:proof) - assert(settingsValidationResult1 == nil, "Settings validation should fail for proof") - - // Settings validation (should pass for settings) - let settingsValidationResult2 = try? settingsValidation(settings:settings) - assert(settingsValidationResult2 != nil, "Settings validation should pass for settings") - - // SRS validation (should pass) - let srsValidationResult = try? srsValidation(srs:srs) - assert(srsValidationResult != nil, "SRS validation should pass for srs") - -} \ No newline at end of file diff --git a/tests/ios_integration_tests.rs b/tests/ios_integration_tests.rs deleted file mode 100644 index 756851fb..00000000 --- a/tests/ios_integration_tests.rs +++ /dev/null @@ -1,11 +0,0 @@ -#[cfg(feature = "ios-bindings-test")] -uniffi::build_foreign_language_testcases!( - "tests/ios/can_verify_aggr.swift", - "tests/ios/verify_gen_witness.swift", - "tests/ios/gen_pk_test.swift", - "tests/ios/gen_vk_test.swift", - "tests/ios/pk_is_valid_test.swift", - "tests/ios/verify_validations.swift", - // "tests/ios/verify_encode_verifier_calldata.swift", // TODO - the function requires rust dependencies to test - // "tests/ios/verify_kzg_commit.swift", // TODO - the function is not exported and requires rust dependencies to test -); diff --git a/tests/py_integration_tests.rs b/tests/py_integration_tests.rs index 84d3719a..a164cbe1 100644 --- a/tests/py_integration_tests.rs +++ b/tests/py_integration_tests.rs @@ -146,7 +146,7 @@ mod py_tests { } } - const TESTS: [&str; 31] = [ + const TESTS: [&str; 30] = [ "mnist_gan.ipynb", // 0 "ezkl_demo_batch.ipynb", // 1 "proof_splitting.ipynb", // 2 @@ -156,28 +156,27 @@ mod py_tests { "hashed_vis.ipynb", // 6 "simple_demo_all_public.ipynb", // 7 "little_transformer.ipynb", // 8 - "simple_demo_aggregated_proofs.ipynb", // 9 - "ezkl_demo.ipynb", // 10 - "lstm.ipynb", // 11 - "set_membership.ipynb", // 12 - "decision_tree.ipynb", // 13 - "random_forest.ipynb", // 14 - "gradient_boosted_trees.ipynb", // 15 - "xgboost.ipynb", // 16 - "lightgbm.ipynb", // 17 - "svm.ipynb", // 18 - "simple_demo_public_input_output.ipynb", // 19 - "simple_demo_public_network_output.ipynb", // 20 - "gcn.ipynb", // 21 - "linear_regression.ipynb", // 22 - "stacked_regression.ipynb", // 23 - "kzg_vis.ipynb", // 24 - "kmeans.ipynb", // 25 - "solvency.ipynb", // 26 - "sklearn_mlp.ipynb", // 27 - "generalized_inverse.ipynb", // 28 - "mnist_classifier.ipynb", // 29 - "logistic_regression.ipynb", // 30 + "ezkl_demo.ipynb", // 9 + "lstm.ipynb", // 10 + "set_membership.ipynb", // 11 + "decision_tree.ipynb", // 12 + "random_forest.ipynb", // 13 + "gradient_boosted_trees.ipynb", // 14 + "xgboost.ipynb", // 15 + "lightgbm.ipynb", // 16 + "svm.ipynb", // 17 + "simple_demo_public_input_output.ipynb", // 18 + "simple_demo_public_network_output.ipynb", // 19 + "gcn.ipynb", // 20 + "linear_regression.ipynb", // 21 + "stacked_regression.ipynb", // 22 + "kzg_vis.ipynb", // 23 + "kmeans.ipynb", // 24 + "solvency.ipynb", // 25 + "sklearn_mlp.ipynb", // 26 + "generalized_inverse.ipynb", // 27 + "mnist_classifier.ipynb", // 28 + "logistic_regression.ipynb", // 29 ]; macro_rules! test_func { @@ -190,7 +189,7 @@ mod py_tests { use super::*; - seq!(N in 0..=30 { + seq!(N in 0..=29 { #(#[test_case(TESTS[N])])* fn run_notebook_(test: &str) { diff --git a/tests/python/binding_tests.py b/tests/python/binding_tests.py index 85ab05d6..b51f1076 100644 --- a/tests/python/binding_tests.py +++ b/tests/python/binding_tests.py @@ -8,22 +8,22 @@ import time folder_path = os.path.abspath( os.path.join( os.path.dirname(__file__), - '.', + ".", ) ) examples_path = os.path.abspath( os.path.join( folder_path, - '..', - '..', - 'examples', + "..", + "..", + "examples", ) ) -srs_path = os.path.join(folder_path, 'kzg_test.params') -params_k17_path = os.path.join(folder_path, 'kzg_test_k17.params') -params_k21_path = os.path.join(folder_path, 'kzg_test_k21.params') +srs_path = os.path.join(folder_path, "kzg_test.params") +params_k17_path = os.path.join(folder_path, "kzg_test_k17.params") +params_k21_path = os.path.join(folder_path, "kzg_test_k21.params") anvil_url = "http://localhost:3030" @@ -36,8 +36,7 @@ def setup_module(module): def teardown_module(module): - """teardown anvil. - """ + """teardown anvil.""" proc.terminate() @@ -57,9 +56,10 @@ def test_poseidon_hash(): message = [1.0, 2.0, 3.0, 4.0] message = [ezkl.float_to_felt(x, 7) for x in message] res = ezkl.poseidon_hash(message) - assert ezkl.felt_to_big_endian( - res[0]) == "0x2369898875588bf49b6539376b09705ea69aee318a58e6fcc1e68fc3e7ad81ab" - + assert ( + ezkl.felt_to_big_endian(res[0]) + == "0x2369898875588bf49b6539376b09705ea69aee318a58e6fcc1e68fc3e7ad81ab" + ) def test_field_serialization(): @@ -84,15 +84,18 @@ def test_buffer_to_felts(): """ Test buffer_to_felt """ - buffer = bytearray("a sample string!", 'utf-8') + buffer = bytearray("a sample string!", "utf-8") felts = ezkl.buffer_to_felts(buffer) ref_felt_1 = "0x0000000000000000000000000000000021676e6972747320656c706d61732061" assert ezkl.felt_to_big_endian(felts[0]) == ref_felt_1 - buffer = bytearray("a sample string!"+"high", 'utf-8') + buffer = bytearray("a sample string!" + "high", "utf-8") felts = ezkl.buffer_to_felts(buffer) ref_felt_2 = "0x0000000000000000000000000000000000000000000000000000000068676968" - assert [ezkl.felt_to_big_endian(felts[0]), ezkl.felt_to_big_endian(felts[1])] == [ref_felt_1, ref_felt_2] + assert [ezkl.felt_to_big_endian(felts[0]), ezkl.felt_to_big_endian(felts[1])] == [ + ref_felt_1, + ref_felt_2, + ] def test_gen_srs(): @@ -107,92 +110,51 @@ def test_gen_srs(): assert os.path.isfile(params_k21_path) - async def test_calibrate_over_user_range(): - data_path = os.path.join( - examples_path, - 'onnx', - '1l_relu', - 'input.json' - ) - model_path = os.path.join( - examples_path, - 'onnx', - '1l_relu', - 'network.onnx' - ) - output_path = os.path.join( - folder_path, - 'settings.json' - ) + data_path = os.path.join(examples_path, "onnx", "1l_relu", "input.json") + model_path = os.path.join(examples_path, "onnx", "1l_relu", "network.onnx") + output_path = os.path.join(folder_path, "settings.json") run_args = ezkl.PyRunArgs() run_args.input_visibility = "hashed" run_args.output_visibility = "hashed" # TODO: Dictionary outputs - res = ezkl.gen_settings( - model_path, output_path, py_run_args=run_args) + res = ezkl.gen_settings(model_path, output_path, py_run_args=run_args) assert res == True res = ezkl.calibrate_settings( - data_path, model_path, output_path, "resources", 1, [0, 1, 2]) + data_path, model_path, output_path, "resources", 1, [0, 1, 2] + ) assert res == True assert os.path.isfile(output_path) - async def test_calibrate(): - data_path = os.path.join( - examples_path, - 'onnx', - '1l_relu', - 'input.json' - ) - model_path = os.path.join( - examples_path, - 'onnx', - '1l_relu', - 'network.onnx' - ) - output_path = os.path.join( - folder_path, - 'settings.json' - ) + data_path = os.path.join(examples_path, "onnx", "1l_relu", "input.json") + model_path = os.path.join(examples_path, "onnx", "1l_relu", "network.onnx") + output_path = os.path.join(folder_path, "settings.json") run_args = ezkl.PyRunArgs() run_args.input_visibility = "hashed" run_args.output_visibility = "hashed" # TODO: Dictionary outputs - res = ezkl.gen_settings( - model_path, output_path, py_run_args=run_args) + res = ezkl.gen_settings(model_path, output_path, py_run_args=run_args) assert res == True - res = ezkl.calibrate_settings( - data_path, model_path, output_path, "resources") + res = ezkl.calibrate_settings(data_path, model_path, output_path, "resources") assert res == True assert os.path.isfile(output_path) def test_model_compile(): """ - Test for model compilation/serialization - """ - model_path = os.path.join( - examples_path, - 'onnx', - '1l_relu', - 'network.onnx' - ) - compiled_model_path = os.path.join( - folder_path, - 'model.compiled' - ) - settings_path = os.path.join( - folder_path, - 'settings.json' - ) + Test for model compilation/serialization + """ + model_path = os.path.join(examples_path, "onnx", "1l_relu", "network.onnx") + compiled_model_path = os.path.join(folder_path, "model.compiled") + settings_path = os.path.join(folder_path, "settings.json") res = ezkl.compile_circuit(model_path, compiled_model_path, settings_path) assert res == True @@ -201,20 +163,9 @@ async def test_forward(): """ Test for vanilla forward pass """ - data_path = os.path.join( - examples_path, - 'onnx', - '1l_relu', - 'input.json' - ) - model_path = os.path.join( - folder_path, - 'model.compiled' - ) - output_path = os.path.join( - folder_path, - 'witness.json' - ) + data_path = os.path.join(examples_path, "onnx", "1l_relu", "input.json") + model_path = os.path.join(folder_path, "model.compiled") + output_path = os.path.join(folder_path, "witness.json") res = ezkl.gen_witness(data_path, model_path, output_path) @@ -224,15 +175,21 @@ async def test_forward(): assert data["inputs"] == res["inputs"] assert data["outputs"] == res["outputs"] - assert data["processed_inputs"]["poseidon_hash"] == res["processed_inputs"]["poseidon_hash"] - assert data["processed_outputs"]["poseidon_hash"] == res["processed_outputs"]["poseidon_hash"] + assert ( + data["processed_inputs"]["poseidon_hash"] + == res["processed_inputs"]["poseidon_hash"] + ) + assert ( + data["processed_outputs"]["poseidon_hash"] + == res["processed_outputs"]["poseidon_hash"] + ) async def test_get_srs(): """ Test for get_srs """ - settings_path = os.path.join(folder_path, 'settings.json') + settings_path = os.path.join(folder_path, "settings.json") res = await ezkl.get_srs(settings_path, srs_path=srs_path) assert res == True @@ -241,7 +198,9 @@ async def test_get_srs(): another_srs_path = os.path.join(folder_path, "kzg_test_k8.params") - res = await ezkl.get_srs(logrows=8, srs_path=another_srs_path, commitment=ezkl.PyCommitments.KZG) + res = await ezkl.get_srs( + logrows=8, srs_path=another_srs_path, commitment=ezkl.PyCommitments.KZG + ) assert os.path.isfile(another_srs_path) @@ -251,17 +210,11 @@ def test_mock(): Test for mock """ - data_path = os.path.join( - folder_path, - 'witness.json' - ) + data_path = os.path.join(folder_path, "witness.json") - model_path = os.path.join( - folder_path, - 'model.compiled' - ) + model_path = os.path.join(folder_path, "model.compiled") - settings_path = os.path.join(folder_path, 'settings.json') + settings_path = os.path.join(folder_path, "settings.json") res = ezkl.mock(data_path, model_path) assert res == True @@ -272,19 +225,13 @@ def test_setup(): Test for setup """ - data_path = os.path.join( - folder_path, - 'witness.json' - ) + data_path = os.path.join(folder_path, "witness.json") - model_path = os.path.join( - folder_path, - 'model.compiled' - ) + model_path = os.path.join(folder_path, "model.compiled") - pk_path = os.path.join(folder_path, 'test.pk') - vk_path = os.path.join(folder_path, 'test.vk') - settings_path = os.path.join(folder_path, 'settings.json') + pk_path = os.path.join(folder_path, "test.pk") + vk_path = os.path.join(folder_path, "test.vk") + settings_path = os.path.join(folder_path, "settings.json") res = ezkl.setup( model_path, @@ -307,13 +254,10 @@ def test_setup_evm(): Test for setup """ - model_path = os.path.join( - folder_path, - 'model.compiled' - ) + model_path = os.path.join(folder_path, "model.compiled") - pk_path = os.path.join(folder_path, 'test_evm.pk') - vk_path = os.path.join(folder_path, 'test_evm.vk') + pk_path = os.path.join(folder_path, "test_evm.pk") + vk_path = os.path.join(folder_path, "test_evm.vk") res = ezkl.setup( model_path, @@ -331,34 +275,25 @@ def test_prove_and_verify(): Test for prove and verify """ - data_path = os.path.join( - folder_path, - 'witness.json' - ) + data_path = os.path.join(folder_path, "witness.json") - model_path = os.path.join( - folder_path, - 'model.compiled' - ) + model_path = os.path.join(folder_path, "model.compiled") - pk_path = os.path.join(folder_path, 'test.pk') - proof_path = os.path.join(folder_path, 'test.pf') + pk_path = os.path.join(folder_path, "test.pk") + proof_path = os.path.join(folder_path, "test.pf") res = ezkl.prove( data_path, model_path, pk_path, proof_path, - "for-aggr", srs_path=srs_path, ) - assert res['transcript_type'] == 'poseidon' assert os.path.isfile(proof_path) - settings_path = os.path.join(folder_path, 'settings.json') - vk_path = os.path.join(folder_path, 'test.vk') - res = ezkl.verify(proof_path, settings_path, - vk_path, srs_path) + settings_path = os.path.join(folder_path, "settings.json") + vk_path = os.path.join(folder_path, "test.vk") + res = ezkl.verify(proof_path, settings_path, vk_path, srs_path) assert res == True assert os.path.isfile(vk_path) @@ -368,27 +303,19 @@ def test_prove_evm(): Test for prove using evm transcript """ - data_path = os.path.join( - folder_path, - 'witness.json' - ) + data_path = os.path.join(folder_path, "witness.json") - model_path = os.path.join( - folder_path, - 'model.compiled' - ) + model_path = os.path.join(folder_path, "model.compiled") - pk_path = os.path.join(folder_path, 'test_evm.pk') - proof_path = os.path.join(folder_path, 'test_evm.pf') - res = ezkl.prove( + pk_path = os.path.join(folder_path, "test_evm.pk") + proof_path = os.path.join(folder_path, "test_evm.pf") + ezkl.prove( data_path, model_path, pk_path, proof_path, - "single", srs_path=srs_path, ) - assert res['transcript_type'] == 'evm' assert os.path.isfile(proof_path) @@ -397,12 +324,12 @@ async def test_create_evm_verifier(): Create EVM verifier with solidity code In order to run this test you will need to install solc in your environment """ - vk_path = os.path.join(folder_path, 'test_evm.vk') - settings_path = os.path.join(folder_path, 'settings.json') - sol_code_path = os.path.join(folder_path, 'test.sol') - abi_path = os.path.join(folder_path, 'test.abi') - proof_path = os.path.join(folder_path, 'test_evm.pf') - calldata_path = os.path.join(folder_path, 'calldata.bytes') + vk_path = os.path.join(folder_path, "test_evm.vk") + settings_path = os.path.join(folder_path, "settings.json") + sol_code_path = os.path.join(folder_path, "test.sol") + abi_path = os.path.join(folder_path, "test.abi") + proof_path = os.path.join(folder_path, "test_evm.pf") + calldata_path = os.path.join(folder_path, "calldata.bytes") # res is now a vector of bytes res = ezkl.encode_evm_calldata(proof_path, calldata_path) @@ -410,7 +337,6 @@ async def test_create_evm_verifier(): assert os.path.isfile(calldata_path) assert len(res) > 0 - res = await ezkl.create_evm_verifier( vk_path, settings_path, @@ -422,19 +348,20 @@ async def test_create_evm_verifier(): assert res == True assert os.path.isfile(sol_code_path) + async def test_create_evm_verifier_separate_vk(): """ Create EVM a verifier with solidity code and separate vk In order to run this test you will need to install solc in your environment """ - vk_path = os.path.join(folder_path, 'test_evm.vk') - settings_path = os.path.join(folder_path, 'settings.json') - sol_code_path = os.path.join(folder_path, 'test_separate.sol') - vka_path = os.path.join(folder_path, 'vka.calldata') - abi_path = os.path.join(folder_path, 'test_separate.abi') - abi_vk_path = os.path.join(folder_path, 'test_vk_separate.abi') - proof_path = os.path.join(folder_path, 'test_evm.pf') - calldata_path = os.path.join(folder_path, 'calldata.bytes') + vk_path = os.path.join(folder_path, "test_evm.vk") + settings_path = os.path.join(folder_path, "settings.json") + sol_code_path = os.path.join(folder_path, "test_separate.sol") + vka_path = os.path.join(folder_path, "vka.calldata") + abi_path = os.path.join(folder_path, "test_separate.abi") + abi_vk_path = os.path.join(folder_path, "test_vk_separate.abi") + proof_path = os.path.join(folder_path, "test_evm.pf") + calldata_path = os.path.join(folder_path, "calldata.bytes") # # res is now a vector of bytes # res = ezkl.encode_evm_calldata(proof_path, calldata_path) @@ -442,22 +369,16 @@ async def test_create_evm_verifier_separate_vk(): # assert os.path.isfile(calldata_path) # assert len(res) > 0 - res = await ezkl.create_evm_verifier( vk_path, settings_path, sol_code_path, abi_path, srs_path=srs_path, - reusable=True + reusable=True, ) - res = await ezkl.create_evm_vka( - vk_path, - settings_path, - vka_path, - srs_path=srs_path - ) + res = await ezkl.create_evm_vka(vk_path, settings_path, vka_path, srs_path=srs_path) assert res == True assert os.path.isfile(sol_code_path) @@ -468,10 +389,10 @@ async def test_deploy_evm_reusable_and_vka(): Test deployment of the reusable verifier smart contract + vka In order to run this you will need to install solc in your environment """ - addr_path_verifier = os.path.join(folder_path, 'address_separate.json') - addr_path_vk = os.path.join(folder_path, 'address_vk.json') - sol_code_path = os.path.join(folder_path, 'test_separate.sol') - vka_path = os.path.join(folder_path, 'vka.calldata') + addr_path_verifier = os.path.join(folder_path, "address_separate.json") + addr_path_vk = os.path.join(folder_path, "address_vk.json") + sol_code_path = os.path.join(folder_path, "test_separate.sol") + vka_path = os.path.join(folder_path, "vka.calldata") # TODO: without optimization there will be out of gas errors # sol_code_path = os.path.join(folder_path, 'test.sol') @@ -483,7 +404,7 @@ async def test_deploy_evm_reusable_and_vka(): "verifier/reusable", ) - with open(addr_path_verifier, 'r') as file: + with open(addr_path_verifier, "r") as file: addr_verifier = file.read().rstrip() # TODO fix: we need to call register vka instead of deploy evm @@ -495,13 +416,14 @@ async def test_deploy_evm_reusable_and_vka(): assert res == True + async def test_deploy_evm(): """ Test deployment of the verifier smart contract In order to run this you will need to install solc in your environment """ - addr_path = os.path.join(folder_path, 'address.json') - sol_code_path = os.path.join(folder_path, 'test.sol') + addr_path = os.path.join(folder_path, "address.json") + sol_code_path = os.path.join(folder_path, "test.sol") # TODO: without optimization there will be out of gas errors # sol_code_path = os.path.join(folder_path, 'test.sol') @@ -520,31 +442,32 @@ async def test_deploy_evm_with_private_key(): Test deployment of the verifier smart contract using a custom private key In order to run this you will need to install solc in your environment """ - addr_path = os.path.join(folder_path, 'address.json') - sol_code_path = os.path.join(folder_path, 'test.sol') + addr_path = os.path.join(folder_path, "address.json") + sol_code_path = os.path.join(folder_path, "test.sol") # TODO: without optimization there will be out of gas errors # sol_code_path = os.path.join(folder_path, 'test.sol') - anvil_default_private_key = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" + anvil_default_private_key = ( + "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" + ) res = await ezkl.deploy_evm( - addr_path, - anvil_url, - sol_code_path, - private_key=anvil_default_private_key + addr_path, anvil_url, sol_code_path, private_key=anvil_default_private_key ) assert res == True - custom_zero_balance_private_key = "ff9dfe0b6d31e93ba13460a4d6f63b5e31dd9532b1304f1cbccea7092a042aa4" + custom_zero_balance_private_key = ( + "ff9dfe0b6d31e93ba13460a4d6f63b5e31dd9532b1304f1cbccea7092a042aa4" + ) with pytest.raises(RuntimeError, match="Failed to run deploy_evm"): res = await ezkl.deploy_evm( addr_path, anvil_url, sol_code_path, - private_key=custom_zero_balance_private_key + private_key=custom_zero_balance_private_key, ) @@ -553,10 +476,10 @@ async def test_verify_evm(): Verifies an evm proof In order to run this you will need to install solc in your environment """ - proof_path = os.path.join(folder_path, 'test_evm.pf') - addr_path = os.path.join(folder_path, 'address.json') + proof_path = os.path.join(folder_path, "test_evm.pf") + addr_path = os.path.join(folder_path, "address.json") - with open(addr_path, 'r') as file: + with open(addr_path, "r") as file: addr = file.read().rstrip() print(addr) @@ -574,18 +497,19 @@ async def test_verify_evm(): assert res == True + async def test_verify_evm_separate_vk(): """ Verifies an evm proof In order to run this you will need to install solc in your environment """ - proof_path = os.path.join(folder_path, 'test_evm.pf') - addr_path_verifier = os.path.join(folder_path, 'address_separate.json') - vka_path = os.path.join(folder_path, 'vka.calldata') - proof_path = os.path.join(folder_path, 'test_evm.pf') - calldata_path = os.path.join(folder_path, 'calldata_separate.bytes') + proof_path = os.path.join(folder_path, "test_evm.pf") + addr_path_verifier = os.path.join(folder_path, "address_separate.json") + vka_path = os.path.join(folder_path, "vka.calldata") + proof_path = os.path.join(folder_path, "test_evm.pf") + calldata_path = os.path.join(folder_path, "calldata_separate.bytes") - with open(addr_path_verifier, 'r') as file: + with open(addr_path_verifier, "r") as file: addr_verifier = file.read().rstrip() print(addr_verifier) @@ -611,262 +535,20 @@ async def test_verify_evm_separate_vk(): assert res == True -async def test_aggregate_and_verify_aggr(): - data_path = os.path.join( - examples_path, - 'onnx', - '1l_relu', - 'input.json' - ) - - model_path = os.path.join( - examples_path, - 'onnx', - '1l_relu', - 'network.onnx' - ) - - compiled_model_path = os.path.join( - folder_path, - 'compiled_relu.onnx' - ) - - pk_path = os.path.join(folder_path, '1l_relu.pk') - vk_path = os.path.join(folder_path, '1l_relu.vk') - settings_path = os.path.join( - folder_path, '1l_relu_aggr_settings.json') - - # TODO: Dictionary outputs - res = ezkl.gen_settings(model_path, settings_path) - assert res == True - - res = ezkl.calibrate_settings( - data_path, model_path, settings_path, "resources") - assert res == True - assert os.path.isfile(settings_path) - - res = ezkl.compile_circuit(model_path, compiled_model_path, settings_path) - assert res == True - - ezkl.setup( - compiled_model_path, - vk_path, - pk_path, - srs_path=srs_path, - ) - - proof_path = os.path.join(folder_path, '1l_relu.pf') - - output_path = os.path.join( - folder_path, - '1l_relu_aggr_witness.json' - ) - - res = ezkl.gen_witness(data_path, compiled_model_path, - output_path) - - ezkl.prove( - output_path, - compiled_model_path, - pk_path, - proof_path, - "for-aggr", - srs_path=srs_path, - ) - - # mock aggregate - res = ezkl.mock_aggregate([proof_path], 21) - assert res == True - - aggregate_proof_path = os.path.join(folder_path, 'aggr_1l_relu.pf') - aggregate_vk_path = os.path.join(folder_path, 'aggr_1l_relu.vk') - aggregate_pk_path = os.path.join(folder_path, 'aggr_1l_relu.pk') - - res = ezkl.setup_aggregate( - [proof_path], - aggregate_vk_path, - aggregate_pk_path, - 21, - srs_path=params_k21_path, - ) - - res = ezkl.gen_vk_from_pk_aggr(aggregate_pk_path, aggregate_vk_path) - assert res == True - assert os.path.isfile(vk_path) - - res = ezkl.aggregate( - [proof_path], - aggregate_proof_path, - aggregate_pk_path, - "poseidon", - 21, - "unsafe", - srs_path=params_k21_path, - ) - - assert res == True - assert os.path.isfile(aggregate_proof_path) - assert os.path.isfile(aggregate_vk_path) - - res = ezkl.verify_aggr( - aggregate_proof_path, - aggregate_vk_path, - 21, - srs_path=params_k21_path, - ) - assert res == True - - -async def test_evm_aggregate_and_verify_aggr(): - data_path = os.path.join( - examples_path, - 'onnx', - '1l_relu', - 'input.json' - ) - - model_path = os.path.join( - examples_path, - 'onnx', - '1l_relu', - 'network.onnx' - ) - - pk_path = os.path.join(folder_path, '1l_relu.pk') - vk_path = os.path.join(folder_path, '1l_relu.vk') - settings_path = os.path.join( - folder_path, '1l_relu_evm_aggr_settings.json') - - ezkl.gen_settings( - model_path, - settings_path, - ) - - ezkl.calibrate_settings( - data_path, - model_path, - settings_path, - "resources", - ) - - compiled_model_path = os.path.join( - folder_path, - 'compiled_relu.onnx' - ) - - res = ezkl.compile_circuit(model_path, compiled_model_path, settings_path) - assert res == True - - ezkl.setup( - compiled_model_path, - vk_path, - pk_path, - srs_path=srs_path, - ) - - proof_path = os.path.join(folder_path, '1l_relu.pf') - - output_path = os.path.join( - folder_path, - '1l_relu_aggr_evm_witness.json' - ) - - res = ezkl.gen_witness(data_path, compiled_model_path, - output_path) - - ezkl.prove( - output_path, - compiled_model_path, - pk_path, - proof_path, - "for-aggr", - srs_path=srs_path, - ) - - aggregate_proof_path = os.path.join(folder_path, 'aggr_evm_1l_relu.pf') - aggregate_vk_path = os.path.join(folder_path, 'aggr_evm_1l_relu.vk') - aggregate_pk_path = os.path.join(folder_path, 'aggr_evm_1l_relu.pk') - - res = ezkl.setup_aggregate( - [proof_path], - aggregate_vk_path, - aggregate_pk_path, - 21, - srs_path=params_k21_path, - ) - - res = ezkl.aggregate( - [proof_path], - aggregate_proof_path, - aggregate_pk_path, - "evm", - 21, - "unsafe", - srs_path=params_k21_path, - ) - - assert res == True - assert os.path.isfile(aggregate_proof_path) - assert os.path.isfile(aggregate_vk_path) - - sol_code_path = os.path.join(folder_path, 'aggr_evm_1l_relu.sol') - abi_path = os.path.join(folder_path, 'aggr_evm_1l_relu.abi') - - res = await ezkl.create_evm_verifier_aggr( - [settings_path], - aggregate_vk_path, - sol_code_path, - abi_path, - logrows=21, - srs_path=params_k21_path, - ) - - assert res == True - assert os.path.isfile(sol_code_path) - - addr_path = os.path.join(folder_path, 'address_aggr.json') - - res = await ezkl.deploy_evm( - addr_path, - anvil_url, - sol_code_path, - ) - - # as a sanity check - res = ezkl.verify_aggr( - aggregate_proof_path, - aggregate_vk_path, - 21, - srs_path=params_k21_path, - ) - assert res == True - - # with open(addr_path, 'r') as file: - # addr_aggr = file.read().rstrip() - - # res = await ezkl.verify_evm( - # aggregate_proof_path, - # addr_aggr, - # rpc_url=anvil_url, - # ) - - # assert res == True - - def get_examples(): EXAMPLES_OMIT = [ # these are too large - 'mobilenet_large', - 'mobilenet', - 'doodles', - 'nanoGPT', + "mobilenet_large", + "mobilenet", + "doodles", + "nanoGPT", "self_attention", - 'multihead_attention', - 'large_op_graph', - '1l_instance_norm', - 'variable_cnn', - 'accuracy', - 'linear_regression', + "multihead_attention", + "large_op_graph", + "1l_instance_norm", + "variable_cnn", + "accuracy", + "linear_regression", "mnist_gan", "smallworm", "fr_age", @@ -874,14 +556,16 @@ def get_examples(): ] examples = [] for subdir, _, _ in os.walk(os.path.join(examples_path, "onnx")): - name = subdir.split('/')[-1] + name = subdir.split("/")[-1] if name in EXAMPLES_OMIT or name == "onnx": continue else: - examples.append(( - os.path.join(subdir, "network.onnx"), - os.path.join(subdir, "input.json"), - )) + examples.append( + ( + os.path.join(subdir, "network.onnx"), + os.path.join(subdir, "input.json"), + ) + ) return examples @@ -890,11 +574,11 @@ async def test_all_examples(model_file, input_file): """Tests all examples in the examples folder""" # gen settings settings_path = os.path.join(folder_path, "settings.json") - compiled_model_path = os.path.join(folder_path, 'network.ezkl') - pk_path = os.path.join(folder_path, 'test.pk') - vk_path = os.path.join(folder_path, 'test.vk') - witness_path = os.path.join(folder_path, 'witness.json') - proof_path = os.path.join(folder_path, 'proof.json') + compiled_model_path = os.path.join(folder_path, "network.ezkl") + pk_path = os.path.join(folder_path, "test.pk") + vk_path = os.path.join(folder_path, "test.vk") + witness_path = os.path.join(folder_path, "witness.json") + proof_path = os.path.join(folder_path, "proof.json") print("Testing example: ", model_file) @@ -905,15 +589,14 @@ async def test_all_examples(model_file, input_file): res = ezkl.gen_settings(model_file, settings_path, py_run_args=run_args) assert res - res = ezkl.calibrate_settings( - input_file, model_file, settings_path, "resources") + res = ezkl.calibrate_settings(input_file, model_file, settings_path, "resources") assert res print("Compiling example: ", model_file) res = ezkl.compile_circuit(model_file, compiled_model_path, settings_path) assert res - with open(settings_path, 'r') as f: + with open(settings_path, "r") as f: data = json.load(f) logrows = data["run_args"]["logrows"] @@ -925,12 +608,7 @@ async def test_all_examples(model_file, input_file): ezkl.gen_srs(os.path.join(folder_path, srs_path), logrows) print("Setting up example: ", model_file) - res = ezkl.setup( - compiled_model_path, - vk_path, - pk_path, - srs_path - ) + res = ezkl.setup(compiled_model_path, vk_path, pk_path, srs_path) assert res == True assert os.path.isfile(vk_path) assert os.path.isfile(pk_path) @@ -945,7 +623,6 @@ async def test_all_examples(model_file, input_file): compiled_model_path, pk_path, proof_path, - "single", srs_path=srs_path, ) diff --git a/tests/wasm.rs b/tests/wasm.rs deleted file mode 100644 index b1b62e67..00000000 --- a/tests/wasm.rs +++ /dev/null @@ -1,394 +0,0 @@ -#[cfg(all(target_arch = "wasm32", target_os = "unknown"))] -#[cfg(test)] -mod wasm32 { - use ezkl::bindings::wasm::{ - bufferToVecOfFelt, compiledCircuitValidation, encodeVerifierCalldata, feltToBigEndian, - feltToFloat, feltToInt, feltToLittleEndian, genPk, genVk, genWitness, inputValidation, - kzgCommit, pkValidation, poseidonHash, proofValidation, prove, settingsValidation, - srsValidation, u8_array_to_u128_le, verify, verifyAggr, vkValidation, witnessValidation, - }; - use ezkl::circuit::modules::polycommit::PolyCommitChip; - use ezkl::circuit::modules::poseidon::spec::{PoseidonSpec, POSEIDON_RATE, POSEIDON_WIDTH}; - use ezkl::circuit::modules::poseidon::PoseidonChip; - use ezkl::circuit::modules::Module; - use ezkl::graph::GraphCircuit; - use ezkl::graph::{GraphSettings, GraphWitness}; - use ezkl::pfsys; - use ezkl::pfsys::encode_calldata; - use halo2_proofs::plonk::VerifyingKey; - use halo2_proofs::poly::kzg::commitment::KZGCommitmentScheme; - use halo2_proofs::poly::kzg::commitment::ParamsKZG; - use halo2curves::bn256::Bn256; - use halo2curves::bn256::{Fr, G1Affine}; - use snark_verifier::util::arithmetic::PrimeField; - #[cfg(feature = "web")] - pub use wasm_bindgen_rayon::init_thread_pool; - use wasm_bindgen_test::*; - - wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); - - pub const WITNESS: &[u8] = include_bytes!("assets/witness.json"); - pub const NETWORK_COMPILED: &[u8] = include_bytes!("assets/model.compiled"); - pub const NETWORK: &[u8] = include_bytes!("assets/network.onnx"); - pub const INPUT: &[u8] = include_bytes!("assets/input.json"); - pub const PROOF: &[u8] = include_bytes!("assets/proof.json"); - pub const PROOF_AGGR: &[u8] = include_bytes!("assets/proof_aggr.json"); - pub const SETTINGS: &[u8] = include_bytes!("assets/settings.json"); - pub const PK: &[u8] = include_bytes!("assets/pk.key"); - pub const VK: &[u8] = include_bytes!("assets/vk.key"); - pub const VK_AGGR: &[u8] = include_bytes!("assets/vk_aggr.key"); - pub const SRS: &[u8] = include_bytes!("assets/kzg"); - 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(); - - // // should not fail - // assert!(value); - // } - - #[wasm_bindgen_test] - async fn verify_encode_verifier_calldata() { - let ser_proof = wasm_bindgen::Clamped(PROOF.to_vec()); - - // with no vk address - let calldata = encodeVerifierCalldata(ser_proof.clone(), None) - .map_err(|_| "failed") - .unwrap(); - - let snark: pfsys::Snark = serde_json::from_slice(&PROOF).unwrap(); - let flattened_instances = snark.instances.into_iter().flatten(); - let reference_calldata = encode_calldata( - None, - &snark.proof, - &flattened_instances.clone().collect::>(), - ); - assert_eq!(calldata, reference_calldata); - // with vk address - let dummy_32_byte_word = [0u8; 32]; - - // define and initialize a variable of type: &[[u8; 32]] named "vka" - let vka: &[[u8; 32]] = &[dummy_32_byte_word.into()]; - - let serialized = serde_json::to_vec(vka).unwrap(); - - let calldata = encodeVerifierCalldata(ser_proof, Some(serialized)) - .map_err(|_| "failed") - .unwrap(); - let reference_calldata = encode_calldata( - Some(vka), - &snark.proof, - &flattened_instances.collect::>(), - ); - assert_eq!(calldata, reference_calldata); - } - - #[wasm_bindgen_test] - fn verify_kzg_commit() { - // create a vector of field elements Vec and assign it to the message variable - let mut message: Vec = vec![]; - for i in 0..32 { - message.push(Fr::from(i as u64)); - } - let message_ser = serde_json::to_vec(&message).unwrap(); - - let settings: GraphSettings = serde_json::from_slice(&SETTINGS).unwrap(); - let mut reader = std::io::BufReader::new(SRS); - let params: ParamsKZG = - halo2_proofs::poly::commitment::Params::<'_, G1Affine>::read(&mut reader).unwrap(); - let mut reader = std::io::BufReader::new(VK); - let vk = VerifyingKey::::read::<_, GraphCircuit>( - &mut reader, - halo2_proofs::SerdeFormat::RawBytes, - settings.clone(), - ) - .unwrap(); - let commitment_ser = kzgCommit( - wasm_bindgen::Clamped(message_ser), - wasm_bindgen::Clamped(VK.to_vec()), - wasm_bindgen::Clamped(SETTINGS.to_vec()), - wasm_bindgen::Clamped(SRS.to_vec()), - ) - .map_err(|_| "failed") - .unwrap(); - let commitment: Vec = - serde_json::from_slice(&commitment_ser[..]).unwrap(); - let reference_commitment = PolyCommitChip::commit::>( - message, - (vk.cs().blinding_factors() + 1) as u32, - ¶ms, - ); - - assert_eq!(commitment, reference_commitment); - } - - #[wasm_bindgen_test] - async fn verify_field_serialization_roundtrip() { - for i in 0..32 { - let field_element = Fr::from(i); - let serialized = serde_json::to_vec(&field_element).unwrap(); - - let clamped = wasm_bindgen::Clamped(serialized); - let scale = 2; - let floating_point = feltToFloat(clamped.clone(), scale) - .map_err(|_| "failed") - .unwrap(); - assert_eq!(floating_point, (i as f64) / 4.0); - - let integer: i64 = - serde_json::from_slice(&feltToInt(clamped.clone()).map_err(|_| "failed").unwrap()) - .unwrap(); - assert_eq!(integer, i as i64); - - let hex_string = format!("{:?}", field_element.clone()); - let returned_string: String = feltToBigEndian(clamped.clone()) - .map_err(|_| "failed") - .unwrap(); - assert_eq!(hex_string, returned_string); - let repr = serde_json::to_string(&field_element).unwrap(); - let little_endian_string: String = serde_json::from_str(&repr).unwrap(); - let returned_string: String = - feltToLittleEndian(clamped).map_err(|_| "failed").unwrap(); - assert_eq!(little_endian_string, returned_string); - } - } - - #[wasm_bindgen_test] - async fn verify_buffer_to_field_elements() { - let string_high = String::from("high"); - let mut buffer = string_high.clone().into_bytes(); - let clamped = wasm_bindgen::Clamped(buffer.clone()); - - let field_elements_ser = bufferToVecOfFelt(clamped).map_err(|_| "failed").unwrap(); - - let field_elements: Vec = serde_json::from_slice(&field_elements_ser[..]).unwrap(); - - buffer.resize(16, 0); - - let reference_int = u8_array_to_u128_le(buffer.try_into().unwrap()); - - let reference_field_element_high = PrimeField::from_u128(reference_int); - - assert_eq!(field_elements[0], reference_field_element_high); - - // length 16 string (divisible by 16 so doesn't need padding) - let string_sample = String::from("a sample string!"); - let buffer = string_sample.clone().into_bytes(); - let clamped = wasm_bindgen::Clamped(buffer.clone()); - - let field_elements_ser = bufferToVecOfFelt(clamped).map_err(|_| "failed").unwrap(); - - let field_elements: Vec = serde_json::from_slice(&field_elements_ser[..]).unwrap(); - - let reference_int = u8_array_to_u128_le(buffer.try_into().unwrap()); - - let reference_field_element_sample = PrimeField::from_u128(reference_int); - - assert_eq!(field_elements[0], reference_field_element_sample); - - let string_concat = string_sample + &string_high; - - let buffer = string_concat.into_bytes(); - let clamped = wasm_bindgen::Clamped(buffer.clone()); - - let field_elements_ser = bufferToVecOfFelt(clamped).map_err(|_| "failed").unwrap(); - - let field_elements: Vec = serde_json::from_slice(&field_elements_ser[..]).unwrap(); - - assert_eq!(field_elements[0], reference_field_element_sample); - assert_eq!(field_elements[1], reference_field_element_high); - } - - #[wasm_bindgen_test] - async fn verify_hash() { - let mut message: Vec = vec![]; - for i in 0..32 { - message.push(Fr::from(i as u64)); - } - - let message_ser = serde_json::to_vec(&message).unwrap(); - - let hash = poseidonHash(wasm_bindgen::Clamped(message_ser)) - .map_err(|_| "failed") - .unwrap(); - let hash: Vec> = serde_json::from_slice(&hash[..]).unwrap(); - - let reference_hash = - PoseidonChip::::run(message.clone()) - .map_err(|_| "failed") - .unwrap(); - - assert_eq!(hash, reference_hash) - } - - #[wasm_bindgen_test] - async fn verify_gen_witness() { - let witness = genWitness( - wasm_bindgen::Clamped(NETWORK_COMPILED.to_vec()), - wasm_bindgen::Clamped(INPUT.to_vec()), - ) - .map_err(|_| "failed") - .unwrap(); - - let witness: GraphWitness = serde_json::from_slice(&witness[..]).unwrap(); - - let reference_witness: GraphWitness = serde_json::from_slice(&WITNESS).unwrap(); - // should not fail - assert_eq!(witness, reference_witness); - } - - #[wasm_bindgen_test] - async fn gen_pk_test() { - let vk = genVk( - wasm_bindgen::Clamped(NETWORK_COMPILED.to_vec()), - wasm_bindgen::Clamped(SRS.to_vec()), - true, - ) - .map_err(|_| "failed") - .unwrap(); - - let pk = genPk( - wasm_bindgen::Clamped(vk), - wasm_bindgen::Clamped(NETWORK_COMPILED.to_vec()), - wasm_bindgen::Clamped(SRS.to_vec()), - ) - .map_err(|_| "failed") - .unwrap(); - - assert!(pk.len() > 0); - } - - #[wasm_bindgen_test] - async fn gen_vk_test() { - let vk = genVk( - wasm_bindgen::Clamped(NETWORK_COMPILED.to_vec()), - wasm_bindgen::Clamped(SRS.to_vec()), - true, - ) - .map_err(|_| "failed") - .unwrap(); - - assert!(vk.len() > 0); - } - - #[wasm_bindgen_test] - async fn pk_is_valid_test() { - let vk = genVk( - wasm_bindgen::Clamped(NETWORK_COMPILED.to_vec()), - wasm_bindgen::Clamped(SRS.to_vec()), - true, - ) - .map_err(|_| "failed") - .unwrap(); - - let pk = genPk( - wasm_bindgen::Clamped(vk.clone()), - wasm_bindgen::Clamped(NETWORK_COMPILED.to_vec()), - wasm_bindgen::Clamped(SRS.to_vec()), - ) - .map_err(|_| "failed") - .unwrap(); - - // prove - let proof = prove( - wasm_bindgen::Clamped(WITNESS.to_vec()), - wasm_bindgen::Clamped(pk.clone()), - wasm_bindgen::Clamped(NETWORK_COMPILED.to_vec()), - wasm_bindgen::Clamped(SRS.to_vec()), - ) - .map_err(|_| "failed") - .unwrap(); - - assert!(proof.len() > 0); - - let value = verify( - wasm_bindgen::Clamped(proof.to_vec()), - wasm_bindgen::Clamped(vk), - wasm_bindgen::Clamped(SETTINGS.to_vec()), - wasm_bindgen::Clamped(SRS.to_vec()), - ) - .map_err(|_| "failed") - .unwrap(); - - // should not fail - assert!(value); - } - - #[wasm_bindgen_test] - async fn verify_validations() { - // Run witness validation on network (should fail) - let witness = witnessValidation(wasm_bindgen::Clamped(NETWORK_COMPILED.to_vec())); - assert!(witness.is_err()); - // Run witness validation on witness (should pass) - let witness = witnessValidation(wasm_bindgen::Clamped(WITNESS.to_vec())); - assert!(witness.is_ok()); - // Run compiled circuit validation on onnx network (should fail) - let circuit = compiledCircuitValidation(wasm_bindgen::Clamped(NETWORK.to_vec())); - assert!(circuit.is_err()); - // Run compiled circuit validation on compiled network (should pass) - let circuit = compiledCircuitValidation(wasm_bindgen::Clamped(NETWORK_COMPILED.to_vec())); - assert!(circuit.is_ok()); - // Run input validation on witness (should fail) - let input = inputValidation(wasm_bindgen::Clamped(WITNESS.to_vec())); - assert!(input.is_err()); - // Run input validation on input (should pass) - let input = inputValidation(wasm_bindgen::Clamped(INPUT.to_vec())); - assert!(input.is_ok()); - // Run proof validation on witness (should fail) - let proof = proofValidation(wasm_bindgen::Clamped(WITNESS.to_vec())); - assert!(proof.is_err()); - // Run proof validation on proof (should pass) - let proof = proofValidation(wasm_bindgen::Clamped(PROOF.to_vec())); - assert!(proof.is_ok()); - // // Run vk validation on SRS (should fail) - // let vk = vkValidation( - // wasm_bindgen::Clamped(SRS.to_vec()), - // wasm_bindgen::Clamped(SETTINGS.to_vec()) - // ); - // assert!(vk.is_err()); - - // Run vk validation on vk (should pass) - let vk = vkValidation( - wasm_bindgen::Clamped(VK.to_vec()), - wasm_bindgen::Clamped(SETTINGS.to_vec()), - ); - assert!(vk.is_ok()); - // // Run pk validation on vk (should fail) - // let pk = pkValidation( - // wasm_bindgen::Clamped(VK.to_vec()), - // wasm_bindgen::Clamped(SETTINGS.to_vec()) - // ); - // assert!(pk.is_err()); - // Run pk validation on pk (should pass) - let pk = pkValidation( - wasm_bindgen::Clamped(PK.to_vec()), - wasm_bindgen::Clamped(SETTINGS.to_vec()), - ); - - assert!(pk.is_ok()); - // Run settings validation on proof (should fail) - let settings = settingsValidation(wasm_bindgen::Clamped(PROOF.to_vec())); - assert!(settings.is_err()); - // Run settings validation on settings (should pass) - let settings = settingsValidation(wasm_bindgen::Clamped(SETTINGS.to_vec())); - assert!(settings.is_ok()); - // // Run srs validation on vk (should fail) - // let srs = srsValidation( - // wasm_bindgen::Clamped(VK.to_vec()) - // ); - // assert!(srs.is_err()); - // Run srs validation on srs (should pass) - let srs = srsValidation(wasm_bindgen::Clamped(SRS.to_vec())); - assert!(srs.is_ok()); - } -} diff --git a/tests/wasm/testBrowserEvmVerify.test.ts b/tests/wasm/testBrowserEvmVerify.test.ts deleted file mode 100644 index 89e1653f..00000000 --- a/tests/wasm/testBrowserEvmVerify.test.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { - serialize, - deserialize -} from './utils'; -import * as wasmFunctions from './nodejs/ezkl' -import { compileContracts } from './utils' -import * as fs from 'fs' - -exports.EXAMPLE = require("minimist")(process.argv.slice(2))["example"]; -exports.PATH = require("minimist")(process.argv.slice(2))["dir"]; -exports.VK = require("minimist")(process.argv.slice(2))["vk"]; - -describe('localEVMVerify', () => { - - let bytecode_verifier_buffer: Uint8Array - - let bytecode_vk_buffer: Uint8Array | undefined = undefined - - let proof: any - - const example = exports.EXAMPLE || "1l_mlp" - const path = exports.PATH || "../ezkl/examples/onnx" - const vk = exports.VK || false - - beforeEach(() => { - const solcOutput = compileContracts(path, example, 'kzg') - - let bytecode_verifier = - solcOutput.contracts['artifacts/Verifier.sol']['Halo2Verifier'].evm.bytecode - .object - bytecode_verifier_buffer = new TextEncoder().encode(bytecode_verifier) - - - if (vk) { - const solcOutput_vk = compileContracts(path, example, 'vk') - - let bytecode_vk = - solcOutput_vk.contracts['artifacts/Verifier.sol']['Halo2VerifyingKey'].evm.bytecode - .object - bytecode_vk_buffer = new TextEncoder().encode(bytecode_vk) - - - console.log('size of verifier bytecode', bytecode_verifier.length) - } - console.log('verifier bytecode', bytecode_verifier) - }) - - it('should return true when verification succeeds', async () => { - const proofFileBuffer = fs.readFileSync(`${path}/${example}/proof.pf`) - const proofSer = new Uint8ClampedArray(proofFileBuffer.buffer) - - proof = deserialize(proofSer) - - const result = wasmFunctions.verifyEVM(proofSer, bytecode_verifier_buffer, bytecode_vk_buffer) - - console.log('result', result) - - expect(result).toBe(true) - }) - - it('should fail to verify faulty proofs', async () => { - let result: boolean = true - console.log(proof.proof) - try { - let index = Math.round((Math.random() * (proof.proof.length))) % proof.proof.length - console.log('index', index) - console.log('index', proof.proof[index]) - let number = (proof.proof[index] + 1) % 256 - console.log('index', index) - console.log('new number', number) - proof.proof[index] = number - console.log('index post', proof.proof[index]) - const proofModified = serialize(proof) - result = wasmFunctions.verifyEVM(proofModified, bytecode_verifier_buffer, bytecode_vk_buffer) - } catch (error) { - result = false - } - expect(result).toBe(false) - }) -}) diff --git a/tests/wasm/testWasm.test.ts b/tests/wasm/testWasm.test.ts deleted file mode 100644 index cb4a1da4..00000000 --- a/tests/wasm/testWasm.test.ts +++ /dev/null @@ -1,75 +0,0 @@ -import * as wasmFunctions from './nodejs/ezkl' -import { - readEzklArtifactsFile, - readEzklSrsFile, - serialize, - deserialize -} from './utils'; -import fs from 'fs'; -exports.USER_NAME = require("minimist")(process.argv.slice(2))["example"]; -exports.PATH = require("minimist")(process.argv.slice(2))["dir"]; - -const timingData: { - example: string, - proveTime: number, - verifyTime: number, - verifyResult: boolean | undefined -}[] = []; - - - -describe('Generate witness, prove and verify', () => { - - let proof_ser: Uint8ClampedArray - let proof_ser_ref: Uint8ClampedArray - let circuit_settings_ser: Uint8ClampedArray; - let params_ser: Uint8ClampedArray; - - let proveTime = 0; - let verifyTime = 0; - let verifyResult: boolean | undefined = false; - - const example = exports.USER_NAME || "1l_mlp" - const path = exports.PATH || "../ezkl/examples/onnx" - - it('prove', async () => { - let result - let witness = await readEzklArtifactsFile(path, example, 'witness.json'); - let pk = await readEzklArtifactsFile(path, example, 'key.pk'); - let circuit_ser = await readEzklArtifactsFile(path, example, 'network.compiled'); - circuit_settings_ser = await readEzklArtifactsFile(path, example, 'settings.json'); - // get the log rows from the circuit settings - const circuit_settings = deserialize(circuit_settings_ser) as any; - const logrows = circuit_settings.run_args.logrows as string; - params_ser = await readEzklSrsFile(logrows); - const startTimeProve = Date.now(); - result = wasmFunctions.prove(witness, pk, circuit_ser, params_ser); - const endTimeProve = Date.now(); - proof_ser = new Uint8ClampedArray(result.buffer); - // test serialization/deserialization methods - const proof = deserialize(proof_ser); - proof_ser_ref = serialize(proof); - proveTime = endTimeProve - startTimeProve; - expect(result).toBeInstanceOf(Uint8Array); - }); - - it('verify', async () => { - let result - const vk = await readEzklArtifactsFile(path, example, 'key.vk'); - const startTimeVerify = Date.now(); - params_ser = await readEzklSrsFile("1"); - result = wasmFunctions.verify(proof_ser, vk, circuit_settings_ser, params_ser); - const result_ref = wasmFunctions.verify(proof_ser_ref, vk, circuit_settings_ser, params_ser); - const endTimeVerify = Date.now(); - verifyTime = endTimeVerify - startTimeVerify; - verifyResult = result; - // test serialization/deserialization methods - expect(typeof result).toBe('boolean'); - expect(result).toBe(true); - expect(result_ref).toBe(true); - }); - - afterAll(() => { - fs.writeFileSync('timingData.json', JSON.stringify(timingData, null, 2)); - }); -}); diff --git a/tests/wasm/tsconfig.json b/tests/wasm/tsconfig.json deleted file mode 100644 index b4860982..00000000 --- a/tests/wasm/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ], - "paths": { - "@/*": ["./*"] - } - }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "jest.config.js"], - "exclude": ["node_modules"] -} diff --git a/tests/wasm/utils.ts b/tests/wasm/utils.ts deleted file mode 100644 index 0ef8dda0..00000000 --- a/tests/wasm/utils.ts +++ /dev/null @@ -1,94 +0,0 @@ -import * as fs from 'fs/promises'; -import * as fsSync from 'fs' -import JSONBig from 'json-bigint'; -const solc = require('solc'); - -// import os module -const os = require('os'); - -// check the available memory -const userHomeDir = os.homedir(); - -export async function readEzklArtifactsFile(path: string, example: string, filename: string): Promise { - //const filePath = path.join(__dirname, '..', '..', 'ezkl', 'examples', 'onnx', example, filename); - const filePath = `${path}/${example}/${filename}` - const buffer = await fs.readFile(filePath); - return new Uint8ClampedArray(buffer.buffer); -} - -export async function readEzklSrsFile(logrows: string): Promise { - const filePath = `${userHomeDir}/.ezkl/srs/kzg${logrows}.srs` - const buffer = await fs.readFile(filePath); - return new Uint8ClampedArray(buffer.buffer); -} - -export function deserialize(buffer: Uint8Array | Uint8ClampedArray): object { // buffer is a Uint8ClampedArray | Uint8Array // return a JSON object - if (buffer instanceof Uint8ClampedArray) { - buffer = new Uint8Array(buffer.buffer); - } - const string = new TextDecoder().decode(buffer); - const jsonObject = JSONBig.parse(string); - return jsonObject; -} - -export function serialize(data: object | string): Uint8ClampedArray { // data is an object // return a Uint8ClampedArray - // Step 1: Stringify the Object with BigInt support - if (typeof data === "object") { - data = JSONBig.stringify(data); - } - // Step 2: Encode the JSON String - const uint8Array = new TextEncoder().encode(data as string); - - // Step 3: Convert to Uint8ClampedArray - return new Uint8ClampedArray(uint8Array.buffer); -} - -export function getSolcInput(path: string, example: string, name: string) { - return { - language: 'Solidity', - sources: { - 'artifacts/Verifier.sol': { - content: fsSync.readFileSync(`${path}/${example}/${name}.sol`, 'utf-8'), - }, - // If more contracts were to be compiled, they should have their own entries here - }, - settings: { - optimizer: { - enabled: true, - runs: 1, - }, - evmVersion: 'shanghai', - outputSelection: { - '*': { - '*': ['abi', 'evm.bytecode'], - }, - }, - }, - } -} - -export function compileContracts(path: string, example: string, name: string) { - const input = getSolcInput(path, example, name) - const output = JSON.parse(solc.compile(JSON.stringify(input))) - - let compilationFailed = false - - if (output.errors) { - for (const error of output.errors) { - if (error.severity === 'error') { - console.error(error.formattedMessage) - compilationFailed = true - } else { - console.warn(error.formattedMessage) - } - } - } - - if (compilationFailed) { - return undefined - } - - return output -} - - diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index b4860982..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ], - "paths": { - "@/*": ["./*"] - } - }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "jest.config.js"], - "exclude": ["node_modules"] -}