Skip to content

refactor: guest bindings #1613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 41 commits into
base: release-v1.2.1-rc.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2191348
Remove explicit calls to setup functions throughout the codebase
Avaneesh-axiom Apr 24, 2025
85cd3d4
Remove guest code and tests from sha256 extension
Avaneesh-axiom Apr 17, 2025
9d464b3
Remove guest code and tests from keccak256 extension
Avaneesh-axiom Apr 17, 2025
a3f85f6
Minor macro changes for algebra re-org
Avaneesh-axiom Apr 22, 2025
6b4bc53
Add hint-based square root implementation
Avaneesh-axiom Apr 22, 2025
d0187c4
Fix rebase mistakes
Avaneesh-axiom Apr 25, 2025
66d0b47
Fix bug
Avaneesh-axiom Apr 25, 2025
33ba8f2
Disambiguate ecc point x() method call
Avaneesh-axiom Apr 28, 2025
86ebe4a
Remove re-export of halo2curves in ecc guest
Avaneesh-axiom Apr 28, 2025
6b65a74
Make sha256 rust binding public
Avaneesh-axiom Apr 29, 2025
b1f1abb
Make keccak256 binding public
Avaneesh-axiom Apr 29, 2025
328ec8e
Replace blanket implementation of traits with macro-based manual impl
Avaneesh-axiom Apr 29, 2025
81d7ff8
Rename moduli_declare's "prime" argument to "impl_field"
Avaneesh-axiom Apr 29, 2025
b08dda9
Update docs and book about impl_field
Avaneesh-axiom Apr 29, 2025
7afa235
Remove U256 and I256 from bigint guest library
Avaneesh-axiom Apr 30, 2025
1614488
Use impl_field = true in k256 and p256 modules
Avaneesh-axiom Apr 30, 2025
4aebb8e
Remove pairing guest library and tests (moved to new repo)
Avaneesh-axiom Apr 30, 2025
c385dd5
Delete bigint tests
Avaneesh-axiom Apr 30, 2025
7fc84ab
Remove pairing library's README
Avaneesh-axiom Apr 30, 2025
5585dca
Remove pairing tests from Cargo.toml
Avaneesh-axiom Apr 30, 2025
390a553
Remove bigint integration tests from Cargo.toml
Avaneesh-axiom Apr 30, 2025
ff70ae8
Fix rebase
Avaneesh-axiom Apr 30, 2025
72ccf70
Revert "Remove pairing guest library and tests (moved to new repo)"
Avaneesh-axiom Apr 30, 2025
b12190f
Delete parts of the pairing guest library
Avaneesh-axiom May 1, 2025
a59cf12
Use rust-runtime feature in openvm-platform
Avaneesh-axiom May 1, 2025
438a357
Fix bugs
Avaneesh-axiom May 1, 2025
7034ad6
Delete pairing benchmark
Avaneesh-axiom May 1, 2025
f8f8ac1
Add complex struct name to openvm-pairing-guest
Avaneesh-axiom May 1, 2025
f5be757
Delete unused code
Avaneesh-axiom May 1, 2025
63e56c6
Fix ecc example
Avaneesh-axiom May 1, 2025
07968b0
Fix lint in ecc tests
Avaneesh-axiom May 1, 2025
da8b54c
Revert "Delete pairing benchmark"
Avaneesh-axiom May 1, 2025
652194c
chore: Cargo.lock
jonathanpwang May 13, 2025
79d1b56
feat: Automatic primality check of moduli in `moduli_declare!` (#1645)
Avaneesh-axiom May 13, 2025
1f771df
feat: Implement ECC point decompression in guest code (#1648)
Avaneesh-axiom May 13, 2025
6eb62ad
feat: Add primitive guest libraries (#1642)
Avaneesh-axiom May 19, 2025
e685863
chore: Cargo.lock
Avaneesh-axiom May 20, 2025
7d1f67d
Fix lint
Avaneesh-axiom May 20, 2025
1e3eb47
Fix examples and book to use ModularExtension::supported_moduli (rename)
Avaneesh-axiom May 20, 2025
c9a3820
Rename Fp2Extension::supported_modulus to supported_moduli
Avaneesh-axiom May 20, 2025
cde4242
chore: remove cargo openvm build outputs
stephenh-axiom-xyz May 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
72 changes: 72 additions & 0 deletions .github/workflows/guest-lib-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Guest Library Tests

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]
paths:
- "guest-libs/**"
- "Cargo.toml"
- ".github/workflows/guest-lib-tests.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
OPENVM_FAST_TEST: "1"

jobs:
integration-tests:
strategy:
matrix:
crate:
- { name: "sha2", path: "sha2" }
- { name: "keccak256", path: "keccak256" }
- { name: "ff_derive", path: "ff_derive" }
- { name: "k256", path: "k256" }
- { name: "p256", path: "p256" }
- { name: "ruint", path: "ruint" }
- { name: "pairing", path: "pairing" }
# Ensure tests run in parallel even if one fails
fail-fast: false

runs-on:
- runs-on=${{ github.run_id }}
- runner=64cpu-linux-arm64
- tag=crate-${{ matrix.crate.name }}
- extras=s3-cache

steps:
- uses: runs-on/action@v1
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
- "guest-libs/${{ matrix.crate.path }}/**"
- ".github/workflows/guest-lib-tests.yml"
- name: Skip if no changes
if: steps.filter.outputs.matched == 'false'
run: |
echo "No relevant changes, skipping tests."
exit 0

- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: taiki-e/install-action@nextest

- name: Run ${{ matrix.crate.name }} guest library tests
if: hashFiles(format('guest-libs/{0}/', matrix.crate.path)) != ''
working-directory: guest-libs/${{ matrix.crate.path }}
run: |
rustup component add rust-src --toolchain nightly-2025-02-14
FEATURE_ARGS=""
if [[ "${{ matrix.crate.name }}" == "pairing" ]]; then
FEATURE_ARGS="--features=bn254,bls12_381"
fi
cargo nextest run --cargo-profile=fast $FEATURE_ARGS --no-tests=pass
8 changes: 4 additions & 4 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- uses: codespell-project/actions-codespell@v2
with:
skip: Cargo.lock,./book/pnpm-lock.yaml,*.txt,./crates/toolchain/openvm/src/memcpy.s,./crates/toolchain/openvm/src/memset.s,./audits/*.pdf,
skip: Cargo.lock,./book/pnpm-lock.yaml,*.txt,./crates/toolchain/openvm/src/memcpy.s,./crates/toolchain/openvm/src/memset.s,./audits/*.pdf,./guest-libs/ruint/*
ignore_words_file: .codespellignore

- uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -60,13 +60,13 @@ jobs:
if [[ "$crate_path" == *"extensions/ecc/tests/programs"* ]]; then
echo "Running cargo clippy with k256 and p256 features for $crate_path"
cargo clippy --manifest-path "$crate_path/Cargo.toml" --all-targets --features "std k256 p256" -- -D warnings
elif [[ "$crate_path" == *"extensions/pairing/tests/programs"* ]]; then
elif [[ "$crate_path" == *"guest-libs/pairing/tests/programs"* ]]; then
echo "Running cargo clippy with openvm_pairing_guest::bn254 feature for $crate_path"
cargo clippy --manifest-path "$crate_path/Cargo.toml" --all-targets --features "std bn254" -- -D warnings
echo "Running cargo clippy with openvm_pairing_guest::bls12_381 feature for $crate_path"
cargo clippy --manifest-path "$crate_path/Cargo.toml" --all-targets --features "std bls12_381" -- -D warnings
elif [[ "$crate_path" == *"extensions/"* ]]; then
echo "Running cargo clippy for $crate_path"
elif [[ "$crate_path" == *"extensions/"* || "$crate_path" == *"guest-libs/"* ]]; then
echo "Running cargo clippy with std feature for $crate_path"
cargo clippy --manifest-path "$crate_path/Cargo.toml" --all-targets --features "std" -- -D warnings
else
echo "Running cargo clippy for $crate_path"
Expand Down
Loading
Loading