mirror of
https://github.com/zkonduit/ezkl.git
synced 2026-01-17 18:27:58 -05:00
Compare commits
1 Commits
v23.0.4
...
ac/simpler
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
704813cc15 |
2
.github/workflows/large-tests.yml
vendored
2
.github/workflows/large-tests.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: nanoGPT Mock
|
||||
|
||||
63
.github/workflows/pypi.yml
vendored
63
.github/workflows/pypi.yml
vendored
@@ -24,12 +24,12 @@ jobs:
|
||||
matrix:
|
||||
target: [x86_64, universal2-apple-darwin]
|
||||
env:
|
||||
RELEASE_TAG: ${{ github.ref_name }}
|
||||
RELEASE_TAG: ${{ github.ref_name }}
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
|
||||
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
|
||||
with:
|
||||
python-version: 3.12
|
||||
architecture: x64
|
||||
@@ -48,22 +48,22 @@ jobs:
|
||||
mv Cargo.lock Cargo.lock.orig
|
||||
sed "s/0\\.0\\.0/${RELEASE_TAG//v}/" Cargo.lock.orig >Cargo.lock
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
cache: false
|
||||
|
||||
- name: Build wheels
|
||||
if: matrix.target == 'universal2-apple-darwin'
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
args: --release --out dist --features python-bindings
|
||||
- name: Build wheels
|
||||
if: matrix.target == 'x86_64'
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
args: --release --out dist --features python-bindings
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
python -c "import ezkl"
|
||||
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
|
||||
with:
|
||||
name: dist-macos-${{ matrix.target }}
|
||||
path: dist
|
||||
@@ -88,10 +88,10 @@ jobs:
|
||||
matrix:
|
||||
target: [x64, x86]
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
|
||||
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
|
||||
with:
|
||||
python-version: 3.12
|
||||
architecture: ${{ matrix.target }}
|
||||
@@ -114,15 +114,15 @@ jobs:
|
||||
mv Cargo.lock Cargo.lock.orig
|
||||
sed "s/0\\.0\\.0/${RELEASE_TAG//v}/" Cargo.lock.orig >Cargo.lock
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
cache: false
|
||||
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
args: --release --out dist --features python-bindings
|
||||
@@ -132,7 +132,7 @@ jobs:
|
||||
python -c "import ezkl"
|
||||
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0 #v4.6.0
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0 #v4.6.0
|
||||
with:
|
||||
name: dist-windows-${{ matrix.target }}
|
||||
path: dist
|
||||
@@ -146,10 +146,10 @@ jobs:
|
||||
matrix:
|
||||
target: [x86_64]
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
|
||||
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
|
||||
with:
|
||||
python-version: 3.12
|
||||
architecture: x64
|
||||
@@ -178,7 +178,7 @@ jobs:
|
||||
sudo apt-get update && sudo apt-get install -y openssl pkg-config libssl-dev
|
||||
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
manylinux: auto
|
||||
@@ -205,7 +205,7 @@ jobs:
|
||||
python -c "import ezkl"
|
||||
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
|
||||
with:
|
||||
name: dist-linux-${{ matrix.target }}
|
||||
path: dist
|
||||
@@ -220,10 +220,10 @@ jobs:
|
||||
target:
|
||||
- x86_64-unknown-linux-musl
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
|
||||
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
|
||||
with:
|
||||
python-version: 3.12
|
||||
architecture: x64
|
||||
@@ -252,7 +252,7 @@ jobs:
|
||||
sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev
|
||||
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
manylinux: musllinux_1_2
|
||||
@@ -273,7 +273,7 @@ jobs:
|
||||
python3 -c "import ezkl"
|
||||
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
|
||||
with:
|
||||
name: dist-musllinux-${{ matrix.target }}
|
||||
path: dist
|
||||
@@ -289,10 +289,10 @@ jobs:
|
||||
- target: aarch64-unknown-linux-musl
|
||||
arch: aarch64
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
|
||||
- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa #v4.8.0
|
||||
with:
|
||||
python-version: 3.12
|
||||
|
||||
@@ -315,13 +315,13 @@ jobs:
|
||||
sed "s/0\\.0\\.0/${RELEASE_TAG//v}/" Cargo.lock.orig >Cargo.lock
|
||||
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
uses: PyO3/maturin-action@5f8a1b3b0aad13193f46c9131f9b9e663def8ce5 #v1.46.0
|
||||
with:
|
||||
target: ${{ matrix.platform.target }}
|
||||
manylinux: musllinux_1_2
|
||||
args: --release --out dist --features python-bindings
|
||||
|
||||
- uses: uraimo/run-on-arch-action@5397f9e30a9b62422f302092631c99ae1effcd9e #v2.8.1
|
||||
- uses: uraimo/run-on-arch-action@5397f9e30a9b62422f302092631c99ae1effcd9e #v2.8.1
|
||||
name: Install built wheel
|
||||
with:
|
||||
arch: ${{ matrix.platform.arch }}
|
||||
@@ -336,7 +336,7 @@ jobs:
|
||||
python3 -c "import ezkl"
|
||||
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
|
||||
with:
|
||||
name: dist-musllinux-${{ matrix.platform.target }}
|
||||
path: dist
|
||||
@@ -349,7 +349,7 @@ jobs:
|
||||
if: "startsWith(github.ref, 'refs/tags/')"
|
||||
needs: [macos, windows, linux, musllinux, musllinux-cross]
|
||||
steps:
|
||||
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8
|
||||
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8
|
||||
with:
|
||||
pattern: dist-*
|
||||
merge-multiple: true
|
||||
@@ -366,10 +366,11 @@ jobs:
|
||||
|
||||
# publishes to PyPI
|
||||
- name: Publish package distributions to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc #v1.12.4
|
||||
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc #v1.12.4
|
||||
with:
|
||||
packages-dir: ./wheels
|
||||
|
||||
|
||||
doc-publish:
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -377,7 +378,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: pypi-publish
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Trigger RTDs build
|
||||
@@ -385,4 +386,4 @@ jobs:
|
||||
with:
|
||||
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }}
|
||||
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }}
|
||||
commit_ref: ${{ github.ref_name }}
|
||||
commit_ref: ${{ github.ref_name }}
|
||||
36
.github/workflows/release.yml
vendored
36
.github/workflows/release.yml
vendored
@@ -52,7 +52,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
cache: false
|
||||
@@ -98,11 +98,14 @@ jobs:
|
||||
echo "ASSET=build-artifacts/ezkl-linux-gpu.tar.gz" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload release archive
|
||||
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda #v2.2.1
|
||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 #v1.0.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
with:
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
||||
tag_name: ${{ env.EZKL_VERSION }}
|
||||
files: ${{ env.ASSET }}
|
||||
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
||||
asset_path: ${{ env.ASSET }}
|
||||
asset_name: ${{ env.ASSET }}
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
build-release:
|
||||
permissions:
|
||||
@@ -124,27 +127,27 @@ jobs:
|
||||
include:
|
||||
- build: windows-msvc
|
||||
os: windows-latest
|
||||
rust: nightly-2025-12-01
|
||||
rust: nightly-2025-05-01
|
||||
target: x86_64-pc-windows-msvc
|
||||
- build: macos
|
||||
os: macos-13
|
||||
rust: nightly-2025-12-01
|
||||
rust: nightly-2025-05-01
|
||||
target: x86_64-apple-darwin
|
||||
- build: macos-aarch64
|
||||
os: macos-13
|
||||
rust: nightly-2025-12-01
|
||||
rust: nightly-2025-05-01
|
||||
target: aarch64-apple-darwin
|
||||
- build: linux-musl
|
||||
os: ubuntu-22.04
|
||||
rust: nightly-2025-12-01
|
||||
rust: nightly-2025-05-01
|
||||
target: x86_64-unknown-linux-musl
|
||||
- build: linux-gnu
|
||||
os: ubuntu-22.04
|
||||
rust: nightly-2025-12-01
|
||||
rust: nightly-2025-05-01
|
||||
target: x86_64-unknown-linux-gnu
|
||||
- build: linux-aarch64
|
||||
os: ubuntu-22.04
|
||||
rust: nightly-2025-12-01
|
||||
rust: nightly-2025-05-01
|
||||
target: aarch64-unknown-linux-gnu
|
||||
|
||||
steps:
|
||||
@@ -237,8 +240,11 @@ jobs:
|
||||
echo "ASSET=build-artifacts/ezkl-win.zip" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload release archive
|
||||
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda #v2.2.1
|
||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 #v1.0.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
with:
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
||||
tag_name: ${{ env.EZKL_VERSION }}
|
||||
files: ${{ env.ASSET }}
|
||||
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
||||
asset_path: ${{ env.ASSET }}
|
||||
asset_name: ${{ env.ASSET }}
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
42
.github/workflows/rust.yml
vendored
42
.github/workflows/rust.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: install libc6
|
||||
@@ -82,7 +82,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: install libc6
|
||||
@@ -106,7 +106,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: install libc6
|
||||
@@ -140,7 +140,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
|
||||
@@ -185,7 +185,7 @@ jobs:
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: install libc6
|
||||
@@ -223,7 +223,7 @@ jobs:
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: install libc6
|
||||
@@ -256,7 +256,7 @@ jobs:
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
|
||||
@@ -331,7 +331,7 @@ jobs:
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
|
||||
@@ -344,11 +344,11 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: "Add rust-src"
|
||||
run: rustup component add rust-src --toolchain nightly-2025-12-01-x86_64-unknown-linux-gnu
|
||||
run: rustup component add rust-src --toolchain nightly-2025-05-01-x86_64-unknown-linux-gnu
|
||||
# - 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 c11315be56183bcbc13235475045670542d542ba --locked anvil --force
|
||||
run: cargo install --git https://github.com/foundry-rs/foundry --rev 56b806a3ba7866a3b061093bebd0fa2ace97f1fc --locked anvil --force
|
||||
- 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)
|
||||
@@ -380,11 +380,11 @@ jobs:
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: Add rust-src
|
||||
run: rustup component add rust-src --toolchain nightly-2025-12-01-x86_64-unknown-linux-gnu
|
||||
run: rustup component add rust-src --toolchain nightly-2025-05-01-x86_64-unknown-linux-gnu
|
||||
- name: Force rebuild icicle dependencies
|
||||
run: cargo clean -p icicle-runtime -p icicle-core -p icicle-hash -p icicle-bn254
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
|
||||
@@ -437,11 +437,11 @@ jobs:
|
||||
persist-credentials: false
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: Add rust-src
|
||||
run: rustup component add rust-src --toolchain nightly-2025-12-01-x86_64-unknown-linux-gnu
|
||||
run: rustup component add rust-src --toolchain nightly-2025-05-01-x86_64-unknown-linux-gnu
|
||||
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
|
||||
with:
|
||||
crate: cargo-nextest
|
||||
@@ -486,7 +486,7 @@ jobs:
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: install libc6
|
||||
@@ -520,7 +520,7 @@ jobs:
|
||||
python-version: "3.12"
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: Install cmake
|
||||
@@ -530,7 +530,7 @@ jobs:
|
||||
- name: Setup Virtual Env and Install python dependencies
|
||||
run: python -m venv .env --clear; source .env/bin/activate; pip install -r requirements.txt;
|
||||
- name: Install Anvil
|
||||
run: cargo install --git https://github.com/foundry-rs/foundry --rev c11315be56183bcbc13235475045670542d542ba --locked anvil --force
|
||||
run: cargo install --git https://github.com/foundry-rs/foundry --rev 56b806a3ba7866a3b061093bebd0fa2ace97f1fc --locked anvil --force
|
||||
- name: Build python ezkl
|
||||
run: source .env/bin/activate; unset CONDA_PREFIX; maturin develop --features python-bindings,reusable-verifier --profile=test-runs
|
||||
- name: Run pytest
|
||||
@@ -554,7 +554,7 @@ jobs:
|
||||
python-version: "3.12"
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
|
||||
@@ -592,7 +592,7 @@ jobs:
|
||||
python-version: "3.11"
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3 #v3.3.0
|
||||
@@ -602,7 +602,7 @@ jobs:
|
||||
# - name: Install solc
|
||||
# run: (hash svm 2>/dev/null || cargo install svm-rs) && svm install 0.8.20 && solc --version
|
||||
- name: Install Anvil
|
||||
run: cargo install --git https://github.com/foundry-rs/foundry --rev c11315be56183bcbc13235475045670542d542ba --locked anvil --force
|
||||
run: cargo install --git https://github.com/foundry-rs/foundry --rev 56b806a3ba7866a3b061093bebd0fa2ace97f1fc --locked anvil --force
|
||||
- name: Install pip
|
||||
run: python -m ensurepip --upgrade
|
||||
- name: Setup Virtual Env and Install python dependencies
|
||||
|
||||
2
.github/workflows/static-analysis.yml
vendored
2
.github/workflows/static-analysis.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.0.6
|
||||
with:
|
||||
toolchain: nightly-2025-12-01
|
||||
toolchain: nightly-2025-05-01
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
|
||||
3338
Cargo.lock
generated
3338
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
13
Cargo.toml
13
Cargo.toml
@@ -51,16 +51,17 @@ semver = { version = "1.0.22", optional = true }
|
||||
# evm related deps
|
||||
serde_json = { version = "1.0.97", features = ["float_roundtrip", "raw_value"] }
|
||||
|
||||
alloy = { version = "1.0", features = [
|
||||
alloy = { git = "https://github.com/alloy-rs/alloy", version = "0.1.0", rev = "5fbf57bac99edef9d8475190109a7ea9fb7e5e83", features = [
|
||||
"provider-http",
|
||||
"signers",
|
||||
"contract",
|
||||
"rpc-types-eth",
|
||||
"signer-local",
|
||||
"signer-wallet",
|
||||
"node-bindings",
|
||||
|
||||
], optional = true }
|
||||
|
||||
foundry-compilers = { version = "0.19.1", features = [
|
||||
foundry-compilers = { version = "0.4.1", features = [
|
||||
"svm-solc",
|
||||
], optional = true }
|
||||
ethabi = { version = "18", optional = true }
|
||||
@@ -79,16 +80,16 @@ tokio = { version = "1.35.0", default-features = false, features = [
|
||||
"macros",
|
||||
"rt-multi-thread",
|
||||
], optional = true }
|
||||
pyo3 = { version = "0.27.2", features = [
|
||||
pyo3 = { version = "0.24.2", features = [
|
||||
"extension-module",
|
||||
"abi3-py37",
|
||||
"macros",
|
||||
], default-features = false, optional = true }
|
||||
pyo3-async-runtimes = { git = "https://github.com/PyO3/pyo3-async-runtimes", version = "0.27.0", features = [
|
||||
pyo3-async-runtimes = { git = "https://github.com/PyO3/pyo3-async-runtimes", version = "0.24.0", features = [
|
||||
"attributes",
|
||||
"tokio-runtime",
|
||||
], default-features = false, optional = true }
|
||||
pyo3-log = { version = "0.13.2", default-features = false, optional = true }
|
||||
pyo3-log = { version = "0.12.0", default-features = false, optional = true }
|
||||
tract-onnx = { git = "https://github.com/sonos/tract/", rev = "37132e0397d0a73e5bd3a8615d932dabe44f6736", default-features = false, optional = true }
|
||||
tabled = { version = "0.12.0", optional = true }
|
||||
objc = { version = "0.2.4", optional = true }
|
||||
|
||||
@@ -155,5 +155,5 @@ Check out `docs/advanced_security` for more advanced information on potential th
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Copyright (c) 2026 Zkonduit Inc.
|
||||
Copyright (c) 2025 Zkonduit Inc.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ezkl
|
||||
|
||||
project = 'ezkl'
|
||||
release = '23.0.4'
|
||||
release = '0.0.0'
|
||||
version = release
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2025-12-01"
|
||||
channel = "nightly-2025-05-01"
|
||||
components = ["rustfmt", "clippy"]
|
||||
|
||||
@@ -920,19 +920,18 @@ fn calibrate_settings(
|
||||
))]
|
||||
#[gen_stub_pyfunction]
|
||||
fn gen_witness(
|
||||
py: Python<'_>,
|
||||
data: String,
|
||||
model: PathBuf,
|
||||
output: Option<PathBuf>,
|
||||
vk_path: Option<PathBuf>,
|
||||
srs_path: Option<PathBuf>,
|
||||
) -> PyResult<Py<PyAny>> {
|
||||
) -> PyResult<PyObject> {
|
||||
let output =
|
||||
crate::execute::gen_witness(model, data, output, vk_path, srs_path).map_err(|e| {
|
||||
let err_str = format!("Failed to generate witness: {}", e);
|
||||
PyRuntimeError::new_err(err_str)
|
||||
})?;
|
||||
Ok(output.into_pyobject(py).unwrap().unbind())
|
||||
Python::with_gil(|py| Ok(output.into_pyobject(py).unwrap().into()))
|
||||
}
|
||||
|
||||
/// Mocks the prover
|
||||
@@ -1054,13 +1053,12 @@ fn setup(
|
||||
))]
|
||||
#[gen_stub_pyfunction]
|
||||
fn prove(
|
||||
py: Python<'_>,
|
||||
witness: PathBuf,
|
||||
model: PathBuf,
|
||||
pk_path: PathBuf,
|
||||
proof_path: Option<PathBuf>,
|
||||
srs_path: Option<PathBuf>,
|
||||
) -> PyResult<Py<PyAny>> {
|
||||
) -> PyResult<PyObject> {
|
||||
let snark = crate::execute::prove(
|
||||
witness,
|
||||
model,
|
||||
@@ -1074,7 +1072,7 @@ fn prove(
|
||||
PyRuntimeError::new_err(err_str)
|
||||
})?;
|
||||
|
||||
Ok(snark.into_pyobject(py).unwrap().unbind())
|
||||
Python::with_gil(|py| Ok(snark.into_pyobject(py).unwrap().into()))
|
||||
}
|
||||
|
||||
/// Verifies a given proof
|
||||
|
||||
@@ -102,11 +102,9 @@ impl<'py> IntoPyObject<'py> for CheckMode {
|
||||
|
||||
#[cfg(feature = "python-bindings")]
|
||||
/// Obtains CheckMode from PyObject (Required for CheckMode to be compatible with Python)
|
||||
impl<'py> FromPyObject<'_, 'py> for CheckMode {
|
||||
type Error = pyo3::PyErr;
|
||||
|
||||
fn extract(ob: pyo3::Borrowed<'_, 'py, pyo3::PyAny>) -> Result<Self, Self::Error> {
|
||||
let trystr = String::extract(ob)?;
|
||||
impl<'source> FromPyObject<'source> for CheckMode {
|
||||
fn extract_bound(ob: &pyo3::Bound<'source, pyo3::PyAny>) -> PyResult<Self> {
|
||||
let trystr = String::extract_bound(ob)?;
|
||||
match trystr.to_lowercase().as_str() {
|
||||
"safe" => Ok(CheckMode::SAFE),
|
||||
"unsafe" => Ok(CheckMode::UNSAFE),
|
||||
|
||||
@@ -159,18 +159,17 @@ pub fn diff_less_than<F: PrimeField + TensorType + PartialOrd + std::hash::Hash>
|
||||
values: &[&ValTensor<F>; 2],
|
||||
constant: F,
|
||||
) -> Result<(), CircuitError> {
|
||||
let distance = l1_distance(config, region, values)?;
|
||||
|
||||
let constant = create_constant_tensor(constant, 1);
|
||||
let is_less = less(config, region, &[&distance, &constant])?;
|
||||
|
||||
// assert the result is 1
|
||||
let comparison_unit = create_constant_tensor(F::ONE, is_less.len());
|
||||
enforce_equality(config, region, &[&is_less, &comparison_unit])?;
|
||||
let diff = pairwise(config, region, values, BaseOp::Sub)?;
|
||||
let int_rep_constant = felt_to_integer_rep(constant);
|
||||
range_check(
|
||||
config,
|
||||
region,
|
||||
&[&diff],
|
||||
&(-int_rep_constant + 1, int_rep_constant - 1),
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Performs division of a tensor by a constant value.
|
||||
///
|
||||
/// This function divides each element in a tensor by a scalar divisor value, using
|
||||
@@ -6229,9 +6228,9 @@ pub(crate) fn recompose<F: PrimeField + TensorType + PartialOrd + std::hash::Has
|
||||
(0..num_first_dims)
|
||||
.flat_map(|_| {
|
||||
(0..n).rev().map(|x| {
|
||||
let base = (*base as IntegerRep).checked_pow(x as u32);
|
||||
let base = (*base).checked_pow(x as u32);
|
||||
if let Some(base) = base {
|
||||
Ok(ValType::Constant(integer_rep_to_felt(base)))
|
||||
Ok(ValType::Constant(integer_rep_to_felt(base as IntegerRep)))
|
||||
} else {
|
||||
Err(CircuitError::DecompositionBaseOverflow)
|
||||
}
|
||||
@@ -6341,9 +6340,9 @@ pub(crate) fn decompose<F: PrimeField + TensorType + PartialOrd + std::hash::Has
|
||||
(0..input.len())
|
||||
.flat_map(|_| {
|
||||
(0..*n).rev().map(|x| {
|
||||
let base = (*base as IntegerRep).checked_pow(x as u32);
|
||||
let base = (*base).checked_pow(x as u32);
|
||||
if let Some(base) = base {
|
||||
Ok(ValType::Constant(integer_rep_to_felt(base)))
|
||||
Ok(ValType::Constant(integer_rep_to_felt(base as IntegerRep)))
|
||||
} else {
|
||||
Err(CircuitError::DecompositionBaseOverflow)
|
||||
}
|
||||
|
||||
@@ -238,11 +238,9 @@ impl<'py> IntoPyObject<'py> for CalibrationTarget {
|
||||
|
||||
#[cfg(feature = "python-bindings")]
|
||||
/// Obtains CalibrationTarget from PyObject (Required for CalibrationTarget to be compatible with Python)
|
||||
impl<'py> FromPyObject<'_, 'py> for CalibrationTarget {
|
||||
type Error = pyo3::PyErr;
|
||||
|
||||
fn extract(ob: pyo3::Borrowed<'_, 'py, pyo3::PyAny>) -> Result<Self, Self::Error> {
|
||||
let strval = String::extract(ob)?;
|
||||
impl<'source> FromPyObject<'source> for CalibrationTarget {
|
||||
fn extract_bound(ob: &pyo3::Bound<'source, pyo3::PyAny>) -> PyResult<Self> {
|
||||
let strval = String::extract_bound(ob)?;
|
||||
match strval.to_lowercase().as_str() {
|
||||
"resources" => Ok(CalibrationTarget::Resources {
|
||||
col_overflow: false,
|
||||
@@ -272,11 +270,9 @@ impl<'py> IntoPyObject<'py> for ContractType {
|
||||
|
||||
#[cfg(feature = "python-bindings")]
|
||||
/// Obtains ContractType from PyObject (Required for ContractType to be compatible with Python)
|
||||
impl<'py> FromPyObject<'_, 'py> for ContractType {
|
||||
type Error = pyo3::PyErr;
|
||||
|
||||
fn extract(ob: pyo3::Borrowed<'_, 'py, pyo3::PyAny>) -> Result<Self, Self::Error> {
|
||||
let strval = String::extract(ob)?;
|
||||
impl<'source> FromPyObject<'source> for ContractType {
|
||||
fn extract_bound(ob: &pyo3::Bound<'source, pyo3::PyAny>) -> PyResult<Self> {
|
||||
let strval = String::extract_bound(ob)?;
|
||||
match strval.to_lowercase().as_str() {
|
||||
"verifier" => Ok(ContractType::Verifier { reusable: false }),
|
||||
"verifier/reusable" => Ok(ContractType::Verifier { reusable: true }),
|
||||
|
||||
108
src/eth.rs
108
src/eth.rs
@@ -4,26 +4,31 @@ use alloy::core::primitives::Address as H160;
|
||||
use alloy::core::primitives::Bytes;
|
||||
use alloy::core::primitives::I256;
|
||||
use alloy::dyn_abi::abi::TokenSeq;
|
||||
// use alloy::providers::Middleware;
|
||||
use alloy::json_abi::JsonAbi;
|
||||
use alloy::network::{Ethereum, EthereumWallet};
|
||||
use alloy::primitives::ruint::ParseError;
|
||||
use alloy::primitives::ParseSignedError;
|
||||
use alloy::providers::fillers::{
|
||||
ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller, SignerFiller,
|
||||
};
|
||||
use alloy::providers::network::{Ethereum, EthereumSigner};
|
||||
use alloy::providers::ProviderBuilder;
|
||||
use alloy::providers::Provider;
|
||||
use alloy::rpc::types::TransactionInput;
|
||||
use alloy::rpc::types::TransactionRequest;
|
||||
use alloy::providers::{Identity, Provider, RootProvider};
|
||||
use alloy::rpc::types::eth::TransactionInput;
|
||||
use alloy::rpc::types::eth::TransactionRequest;
|
||||
use alloy::signers::k256::ecdsa;
|
||||
use alloy::signers::local::{PrivateKeySigner, LocalSignerError};
|
||||
use alloy::signers::wallet::{LocalWallet, WalletError};
|
||||
use alloy::transports::http::Http;
|
||||
use alloy::transports::{RpcError, TransportErrorKind};
|
||||
use foundry_compilers::artifacts::Settings as SolcSettings;
|
||||
use foundry_compilers::error::{SolcError, SolcIoError};
|
||||
use foundry_compilers::solc::Solc;
|
||||
use foundry_compilers::Solc;
|
||||
use halo2_solidity_verifier::encode_register_vk_calldata;
|
||||
use halo2curves::bn256::{Fr, G1Affine};
|
||||
use log::{debug, info, warn};
|
||||
use reqwest::Client;
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
|
||||
const ANVIL_DEFAULT_PRIVATE_KEY: &str =
|
||||
@@ -47,10 +52,8 @@ pub enum EthError {
|
||||
Transport(#[from] RpcError<TransportErrorKind>),
|
||||
#[error("a contract error occurred: {0}")]
|
||||
Contract(#[from] alloy::contract::Error),
|
||||
#[error("a pending transaction error occurred: {0}")]
|
||||
PendingTransaction(#[from] alloy::providers::PendingTransactionError),
|
||||
#[error("a wallet error occurred: {0}")]
|
||||
Wallet(#[from] LocalSignerError),
|
||||
Wallet(#[from] WalletError),
|
||||
#[error("failed to parse url {0}")]
|
||||
UrlParse(String),
|
||||
#[error("Private key must be in hex format, 64 chars, without 0x prefix")]
|
||||
@@ -99,57 +102,49 @@ pub enum EthError {
|
||||
}
|
||||
|
||||
pub type EthersClient = Arc<
|
||||
alloy::providers::fillers::FillProvider<
|
||||
alloy::providers::fillers::JoinFill<
|
||||
alloy::providers::fillers::JoinFill<
|
||||
alloy::providers::fillers::JoinFill<
|
||||
alloy::providers::fillers::JoinFill<
|
||||
alloy::providers::Identity,
|
||||
alloy::providers::fillers::GasFiller,
|
||||
>,
|
||||
alloy::providers::fillers::NonceFiller,
|
||||
>,
|
||||
alloy::providers::fillers::ChainIdFiller,
|
||||
>,
|
||||
alloy::providers::fillers::WalletFiller<EthereumWallet>,
|
||||
FillProvider<
|
||||
JoinFill<
|
||||
JoinFill<JoinFill<JoinFill<Identity, GasFiller>, NonceFiller>, ChainIdFiller>,
|
||||
SignerFiller<EthereumSigner>,
|
||||
>,
|
||||
alloy::providers::RootProvider<Http<Client>>,
|
||||
RootProvider<Http<Client>>,
|
||||
Http<Client>,
|
||||
Ethereum,
|
||||
>,
|
||||
>;
|
||||
|
||||
pub type ContractFactory<M> = CallBuilder<Arc<M>, (), Ethereum>;
|
||||
pub type ContractFactory<M> = CallBuilder<Http<Client>, Arc<M>, ()>;
|
||||
|
||||
/// Return an instance of Anvil and a client for the given RPC URL. If none is provided, a local client is used.
|
||||
pub async fn setup_eth_backend(
|
||||
rpc_url: &str,
|
||||
private_key: Option<&str>,
|
||||
) -> Result<(Arc<impl Provider + Clone>, alloy::primitives::Address), EthError> {
|
||||
) -> Result<(EthersClient, alloy::primitives::Address), EthError> {
|
||||
// Launch anvil
|
||||
|
||||
let endpoint = rpc_url.to_string();
|
||||
|
||||
// Instantiate the wallet
|
||||
let signer: PrivateKeySigner;
|
||||
let wallet: LocalWallet;
|
||||
if let Some(private_key) = private_key {
|
||||
debug!("using private key {}", private_key);
|
||||
if private_key.len() != 64 {
|
||||
return Err(EthError::PrivateKeyFormat);
|
||||
}
|
||||
let private_key_buffer = hex::decode(private_key)?;
|
||||
signer = PrivateKeySigner::from_slice(&private_key_buffer)?;
|
||||
wallet = LocalWallet::from_slice(&private_key_buffer)?;
|
||||
} else {
|
||||
signer = ANVIL_DEFAULT_PRIVATE_KEY.parse()?;
|
||||
wallet = LocalWallet::from_str(ANVIL_DEFAULT_PRIVATE_KEY)?;
|
||||
}
|
||||
|
||||
let wallet_address = signer.address();
|
||||
let wallet = EthereumWallet::from(signer);
|
||||
let wallet_address = wallet.address();
|
||||
|
||||
// Connect to the network
|
||||
let client = Arc::new(
|
||||
ProviderBuilder::new()
|
||||
.wallet(wallet)
|
||||
.connect_http(endpoint.parse().map_err(|_| EthError::UrlParse(endpoint))?),
|
||||
.with_recommended_fillers()
|
||||
.signer(EthereumSigner::from(wallet))
|
||||
.on_http(endpoint.parse().map_err(|_| EthError::UrlParse(endpoint))?),
|
||||
);
|
||||
|
||||
let chain_id = client.get_chain_id().await?;
|
||||
@@ -199,7 +194,7 @@ pub async fn register_vka_via_rv(
|
||||
let tx = TransactionRequest::default().to(rv_address).input(input);
|
||||
debug!("transaction {:#?}", tx);
|
||||
|
||||
let result = client.call(tx.clone()).await;
|
||||
let result = client.call(&tx).await;
|
||||
|
||||
if let Err(e) = result {
|
||||
return Err(EthError::EvmVerificationError(e.to_string()).into());
|
||||
@@ -209,7 +204,7 @@ pub async fn register_vka_via_rv(
|
||||
// decode return bytes value into uint8
|
||||
let output = result.to_vec();
|
||||
|
||||
let gas = client.estimate_gas(tx.clone()).await?;
|
||||
let gas = client.estimate_gas(&tx).await?;
|
||||
|
||||
info!("estimated vka registration cost: {:#?}", gas);
|
||||
|
||||
@@ -220,11 +215,11 @@ pub async fn register_vka_via_rv(
|
||||
result.watch().await?;
|
||||
|
||||
// if gas is greater than 30 million warn the user that the gas cost is above ethereum's 30 million block gas limit
|
||||
if gas > 30_000_000_u64 {
|
||||
if gas > 30_000_000_u128 {
|
||||
warn!(
|
||||
"Gas cost of verify transaction is greater than 30 million block gas limit. It will fail on mainnet."
|
||||
);
|
||||
} else if gas > 15_000_000_u64 {
|
||||
} else if gas > 15_000_000_u128 {
|
||||
warn!(
|
||||
"Gas cost of verify transaction is greater than 15 million, the target block size for ethereum"
|
||||
);
|
||||
@@ -271,7 +266,7 @@ pub async fn verify_proof_via_solidity(
|
||||
let tx = TransactionRequest::default().to(addr).input(input);
|
||||
debug!("transaction {:#?}", tx);
|
||||
|
||||
let result = client.call(tx.clone()).await;
|
||||
let result = client.call(&tx).await;
|
||||
|
||||
if let Err(e) = result {
|
||||
return Err(EthError::EvmVerificationError(e.to_string()).into());
|
||||
@@ -296,7 +291,7 @@ pub async fn verify_proof_via_solidity(
|
||||
if !scaled_matches(inst, exp) {
|
||||
return Err(EthError::RescaleCheckError(RescaleCheckError::Mismatch {
|
||||
idx,
|
||||
expected: exp.to_string(),
|
||||
expected: exp.clone(),
|
||||
got: to_decimal_18(inst),
|
||||
}));
|
||||
}
|
||||
@@ -313,16 +308,16 @@ pub async fn verify_proof_via_solidity(
|
||||
return Err(EthError::EvmVerificationError("Invalid proof".into()));
|
||||
}
|
||||
|
||||
let gas = client.estimate_gas(tx.clone()).await?;
|
||||
let gas = client.estimate_gas(&tx).await?;
|
||||
|
||||
info!("estimated verify gas cost: {:#?}", gas);
|
||||
|
||||
// if gas is greater than 30 million warn the user that the gas cost is above ethereum's 30 million block gas limit
|
||||
if gas > 30_000_000_u64 {
|
||||
if gas > 30_000_000_u128 {
|
||||
warn!(
|
||||
"Gas cost of verify transaction is greater than 30 million block gas limit. It will fail on mainnet."
|
||||
);
|
||||
} else if gas > 15_000_000_u64 {
|
||||
} else if gas > 15_000_000_u128 {
|
||||
warn!(
|
||||
"Gas cost of verify transaction is greater than 15 million, the target block size for ethereum"
|
||||
);
|
||||
@@ -332,7 +327,7 @@ pub async fn verify_proof_via_solidity(
|
||||
}
|
||||
|
||||
/// Generates the contract factory for a solidity verifier. The factory is used to deploy the contract
|
||||
fn get_sol_contract_factory<'a, M: 'static + Provider, T: TokenSeq<'a>>(
|
||||
fn get_sol_contract_factory<'a, M: 'static + Provider<Http<Client>, Ethereum>, T: TokenSeq<'a>>(
|
||||
abi: JsonAbi,
|
||||
bytecode: Bytes,
|
||||
runtime_bytecode: Bytes,
|
||||
@@ -370,7 +365,7 @@ fn get_sol_contract_factory<'a, M: 'static + Provider, T: TokenSeq<'a>>(
|
||||
}
|
||||
};
|
||||
|
||||
Ok(CallBuilder::<_, _, Ethereum>::new_raw_deploy(client, data))
|
||||
Ok(CallBuilder::new_raw_deploy(client, data))
|
||||
}
|
||||
|
||||
/// Compiles a solidity verifier contract and returns the abi, bytecode, and runtime bytecode
|
||||
@@ -379,12 +374,11 @@ pub async fn get_contract_artifacts(
|
||||
contract_name: &str,
|
||||
runs: usize,
|
||||
) -> Result<(JsonAbi, Bytes, Bytes), EthError> {
|
||||
use foundry_compilers::artifacts::{
|
||||
output_selection::OutputSelection, Optimizer, SolcInput, SolcLanguage,
|
||||
use foundry_compilers::{
|
||||
artifacts::{output_selection::OutputSelection, Optimizer},
|
||||
compilers::CompilerInput,
|
||||
SolcInput, SHANGHAI_SOLC,
|
||||
};
|
||||
use semver::Version;
|
||||
|
||||
const SHANGHAI_SOLC: Version = Version::new(0, 8, 20);
|
||||
|
||||
if !sol_code_path.exists() {
|
||||
return Err(EthError::ContractNotFound(
|
||||
@@ -402,14 +396,16 @@ pub async fn get_contract_artifacts(
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let sources = foundry_compilers::artifacts::Sources::from([(
|
||||
sol_code_path.clone(),
|
||||
foundry_compilers::artifacts::Source::read(&sol_code_path)?,
|
||||
)]);
|
||||
let input = SolcInput::build(
|
||||
std::collections::BTreeMap::from([(
|
||||
sol_code_path.clone(),
|
||||
foundry_compilers::artifacts::Source::read(sol_code_path)?,
|
||||
)]),
|
||||
settings,
|
||||
&SHANGHAI_SOLC,
|
||||
);
|
||||
|
||||
let input = SolcInput::new(SolcLanguage::Solidity, sources, settings).sanitized(&SHANGHAI_SOLC);
|
||||
|
||||
let solc_opt = Solc::find_svm_installed_version(&SHANGHAI_SOLC)?;
|
||||
let solc_opt = Solc::find_svm_installed_version(SHANGHAI_SOLC.to_string())?;
|
||||
let solc = match solc_opt {
|
||||
Some(solc) => solc,
|
||||
None => {
|
||||
@@ -420,7 +416,7 @@ pub async fn get_contract_artifacts(
|
||||
}
|
||||
};
|
||||
|
||||
let compiled = solc.compile(&input)?;
|
||||
let compiled: foundry_compilers::CompilerOutput = solc.compile(&input[0])?;
|
||||
|
||||
let (abi, bytecode, runtime_bytecode) = match compiled.find(contract_name) {
|
||||
Some(c) => c.into_parts_or_default(),
|
||||
|
||||
@@ -8,7 +8,7 @@ use halo2curves::ff::PrimeField;
|
||||
use itertools::Itertools;
|
||||
use log::debug;
|
||||
#[cfg(feature = "python-bindings")]
|
||||
use pyo3::{exceptions::PyValueError, FromPyObject, IntoPyObject, Python};
|
||||
use pyo3::{exceptions::PyValueError, FromPyObject, IntoPyObject, PyResult, Python};
|
||||
use serde::{Deserialize, Serialize};
|
||||
#[cfg(all(feature = "ezkl", not(target_arch = "wasm32")))]
|
||||
use tosubcommand::ToFlags;
|
||||
@@ -78,7 +78,7 @@ impl<'a> From<&'a str> for Visibility {
|
||||
let outlets = outlets
|
||||
.trim_start_matches('/')
|
||||
.split(',')
|
||||
.map(|s: &str| s.parse::<usize>().unwrap())
|
||||
.map(|s| s.parse::<usize>().unwrap())
|
||||
.collect_vec();
|
||||
|
||||
return Visibility::Hashed {
|
||||
@@ -139,12 +139,10 @@ impl<'py> IntoPyObject<'py> for Visibility {
|
||||
}
|
||||
|
||||
#[cfg(feature = "python-bindings")]
|
||||
impl<'py> FromPyObject<'_, 'py> for Visibility {
|
||||
type Error = pyo3::PyErr;
|
||||
|
||||
impl<'source> FromPyObject<'source> for Visibility {
|
||||
/// Extracts Visibility from Python object
|
||||
fn extract(ob: pyo3::Borrowed<'_, 'py, pyo3::PyAny>) -> Result<Self, Self::Error> {
|
||||
let strval = String::extract(ob)?;
|
||||
fn extract_bound(ob: &pyo3::Bound<'source, pyo3::PyAny>) -> PyResult<Self> {
|
||||
let strval = String::extract_bound(ob)?;
|
||||
let strval = strval.as_str();
|
||||
|
||||
if strval.contains("hashed/private") {
|
||||
@@ -152,7 +150,7 @@ impl<'py> FromPyObject<'_, 'py> for Visibility {
|
||||
let outlets = outlets
|
||||
.trim_start_matches('/')
|
||||
.split(',')
|
||||
.map(|s: &str| s.parse::<usize>().unwrap())
|
||||
.map(|s| s.parse::<usize>().unwrap())
|
||||
.collect_vec();
|
||||
|
||||
return Ok(Visibility::Hashed {
|
||||
|
||||
Reference in New Issue
Block a user