diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..e69de29bb diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml deleted file mode 100644 index 0dd2edabe..000000000 --- a/.github/workflows/bench.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Benchmark - -on: - push: - branches: [main] - pull_request: - workflow_dispatch: - -env: - CARGO_TERM_COLOR: always - -jobs: - codspeed: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - name: Install cargo-codspeed - uses: taiki-e/install-action@v2 - with: - tool: cargo-codspeed - - name: Build the benchmark target(s) - run: cargo codspeed build --profile profiling --workspace --exclude '*example*' --exclude op-revm - - name: Run the benchmarks - uses: CodSpeedHQ/action@v3 - with: - run: cargo codspeed run --workspace - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml deleted file mode 100644 index 8733a73ab..000000000 --- a/.github/workflows/book.yml +++ /dev/null @@ -1,138 +0,0 @@ -name: book - -concurrency: - cancel-in-progress: true - group: ${{github.workflow}}-${{github.ref}} - -on: - push: - branches: [main] - pull_request: - branches: [main] - merge_group: - -jobs: - test: - runs-on: ubuntu-latest - name: test - - steps: - - uses: actions/checkout@v4 - - - name: Install mdbook - run: | - mkdir mdbook - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook - echo `pwd`/mdbook >> $GITHUB_PATH - - - name: Install mdbook-template - run: | - mkdir mdbook-template - curl -sSL https://github.com/sgoudham/mdbook-template/releases/latest/download/mdbook-template-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook-template - echo `pwd`/mdbook-template >> $GITHUB_PATH - - - name: Run tests - run: | - cp README.md book/src/README.md - sed -i -e 's|../../README.md|./README.md|g' book/src/SUMMARY.md - mdbook test - - lint: - runs-on: ubuntu-latest - name: lint - - steps: - - uses: actions/checkout@v4 - - - name: Install mdbook-linkcheck - run: | - mkdir mdbook-linkcheck - curl -sSL -o mdbook-linkcheck.zip https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip - unzip mdbook-linkcheck.zip -d ./mdbook-linkcheck - chmod +x `pwd`/mdbook-linkcheck/mdbook-linkcheck - echo `pwd`/mdbook-linkcheck >> $GITHUB_PATH - - - name: Run linkcheck - run: mdbook-linkcheck --standalone - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install toolchain - uses: dtolnay/rust-toolchain@nightly - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - - name: Install mdbook - run: | - mkdir mdbook - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook - echo `pwd`/mdbook >> $GITHUB_PATH - - - name: Install mdbook-template - run: | - mkdir mdbook-template - curl -sSL https://github.com/sgoudham/mdbook-template/releases/latest/download/mdbook-template-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook-template - echo `pwd`/mdbook-template >> $GITHUB_PATH - - - name: Build book - run: | - cp README.md book/src/README.md - sed -i -e 's|../../README.md|./README.md|g' book/src/SUMMARY.md - mdbook build book - - - name: Build docs - run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo doc --all --no-deps - - - name: Move docs to book folder - run: | - mkdir -p target/book/docs - mv target/doc book/book/docs - - - name: Archive artifact - shell: sh - run: | - chmod -c -R +rX "book/book" | - while read line; do - echo "::warning title=Invalid file permissions automatically fixed::$line" - done - tar \ - --dereference --hard-dereference \ - --directory "book/book" \ - -cvf "$RUNNER_TEMP/artifact.tar" \ - --exclude=.git \ - --exclude=.github \ - . - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: github-pages - path: ${{ runner.temp }}/artifact.tar - retention-days: 1 - if-no-files-found: error - - deploy: - # Only deploy if a push to main - if: github.ref_name == 'main' && github.event_name == 'push' - runs-on: ubuntu-latest - needs: [test, lint, build] - - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/openvm-tests.yml b/.github/workflows/openvm-tests.yml new file mode 100644 index 000000000..f3140f865 --- /dev/null +++ b/.github/workflows/openvm-tests.yml @@ -0,0 +1,36 @@ +name: OpenVM Tests + +on: + push: + branches: ["v*-openvm"] + pull_request: + branches: ["**"] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +env: + OPENVM_FAST_TEST: 1 + +jobs: + tests: + name: OpenVM Tests + runs-on: + - runs-on=${{ github.run_id }} + - runner=64cpu-linux-x64 + - extras=s3-cache + steps: + - uses: runs-on/action@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - uses: taiki-e/install-action@nextest + - name: Rust toolchain + run: rustup component add rust-src --toolchain nightly-2025-02-14 + + - name: Run tests + working-directory: tests/openvm + run: RUST_BACKTRACE=1 cargo nextest run diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index d5b034760..000000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Documentation: https://release-plz.ieni.dev/docs -name: Release-plz - -permissions: - pull-requests: write - contents: write - -on: - push: - branches: - - main - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - # Commits the cargo lock (generally a good practice for upstream libraries) - - name: Commit Cargo.lock - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add Cargo.lock - git commit -m "Update Cargo.lock" || echo "No changes to commit" - # This will run the release-plz action - # The action detect API breaking changes detection with cargo-semver-checks. - # Semver is auto incremented based on this - # A PR with the semver bump is created with a new release tag and changelog - # if you configure the cargo registry token, the action will also publish the new version to crates.io - - name: Run release-plz - uses: MarcoIeni/release-plz-action@v0.5 - with: - command: release-pr - env: - # The admin of the repository with need to configure the following secrets: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 10e3bcae4..dfa50536f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ rustc-ice-* # Fixtures /test-fixtures + +**/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock index c996bea1c..7bd48f37c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,7 +63,7 @@ checksum = "19a9cc9d81ace3da457883b0bdf76776e55f1b84219a9e9d55c27ad308548d3f" dependencies = [ "alloy-primitives", "num_enum", - "strum", + "strum 0.27.1", ] [[package]] @@ -80,15 +80,15 @@ dependencies = [ "alloy-tx-macros", "auto_impl", "c-kzg", - "derive_more", + "derive_more 2.0.1", "either", - "k256", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell", "rand 0.8.5", "secp256k1 0.30.0", "serde", "serde_with", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -115,7 +115,7 @@ dependencies = [ "alloy-rlp", "crc", "serde", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -137,9 +137,9 @@ checksum = "9d4769c6ffddca380b0070d71c8b7f30bed375543fe76bb2f74ec0acf4b7cd16" dependencies = [ "alloy-primitives", "alloy-rlp", - "k256", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -156,7 +156,7 @@ dependencies = [ "alloy-serde", "auto_impl", "c-kzg", - "derive_more", + "derive_more 2.0.1", "either", "serde", "sha2 0.10.9", @@ -185,7 +185,7 @@ dependencies = [ "http", "serde", "serde_json", - "thiserror", + "thiserror 2.0.12", "tracing", ] @@ -208,11 +208,11 @@ dependencies = [ "alloy-sol-types", "async-trait", "auto_impl", - "derive_more", + "derive_more 2.0.1", "futures-utils-wasm", "serde", "serde_json", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -240,13 +240,13 @@ dependencies = [ "cfg-if", "const-hex", "derive_arbitrary", - "derive_more", + "derive_more 2.0.1", "foldhash", "getrandom 0.3.3", "hashbrown 0.15.4", "indexmap 2.9.0", "itoa", - "k256", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-asm", "paste", "proptest", @@ -286,13 +286,13 @@ dependencies = [ "futures", "futures-utils-wasm", "http", - "lru", + "lru 0.13.0", "parking_lot", "pin-project", "reqwest", "serde", "serde_json", - "thiserror", + "thiserror 2.0.12", "tokio", "tracing", "url", @@ -374,7 +374,7 @@ dependencies = [ "itertools 0.14.0", "serde", "serde_json", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -399,8 +399,8 @@ dependencies = [ "auto_impl", "either", "elliptic-curve", - "k256", - "thiserror", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 2.0.12", ] [[package]] @@ -414,9 +414,9 @@ dependencies = [ "alloy-primitives", "alloy-signer", "async-trait", - "k256", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.8.5", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -498,13 +498,13 @@ dependencies = [ "alloy-json-rpc", "alloy-primitives", "base64", - "derive_more", + "derive_more 2.0.1", "futures", "futures-utils-wasm", "parking_lot", "serde", "serde_json", - "thiserror", + "thiserror 2.0.12", "tokio", "tower", "tracing", @@ -536,7 +536,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "arrayvec", - "derive_more", + "derive_more 2.0.1", "nybbles", "serde", "smallvec", @@ -550,7 +550,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b75ef8609ea2b31c799b0a56c724dca4c73105c5ccc205d9dfeb1d038df6a1da" dependencies = [ "alloy-primitives", - "darling", + "darling 0.20.11", "proc-macro2", "quote", "syn 2.0.103", @@ -577,6 +577,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + [[package]] name = "anstream" version = "0.6.19" @@ -851,7 +860,7 @@ dependencies = [ "ark-ff 0.5.0", "ark-std 0.5.0", "tracing", - "tracing-subscriber", + "tracing-subscriber 0.2.25", ] [[package]] @@ -1022,6 +1031,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", + "serde", "windows-targets", ] @@ -1087,6 +1097,30 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" +[[package]] +name = "bitcode" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "648bd963d2e5d465377acecfb4b827f9f553b6bc97a8f61715779e9ed9e52b74" +dependencies = [ + "arrayvec", + "bitcode_derive", + "bytemuck", + "glam", + "serde", +] + +[[package]] +name = "bitcode_derive" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffebfc2d28a12b262c303cb3860ee77b91bd83b1f20f0bd2a9693008e2f55a9e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "bitcoin-io" version = "0.1.3" @@ -1125,6 +1159,26 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + [[package]] name = "blake3" version = "1.8.2" @@ -1156,6 +1210,32 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bls12_381" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3c196a77437e7cc2fb515ce413a6401291578b5afc8ecb29a3c7ab957f05941" +dependencies = [ + "ff 0.12.1", + "group 0.12.1", + "pairing 0.22.0", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "bls12_381" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7bc6d6292be3a19e6379786dac800f551e5865a5bb51ebbe3064ab80433f403" +dependencies = [ + "ff 0.13.1", + "group 0.13.0", + "pairing 0.23.0", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "blst" version = "0.3.15" @@ -1168,6 +1248,31 @@ dependencies = [ "zeroize", ] +[[package]] +name = "bon" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2529c31017402be841eb45892278a6c21a000c0a17643af326c73a73f83f0fb" +dependencies = [ + "bon-macros", + "rustversion", +] + +[[package]] +name = "bon-macros" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82020dadcb845a345591863adb65d74fa8dc5c18a0b6d408470e13b7adc7005" +dependencies = [ + "darling 0.21.3", + "ident_case", + "prettyplease", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.103", +] + [[package]] name = "bumpalo" version = "3.18.1" @@ -1180,6 +1285,12 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" +[[package]] +name = "bytemuck" +version = "1.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677" + [[package]] name = "byteorder" version = "1.5.0" @@ -1210,6 +1321,38 @@ dependencies = [ "serde", ] +[[package]] +name = "camino" +version = "1.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0b03af37dad7a14518b7691d81acb0f8222604ad3d1b02f6b4bed5188c0cd5" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.26", + "serde", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "cast" version = "0.3.0" @@ -1222,6 +1365,8 @@ version = "1.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" dependencies = [ + "jobserver", + "libc", "shlex", ] @@ -1436,6 +1581,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" version = "0.9.4" @@ -1574,8 +1725,18 @@ version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.11", + "darling_macro 0.20.11", +] + +[[package]] +name = "darling" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" +dependencies = [ + "darling_core 0.21.3", + "darling_macro 0.21.3", ] [[package]] @@ -1592,13 +1753,38 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "darling_core" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.103", +] + [[package]] name = "darling_macro" version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "darling_core", + "darling_core 0.20.11", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "darling_macro" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" +dependencies = [ + "darling_core 0.21.3", "quote", "syn 2.0.103", ] @@ -1615,6 +1801,7 @@ dependencies = [ "lock_api", "once_cell", "parking_lot_core", + "rayon", ] [[package]] @@ -1648,6 +1835,28 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-new" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "derive-new" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "derive-where" version = "1.5.0" @@ -1670,13 +1879,47 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "derive_more" +version = "0.99.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.1", + "syn 2.0.103", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl 1.0.0", +] + [[package]] name = "derive_more" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" dependencies = [ - "derive_more-impl", + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", + "unicode-xid", ] [[package]] @@ -1723,6 +1966,12 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + [[package]] name = "dunce" version = "1.0.5" @@ -1771,6 +2020,12 @@ dependencies = [ "serde", ] +[[package]] +name = "elf" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" + [[package]] name = "elliptic-curve" version = "0.13.8" @@ -1780,9 +2035,9 @@ dependencies = [ "base16ct", "crypto-bigint", "digest 0.10.7", - "ff", + "ff 0.13.1", "generic-array", - "group", + "group 0.13.0", "pkcs8", "rand_core 0.6.4", "sec1", @@ -1797,6 +2052,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + [[package]] name = "enum-ordinalize" version = "4.3.0" @@ -1817,6 +2078,18 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "enum_dispatch" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -1875,7 +2148,7 @@ version = "0.0.0" dependencies = [ "auto_impl", "revm", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -1920,6 +2193,16 @@ dependencies = [ "tokio", ] +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -1948,12 +2231,24 @@ dependencies = [ "bytes", ] +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "bitvec", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "ff" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ + "bitvec", "byteorder", "ff_derive", "rand_core 0.6.4", @@ -2170,12 +2465,30 @@ dependencies = [ "wasi 0.14.2+wasi-0.2.4", ] +[[package]] +name = "getset" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf0fc11e47561d47397154977bc219f4cf809b2974facc3ccb3b89e2436f912" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +[[package]] +name = "glam" +version = "0.30.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d1aab06663bdce00d6ca5e5ed586ec8d18033a771906c993a1e3755b368d85" + [[package]] name = "glob" version = "0.3.2" @@ -2192,13 +2505,25 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "memuse", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.1", "rand_core 0.6.4", "subtle", ] @@ -2214,32 +2539,129 @@ dependencies = [ ] [[package]] -name = "hash-db" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" - -[[package]] -name = "hashbrown" -version = "0.12.3" +name = "halo2" +version = "0.1.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "2a23c779b38253fe1538102da44ad5bd5378495a61d2c4ee18d64eaa61ae5995" +dependencies = [ + "halo2_proofs", +] [[package]] -name = "hashbrown" -version = "0.14.5" +name = "halo2_proofs" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "e925780549adee8364c7f2b685c753f6f3df23bde520c67416e93bf615933760" +dependencies = [ + "blake2b_simd", + "ff 0.12.1", + "group 0.12.1", + "pasta_curves 0.4.1", + "rand_core 0.6.4", + "rayon", +] [[package]] -name = "hashbrown" -version = "0.15.4" +name = "halo2curves" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +checksum = "b756596082144af6e57105a20403b7b80fe9dccd085700b74fae3af523b74dba" dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", + "blake2", + "digest 0.10.7", + "ff 0.13.1", + "group 0.13.0", + "halo2derive", + "hex", + "lazy_static", + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "pairing 0.23.0", + "paste", + "rand 0.8.5", + "rand_core 0.6.4", + "rayon", + "serde", + "serde_arrays 0.1.0", + "sha2 0.10.9", + "static_assertions", + "subtle", + "unroll", +] + +[[package]] +name = "halo2curves-axiom" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8309e4638b4f1bcf6613d72265a84074d26034c35edc5d605b5688e580b8b8" +dependencies = [ + "blake2b_simd", + "digest 0.10.7", + "ff 0.13.1", + "group 0.13.0", + "hex", + "lazy_static", + "num-bigint 0.4.6", + "num-traits", + "pairing 0.23.0", + "pasta_curves 0.5.1", + "paste", + "rand 0.8.5", + "rand_core 0.6.4", + "rayon", + "serde", + "serde_arrays 0.1.0", + "sha2 0.10.9", + "static_assertions", + "subtle", + "unroll", +] + +[[package]] +name = "halo2derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb99e7492b4f5ff469d238db464131b86c2eaac814a78715acba369f64d2c76" +dependencies = [ + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", "serde", ] @@ -2273,6 +2695,18 @@ dependencies = [ "arrayvec", ] +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hex-literal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcaaec4551594c969335c98c903c1397853d4198408ea609190f420500f6be71" + [[package]] name = "hmac" version = "0.12.1" @@ -2538,6 +2972,12 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "indenter" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" + [[package]] name = "indexmap" version = "1.9.3" @@ -2649,6 +3089,16 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.3", + "libc", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -2659,6 +3109,20 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jubjub" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a575df5f985fe1cd5b2b05664ff6accfc46559032b954529fd225a2168d27b0f" +dependencies = [ + "bitvec", + "bls12_381 0.7.1", + "ff 0.12.1", + "group 0.12.1", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "k256" version = "0.13.4" @@ -2673,6 +3137,24 @@ dependencies = [ "sha2 0.10.9", ] +[[package]] +name = "k256" +version = "0.13.4" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "ecdsa", + "elliptic-curve", + "ff 0.13.1", + "hex-literal 0.4.1", + "num-bigint 0.4.6", + "openvm", + "openvm-algebra-guest", + "openvm-algebra-moduli-macros", + "openvm-ecc-guest", + "openvm-ecc-sw-macros", + "serde", +] + [[package]] name = "keccak" version = "0.1.5" @@ -2698,12 +3180,12 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9201effeea3fcc93b587904ae2df9ce97e433184b9d6d299e9ebc9830a546636" dependencies = [ - "ff", + "ff 0.13.1", "hex", - "serde_arrays", + "serde_arrays 0.2.0", "sha2 0.10.9", "sp1_bls12_381", - "spin", + "spin 0.9.8", ] [[package]] @@ -2712,14 +3194,14 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin", + "spin 0.9.8", ] [[package]] name = "libc" -version = "0.2.174" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "libm" @@ -2795,12 +3277,27 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "lockfree-object-pool" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" + [[package]] name = "log" version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.4", +] + [[package]] name = "lru" version = "0.13.0" @@ -2821,12 +3318,82 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + [[package]] name = "memchr" version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +[[package]] +name = "memmap2" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843a98750cd611cc2965a8213b53b43e715f13c37a9e096c6408e69990961db7" +dependencies = [ + "libc", +] + +[[package]] +name = "memuse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d97bbf43eb4f088f8ca469930cde17fa036207c9a5e02ccc5107c4e8b17c964" + +[[package]] +name = "metrics" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3045b4193fbdc5b5681f32f11070da9be3609f189a79f3390706d42587f46bb5" +dependencies = [ + "ahash", + "portable-atomic", +] + +[[package]] +name = "metrics-tracing-context" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62a6a1f7141f1d9bc7a886b87536bbfc97752e08b369e1e0453a9acfab5f5da4" +dependencies = [ + "indexmap 2.9.0", + "itoa", + "lockfree-object-pool", + "metrics", + "metrics-util", + "once_cell", + "tracing", + "tracing-core", + "tracing-subscriber 0.3.20", +] + +[[package]] +name = "metrics-util" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4259040465c955f9f2f1a4a8a16dc46726169bca0f88e8fb2dbeced487c3e828" +dependencies = [ + "aho-corasick", + "crossbeam-epoch", + "crossbeam-utils", + "hashbrown 0.14.5", + "indexmap 2.9.0", + "metrics", + "num_cpus", + "ordered-float", + "quanta", + "radix_trie", + "sketches-ddsketch", +] + [[package]] name = "miniz_oxide" version = "0.8.9" @@ -2864,6 +3431,24 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "num" version = "0.4.3" @@ -2897,6 +3482,8 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", + "rand 0.8.5", + "serde", ] [[package]] @@ -2934,6 +3521,33 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-modular" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a5fe11d4135c3bcdf3a95b18b194afa9608a5f6ff034f5d857bc9a27fb0119" +dependencies = [ + "num-bigint 0.4.6", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-prime" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e238432a7881ec7164503ccc516c014bf009be7984cde1ba56837862543bdec3" +dependencies = [ + "bitvec", + "either", + "lru 0.12.5", + "num-bigint 0.4.6", + "num-integer", + "num-modular", + "num-traits", + "rand 0.8.5", +] + [[package]] name = "num-rational" version = "0.4.2" @@ -2992,6 +3606,18 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "nums" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3c74f925fb8cfc49a8022f2afce48a0683b70f9e439885594e84c5edbf5b01" +dependencies = [ + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "rand 0.8.5", +] + [[package]] name = "nybbles" version = "0.3.4" @@ -3098,80 +3724,1274 @@ dependencies = [ ] [[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +name = "openvm" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2 0.10.9", + "bytemuck", + "getrandom 0.2.16", + "getrandom 0.3.3", + "num-bigint 0.4.6", + "openvm-custom-insn", + "openvm-platform", + "openvm-rv32im-guest", + "serde", ] [[package]] -name = "p3-baby-bear" -version = "0.2.3-succinct" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7521838ecab2ddf4f7bc4ceebad06ec02414729598485c1ada516c39900820e8" +name = "openvm-algebra-circuit" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" dependencies = [ + "cfg-if", + "derive-new 0.6.0", + "derive_more 1.0.0", + "eyre", + "halo2curves-axiom", "num-bigint 0.4.6", - "p3-field", - "p3-mds", - "p3-poseidon2", - "p3-symmetric", + "num-traits", + "openvm-algebra-transpiler", + "openvm-circuit", + "openvm-circuit-derive", + "openvm-circuit-primitives", + "openvm-circuit-primitives-derive", + "openvm-instructions", + "openvm-mod-circuit-builder", + "openvm-rv32-adapters", + "openvm-rv32im-circuit", + "openvm-stark-backend", + "openvm-stark-sdk", "rand 0.8.5", "serde", + "serde_with", + "strum 0.26.3", ] [[package]] -name = "p3-dft" -version = "0.2.3-succinct" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46414daedd796f1eefcdc1811c0484e4bced5729486b6eaba9521c572c76761a" +name = "openvm-algebra-complex-macros" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" dependencies = [ - "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", - "tracing", + "openvm-macros-common", + "quote", + "syn 2.0.103", ] [[package]] -name = "p3-field" -version = "0.2.3-succinct" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48948a0516b349e9d1cdb95e7236a6ee010c44e68c5cc78b4b92bf1c4022a0d9" +name = "openvm-algebra-guest" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" dependencies = [ - "itertools 0.12.1", + "halo2curves-axiom", "num-bigint 0.4.6", - "num-traits", - "p3-util", - "rand 0.8.5", - "serde", + "once_cell", + "openvm-algebra-complex-macros", + "openvm-algebra-moduli-macros", + "openvm-custom-insn", + "openvm-rv32im-guest", + "serde-big-array", + "strum_macros 0.26.4", ] [[package]] -name = "p3-matrix" -version = "0.2.3-succinct" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "openvm-algebra-moduli-macros" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "num-bigint 0.4.6", + "num-prime", + "openvm-macros-common", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "openvm-algebra-transpiler" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-algebra-guest", + "openvm-instructions", + "openvm-instructions-derive", + "openvm-stark-backend", + "openvm-transpiler", + "rrs-lib", + "strum 0.26.3", +] + +[[package]] +name = "openvm-bigint-circuit" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "cfg-if", + "derive-new 0.6.0", + "derive_more 1.0.0", + "openvm-bigint-transpiler", + "openvm-circuit", + "openvm-circuit-derive", + "openvm-circuit-primitives", + "openvm-circuit-primitives-derive", + "openvm-instructions", + "openvm-rv32-adapters", + "openvm-rv32im-circuit", + "openvm-rv32im-transpiler", + "openvm-stark-backend", + "openvm-stark-sdk", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "openvm-bigint-guest" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-platform", + "strum_macros 0.26.4", +] + +[[package]] +name = "openvm-bigint-transpiler" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-bigint-guest", + "openvm-instructions", + "openvm-instructions-derive", + "openvm-rv32im-transpiler", + "openvm-stark-backend", + "openvm-transpiler", + "rrs-lib", + "strum 0.26.3", +] + +[[package]] +name = "openvm-build" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "cargo_metadata", + "eyre", + "openvm-platform", + "serde", + "serde_json", +] + +[[package]] +name = "openvm-circuit" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "backtrace", + "cfg-if", + "dashmap", + "derivative", + "derive-new 0.6.0", + "derive_more 1.0.0", + "enum_dispatch", + "eyre", + "getset", + "itertools 0.14.0", + "libc", + "memmap2", + "openvm-circuit-derive", + "openvm-circuit-primitives", + "openvm-circuit-primitives-derive", + "openvm-instructions", + "openvm-poseidon2-air", + "openvm-stark-backend", + "openvm-stark-sdk", + "p3-baby-bear 0.1.0", + "p3-field 0.1.0", + "rand 0.8.5", + "rustc-hash", + "serde", + "serde-big-array", + "static_assertions", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "openvm-circuit-derive" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "itertools 0.14.0", + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "openvm-circuit-primitives" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "derive-new 0.6.0", + "itertools 0.14.0", + "num-bigint 0.4.6", + "num-traits", + "openvm-circuit-primitives-derive", + "openvm-cuda-builder", + "openvm-stark-backend", + "rand 0.8.5", + "tracing", +] + +[[package]] +name = "openvm-circuit-primitives-derive" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "itertools 0.14.0", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "openvm-continuations" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "derivative", + "openvm-circuit", + "openvm-native-compiler", + "openvm-native-recursion", + "openvm-stark-backend", + "openvm-stark-sdk", + "serde", + "static_assertions", +] + +[[package]] +name = "openvm-cuda-builder" +version = "1.2.0" +source = "git+https://github.com/openvm-org/stark-backend.git?tag=v1.2.0#64c72dba9db8dedad1c936a04fa344b4b9ecb1cd" +dependencies = [ + "cc", + "glob", +] + +[[package]] +name = "openvm-custom-insn" +version = "0.1.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "openvm-ecc-circuit" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "cfg-if", + "derive-new 0.6.0", + "derive_more 1.0.0", + "halo2curves-axiom", + "hex-literal 0.4.1", + "lazy_static", + "num-bigint 0.4.6", + "num-traits", + "once_cell", + "openvm-algebra-circuit", + "openvm-circuit", + "openvm-circuit-derive", + "openvm-circuit-primitives", + "openvm-ecc-transpiler", + "openvm-instructions", + "openvm-mod-circuit-builder", + "openvm-rv32-adapters", + "openvm-stark-backend", + "rand 0.8.5", + "serde", + "serde_with", + "strum 0.26.3", +] + +[[package]] +name = "openvm-ecc-guest" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "ecdsa", + "elliptic-curve", + "group 0.13.0", + "halo2curves-axiom", + "once_cell", + "openvm", + "openvm-algebra-guest", + "openvm-custom-insn", + "openvm-ecc-sw-macros", + "openvm-rv32im-guest", + "serde", + "strum_macros 0.26.4", +] + +[[package]] +name = "openvm-ecc-sw-macros" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-macros-common", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "openvm-ecc-transpiler" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-ecc-guest", + "openvm-instructions", + "openvm-instructions-derive", + "openvm-stark-backend", + "openvm-transpiler", + "rrs-lib", + "strum 0.26.3", +] + +[[package]] +name = "openvm-instructions" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "backtrace", + "derive-new 0.6.0", + "itertools 0.14.0", + "num-bigint 0.4.6", + "num-traits", + "openvm-instructions-derive", + "openvm-stark-backend", + "serde", + "strum 0.26.3", + "strum_macros 0.26.4", +] + +[[package]] +name = "openvm-instructions-derive" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "quote", + "syn 2.0.103", +] + +[[package]] +name = "openvm-keccak256" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-keccak256-guest", + "tiny-keccak", +] + +[[package]] +name = "openvm-keccak256-circuit" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "cfg-if", + "derive-new 0.6.0", + "derive_more 1.0.0", + "itertools 0.14.0", + "openvm-circuit", + "openvm-circuit-derive", + "openvm-circuit-primitives", + "openvm-circuit-primitives-derive", + "openvm-instructions", + "openvm-keccak256-transpiler", + "openvm-rv32im-circuit", + "openvm-stark-backend", + "openvm-stark-sdk", + "p3-keccak-air", + "rand 0.8.5", + "serde", + "strum 0.26.3", + "tiny-keccak", +] + +[[package]] +name = "openvm-keccak256-guest" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-platform", +] + +[[package]] +name = "openvm-keccak256-transpiler" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-instructions", + "openvm-instructions-derive", + "openvm-keccak256-guest", + "openvm-stark-backend", + "openvm-transpiler", + "rrs-lib", + "strum 0.26.3", +] + +[[package]] +name = "openvm-kzg" +version = "0.1.0-alpha" +source = "git+https://github.com/axiom-crypto/openvm-kzg.git?branch=openvm-main#a0e8432906aeba2992f41365a8e1c7e2414f0e7c" +dependencies = [ + "bls12_381 0.8.0", + "hex", + "hex-literal 1.0.0", + "openvm-algebra-guest", + "openvm-ecc-guest", + "openvm-pairing", + "serde", + "serde-big-array", + "spin 0.10.0", +] + +[[package]] +name = "openvm-macros-common" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "syn 2.0.103", +] + +[[package]] +name = "openvm-mod-circuit-builder" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "itertools 0.14.0", + "num-bigint 0.4.6", + "num-traits", + "openvm-circuit", + "openvm-circuit-primitives", + "openvm-cuda-builder", + "openvm-instructions", + "openvm-stark-backend", + "openvm-stark-sdk", + "rand 0.8.5", + "tracing", +] + +[[package]] +name = "openvm-native-circuit" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "cfg-if", + "derive-new 0.6.0", + "derive_more 1.0.0", + "eyre", + "itertools 0.14.0", + "openvm-circuit", + "openvm-circuit-derive", + "openvm-circuit-primitives", + "openvm-circuit-primitives-derive", + "openvm-instructions", + "openvm-native-compiler", + "openvm-poseidon2-air", + "openvm-rv32im-circuit", + "openvm-rv32im-transpiler", + "openvm-stark-backend", + "openvm-stark-sdk", + "p3-field 0.1.0", + "rand 0.8.5", + "serde", + "static_assertions", + "strum 0.26.3", +] + +[[package]] +name = "openvm-native-compiler" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "backtrace", + "itertools 0.14.0", + "num-bigint 0.4.6", + "num-integer", + "openvm-circuit", + "openvm-instructions", + "openvm-instructions-derive", + "openvm-native-compiler-derive", + "openvm-rv32im-transpiler", + "openvm-stark-backend", + "openvm-stark-sdk", + "serde", + "strum 0.26.3", + "strum_macros 0.26.4", + "zkhash", +] + +[[package]] +name = "openvm-native-compiler-derive" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "quote", + "syn 2.0.103", +] + +[[package]] +name = "openvm-native-recursion" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "cfg-if", + "itertools 0.14.0", + "lazy_static", + "openvm-circuit", + "openvm-native-circuit", + "openvm-native-compiler", + "openvm-native-compiler-derive", + "openvm-stark-backend", + "openvm-stark-sdk", + "p3-dft 0.1.0", + "p3-fri", + "p3-merkle-tree", + "p3-symmetric 0.1.0", + "rand 0.8.5", + "serde", + "serde_json", + "tracing", +] + +[[package]] +name = "openvm-native-transpiler" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-instructions", + "openvm-transpiler", + "p3-field 0.1.0", +] + +[[package]] +name = "openvm-pairing" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "group 0.13.0", + "hex-literal 0.4.1", + "itertools 0.14.0", + "num-bigint 0.4.6", + "num-traits", + "openvm", + "openvm-algebra-complex-macros", + "openvm-algebra-guest", + "openvm-algebra-moduli-macros", + "openvm-custom-insn", + "openvm-ecc-guest", + "openvm-ecc-sw-macros", + "openvm-pairing-guest", + "openvm-platform", + "openvm-rv32im-guest", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "openvm-pairing-circuit" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "cfg-if", + "derive-new 0.6.0", + "derive_more 1.0.0", + "eyre", + "halo2curves-axiom", + "num-bigint 0.4.6", + "num-traits", + "openvm-algebra-circuit", + "openvm-circuit", + "openvm-circuit-derive", + "openvm-circuit-primitives", + "openvm-ecc-circuit", + "openvm-ecc-guest", + "openvm-instructions", + "openvm-mod-circuit-builder", + "openvm-pairing-guest", + "openvm-pairing-transpiler", + "openvm-rv32im-circuit", + "openvm-stark-backend", + "rand 0.8.5", + "serde", + "strum 0.26.3", +] + +[[package]] +name = "openvm-pairing-guest" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "halo2curves-axiom", + "hex-literal 0.4.1", + "itertools 0.14.0", + "lazy_static", + "num-bigint 0.4.6", + "num-traits", + "openvm", + "openvm-algebra-guest", + "openvm-algebra-moduli-macros", + "openvm-custom-insn", + "openvm-ecc-guest", + "rand 0.8.5", + "serde", + "strum_macros 0.26.4", +] + +[[package]] +name = "openvm-pairing-transpiler" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-instructions", + "openvm-pairing-guest", + "openvm-stark-backend", + "openvm-transpiler", + "rrs-lib", + "strum 0.26.3", +] + +[[package]] +name = "openvm-platform" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "libm", + "openvm-custom-insn", + "openvm-rv32im-guest", +] + +[[package]] +name = "openvm-poseidon2-air" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "derivative", + "lazy_static", + "openvm-cuda-builder", + "openvm-stark-backend", + "openvm-stark-sdk", + "p3-monty-31", + "p3-poseidon2 0.1.0", + "p3-poseidon2-air", + "p3-symmetric 0.1.0", + "rand 0.8.5", + "zkhash", +] + +[[package]] +name = "openvm-rv32-adapters" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "derive-new 0.6.0", + "itertools 0.14.0", + "openvm-circuit", + "openvm-circuit-primitives", + "openvm-circuit-primitives-derive", + "openvm-instructions", + "openvm-rv32im-circuit", + "openvm-stark-backend", + "openvm-stark-sdk", + "rand 0.8.5", +] + +[[package]] +name = "openvm-rv32im-circuit" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "cfg-if", + "derive-new 0.6.0", + "derive_more 1.0.0", + "eyre", + "num-bigint 0.4.6", + "num-integer", + "openvm-circuit", + "openvm-circuit-derive", + "openvm-circuit-primitives", + "openvm-circuit-primitives-derive", + "openvm-instructions", + "openvm-rv32im-transpiler", + "openvm-stark-backend", + "rand 0.8.5", + "serde", + "strum 0.26.3", +] + +[[package]] +name = "openvm-rv32im-guest" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-custom-insn", + "p3-field 0.1.0", + "strum_macros 0.26.4", +] + +[[package]] +name = "openvm-rv32im-transpiler" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-instructions", + "openvm-instructions-derive", + "openvm-rv32im-guest", + "openvm-stark-backend", + "openvm-transpiler", + "rrs-lib", + "serde", + "strum 0.26.3", + "tracing", +] + +[[package]] +name = "openvm-sdk" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "bitcode", + "bon", + "cfg-if", + "clap", + "derivative", + "derive_more 1.0.0", + "eyre", + "getset", + "hex", + "itertools 0.14.0", + "metrics", + "num-bigint 0.4.6", + "openvm", + "openvm-algebra-circuit", + "openvm-algebra-transpiler", + "openvm-bigint-circuit", + "openvm-bigint-transpiler", + "openvm-build", + "openvm-circuit", + "openvm-continuations", + "openvm-ecc-circuit", + "openvm-ecc-transpiler", + "openvm-keccak256-circuit", + "openvm-keccak256-transpiler", + "openvm-native-circuit", + "openvm-native-compiler", + "openvm-native-recursion", + "openvm-native-transpiler", + "openvm-pairing-circuit", + "openvm-pairing-transpiler", + "openvm-rv32im-circuit", + "openvm-rv32im-transpiler", + "openvm-sha256-circuit", + "openvm-sha256-transpiler", + "openvm-stark-backend", + "openvm-stark-sdk", + "openvm-transpiler", + "p3-fri", + "rand 0.8.5", + "rrs-lib", + "serde", + "serde_json", + "serde_with", + "tempfile", + "thiserror 1.0.69", + "toml", + "tracing", +] + +[[package]] +name = "openvm-sha2" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-sha256-guest", + "sha2 0.10.9", +] + +[[package]] +name = "openvm-sha256-air" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-circuit-primitives", + "openvm-stark-backend", + "rand 0.8.5", + "sha2 0.10.9", +] + +[[package]] +name = "openvm-sha256-circuit" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "cfg-if", + "derive-new 0.6.0", + "derive_more 1.0.0", + "openvm-circuit", + "openvm-circuit-derive", + "openvm-circuit-primitives", + "openvm-instructions", + "openvm-rv32im-circuit", + "openvm-sha256-air", + "openvm-sha256-transpiler", + "openvm-stark-backend", + "openvm-stark-sdk", + "rand 0.8.5", + "serde", + "sha2 0.10.9", + "strum 0.26.3", +] + +[[package]] +name = "openvm-sha256-guest" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-platform", +] + +[[package]] +name = "openvm-sha256-transpiler" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "openvm-instructions", + "openvm-instructions-derive", + "openvm-sha256-guest", + "openvm-stark-backend", + "openvm-transpiler", + "rrs-lib", + "strum 0.26.3", +] + +[[package]] +name = "openvm-stark-backend" +version = "1.2.0" +source = "git+https://github.com/openvm-org/stark-backend.git?tag=v1.2.0#64c72dba9db8dedad1c936a04fa344b4b9ecb1cd" +dependencies = [ + "bitcode", + "cfg-if", + "derivative", + "derive-new 0.7.0", + "itertools 0.14.0", + "p3-air", + "p3-challenger", + "p3-commit", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-uni-stark", + "p3-util 0.1.0", + "rayon", + "rustc-hash", + "serde", + "thiserror 1.0.69", + "tikv-jemallocator", + "tracing", +] + +[[package]] +name = "openvm-stark-sdk" +version = "1.2.0" +source = "git+https://github.com/openvm-org/stark-backend.git?tag=v1.2.0#64c72dba9db8dedad1c936a04fa344b4b9ecb1cd" +dependencies = [ + "dashmap", + "derivative", + "derive_more 0.99.20", + "ff 0.13.1", + "itertools 0.14.0", + "metrics", + "metrics-tracing-context", + "metrics-util", + "openvm-stark-backend", + "p3-baby-bear 0.1.0", + "p3-blake3", + "p3-bn254-fr", + "p3-dft 0.1.0", + "p3-fri", + "p3-goldilocks", + "p3-keccak", + "p3-koala-bear", + "p3-merkle-tree", + "p3-poseidon", + "p3-poseidon2 0.1.0", + "p3-symmetric 0.1.0", + "rand 0.8.5", + "serde", + "serde_json", + "static_assertions", + "toml", + "tracing", + "tracing-forest", + "tracing-subscriber 0.3.20", + "zkhash", +] + +[[package]] +name = "openvm-tests" +version = "0.1.0" +dependencies = [ + "eyre", + "num-bigint 0.4.6", + "num-traits", + "openvm", + "openvm-algebra-circuit", + "openvm-algebra-transpiler", + "openvm-build", + "openvm-circuit", + "openvm-ecc-circuit", + "openvm-ecc-guest", + "openvm-ecc-transpiler", + "openvm-keccak256-guest", + "openvm-pairing", + "openvm-pairing-circuit", + "openvm-pairing-transpiler", + "openvm-rv32im-transpiler", + "openvm-sdk", + "openvm-stark-sdk", + "openvm-transpiler", + "rand 0.9.1", + "revm-primitives", + "secp256k1 0.31.0", + "sha2 0.10.9", + "toml", +] + +[[package]] +name = "openvm-transpiler" +version = "1.4.0" +source = "git+https://github.com/openvm-org/openvm.git?branch=main#b9f94ffa6f3c02ea28bff8eccde013d8a9418434" +dependencies = [ + "elf", + "eyre", + "openvm-instructions", + "openvm-platform", + "openvm-stark-backend", + "rrs-lib", + "thiserror 1.0.69", +] + +[[package]] +name = "ordered-float" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +dependencies = [ + "num-traits", +] + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2 0.10.9", +] + +[[package]] +name = "p3-air" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "p3-field 0.1.0", + "p3-matrix 0.1.0", +] + +[[package]] +name = "p3-baby-bear" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "p3-field 0.1.0", + "p3-mds 0.1.0", + "p3-monty-31", + "p3-poseidon2 0.1.0", + "p3-symmetric 0.1.0", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-baby-bear" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7521838ecab2ddf4f7bc4ceebad06ec02414729598485c1ada516c39900820e8" +dependencies = [ + "num-bigint 0.4.6", + "p3-field 0.2.3-succinct", + "p3-mds 0.2.3-succinct", + "p3-poseidon2 0.2.3-succinct", + "p3-symmetric 0.2.3-succinct", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-blake3" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "blake3", + "p3-symmetric 0.1.0", + "p3-util 0.1.0", +] + +[[package]] +name = "p3-bn254-fr" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "ff 0.13.1", + "halo2curves", + "num-bigint 0.4.6", + "p3-field 0.1.0", + "p3-poseidon2 0.1.0", + "p3-symmetric 0.1.0", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-challenger" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "p3-field 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-symmetric 0.1.0", + "p3-util 0.1.0", + "tracing", +] + +[[package]] +name = "p3-commit" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "p3-challenger", + "p3-dft 0.1.0", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-util 0.1.0", + "serde", +] + +[[package]] +name = "p3-dft" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", + "tracing", +] + +[[package]] +name = "p3-dft" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46414daedd796f1eefcdc1811c0484e4bced5729486b6eaba9521c572c76761a" +dependencies = [ + "p3-field 0.2.3-succinct", + "p3-matrix 0.2.3-succinct", + "p3-maybe-rayon 0.2.3-succinct", + "p3-util 0.2.3-succinct", + "tracing", +] + +[[package]] +name = "p3-field" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "nums", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", + "rand 0.8.5", + "serde", + "tracing", +] + +[[package]] +name = "p3-field" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48948a0516b349e9d1cdb95e7236a6ee010c44e68c5cc78b4b92bf1c4022a0d9" +dependencies = [ + "itertools 0.12.1", + "num-bigint 0.4.6", + "num-traits", + "p3-util 0.2.3-succinct", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-fri" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "p3-challenger", + "p3-commit", + "p3-dft 0.1.0", + "p3-field 0.1.0", + "p3-interpolation", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", + "rand 0.8.5", + "serde", + "tracing", +] + +[[package]] +name = "p3-goldilocks" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "num-bigint 0.4.6", + "p3-dft 0.1.0", + "p3-field 0.1.0", + "p3-mds 0.1.0", + "p3-poseidon", + "p3-poseidon2 0.1.0", + "p3-symmetric 0.1.0", + "p3-util 0.1.0", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-interpolation" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", +] + +[[package]] +name = "p3-keccak" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "p3-field 0.1.0", + "p3-symmetric 0.1.0", + "p3-util 0.1.0", + "tiny-keccak", +] + +[[package]] +name = "p3-keccak-air" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "p3-air", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", + "rand 0.8.5", + "tracing", +] + +[[package]] +name = "p3-koala-bear" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "p3-field 0.1.0", + "p3-mds 0.1.0", + "p3-monty-31", + "p3-poseidon2 0.1.0", + "p3-symmetric 0.1.0", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-matrix" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "p3-field 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", + "rand 0.8.5", + "serde", + "tracing", + "transpose", +] + +[[package]] +name = "p3-matrix" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e4de3f373589477cb735ea58e125898ed20935e03664b4614c7fac258b3c42f" dependencies = [ "itertools 0.12.1", - "p3-field", - "p3-maybe-rayon", - "p3-util", + "p3-field 0.2.3-succinct", + "p3-maybe-rayon 0.2.3-succinct", + "p3-util 0.2.3-succinct", "rand 0.8.5", "serde", "tracing", ] +[[package]] +name = "p3-maybe-rayon" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "rayon", +] + [[package]] name = "p3-maybe-rayon" version = "0.2.3-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3968ad1160310296eb04f91a5f4edfa38fe1d6b2b8cd6b5c64e6f9b7370979e" +[[package]] +name = "p3-mds" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "p3-dft 0.1.0", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-symmetric 0.1.0", + "p3-util 0.1.0", + "rand 0.8.5", +] + [[package]] name = "p3-mds" version = "0.2.3-succinct" @@ -3179,11 +4999,72 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2356b1ed0add6d5dfbf7a338ce534a6fde827374394a52cec16a0840af6e97c9" dependencies = [ "itertools 0.12.1", - "p3-dft", - "p3-field", - "p3-matrix", - "p3-symmetric", - "p3-util", + "p3-dft 0.2.3-succinct", + "p3-field 0.2.3-succinct", + "p3-matrix 0.2.3-succinct", + "p3-symmetric 0.2.3-succinct", + "p3-util 0.2.3-succinct", + "rand 0.8.5", +] + +[[package]] +name = "p3-merkle-tree" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "p3-commit", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-symmetric 0.1.0", + "p3-util 0.1.0", + "rand 0.8.5", + "serde", + "tracing", +] + +[[package]] +name = "p3-monty-31" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "num-bigint 0.4.6", + "p3-dft 0.1.0", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-mds 0.1.0", + "p3-poseidon2 0.1.0", + "p3-symmetric 0.1.0", + "p3-util 0.1.0", + "rand 0.8.5", + "serde", + "tracing", + "transpose", +] + +[[package]] +name = "p3-poseidon" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "p3-field 0.1.0", + "p3-mds 0.1.0", + "p3-symmetric 0.1.0", + "rand 0.8.5", +] + +[[package]] +name = "p3-poseidon2" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "gcd", + "p3-field 0.1.0", + "p3-mds 0.1.0", + "p3-symmetric 0.1.0", "rand 0.8.5", ] @@ -3194,21 +5075,73 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da1eec7e1b6900581bedd95e76e1ef4975608dd55be9872c9d257a8a9651c3a" dependencies = [ "gcd", - "p3-field", - "p3-mds", - "p3-symmetric", + "p3-field 0.2.3-succinct", + "p3-mds 0.2.3-succinct", + "p3-symmetric 0.2.3-succinct", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-poseidon2-air" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "p3-air", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-poseidon2 0.1.0", + "p3-util 0.1.0", "rand 0.8.5", + "tikv-jemallocator", + "tracing", +] + +[[package]] +name = "p3-symmetric" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "p3-field 0.1.0", + "serde", +] + +[[package]] +name = "p3-symmetric" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb439bea1d822623b41ff4b51e3309e80d13cadf8b86d16ffd5e6efb9fdc360" +dependencies = [ + "itertools 0.12.1", + "p3-field 0.2.3-succinct", + "serde", +] + +[[package]] +name = "p3-uni-stark" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" +dependencies = [ + "itertools 0.14.0", + "p3-air", + "p3-challenger", + "p3-commit", + "p3-dft 0.1.0", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", "serde", + "tracing", ] [[package]] -name = "p3-symmetric" -version = "0.2.3-succinct" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb439bea1d822623b41ff4b51e3309e80d13cadf8b86d16ffd5e6efb9fdc360" +name = "p3-util" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ - "itertools 0.12.1", - "p3-field", "serde", ] @@ -3221,13 +5154,22 @@ dependencies = [ "serde", ] +[[package]] +name = "pairing" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135590d8bdba2b31346f9cd1fb2a912329f5135e832a4f422942eb6ead8b6b3b" +dependencies = [ + "group 0.12.1", +] + [[package]] name = "pairing" version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" dependencies = [ - "group", + "group 0.13.0", ] [[package]] @@ -3281,6 +5223,36 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "pasta_curves" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc65faf8e7313b4b1fbaa9f7ca917a0eed499a9663be71477f87993604341d8" +dependencies = [ + "blake2b_simd", + "ff 0.12.1", + "group 0.12.1", + "lazy_static", + "rand 0.8.5", + "static_assertions", + "subtle", +] + +[[package]] +name = "pasta_curves" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" +dependencies = [ + "blake2b_simd", + "ff 0.13.1", + "group 0.13.0", + "lazy_static", + "rand 0.8.5", + "static_assertions", + "subtle", +] + [[package]] name = "paste" version = "1.0.15" @@ -3300,7 +5272,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" dependencies = [ "memchr", - "thiserror", + "thiserror 2.0.12", "ucd-trie", ] @@ -3462,6 +5434,16 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55" +dependencies = [ + "proc-macro2", + "syn 2.0.103", +] + [[package]] name = "primeorder" version = "0.13.6" @@ -3553,6 +5535,21 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "quanta" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3ab5a9d756f0d97bdc89019bd2e4ea098cf9cde50ee7564dde6b81ccc8f06c7" +dependencies = [ + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi 0.11.1+wasi-snapshot-preview1", + "web-sys", + "winapi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -3580,6 +5577,16 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + [[package]] name = "rand" version = "0.8.5" @@ -3651,6 +5658,15 @@ dependencies = [ "rand_core 0.9.3", ] +[[package]] +name = "raw-cpuid" +version = "11.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df7ab838ed27997ba19a4664507e6f82b41fe6e20be42929332156e5e85146" +dependencies = [ + "bitflags", +] + [[package]] name = "rayon" version = "1.10.0" @@ -3929,10 +5945,17 @@ dependencies = [ "c-kzg", "cfg-if", "codspeed-criterion-compat", - "k256", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", + "k256 0.13.4 (git+https://github.com/openvm-org/openvm.git?branch=main)", "kzg-rs", "libsecp256k1", "once_cell", + "openvm", + "openvm-ecc-guest", + "openvm-keccak256", + "openvm-kzg", + "openvm-pairing", + "openvm-sha2", "p256", "rand 0.9.1", "revm-primitives", @@ -3967,11 +5990,11 @@ dependencies = [ name = "revm-statetest-types" version = "8.0.4" dependencies = [ - "k256", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "revm", "serde", "serde_json", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -3985,7 +6008,7 @@ dependencies = [ "csv", "hash-db", "indicatif", - "k256", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher", "revm", "revm-bytecode", @@ -3999,7 +6022,7 @@ dependencies = [ "revm-statetest-types", "serde", "serde_json", - "thiserror", + "thiserror 2.0.12", "triehash", "walkdir", ] @@ -4033,6 +6056,16 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + [[package]] name = "rstest" version = "0.25.0" @@ -4323,6 +6356,9 @@ name = "semver" version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +dependencies = [ + "serde", +] [[package]] name = "semver-parser" @@ -4342,6 +6378,24 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_arrays" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38636132857f68ec3d5f3eb121166d2af33cb55174c4d5ff645db6165cbef0fd" +dependencies = [ + "serde", +] + [[package]] name = "serde_arrays" version = "0.2.0" @@ -4375,6 +6429,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -4412,7 +6475,7 @@ version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81679d9ed988d5e9a5e6531dc3f2c28efbd639cbd1dfb628df08edea6004da77" dependencies = [ - "darling", + "darling 0.20.11", "proc-macro2", "quote", "syn 2.0.103", @@ -4472,6 +6535,15 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shlex" version = "1.3.0" @@ -4494,6 +6566,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" +[[package]] +name = "sketches-ddsketch" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85636c14b73d81f541e525f585c0a2109e6744e1565b5c1668e31c70c10ed65c" + [[package]] name = "slab" version = "0.4.10" @@ -4542,10 +6620,10 @@ dependencies = [ "hex", "lazy_static", "num-bigint 0.4.6", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", + "p3-baby-bear 0.2.3-succinct", + "p3-field 0.2.3-succinct", + "p3-poseidon2 0.2.3-succinct", + "p3-symmetric 0.2.3-succinct", "serde", "sha2 0.10.9", ] @@ -4557,9 +6635,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac255e1704ebcdeec5e02f6a0ebc4d2e9e6b802161938330b6810c13a610c583" dependencies = [ "cfg-if", - "ff", - "group", - "pairing", + "ff 0.13.1", + "group 0.13.0", + "pairing 0.23.0", "rand_core 0.6.4", "sp1-lib", "subtle", @@ -4571,6 +6649,12 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spin" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" + [[package]] name = "spki" version = "0.7.3" @@ -4593,19 +6677,47 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + [[package]] name = "strsim" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros 0.26.4", +] + [[package]] name = "strum" version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" dependencies = [ - "strum_macros", + "strum_macros 0.27.1", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.103", ] [[package]] @@ -4713,13 +6825,33 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + [[package]] name = "thiserror" version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] @@ -4733,6 +6865,15 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + [[package]] name = "threadpool" version = "1.8.1" @@ -4742,6 +6883,26 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "tikv-jemalloc-sys" +version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865" +dependencies = [ + "libc", + "tikv-jemalloc-sys", +] + [[package]] name = "time" version = "0.3.41" @@ -4864,11 +7025,26 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -4877,10 +7053,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ "indexmap 2.9.0", + "serde", + "serde_spanned", "toml_datetime", + "toml_write", "winnow", ] +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + [[package]] name = "tower" version = "0.5.2" @@ -4958,6 +7143,19 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-forest" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee40835db14ddd1e3ba414292272eddde9dad04d3d4b65509656414d1c42592f" +dependencies = [ + "ansi_term", + "smallvec", + "thiserror 1.0.69", + "tracing", + "tracing-subscriber 0.3.20", +] + [[package]] name = "tracing-futures" version = "0.2.5" @@ -4970,6 +7168,17 @@ dependencies = [ "tracing", ] +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-subscriber" version = "0.2.25" @@ -4979,6 +7188,34 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-subscriber" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "transpose" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" +dependencies = [ + "num-integer", + "strength_reduce", +] + [[package]] name = "triehash" version = "0.8.4" @@ -5043,6 +7280,16 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "unroll" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ad948c1cb799b1a70f836077721a92a35ac177d4daddf4c20a633786d4cf618" +dependencies = [ + "quote", + "syn 1.0.109", +] + [[package]] name = "unty" version = "0.0.4" @@ -5255,6 +7502,22 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + [[package]] name = "winapi-util" version = "0.1.9" @@ -5264,6 +7527,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-core" version = "0.61.2" @@ -5555,3 +7824,29 @@ dependencies = [ "quote", "syn 2.0.103", ] + +[[package]] +name = "zkhash" +version = "0.2.0" +source = "git+https://github.com/HorizenLabs/poseidon2.git?rev=bb476b9#bb476b9ca38198cf5092487283c8b8c5d4317c4e" +dependencies = [ + "ark-ff 0.4.2", + "ark-std 0.4.0", + "bitvec", + "blake2", + "bls12_381 0.7.1", + "byteorder", + "cfg-if", + "group 0.12.1", + "group 0.13.0", + "halo2", + "hex", + "jubjub", + "lazy_static", + "pasta_curves 0.5.1", + "rand 0.8.5", + "serde", + "sha2 0.10.9", + "sha3", + "subtle", +] diff --git a/Cargo.toml b/Cargo.toml index e7ab89f80..f24085bd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,8 @@ members = [ "examples/my_evm", "examples/custom_opcodes", "examples/custom_precompile_journal", + + "tests/openvm", ] resolver = "2" default-members = ["crates/revm"] @@ -115,6 +117,32 @@ rand = "0.9" tokio = "1.45" either = { version = "1.15.0", default-features = false } +# openvm stark-backend +openvm-stark-sdk = { git = "https://github.com/openvm-org/stark-backend.git", tag = "v1.2.0" } +# openvm +openvm = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-build = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-sdk = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +# openvm extensions +openvm-ecc-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-keccak256-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-sha256-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-pairing-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-rv32im-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-algebra-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-algebra-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-ecc-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-ecc-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-pairing-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +# openvm guest libs +openvm-keccak256 = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-sha2 = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-pairing = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-k256 = { git = "https://github.com/openvm-org/openvm.git", branch = "main", package = "k256", default-features = false } +openvm-kzg = { git = "https://github.com/axiom-crypto/openvm-kzg.git", branch = "openvm-main", default-features = false } + # dev-dependencies anyhow = "1.0.98" bincode = { version = "2.0", features = ["serde"] } @@ -172,3 +200,6 @@ inherits = "profiling" [profile.ethtests] inherits = "test" opt-level = 3 + +[profile.dev] +opt-level = 1 diff --git a/crates/interpreter/Cargo.toml b/crates/interpreter/Cargo.toml index 64b7776d4..062bb1828 100644 --- a/crates/interpreter/Cargo.toml +++ b/crates/interpreter/Cargo.toml @@ -30,12 +30,7 @@ bincode.workspace = true [features] default = ["std"] -std = [ - "serde?/std", - "primitives/std", - "context-interface/std", - "bytecode/std" -] +std = ["serde?/std", "primitives/std", "context-interface/std", "bytecode/std"] hashbrown = ["primitives/hashbrown"] serde = [ "dep:serde", diff --git a/crates/precompile/Cargo.toml b/crates/precompile/Cargo.toml index 473cdaafe..fa96e785b 100644 --- a/crates/precompile/Cargo.toml +++ b/crates/precompile/Cargo.toml @@ -31,14 +31,15 @@ once_cell = { workspace = true, features = ["alloc"] } # ecRecover k256 = { workspace = true, features = ["ecdsa"] } secp256k1 = { workspace = true, features = [ - "alloc", - "recovery", - "rand", - "global-context", + "alloc", + "recovery", + "rand", + "global-context", ], optional = true } libsecp256k1 = { workspace = true, features = [ - "static-context", + "static-context", ], optional = true } +openvm-k256 = { workspace = true, features = ["ecdsa"], optional = true } # SHA2-256 and RIPEMD-160 sha2.workspace = true @@ -55,7 +56,7 @@ ark-serialize = { workspace = true } # KZG point evaluation precompile c-kzg = { workspace = true, optional = true, features = [ - "ethereum_kzg_settings", + "ethereum_kzg_settings", ] } # Optionally use `kzg-rs` for a pure Rust implementation of KZG point evaluation. @@ -74,6 +75,14 @@ p256 = { workspace = true, features = ["ecdsa"] } cfg-if.workspace = true arrayref = "0.3.6" +# Optionally use openvm intrinsics +openvm = { workspace = true, optional = true } +openvm-ecc-guest = { workspace = true, optional = true } +openvm-keccak256 = { workspace = true, optional = true } +openvm-sha2 = { workspace = true, optional = true } +openvm-pairing = { workspace = true, optional = true } +openvm-kzg = { workspace = true, optional = true } + [dev-dependencies] criterion.workspace = true rand = { workspace = true, features = ["std"] } @@ -81,7 +90,7 @@ ark-std = { workspace = true } rstest.workspace = true [features] -default = ["std", "c-kzg", "secp256k1", "portable", "blst"] +default = ["openvm"] std = [ "primitives/std", "k256/std", @@ -110,6 +119,9 @@ asm-keccak = ["primitives/asm-keccak"] c-kzg = ["dep:c-kzg"] # `kzg-rs` is not audited but useful for `no_std` environment, use it with causing and default to `c-kzg` if possible. kzg-rs = ["dep:kzg-rs"] +# `openvm-kzg` can be used in place of kzg-rs for acceleration on OpenVM guest +openvm-kzg = ["dep:openvm-kzg"] +openvm-kzg-intrinsics = ["openvm-kzg/use-intrinsics"] # Compile in portable mode, without ISA extensions. # Binary can be executed on all systems. @@ -120,12 +132,24 @@ portable = ["c-kzg?/portable", "blst?/portable"] # In Linux it passes. If you don't require to build wasm on win/mac, it is safe to use it and it is enabled by default. secp256k1 = ["dep:secp256k1"] libsecp256k1 = ["dep:libsecp256k1"] +# Use openvm accelerated k256. This is slightly more optimized even compared to directly patching k256 with openvm-k256 due to how byte manipulation is done. +openvm-k256 = [ + "dep:openvm", + "dep:openvm-k256", + "openvm-ecc-guest", + "openvm-keccak256", +] # Enables the blst implementation of the BLS12-381 precompile. blst = ["dep:blst"] # Enables the substrate implementation of eip1962 bn = ["dep:bn"] +# Enable openvm accelerated implementation +openvm-bn = ["dep:openvm", "openvm-ecc-guest", "openvm-pairing/bn254"] + +# We do NOT include `openvm-k256` because it will cause a conflict when patching k256 +openvm = ["dep:openvm", "openvm-bn", "openvm-sha2", "openvm-kzg-intrinsics"] # Use rug (that wraps gmp) for modexp precompile. # It is faster library but licences as GPL code, if enabled please make sure to follow the license. diff --git a/crates/precompile/src/bn128.rs b/crates/precompile/src/bn128.rs index b84e96f66..26856cb39 100644 --- a/crates/precompile/src/bn128.rs +++ b/crates/precompile/src/bn128.rs @@ -12,6 +12,12 @@ cfg_if::cfg_if! { encode_g1_point, g1_point_add, g1_point_mul, pairing_check, read_g1_point, read_g2_point, read_scalar, }; + } else if #[cfg(feature = "openvm-bn")] { + mod openvm; + use openvm::{ + encode_g1_point, g1_point_add, g1_point_mul, pairing_check, read_g1_point, read_g2_point, + read_scalar, + }; } else { mod arkworks; use arkworks::{ diff --git a/crates/precompile/src/bn128/openvm.rs b/crates/precompile/src/bn128/openvm.rs new file mode 100644 index 000000000..1928261e8 --- /dev/null +++ b/crates/precompile/src/bn128/openvm.rs @@ -0,0 +1,155 @@ +use std::vec::Vec; + +use { + openvm_ecc_guest::{ + algebra::IntMod, + weierstrass::{IntrinsicCurve, WeierstrassPoint}, + AffinePoint, + }, + openvm_pairing::{ + bn254::{Bn254, Fp, Fp2, G1Affine, G2Affine, Scalar}, + PairingCheck, + }, +}; + +use super::{FQ2_LEN, FQ_LEN, G1_LEN, SCALAR_LEN}; +use crate::PrecompileError; + +#[inline] +fn read_fq(input: &[u8]) -> Result { + if input.len() < FQ_LEN { + Err(PrecompileError::Bn128FieldPointNotAMember) + } else { + Fp::from_be_bytes(&input[..32]).ok_or(PrecompileError::Bn128FieldPointNotAMember) + } +} + +/// Reads a Fq2 (quadratic extension field element) from the input slice. +/// +/// Parses two consecutive Fq field elements as the real and imaginary parts +/// of an Fq2 element. +/// The second component is parsed before the first, ie if a we represent an +/// element in Fq2 as (x,y) -- `y` is parsed before `x` +/// +/// # Panics +/// +/// Panics if the input is not at least 64 bytes long. +#[inline] +fn read_fq2(input: &[u8]) -> Result { + let y = read_fq(&input[..FQ_LEN])?; + let x = read_fq(&input[FQ_LEN..2 * FQ_LEN])?; + Ok(Fp2::new(x, y)) +} + +#[inline] +fn new_g1_affine_point(px: Fp, py: Fp) -> Result { + G1Affine::from_xy(px, py).ok_or(PrecompileError::Bn128AffineGFailedToCreate) +} + +/// Reads a G1 point from the input slice. +/// +/// Parses a G1 point from a byte slice by reading two consecutive field elements +/// representing the x and y coordinates. +/// +/// # Panics +/// +/// Panics if the input is not at least 64 bytes long. +#[inline] +pub(super) fn read_g1_point(input: &[u8]) -> Result { + let px = read_fq(&input[0..FQ_LEN])?; + let py = read_fq(&input[FQ_LEN..2 * FQ_LEN])?; + new_g1_affine_point(px, py) +} + +/// Encodes a G1 point into a byte array. +/// +/// Converts a G1 point in Jacobian coordinates to affine coordinates and +/// serializes the x and y coordinates as big-endian byte arrays. +/// +/// Note: If the point is the point at infinity, this function returns +/// all zeroes. +#[inline] +pub(super) fn encode_g1_point(point: G1Affine) -> [u8; G1_LEN] { + let mut output = [0u8; G1_LEN]; + + // manually reverse to avoid allocation + let x_bytes: &[u8] = point.x().as_le_bytes(); + let y_bytes: &[u8] = point.y().as_le_bytes(); + for i in 0..FQ_LEN { + output[i] = x_bytes[FQ_LEN - 1 - i]; + output[i + FQ_LEN] = y_bytes[FQ_LEN - 1 - i]; + } + output +} + +/// Reads a G2 point from the input slice. +/// +/// Parses a G2 point from a byte slice by reading four consecutive Fq field elements +/// representing the two Fq2 coordinates (x and y) of the G2 point. +/// +/// # Panics +/// +/// Panics if the input is not at least 128 bytes long. +#[inline] +pub(super) fn read_g2_point(input: &[u8]) -> Result { + let ba = read_fq2(&input[0..FQ2_LEN])?; + let bb = read_fq2(&input[FQ2_LEN..2 * FQ2_LEN])?; + + G2Affine::from_xy(ba, bb).ok_or(PrecompileError::Bn128AffineGFailedToCreate) +} + +/// Reads a scalar from the input slice +/// +/// Note: The scalar does not need to be canonical. +/// +/// # Panics +/// +/// If `input.len()` is not equal to [`SCALAR_LEN`]. +#[inline] +pub(super) fn read_scalar(input: &[u8]) -> Scalar { + assert_eq!( + input.len(), + SCALAR_LEN, + "unexpected scalar length. got {}, expected {SCALAR_LEN}", + input.len() + ); + Scalar::from_be_bytes_unchecked(input) +} + +/// Performs point addition on two G1 points. +#[inline] +pub(super) fn g1_point_add(p1: G1Affine, p2: G1Affine) -> G1Affine { + p1 + p2 +} + +/// Performs a G1 scalar multiplication. +#[inline] +pub(super) fn g1_point_mul(p: G1Affine, fr: Scalar) -> G1Affine { + Bn254::msm(&[fr], &[p]) +} + +/// pairing_check performs a pairing check on a list of G1 and G2 point pairs and +/// returns true if the result is equal to the identity element. +/// +/// Note: If the input is empty, this function returns true. +/// This is different to EIP2537 which disallows the empty input. +#[inline] +pub(super) fn pairing_check(pairs: &[(G1Affine, G2Affine)]) -> bool { + if pairs.is_empty() { + return true; + } + let (g1_points, g2_points): (Vec<_>, Vec<_>) = pairs + .iter() + .cloned() + .map(|(g1, g2)| { + let (g1_x, g1_y) = g1.into_coords(); + let g1 = AffinePoint::new(g1_x, g1_y); + + let (g2_x, g2_y) = g2.into_coords(); + let g2 = AffinePoint::new(g2_x, g2_y); + (g1, g2) + }) + .unzip(); + + Bn254::pairing_check(&g1_points, &g2_points).is_ok() +} diff --git a/crates/precompile/src/hash.rs b/crates/precompile/src/hash.rs index 58286d648..fb9ef7444 100644 --- a/crates/precompile/src/hash.rs +++ b/crates/precompile/src/hash.rs @@ -23,7 +23,10 @@ pub fn sha256_run(input: &[u8], gas_limit: u64) -> PrecompileResult { if cost > gas_limit { Err(PrecompileError::OutOfGas) } else { + #[cfg(not(feature = "openvm-sha2"))] let output = sha2::Sha256::digest(input); + #[cfg(feature = "openvm-sha2")] + let output = openvm_sha2::sha256(input); Ok(PrecompileOutput::new(cost, output.to_vec().into())) } } diff --git a/crates/precompile/src/kzg_point_evaluation.rs b/crates/precompile/src/kzg_point_evaluation.rs index 8c285ecb1..19260cbd5 100644 --- a/crates/precompile/src/kzg_point_evaluation.rs +++ b/crates/precompile/src/kzg_point_evaluation.rs @@ -4,6 +4,8 @@ use crate::{Address, PrecompileError, PrecompileOutput, PrecompileResult, Precom cfg_if::cfg_if! { if #[cfg(feature = "c-kzg")] { use c_kzg::{Bytes32, Bytes48}; + } else if #[cfg(feature = "openvm-kzg")] { + use openvm_kzg::{Bytes32, Bytes48, KzgProof}; } else if #[cfg(feature = "kzg-rs")] { use kzg_rs::{Bytes32, Bytes48, KzgProof}; } @@ -82,6 +84,10 @@ pub fn verify_kzg_proof(commitment: &Bytes48, z: &Bytes32, y: &Bytes32, proof: & if #[cfg(feature = "c-kzg")] { let kzg_settings = c_kzg::ethereum_kzg_settings(8); kzg_settings.verify_kzg_proof(commitment, z, y, proof).unwrap_or(false) + } else if #[cfg(feature = "openvm-kzg")] { + let env = openvm_kzg::EnvKzgSettings::default(); + let kzg_settings = env.get(); + KzgProof::verify_kzg_proof(commitment, z, y, proof, kzg_settings).unwrap_or(false) } else if #[cfg(feature = "kzg-rs")] { let env = kzg_rs::EnvKzgSettings::default(); let kzg_settings = env.get(); diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index 7cf739fba..3288e0d65 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -1,7 +1,7 @@ //! # revm-precompile //! //! Implementations of EVM precompiled contracts. -#![cfg_attr(not(test), warn(unused_crate_dependencies))] +// #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(not(feature = "std"), no_std)] #[macro_use] @@ -16,7 +16,7 @@ pub mod bn128; pub mod hash; pub mod identity; pub mod interface; -#[cfg(any(feature = "c-kzg", feature = "kzg-rs"))] +#[cfg(any(feature = "c-kzg", feature = "kzg-rs", feature = "openvm-kzg"))] pub mod kzg_point_evaluation; pub mod modexp; pub mod secp256k1; @@ -169,7 +169,7 @@ impl Precompiles { // EIP-4844: Shard Blob Transactions cfg_if! { - if #[cfg(any(feature = "c-kzg", feature = "kzg-rs"))] { + if #[cfg(any(feature = "c-kzg", feature = "kzg-rs", feature = "openvm-kzg"))] { let precompile = kzg_point_evaluation::POINT_EVALUATION.clone(); } else { let precompile = PrecompileWithAddress(u64_to_address(0x0A), |_,_| Err(PrecompileError::Fatal("c-kzg feature is not enabled".into()))); diff --git a/crates/precompile/src/secp256k1.rs b/crates/precompile/src/secp256k1.rs index 8c0676d6f..8e69b9569 100644 --- a/crates/precompile/src/secp256k1.rs +++ b/crates/precompile/src/secp256k1.rs @@ -16,6 +16,8 @@ #[cfg(feature = "secp256k1")] pub mod bitcoin_secp256k1; pub mod k256; +#[cfg(feature = "openvm-k256")] +pub mod openvm_k256; #[cfg(feature = "libsecp256k1")] pub mod parity_libsecp256k1; @@ -60,6 +62,8 @@ cfg_if::cfg_if! { pub use bitcoin_secp256k1::ecrecover; } else if #[cfg(feature = "libsecp256k1")] { pub use parity_libsecp256k1::ecrecover; + } else if #[cfg(feature = "openvm-k256")] { + pub use openvm_k256::ecrecover; } else { pub use k256::ecrecover; } diff --git a/crates/precompile/src/secp256k1/openvm_k256.rs b/crates/precompile/src/secp256k1/openvm_k256.rs new file mode 100644 index 000000000..bcf556b64 --- /dev/null +++ b/crates/precompile/src/secp256k1/openvm_k256.rs @@ -0,0 +1,33 @@ +//! OpenVM implementation of `ecrecover`. More about it in [`crate::secp256k1`]. +use openvm_ecc_guest::{algebra::IntMod, weierstrass::WeierstrassPoint}; +use openvm_k256::ecdsa::{Error, RecoveryId, Signature, VerifyingKey}; +use openvm_keccak256::keccak256; +use primitives::{alloy_primitives::B512, B256}; + +/// Recover the public key from a signature and a message. +/// +/// This function is using the OpenVM patch of the `k256` crate. +pub fn ecrecover(sig: &B512, mut recid: u8, msg: &B256) -> Result { + let _sig = sig; + let _recid = recid; + // parse signature + let mut sig = Signature::from_slice(sig.as_slice())?; + if let Some(sig_normalized) = sig.normalize_s() { + sig = sig_normalized; + recid ^= 1; + } + let recid = RecoveryId::from_byte(recid).expect("recovery ID is valid"); + + // annoying: Signature::to_bytes copies from slice + let recovered_key = + VerifyingKey::recover_from_prehash_noverify(&msg[..], &sig.to_bytes(), recid)?; + let public_key = recovered_key.as_affine(); + let mut encoded = [0u8; 64]; + encoded[..32].copy_from_slice(&WeierstrassPoint::x(public_key).to_be_bytes()); + encoded[32..].copy_from_slice(&WeierstrassPoint::y(public_key).to_be_bytes()); + // hash it + let mut hash = keccak256(&encoded); + // truncate to 20 bytes + hash[..12].fill(0); + Ok(B256::from(hash)) +} diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 3379e6090..a68d77838 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -26,14 +26,9 @@ num_enum = { version = "0.7.3", default-features = false } # Optional serde = { workspace = true, features = ["derive", "rc"], optional = true } - [features] default = ["std"] -std = [ - "alloy-primitives/std", - "serde?/std", - "num_enum/std" -] +std = ["alloy-primitives/std", "serde?/std", "num_enum/std"] serde = ["dep:serde", "alloy-primitives/serde"] hashbrown = ["alloy-primitives/map-hashbrown"] diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 5a950e430..986b9d4c7 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -91,12 +91,13 @@ optional_eip3607 = ["context/optional_eip3607"] optional_no_base_fee = ["context/optional_no_base_fee"] # Precompiles features - -secp256k1 = ["precompile/secp256k1"] # See comments in `precompile` -c-kzg = [ - "precompile/c-kzg", -] # `kzg-rs` is not audited but useful for `no_std` environment, use it with causing and default to `c-kzg` if possible. +# See comments in `precompile` +secp256k1 = ["precompile/secp256k1"] +c-kzg = ["precompile/c-kzg"] +# `kzg-rs` is not audited but useful for `no_std` environment, use it with causing and default to `c-kzg` if possible. kzg-rs = ["precompile/kzg-rs"] +# `openvm-kzg` can be used in place of kzg-rs for acceleration on OpenVM guest +openvm-kzg = ["precompile/openvm-kzg"] blst = ["precompile/blst"] bn = ["precompile/bn"] diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 000000000..882510206 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.86.0" +components = ["clippy", "rustfmt"] diff --git a/tests/openvm/Cargo.toml b/tests/openvm/Cargo.toml new file mode 100644 index 000000000..692ff81df --- /dev/null +++ b/tests/openvm/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "openvm-tests" +version = "0.1.0" +edition = "2021" + +[dependencies] +openvm = { workspace = true } +openvm-ecc-guest = { workspace = true } +openvm-pairing = { workspace = true } +openvm-keccak256-guest = { workspace = true } +openvm-sdk = { workspace = true } +openvm-build = { workspace = true } +openvm-pairing-transpiler = { workspace = true } +openvm-rv32im-transpiler = { workspace = true } +openvm-transpiler = { workspace = true } +openvm-algebra-circuit = { workspace = true } +openvm-algebra-transpiler = { workspace = true } +openvm-ecc-circuit = { workspace = true } +openvm-ecc-transpiler = { workspace = true } +openvm-pairing-circuit = { workspace = true } +openvm-circuit = { workspace = true, features = ["test-utils", "parallel"] } +openvm-stark-sdk = { workspace = true } + +num-bigint = { version = "0.4", default-features = false } +num-traits = { version = "0.2", default-features = false } + +primitives = { workspace = true } + +sha2 = { version = "0.10", default-features = false } +toml = "0.8.23" +eyre.workspace = true + +[dev-dependencies] +rand.workspace = true +secp256k1 = { workspace = true, features = [ + "alloc", + "recovery", + "rand", + "global-context", +] } diff --git a/tests/openvm/programs/ec_add/Cargo.toml b/tests/openvm/programs/ec_add/Cargo.toml new file mode 100644 index 000000000..4837f7b84 --- /dev/null +++ b/tests/openvm/programs/ec_add/Cargo.toml @@ -0,0 +1,14 @@ +[workspace] +[package] +name = "ec-add-program" +version = "0.1.0" +edition = "2021" + +[dependencies] +openvm = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-algebra-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-ecc-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-pairing = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +revm-precompile = { path = "../../../../crates/precompile", default-features = false, features = [ + "openvm-bn", +] } diff --git a/tests/openvm/programs/ec_add/openvm.toml b/tests/openvm/programs/ec_add/openvm.toml new file mode 100644 index 000000000..b704f9971 --- /dev/null +++ b/tests/openvm/programs/ec_add/openvm.toml @@ -0,0 +1,18 @@ +[app_vm_config.rv32i] +[app_vm_config.rv32m] +[app_vm_config.io] + +[app_vm_config.modular] +supported_moduli = [ + # bn254 (alt bn128) + "21888242871839275222246405745257275088696311157297823662689037894645226208583", # coordinate field + "21888242871839275222246405745257275088548364400416034343698204186575808495617", # scalar field +] + +# bn254 (alt bn128) +[[app_vm_config.ecc.supported_curves]] +struct_name = "Bn254G1Affine" +modulus = "21888242871839275222246405745257275088696311157297823662689037894645226208583" +scalar = "21888242871839275222246405745257275088548364400416034343698204186575808495617" +a = "0" +b = "3" diff --git a/tests/openvm/programs/ec_add/openvm_init.rs b/tests/openvm/programs/ec_add/openvm_init.rs new file mode 100644 index 000000000..e8911a04a --- /dev/null +++ b/tests/openvm/programs/ec_add/openvm_init.rs @@ -0,0 +1,3 @@ +// This file is automatically generated by cargo openvm. Do not rename or edit. +openvm_algebra_guest::moduli_macros::moduli_init! { "21888242871839275222246405745257275088696311157297823662689037894645226208583", "21888242871839275222246405745257275088548364400416034343698204186575808495617" } +openvm_ecc_guest::sw_macros::sw_init! { "Bn254G1Affine" } diff --git a/tests/openvm/programs/ec_add/src/main.rs b/tests/openvm/programs/ec_add/src/main.rs new file mode 100644 index 000000000..aab900407 --- /dev/null +++ b/tests/openvm/programs/ec_add/src/main.rs @@ -0,0 +1,19 @@ +#![no_std] +#![no_main] + +use openvm::io::read_vec; +#[allow(unused_imports)] +use openvm_pairing::bn254::Bn254G1Affine; +use revm_precompile::bn128::{add::BYZANTIUM_ADD_GAS_COST, run_add}; + +openvm::init!(); + +openvm::entry!(main); + +pub fn main() { + let input = read_vec(); + let expected = read_vec(); + + let outcome = run_add(&input, BYZANTIUM_ADD_GAS_COST, 500).unwrap(); + assert_eq!(outcome.bytes, expected); +} diff --git a/tests/openvm/programs/ec_mul/Cargo.toml b/tests/openvm/programs/ec_mul/Cargo.toml new file mode 100644 index 000000000..df4fca55f --- /dev/null +++ b/tests/openvm/programs/ec_mul/Cargo.toml @@ -0,0 +1,14 @@ +[workspace] +[package] +name = "ec-mul-program" +version = "0.1.0" +edition = "2021" + +[dependencies] +openvm = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-algebra-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-ecc-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-pairing = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +revm-precompile = { path = "../../../../crates/precompile", default-features = false, features = [ + "openvm-bn", +] } diff --git a/tests/openvm/programs/ec_mul/openvm.toml b/tests/openvm/programs/ec_mul/openvm.toml new file mode 100644 index 000000000..b704f9971 --- /dev/null +++ b/tests/openvm/programs/ec_mul/openvm.toml @@ -0,0 +1,18 @@ +[app_vm_config.rv32i] +[app_vm_config.rv32m] +[app_vm_config.io] + +[app_vm_config.modular] +supported_moduli = [ + # bn254 (alt bn128) + "21888242871839275222246405745257275088696311157297823662689037894645226208583", # coordinate field + "21888242871839275222246405745257275088548364400416034343698204186575808495617", # scalar field +] + +# bn254 (alt bn128) +[[app_vm_config.ecc.supported_curves]] +struct_name = "Bn254G1Affine" +modulus = "21888242871839275222246405745257275088696311157297823662689037894645226208583" +scalar = "21888242871839275222246405745257275088548364400416034343698204186575808495617" +a = "0" +b = "3" diff --git a/tests/openvm/programs/ec_mul/openvm_init.rs b/tests/openvm/programs/ec_mul/openvm_init.rs new file mode 100644 index 000000000..e8911a04a --- /dev/null +++ b/tests/openvm/programs/ec_mul/openvm_init.rs @@ -0,0 +1,3 @@ +// This file is automatically generated by cargo openvm. Do not rename or edit. +openvm_algebra_guest::moduli_macros::moduli_init! { "21888242871839275222246405745257275088696311157297823662689037894645226208583", "21888242871839275222246405745257275088548364400416034343698204186575808495617" } +openvm_ecc_guest::sw_macros::sw_init! { "Bn254G1Affine" } diff --git a/tests/openvm/programs/ec_mul/src/main.rs b/tests/openvm/programs/ec_mul/src/main.rs new file mode 100644 index 000000000..4ac9ef0ee --- /dev/null +++ b/tests/openvm/programs/ec_mul/src/main.rs @@ -0,0 +1,19 @@ +#![no_std] +#![no_main] + +use openvm::io::read_vec; +#[allow(unused_imports)] +use openvm_pairing::bn254::Bn254G1Affine; +use revm_precompile::bn128::{mul::BYZANTIUM_MUL_GAS_COST, run_mul}; + +openvm::init!(); + +openvm::entry!(main); + +pub fn main() { + let input = read_vec(); + let expected = read_vec(); + + let outcome = run_mul(&input, BYZANTIUM_MUL_GAS_COST, 40_000).unwrap(); + assert_eq!(outcome.bytes, expected); +} diff --git a/tests/openvm/programs/ecrecover/Cargo.toml b/tests/openvm/programs/ecrecover/Cargo.toml new file mode 100644 index 000000000..d8dc07f6e --- /dev/null +++ b/tests/openvm/programs/ecrecover/Cargo.toml @@ -0,0 +1,27 @@ +[workspace] +[package] +name = "ecrecover-program" +version = "0.1.0" +edition = "2021" + +[dependencies] +openvm = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-algebra-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-ecc-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +revm-precompile = { path = "../../../../crates/precompile", default-features = false, features = [ + "openvm-k256", +] } +revm-primitives = { path = "../../../../crates/primitives", default-features = false } +k256 = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } + +[features] +default = [] + +[profile.release] +panic = "abort" +lto = "thin" # faster compile time + +[profile.profiling] +inherits = "release" +debug = 2 +strip = false diff --git a/tests/openvm/programs/ecrecover/openvm.toml b/tests/openvm/programs/ecrecover/openvm.toml new file mode 100644 index 000000000..c1261ee45 --- /dev/null +++ b/tests/openvm/programs/ecrecover/openvm.toml @@ -0,0 +1,17 @@ +[app_vm_config.rv32i] +[app_vm_config.rv32m] +[app_vm_config.io] +[app_vm_config.keccak] + +[app_vm_config.modular] +supported_moduli = [ + "115792089237316195423570985008687907853269984665640564039457584007908834671663", + "115792089237316195423570985008687907852837564279074904382605163141518161494337", +] + +[[app_vm_config.ecc.supported_curves]] +struct_name = "Secp256k1Point" +modulus = "115792089237316195423570985008687907853269984665640564039457584007908834671663" +scalar = "115792089237316195423570985008687907852837564279074904382605163141518161494337" +a = "0" +b = "7" diff --git a/tests/openvm/programs/ecrecover/openvm_init.rs b/tests/openvm/programs/ecrecover/openvm_init.rs new file mode 100644 index 000000000..dc6d4917d --- /dev/null +++ b/tests/openvm/programs/ecrecover/openvm_init.rs @@ -0,0 +1,3 @@ +// This file is automatically generated by cargo openvm. Do not rename or edit. +openvm_algebra_guest::moduli_macros::moduli_init! { "115792089237316195423570985008687907853269984665640564039457584007908834671663", "115792089237316195423570985008687907852837564279074904382605163141518161494337" } +openvm_ecc_guest::sw_macros::sw_init! { "Secp256k1Point" } diff --git a/tests/openvm/programs/ecrecover/src/main.rs b/tests/openvm/programs/ecrecover/src/main.rs new file mode 100644 index 000000000..953e16ff8 --- /dev/null +++ b/tests/openvm/programs/ecrecover/src/main.rs @@ -0,0 +1,19 @@ +#![no_std] +#![no_main] + +#[allow(unused_imports)] +use k256::Secp256k1Point; +use openvm::io::read_vec; +use revm_precompile::secp256k1::ec_recover_run; +use revm_primitives::Bytes; + +openvm::init!(); + +openvm::entry!(main); + +pub fn main() { + let expected_address = read_vec(); + let input = read_vec(); + let recovered = ec_recover_run(&Bytes::from(input), 3000).unwrap(); + assert_eq!(recovered.bytes.as_ref(), expected_address); +} diff --git a/tests/openvm/programs/kzg_point_evaluation/Cargo.toml b/tests/openvm/programs/kzg_point_evaluation/Cargo.toml new file mode 100644 index 000000000..3c8c293b4 --- /dev/null +++ b/tests/openvm/programs/kzg_point_evaluation/Cargo.toml @@ -0,0 +1,19 @@ +[workspace] +[package] +name = "kzg-point-evaluation-program" +version = "0.1.0" +edition = "2021" + +[dependencies] +openvm = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-algebra-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-ecc-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-pairing = { git = "https://github.com/openvm-org/openvm.git", branch = "main", features = [ + "bls12_381", +] } +revm-precompile = { path = "../../../../crates/precompile", default-features = false, features = [ + "openvm-kzg", +] } + +[features] +use-intrinsics = ["revm-precompile/openvm-kzg-intrinsics"] diff --git a/tests/openvm/programs/kzg_point_evaluation/openvm.toml b/tests/openvm/programs/kzg_point_evaluation/openvm.toml new file mode 100644 index 000000000..20d06d34d --- /dev/null +++ b/tests/openvm/programs/kzg_point_evaluation/openvm.toml @@ -0,0 +1,26 @@ +[app_vm_config.rv32i] +[app_vm_config.rv32m] +[app_vm_config.io] + +[app_vm_config.modular] +supported_moduli = [ + "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787", +] + +[app_vm_config.fp2] +supported_moduli = [ + [ + "Bls12_381Fp2", + "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787", + ], +] + +[[app_vm_config.ecc.supported_curves]] +struct_name = "Bls12_381G1Affine" +modulus = "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787" +scalar = "52435875175126190479447740508185965837690552500527637822603658699938581184513" +a = "0" +b = "4" + +[app_vm_config.pairing] +supported_curves = ["Bls12_381"] diff --git a/tests/openvm/programs/kzg_point_evaluation/openvm_init.rs b/tests/openvm/programs/kzg_point_evaluation/openvm_init.rs new file mode 100644 index 000000000..490827510 --- /dev/null +++ b/tests/openvm/programs/kzg_point_evaluation/openvm_init.rs @@ -0,0 +1,4 @@ +// This file is automatically generated by cargo openvm. Do not rename or edit. +openvm_algebra_guest::moduli_macros::moduli_init! { "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787" } +openvm_algebra_guest::complex_macros::complex_init! { "Bls12_381Fp2" { mod_idx = 0 } } +openvm_ecc_guest::sw_macros::sw_init! { "Bls12_381G1Affine" } diff --git a/tests/openvm/programs/kzg_point_evaluation/src/main.rs b/tests/openvm/programs/kzg_point_evaluation/src/main.rs new file mode 100644 index 000000000..d614e4fa7 --- /dev/null +++ b/tests/openvm/programs/kzg_point_evaluation/src/main.rs @@ -0,0 +1,22 @@ +#![no_std] +#![no_main] + +use openvm::io::read_vec; +#[allow(unused_imports)] +use openvm_pairing::bls12_381::Bls12_381G1Affine; +use revm_precompile::kzg_point_evaluation::{run, GAS_COST}; + +openvm::entry!(main); + +#[cfg(feature = "use-intrinsics")] +openvm::init!(); + +pub fn main() { + let input = read_vec(); + let expected_output = read_vec(); + + let gas = GAS_COST; + let output = run(&input, gas).unwrap(); + assert_eq!(output.gas_used, gas); + assert_eq!(&output.bytes[..], &expected_output); +} diff --git a/tests/openvm/programs/pairing/Cargo.toml b/tests/openvm/programs/pairing/Cargo.toml new file mode 100644 index 000000000..cdae58ea4 --- /dev/null +++ b/tests/openvm/programs/pairing/Cargo.toml @@ -0,0 +1,12 @@ +[workspace] +[package] +name = "ec-pairing-program" +version = "0.1.0" +edition = "2021" + +[dependencies] +openvm = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +openvm-algebra-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +revm-precompile = { path = "../../../../crates/precompile", default-features = false, features = [ + "openvm-bn", +] } diff --git a/tests/openvm/programs/pairing/openvm.toml b/tests/openvm/programs/pairing/openvm.toml new file mode 100644 index 000000000..16186e9b9 --- /dev/null +++ b/tests/openvm/programs/pairing/openvm.toml @@ -0,0 +1,21 @@ +[app_vm_config.rv32i] +[app_vm_config.rv32m] +[app_vm_config.io] +[app_vm_config.modular] +supported_moduli = [ + # bn254 (alt bn128) + "21888242871839275222246405745257275088696311157297823662689037894645226208583", # coordinate field + "21888242871839275222246405745257275088548364400416034343698204186575808495617", # scalar field +] + +[app_vm_config.fp2] +supported_moduli = [ + # bn254 (alt bn128) + [ + "Bn254Fp2", + "21888242871839275222246405745257275088696311157297823662689037894645226208583", + ], +] + +[app_vm_config.pairing] +supported_curves = ["Bn254"] diff --git a/tests/openvm/programs/pairing/openvm_init.rs b/tests/openvm/programs/pairing/openvm_init.rs new file mode 100644 index 000000000..e712b2a85 --- /dev/null +++ b/tests/openvm/programs/pairing/openvm_init.rs @@ -0,0 +1,3 @@ +// This file is automatically generated by cargo openvm. Do not rename or edit. +openvm_algebra_guest::moduli_macros::moduli_init! { "21888242871839275222246405745257275088696311157297823662689037894645226208583", "21888242871839275222246405745257275088548364400416034343698204186575808495617" } +openvm_algebra_guest::complex_macros::complex_init! { "Bn254Fp2" { mod_idx = 0 } } diff --git a/tests/openvm/programs/pairing/src/main.rs b/tests/openvm/programs/pairing/src/main.rs new file mode 100644 index 000000000..8f44f3c50 --- /dev/null +++ b/tests/openvm/programs/pairing/src/main.rs @@ -0,0 +1,26 @@ +#![no_std] +#![no_main] + +use openvm::io::read_vec; +use revm_precompile::bn128::{ + pair::{BYZANTIUM_PAIR_BASE, BYZANTIUM_PAIR_PER_POINT}, + run_pair, +}; + +openvm::init!(); + +openvm::entry!(main); + +pub fn main() { + let input = read_vec(); + let expected = read_vec(); + + let outcome = run_pair( + &input, + BYZANTIUM_PAIR_PER_POINT, + BYZANTIUM_PAIR_BASE, + 260_000, + ) + .unwrap(); + assert_eq!(outcome.bytes, expected); +} diff --git a/tests/openvm/programs/sha256/Cargo.toml b/tests/openvm/programs/sha256/Cargo.toml new file mode 100644 index 000000000..26de28f3e --- /dev/null +++ b/tests/openvm/programs/sha256/Cargo.toml @@ -0,0 +1,11 @@ +[workspace] +[package] +name = "sha256-program" +version = "0.1.0" +edition = "2021" + +[dependencies] +openvm = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } +revm-precompile = { path = "../../../../crates/precompile", default-features = false, features = [ + "openvm-sha2", +] } diff --git a/tests/openvm/programs/sha256/openvm.toml b/tests/openvm/programs/sha256/openvm.toml new file mode 100644 index 000000000..656bf5241 --- /dev/null +++ b/tests/openvm/programs/sha256/openvm.toml @@ -0,0 +1,4 @@ +[app_vm_config.rv32i] +[app_vm_config.rv32m] +[app_vm_config.io] +[app_vm_config.sha256] diff --git a/tests/openvm/programs/sha256/src/main.rs b/tests/openvm/programs/sha256/src/main.rs new file mode 100644 index 000000000..80b8acac3 --- /dev/null +++ b/tests/openvm/programs/sha256/src/main.rs @@ -0,0 +1,16 @@ +#![no_std] +#![no_main] + +extern crate alloc; + +use openvm::io::read_vec; +use revm_precompile::hash::sha256_run; +openvm::entry!(main); + +pub fn main() { + let input = read_vec(); + let expected = read_vec(); + + let outcome = sha256_run(&input, 260_000).unwrap(); + assert_eq!(outcome.bytes, expected); +} diff --git a/tests/openvm/src/ec_precompile.rs b/tests/openvm/src/ec_precompile.rs new file mode 100644 index 000000000..7e3037537 --- /dev/null +++ b/tests/openvm/src/ec_precompile.rs @@ -0,0 +1,114 @@ +use std::path::PathBuf; + +use openvm_build::GuestOptions; +use openvm_sdk::config::AppConfig; +use openvm_sdk::{config::SdkVmConfig, Sdk}; +use openvm_stark_sdk::openvm_stark_backend::p3_field::FieldAlgebra; +use openvm_stark_sdk::p3_baby_bear::BabyBear; +use primitives::hex; + +type F = BabyBear; + +// These tests should be run with --profile=ethtests for more compiler optimization + +// RUST_MIN_STACK=8388608 +#[test] +fn test_ec_pairing_precompile() -> eyre::Result<()> { + let app_config: AppConfig = + toml::from_str(include_str!("../programs/pairing/openvm.toml")).unwrap(); + let sdk = Sdk::new(app_config)?; + let guest_opts = GuestOptions::default(); + let mut pkg_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).to_path_buf(); + pkg_dir.push("programs/pairing"); + let elf = sdk.build(guest_opts.clone(), &pkg_dir, &None, None)?; + + let input = hex::decode( + "\ + 1c76476f4def4bb94541d57ebba1193381ffa7aa76ada664dd31c16024c43f59\ + 3034dd2920f673e204fee2811c678745fc819b55d3e9d294e45c9b03a76aef41\ + 209dd15ebff5d46c4bd888e51a93cf99a7329636c63514396b4a452003a35bf7\ + 04bf11ca01483bfa8b34b43561848d28905960114c8ac04049af4b6315a41678\ + 2bb8324af6cfc93537a2ad1a445cfd0ca2a71acd7ac41fadbf933c2a51be344d\ + 120a2a4cf30c1bf9845f20c6fe39e07ea2cce61f0c9bb048165fe5e4de877550\ + 111e129f1cf1097710d41c4ac70fcdfa5ba2023c6ff1cbeac322de49d1b6df7c\ + 2032c61a830e3c17286de9462bf242fca2883585b93870a73853face6a6bf411\ + 198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2\ + 1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed\ + 090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b\ + 12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa", + ) + .unwrap(); + let expected = + hex::decode("0000000000000000000000000000000000000000000000000000000000000001").unwrap(); + + let io = [input, expected] + .into_iter() + .map(|w| w.into_iter().map(F::from_canonical_u8).collect::>()) + .collect::>(); + sdk.app_prover(elf)?.prove(io.into())?; + Ok(()) +} + +#[test] +fn test_ec_add_precompile() -> eyre::Result<()> { + let app_config: AppConfig = + toml::from_str(include_str!("../programs/ec_add/openvm.toml")).unwrap(); + let sdk = Sdk::new(app_config)?; + let guest_opts = GuestOptions::default(); + let mut pkg_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).to_path_buf(); + pkg_dir.push("programs/ec_add"); + + let elf = sdk.build(guest_opts.clone(), &pkg_dir, &None, None)?; + + let input = hex::decode( + "\ + 18b18acfb4c2c30276db5411368e7185b311dd124691610c5d3b74034e093dc9\ + 063c909c4720840cb5134cb9f59fa749755796819658d32efc0d288198f37266\ + 07c2b7f58a84bd6145f00c9c2bc0bb1a187f20ff2c92963a88019e7c6a014eed\ + 06614e20c147e940f2d70da3f74c9a17df361706a4485c742bd6788478fa17d7", + )?; + let expected = hex::decode( + "\ + 2243525c5efd4b9c3d3c45ac0ca3fe4dd85e830a4ce6b65fa1eeaee202839703\ + 301d1d33be6da8e509df21cc35964723180eed7532537db9ae5e7d48f195c915", + )?; + + let io = [input, expected] + .into_iter() + .map(|w| w.into_iter().map(F::from_canonical_u8).collect::>()) + .collect::>(); + sdk.app_prover(elf)?.prove(io.into())?; + Ok(()) +} + +#[test] +fn test_ec_mul_precompile() -> eyre::Result<()> { + let app_config: AppConfig = + toml::from_str(include_str!("../programs/ec_mul/openvm.toml")).unwrap(); + let sdk = Sdk::new(app_config)?; + let guest_opts = GuestOptions::default(); + let mut pkg_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).to_path_buf(); + pkg_dir.push("programs/ec_mul"); + let elf = sdk.build(guest_opts.clone(), &pkg_dir, &None, None)?; + + let input = hex::decode( + "\ + 2bd3e6d0f3b142924f5ca7b49ce5b9d54c4703d7ae5648e61d02268b1a0a9fb7\ + 21611ce0a6af85915e2f1d70300909ce2e49dfad4a4619c8390cae66cefdb204\ + 00000000000000000000000000000000000000000000000011138ce750fa15c2", + ) + .unwrap(); + let expected = hex::decode( + "\ + 070a8d6a982153cae4be29d434e8faef8a47b274a053f5a4ee2a6c9c13c31e5c\ + 031b8ce914eba3a9ffb989f9cdd5b0f01943074bf4f0f315690ec3cec6981afc", + ) + .unwrap(); + + let io = [input, expected] + .into_iter() + .map(|w| w.into_iter().map(F::from_canonical_u8).collect::>()) + .collect::>(); + sdk.app_prover(elf)?.prove(io.into())?; + Ok(()) +} diff --git a/tests/openvm/src/ecrecover.rs b/tests/openvm/src/ecrecover.rs new file mode 100644 index 000000000..7543d4ebb --- /dev/null +++ b/tests/openvm/src/ecrecover.rs @@ -0,0 +1,55 @@ +use std::{path::PathBuf, thread::Builder}; + +use openvm_build::GuestOptions; +use openvm_sdk::config::AppConfig; +use openvm_sdk::StdIn; +use openvm_sdk::{config::SdkVmConfig, Sdk}; +use primitives::{hex, keccak256, Bytes, U256}; +use secp256k1::{Message, SecretKey, SECP256K1}; + +#[test] +fn test_ecrecover_precompile() -> eyre::Result<()> { + // Spawn thread with increased stack size + let handle = Builder::new() + .stack_size(8 * 1024 * 1024) // 8MB stack + .spawn(|| -> eyre::Result<()> { + let app_config: AppConfig = + toml::from_str(include_str!("../programs/ecrecover/openvm.toml")).unwrap(); + let sdk = Sdk::new(app_config)?; + let guest_opts = GuestOptions::default(); + let mut pkg_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).to_path_buf(); + pkg_dir.push("programs/ecrecover"); + + let elf = sdk.build(guest_opts.clone(), &pkg_dir, &None, None)?; + + // Generate secp256k1 signature + let data = hex::decode("1337133713371337").unwrap(); + let hash = keccak256(data); + let secret_key = SecretKey::new(&mut secp256k1::rand::rng()); + + let message = Message::from_digest_slice(&hash[..]).unwrap(); + let s = SECP256K1.sign_ecdsa_recoverable(message, &secret_key); + let (rec_id, data) = s.serialize_compact(); + let rec_id = i32::from(rec_id) as u8 + 27; + + let mut message_and_signature = [0u8; 128]; + message_and_signature[0..32].copy_from_slice(&hash[..]); + + // Fit signature into format the precompile expects + let rec_id = U256::from(rec_id as u64); + message_and_signature[32..64].copy_from_slice(&rec_id.to_be_bytes::<32>()); + message_and_signature[64..128].copy_from_slice(&data); + + let message_and_signature = Bytes::from(message_and_signature); + let public = SECP256K1.recover_ecdsa(message, &s).unwrap(); + let mut expected = keccak256(&public.serialize_uncompressed()[1..]); + expected[..12].fill(0); + let mut stdin = StdIn::default(); + stdin.write_bytes(expected.as_slice()); + stdin.write_bytes(&message_and_signature); + sdk.app_prover(elf)?.prove(stdin)?; + Ok(()) + })?; + + handle.join().unwrap() +} diff --git a/tests/openvm/src/kzg_precompile.rs b/tests/openvm/src/kzg_precompile.rs new file mode 100644 index 000000000..b3815a212 --- /dev/null +++ b/tests/openvm/src/kzg_precompile.rs @@ -0,0 +1,79 @@ +use std::path::PathBuf; + +use openvm_build::GuestOptions; +use openvm_circuit::openvm_stark_sdk::config::FriParameters; +use openvm_sdk::config::AppConfig; +use openvm_sdk::StdIn; +use openvm_sdk::{config::SdkVmConfig, Sdk}; +use primitives::eip4844::VERSIONED_HASH_VERSION_KZG; +use primitives::hex; +use sha2::{Digest, Sha256}; + +// These tests should be run with --profile=fast or --profile=ethtests for more compiler optimization + +#[test] +fn test_kzg_precompile_with_intrinsics() -> eyre::Result<()> { + let app_config: AppConfig = + toml::from_str(include_str!("../programs/kzg_point_evaluation/openvm.toml")).unwrap(); + let sdk = Sdk::new(app_config)?; + let guest_opts = GuestOptions::default().with_features(["use-intrinsics"]); + let mut pkg_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).to_path_buf(); + pkg_dir.push("programs/kzg_point_evaluation"); + + let elf = sdk.build(guest_opts, &pkg_dir, &None, None)?; + + // test data from: https://github.com/ethereum/c-kzg-4844/blob/main/tests/verify_kzg_proof/kzg-mainnet/verify_kzg_proof_case_correct_proof_31ebd010e6098750/data.yaml + + let commitment = hex!("8f59a8d2a1a625a17f3fea0fe5eb8c896db3764f3185481bc22f91b4aaffcca25f26936857bc3a7c2539ea8ec3a952b7").to_vec(); + let mut versioned_hash = Sha256::digest(&commitment).to_vec(); + versioned_hash[0] = VERSIONED_HASH_VERSION_KZG; + let z = hex!("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000").to_vec(); + let y = hex!("1522a4a7f34e1ea350ae07c29c96c7e79655aa926122e95fe69fcbd932ca49e9").to_vec(); + let proof = hex!("a62ad71d14c5719385c0686f1871430475bf3a00f0aa3f7b8dd99a9abc2160744faf0070725e00b60ad9a026a15b1a8c").to_vec(); + + let input = [versioned_hash, z, y, commitment, proof].concat(); + + let expected_output = hex!("000000000000000000000000000000000000000000000000000000000000100073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001"); + + let mut io = StdIn::default(); + io.write_bytes(&input); + io.write_bytes(&expected_output); + sdk.app_prover(elf)?.prove(io)?; + Ok(()) +} + +#[test] +#[ignore] +fn test_kzg_precompile_without_intrinsics() -> eyre::Result<()> { + let vm_config = SdkVmConfig::builder() + .system(Default::default()) + .rv32i(Default::default()) + .rv32m(Default::default()) + .io(Default::default()) + .keccak(Default::default()) + .build() + .optimize(); + let sdk = Sdk::new(AppConfig::new(FriParameters::new_for_testing(1), vm_config))?; + let guest_opts = GuestOptions::default(); + let mut pkg_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).to_path_buf(); + pkg_dir.push("programs/kzg_point_evaluation"); + let elf = sdk.build(guest_opts, &pkg_dir, &None, None)?; + + // test data from: https://github.com/ethereum/c-kzg-4844/blob/main/tests/verify_kzg_proof/kzg-mainnet/verify_kzg_proof_case_correct_proof_31ebd010e6098750/data.yaml + let commitment = hex!("8f59a8d2a1a625a17f3fea0fe5eb8c896db3764f3185481bc22f91b4aaffcca25f26936857bc3a7c2539ea8ec3a952b7").to_vec(); + let mut versioned_hash = Sha256::digest(&commitment).to_vec(); + versioned_hash[0] = VERSIONED_HASH_VERSION_KZG; + let z = hex!("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000").to_vec(); + let y = hex!("1522a4a7f34e1ea350ae07c29c96c7e79655aa926122e95fe69fcbd932ca49e9").to_vec(); + let proof = hex!("a62ad71d14c5719385c0686f1871430475bf3a00f0aa3f7b8dd99a9abc2160744faf0070725e00b60ad9a026a15b1a8c").to_vec(); + + let input = [versioned_hash, z, y, commitment, proof].concat(); + + let expected_output = hex!("000000000000000000000000000000000000000000000000000000000000100073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001"); + + let mut io = StdIn::default(); + io.write_bytes(&input); + io.write_bytes(&expected_output); + sdk.app_prover(elf)?.prove(io)?; + Ok(()) +} diff --git a/tests/openvm/src/lib.rs b/tests/openvm/src/lib.rs new file mode 100644 index 000000000..3518bcc26 --- /dev/null +++ b/tests/openvm/src/lib.rs @@ -0,0 +1,8 @@ +#[cfg(test)] +pub mod ec_precompile; +#[cfg(test)] +pub mod ecrecover; +#[cfg(test)] +pub mod kzg_precompile; +#[cfg(test)] +pub mod sha256_precompile; diff --git a/tests/openvm/src/sha256_precompile.rs b/tests/openvm/src/sha256_precompile.rs new file mode 100644 index 000000000..7478bbee8 --- /dev/null +++ b/tests/openvm/src/sha256_precompile.rs @@ -0,0 +1,48 @@ +use std::path::PathBuf; + +use openvm_build::GuestOptions; +use openvm_sdk::{ + config::{AppConfig, SdkVmConfig}, + Sdk, +}; +use openvm_stark_sdk::openvm_stark_backend::p3_field::FieldAlgebra; +use openvm_stark_sdk::p3_baby_bear::BabyBear; +use primitives::hex; + +type F = BabyBear; + +#[test] +fn test_sha256_precompile() -> eyre::Result<()> { + let app_config: AppConfig = + toml::from_str(include_str!("../programs/sha256/openvm.toml"))?; + let sdk = Sdk::new(app_config)?; + let guest_opts = GuestOptions::default(); + let mut pkg_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).to_path_buf(); + pkg_dir.push("programs/sha256"); + let elf = sdk.build(guest_opts.clone(), &pkg_dir, &None, None)?; + + let input = hex::decode( + "\ + 1c76476f4def4bb94541d57ebba1193381ffa7aa76ada664dd31c16024c43f59\ + 3034dd2920f673e204fee2811c678745fc819b55d3e9d294e45c9b03a76aef41\ + 209dd15ebff5d46c4bd888e51a93cf99a7329636c63514396b4a452003a35bf7\ + 04bf11ca01483bfa8b34b43561848d28905960114c8ac04049af4b6315a41678\ + 2bb8324af6cfc93537a2ad1a445cfd0ca2a71acd7ac41fadbf933c2a51be344d\ + 120a2a4cf30c1bf9845f20c6fe39e07ea2cce61f0c9bb048165fe5e4de877550\ + 111e129f1cf1097710d41c4ac70fcdfa5ba2023c6ff1cbeac322de49d1b6df7c\ + 2032c61a830e3c17286de9462bf242fca2883585b93870a73853face6a6bf411\ + 198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2\ + 1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed\ + 090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b\ + 12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa", + ) + .unwrap(); + let expected = hex::decode("5f4e768d9faaf07a8c7264b937d60ff0b2fd52458e60a235f79c54bea68979dc")?; + + let io = [input, expected] + .into_iter() + .map(|w| w.into_iter().map(F::from_canonical_u8).collect::>()) + .collect::>(); + sdk.app_prover(elf)?.prove(io.into())?; + Ok(()) +}