diff --git a/.github/workflows/docker-publish-gnark.yml b/.github/workflows/docker-publish-gnark.yml index 34be51d005..5386c91107 100644 --- a/.github/workflows/docker-publish-gnark.yml +++ b/.github/workflows/docker-publish-gnark.yml @@ -1,4 +1,3 @@ -# Source: https://raw.githubusercontent.com/foundry-rs/foundry/master/.github/workflows/docker-publish.yml name: docker-gnark on: @@ -7,7 +6,6 @@ on: - "v*.*.*" schedule: - cron: "0 0 * * *" - # Trigger without any parameters a proactive rebuild workflow_dispatch: inputs: tags: @@ -20,83 +18,85 @@ env: IMAGE_NAME: succinctlabs/sp1-gnark jobs: - container: - runs-on: ubuntu-latest - # https://docs.github.com/en/actions/reference/authentication-in-a-workflow + build-amd64: + runs-on: [runs-on, runner=64cpu-linux-x64, spot=false, "run-id=${{ github.run_id }}"] permissions: id-token: write packages: write contents: read - timeout-minutes: 120 steps: - name: Checkout repository - id: checkout uses: actions/checkout@v4 - - - name: Install Docker BuildX + - name: Set up Docker BuildX uses: docker/setup-buildx-action@v3 - id: buildx + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v3 with: - install: true + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push AMD64 image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile.gnark-ffi + platforms: linux/amd64 + push: true + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 + cache-from: type=gha + cache-to: type=gha,mode=max - # Login against a Docker registry except on PR - # https://github.com/docker/login-action + build-arm64: + runs-on: [runs-on, runner=64cpu-linux-arm64, spot=false, "run-id=${{ github.run_id }}"] + permissions: + id-token: write + packages: write + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 - name: Log into registry ${{ env.REGISTRY }} - # Ensure this doesn't trigger on PR's - if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v5 + - name: Build and push ARM64 image + uses: docker/build-push-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + context: . + file: ./Dockerfile.gnark-ffi + platforms: linux/arm64 + push: true + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64 + cache-from: type=gha + cache-to: type=gha,mode=max - # Creates an additional 'latest' or 'nightly' tag - # If the job is triggered via cron schedule, tag nightly and nightly-{SHA} - # If the job is triggered via workflow dispatch and on a master branch, tag branch and latest - # Otherwise, just tag as the branch name - - name: Finalize Docker Metadata - id: docker_tagging + create-manifest: + needs: [build-amd64, build-arm64] + runs-on: ubuntu-latest + steps: + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Create and push manifest run: | + TAGS="" if [[ "${{ github.event_name }}" == 'workflow_dispatch' ]]; then - echo "manual trigger from workflow_dispatch, assigning tag ${{ github.event.inputs.tags }}" - echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tags }}" >> $GITHUB_OUTPUT + TAGS="${{ github.event.inputs.tags }}" elif [[ "${{ github.event_name }}" == 'schedule' ]]; then - echo "cron trigger, assigning nightly tag" - echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT + TAGS="nightly nightly-${{ github.sha }}" else - echo "Neither scheduled nor manual release from main branch. Just tagging as branch name" - echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF##*/}" >> $GITHUB_OUTPUT + TAGS="${GITHUB_REF##*/}" fi - - # Log docker metadata to explicitly know what is being pushed - - name: Inspect Docker Metadata - run: | - echo "TAGS -> ${{ steps.docker_tagging.outputs.docker_tags }}" - echo "LABELS -> ${{ steps.meta.outputs.labels }}" - - # Build and push Docker image - # https://github.com/docker/build-push-action - # https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile.gnark-ffi - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.docker_tagging.outputs.docker_tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - build-args: | - BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }} - VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} - REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }} + + for TAG in $TAGS; do + docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$TAG \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64 + done \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 251c44d529..2afe4bdb4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - main + - tamir/v1.3.0-rc2 paths: - "crates/**" - "Cargo.toml" diff --git a/.github/workflows/suite.yml b/.github/workflows/suite.yml index a394243103..4ff3e7fd15 100644 --- a/.github/workflows/suite.yml +++ b/.github/workflows/suite.yml @@ -138,4 +138,4 @@ jobs: RUST_BACKTRACE: 1 SP1_PROVER: network SP1_PRIVATE_KEY: ${{ secrets.SP1_PRIVATE_KEY }} - PROVER_NETWORK_RPC: https://rpc-staging.succinct.xyz \ No newline at end of file + PROVER_NETWORK_RPC: https://rpc-taiko.succinct.xyz \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 877a0f70d9..cc4e0300cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,9 +25,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -130,6 +130,107 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "alloy-consensus" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "629b62e38d471cc15fea534eb7283d2f8a4e8bdb1811bcc5d66dda6cfce6fae1" +dependencies = [ + "alloy-eips", + "alloy-primitives 0.8.7", + "alloy-rlp", + "alloy-serde", + "c-kzg", + "serde", +] + +[[package]] +name = "alloy-eip2930" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" +dependencies = [ + "alloy-primitives 0.8.7", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-eip7702" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea59dc42102bc9a1905dc57901edc6dd48b9f38115df86c7d252acba70d71d04" +dependencies = [ + "alloy-primitives 0.8.7", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-eips" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f923dd5fca5f67a43d81ed3ebad0880bd41f6dd0ada930030353ac356c54cd0f" +dependencies = [ + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives 0.8.7", + "alloy-rlp", + "alloy-serde", + "c-kzg", + "derive_more 1.0.0", + "once_cell", + "serde", + "sha2 0.10.8", +] + +[[package]] +name = "alloy-json-rpc" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3c717b5298fad078cd3a418335b266eba91b511383ca9bd497f742d5975d5ab" +dependencies = [ + "alloy-primitives 0.8.7", + "alloy-sol-types 0.8.7", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "alloy-network" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb3705ce7d8602132bcf5ac7a1dd293a42adc2f183abf5907c30ac535ceca049" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network-primitives", + "alloy-primitives 0.8.7", + "alloy-rpc-types-eth", + "alloy-serde", + "alloy-signer", + "alloy-sol-types 0.8.7", + "async-trait", + "auto_impl", + "futures-utils-wasm", + "thiserror", +] + +[[package]] +name = "alloy-network-primitives" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94ad40869867ed2d9cd3842b1e800889e5b49e6b92da346e93862b4a741bedf3" +dependencies = [ + "alloy-eips", + "alloy-primitives 0.8.7", + "alloy-serde", + "serde", +] + [[package]] name = "alloy-primitives" version = "0.7.7" @@ -140,7 +241,7 @@ dependencies = [ "bytes 1.7.2", "cfg-if", "const-hex", - "derive_more", + "derive_more 0.99.18", "hex-literal", "itoa", "k256", @@ -152,45 +253,179 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "alloy-primitives" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb848c43f6b06ae3de2e4a67496cbbabd78ae87db0f1248934f15d76192c6a" +dependencies = [ + "alloy-rlp", + "bytes 1.7.2", + "cfg-if", + "const-hex", + "derive_more 1.0.0", + "foldhash", + "hashbrown 0.15.0", + "hex-literal", + "indexmap 2.6.0", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.8.5", + "ruint", + "rustc-hash 2.0.0", + "serde", + "sha3", + "tiny-keccak", +] + [[package]] name = "alloy-rlp" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ + "alloy-rlp-derive", "arrayvec", "bytes 1.7.2", ] +[[package]] +name = "alloy-rlp-derive" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "alloy-rpc-types-eth" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83aa984386deda02482660aa31cb8ca1e63d533f1c31a52d7d181ac5ec68e9b8" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-network-primitives", + "alloy-primitives 0.8.7", + "alloy-rlp", + "alloy-serde", + "alloy-sol-types 0.8.7", + "cfg-if", + "derive_more 1.0.0", + "hashbrown 0.14.5", + "itertools 0.13.0", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "731f75ec5d383107fd745d781619bd9cedf145836c51ecb991623d41278e71fa" +dependencies = [ + "alloy-primitives 0.8.7", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-signer" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "307324cca94354cd654d6713629f0383ec037e1ff9e3e3d547212471209860c0" +dependencies = [ + "alloy-primitives 0.8.7", + "async-trait", + "auto_impl", + "elliptic-curve 0.13.8", + "k256", + "thiserror", +] + +[[package]] +name = "alloy-signer-local" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fabe917ab1778e760b4701628d1cae8e028ee9d52ac6307de4e1e9286ab6b5f" +dependencies = [ + "alloy-consensus", + "alloy-network", + "alloy-primitives 0.8.7", + "alloy-signer", + "async-trait", + "k256", + "rand 0.8.5", + "thiserror", +] + [[package]] name = "alloy-sol-macro" version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", + "alloy-sol-macro-expander 0.7.7", + "alloy-sol-macro-input 0.7.7", "proc-macro-error", "proc-macro2", "quote", "syn 2.0.79", ] +[[package]] +name = "alloy-sol-macro" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "661c516eb1fa3294cc7f2fb8955b3b609d639c282ac81a4eedb14d3046db503a" +dependencies = [ + "alloy-sol-macro-expander 0.8.7", + "alloy-sol-macro-input 0.8.7", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "alloy-sol-macro-expander" version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" dependencies = [ - "alloy-sol-macro-input", + "alloy-sol-macro-input 0.7.7", "const-hex", "heck", - "indexmap", + "indexmap 2.6.0", "proc-macro-error", "proc-macro2", "quote", "syn 2.0.79", - "syn-solidity", + "syn-solidity 0.7.7", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecbabb8fc3d75a0c2cea5215be22e7a267e3efde835b0f2a8922f5e3f5d47683" +dependencies = [ + "alloy-sol-macro-input 0.8.7", + "const-hex", + "heck", + "indexmap 2.6.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.79", + "syn-solidity 0.8.7", "tiny-keccak", ] @@ -206,7 +441,22 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.79", - "syn-solidity", + "syn-solidity 0.7.7", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16517f2af03064485150d89746b8ffdcdbc9b6eeb3d536fb66efd7c2846fbc75" +dependencies = [ + "const-hex", + "dunce", + "heck", + "proc-macro2", + "quote", + "syn 2.0.79", + "syn-solidity 0.8.7", ] [[package]] @@ -215,12 +465,23 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" dependencies = [ - "alloy-primitives", - "alloy-sol-macro", + "alloy-primitives 0.7.7", + "alloy-sol-macro 0.7.7", "const-hex", "serde", ] +[[package]] +name = "alloy-sol-types" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e448d879903624863f608c552d10efb0e0905ddbee98b0049412799911eb062" +dependencies = [ + "alloy-primitives 0.8.7", + "alloy-sol-macro 0.8.7", + "const-hex", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -564,81 +825,478 @@ dependencies = [ ] [[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - -[[package]] -name = "async-tls" -version = "0.11.0" +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-tls" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f23d769dbf1838d5df5156e7b1ad404f4c463d1ac2c6aeb6cd943630f8a8400" +dependencies = [ + "futures-core", + "futures-io", + "rustls 0.19.1", + "webpki", + "webpki-roots 0.21.1", +] + +[[package]] +name = "async-trait" +version = "0.1.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "async-tungstenite" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6acf7e4a267eecbb127ed696bb2d50572c22ba7f586a646321e1798d8336a1" +dependencies = [ + "futures-io", + "futures-util", + "log", + "pin-project-lite", + "tungstenite", +] + +[[package]] +name = "async_io_stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +dependencies = [ + "futures", + "pharos", + "rustc_version 0.4.1", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "auto_impl" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "aws-config" +version = "1.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7198e6f03240fdceba36656d8be440297b6b82270325908c7381f37d826a74f6" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-sdk-sso", + "aws-sdk-ssooidc", + "aws-sdk-sts", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes 1.7.2", + "fastrand 2.1.1", + "hex", + "http 0.2.12", + "ring 0.17.8", + "time 0.3.36", + "tokio", + "tracing", + "url", + "zeroize", +] + +[[package]] +name = "aws-credential-types" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e8f6b615cb5fc60a98132268508ad104310f0cfb25a1c22eee76efdf9154da" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "zeroize", +] + +[[package]] +name = "aws-runtime" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a10d5c055aa540164d9561a0e2e74ad30f0dcf7393c3a92f6733ddf9c5762468" +dependencies = [ + "aws-credential-types", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes 1.7.2", + "fastrand 2.1.1", + "http 0.2.12", + "http-body 0.4.6", + "once_cell", + "percent-encoding", + "pin-project-lite", + "tracing", + "uuid 1.10.0", +] + +[[package]] +name = "aws-sdk-s3" +version = "1.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2f2a62020f3e06f9b352b2a23547f6e1d110b6bf1e18a6b588ae36114eaf6e2" +dependencies = [ + "ahash", + "aws-credential-types", + "aws-runtime", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-checksums", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "bytes 1.7.2", + "fastrand 2.1.1", + "hex", + "hmac 0.12.1", + "http 0.2.12", + "http-body 0.4.6", + "lru", + "once_cell", + "percent-encoding", + "regex-lite", + "sha2 0.10.8", + "tracing", + "url", +] + +[[package]] +name = "aws-sdk-sso" +version = "1.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33ae899566f3d395cbf42858e433930682cc9c1889fa89318896082fef45efb" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes 1.7.2", + "http 0.2.12", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-ssooidc" +version = "1.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f39c09e199ebd96b9f860b0fce4b6625f211e064ad7c8693b72ecf7ef03881e0" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes 1.7.2", + "http 0.2.12", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-sts" +version = "1.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d95f93a98130389eb6233b9d615249e543f6c24a68ca1f109af9ca5164a8765" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-query", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "http 0.2.12", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sigv4" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc8db6904450bafe7473c6ca9123f88cc11089e41a025408f992db4e22d3be68" +dependencies = [ + "aws-credential-types", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes 1.7.2", + "crypto-bigint 0.5.5", + "form_urlencoded", + "hex", + "hmac 0.12.1", + "http 0.2.12", + "http 1.1.0", + "once_cell", + "p256", + "percent-encoding", + "ring 0.17.8", + "sha2 0.10.8", + "subtle", + "time 0.3.36", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-smithy-async" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62220bc6e97f946ddd51b5f1361f78996e704677afc518a4ff66b7a72ea1378c" +dependencies = [ + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "aws-smithy-checksums" +version = "0.60.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598b1689d001c4d4dc3cb386adb07d37786783aee3ac4b324bcadac116bf3d23" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "bytes 1.7.2", + "crc32c", + "crc32fast", + "hex", + "http 0.2.12", + "http-body 0.4.6", + "md-5", + "pin-project-lite", + "sha1 0.10.6", + "sha2 0.10.8", + "tracing", +] + +[[package]] +name = "aws-smithy-eventstream" +version = "0.60.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cef7d0a272725f87e51ba2bf89f8c21e4df61b9e49ae1ac367a6d69916ef7c90" +dependencies = [ + "aws-smithy-types", + "bytes 1.7.2", + "crc32fast", +] + +[[package]] +name = "aws-smithy-http" +version = "0.60.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8bc3e8fdc6b8d07d976e301c02fe553f72a39b7a9fea820e023268467d7ab6" +dependencies = [ + "aws-smithy-eventstream", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes 1.7.2", + "bytes-utils", + "futures-core", + "http 0.2.12", + "http-body 0.4.6", + "once_cell", + "percent-encoding", + "pin-project-lite", + "pin-utils", + "tracing", +] + +[[package]] +name = "aws-smithy-json" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f23d769dbf1838d5df5156e7b1ad404f4c463d1ac2c6aeb6cd943630f8a8400" +checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" dependencies = [ - "futures-core", - "futures-io", - "rustls 0.19.1", - "webpki", - "webpki-roots 0.21.1", + "aws-smithy-types", ] [[package]] -name = "async-trait" -version = "0.1.83" +name = "aws-smithy-query" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "f2fbd61ceb3fe8a1cb7352e42689cec5335833cd9f94103a61e98f9bb61c64bb" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", + "aws-smithy-types", + "urlencoding", ] [[package]] -name = "async-tungstenite" -version = "0.19.0" +name = "aws-smithy-runtime" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6acf7e4a267eecbb127ed696bb2d50572c22ba7f586a646321e1798d8336a1" +checksum = "a065c0fe6fdbdf9f11817eb68582b2ab4aff9e9c39e986ae48f7ec576c6322db" dependencies = [ - "futures-io", - "futures-util", - "log", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes 1.7.2", + "fastrand 2.1.1", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "http-body 1.0.1", + "httparse", + "hyper 0.14.30", + "hyper-rustls 0.24.2", + "once_cell", "pin-project-lite", - "tungstenite", + "pin-utils", + "rustls 0.21.12", + "tokio", + "tracing", ] [[package]] -name = "async_io_stream" -version = "0.3.3" +name = "aws-smithy-runtime-api" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +checksum = "e086682a53d3aa241192aa110fa8dfce98f2f5ac2ead0de84d41582c7e8fdb96" dependencies = [ - "futures", - "pharos", - "rustc_version 0.4.1", + "aws-smithy-async", + "aws-smithy-types", + "bytes 1.7.2", + "http 0.2.12", + "http 1.1.0", + "pin-project-lite", + "tokio", + "tracing", + "zeroize", ] [[package]] -name = "atomic-waker" -version = "1.1.2" +name = "aws-smithy-types" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +checksum = "147100a7bea70fa20ef224a6bad700358305f5dc0f84649c53769761395b355b" +dependencies = [ + "base64-simd", + "bytes 1.7.2", + "bytes-utils", + "futures-core", + "http 0.2.12", + "http 1.1.0", + "http-body 0.4.6", + "http-body 1.0.1", + "http-body-util", + "itoa", + "num-integer", + "pin-project-lite", + "pin-utils", + "ryu", + "serde", + "time 0.3.36", + "tokio", + "tokio-util", +] [[package]] -name = "auto_impl" -version = "1.2.0" +name = "aws-smithy-xml" +version = "0.60.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "ab0b0166827aa700d3dc519f72f8b3a91c35d0b8d042dc5d643a91e6f80648fc" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", + "xmlparser", ] [[package]] -name = "autocfg" -version = "1.4.0" +name = "aws-types" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "5221b91b3e441e6675310829fd8984801b772cb1546ef6c0e54dec9f1ac13fef" +dependencies = [ + "aws-credential-types", + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "rustc_version 0.4.1", + "tracing", +] [[package]] name = "axum" @@ -668,7 +1326,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 1.0.1", "tokio", - "tower", + "tower 0.5.1", "tower-layer", "tower-service", "tracing", @@ -723,6 +1381,12 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base16ct" version = "0.2.0" @@ -747,6 +1411,16 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" +dependencies = [ + "outref", + "vsimd", +] + [[package]] name = "base64ct" version = "1.6.0" @@ -770,9 +1444,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.69.4" +version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ "bitflags 2.6.0", "cexpr", @@ -907,6 +1581,18 @@ dependencies = [ "subtle", ] +[[package]] +name = "blst" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + [[package]] name = "bs58" version = "0.5.1" @@ -956,6 +1642,31 @@ dependencies = [ "serde", ] +[[package]] +name = "bytes-utils" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" +dependencies = [ + "bytes 1.7.2", + "either", +] + +[[package]] +name = "c-kzg" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" +dependencies = [ + "blst", + "cc", + "glob", + "hex", + "libc", + "once_cell", + "serde", +] + [[package]] name = "camino" version = "1.1.9" @@ -996,9 +1707,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.24" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ "jobserver", "libc", @@ -1097,9 +1808,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -1107,9 +1818,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -1300,6 +2011,24 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" +[[package]] +name = "crc32c" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a47af21622d091a8f0fb295b88bc886ac74efcc613efc19f5d0b21de5c89e47" +dependencies = [ + "rustc_version 0.4.1", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + [[package]] name = "criterion" version = "0.5.1" @@ -1367,6 +2096,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1618,6 +2359,16 @@ dependencies = [ "rustversion", ] +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "der" version = "0.7.9" @@ -1661,6 +2412,27 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[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.79", + "unicode-xid", +] + [[package]] name = "digest" version = "0.9.0" @@ -1742,18 +2514,30 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der", + "der 0.7.9", "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", - "spki", + "elliptic-curve 0.13.8", + "rfc6979 0.4.0", + "signature 2.2.0", + "spki 0.7.3", ] [[package]] @@ -1768,21 +2552,41 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array 0.14.7", + "group 0.12.1", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sec1 0.3.0", + "subtle", + "zeroize", +] + [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct", - "crypto-bigint", + "base16ct 0.2.0", + "crypto-bigint 0.5.5", "digest 0.10.7", "ff 0.13.0", "generic-array 0.14.7", "group 0.13.0", - "pkcs8", + "pkcs8 0.10.2", "rand_core 0.6.4", - "sec1", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -1882,7 +2686,7 @@ dependencies = [ "sha2 0.10.8", "sha3", "thiserror", - "uuid", + "uuid 0.8.2", ] [[package]] @@ -2027,7 +2831,7 @@ dependencies = [ "cargo_metadata", "chrono", "const-hex", - "elliptic-curve", + "elliptic-curve 0.13.8", "ethabi", "generic-array 0.14.7", "k256", @@ -2118,7 +2922,7 @@ dependencies = [ "coins-bip32", "coins-bip39", "const-hex", - "elliptic-curve", + "elliptic-curve 0.13.8", "eth-keystore", "ethers-core", "rand 0.8.5", @@ -2271,6 +3075,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -2303,9 +3113,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -2318,9 +3128,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -2328,15 +3138,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -2345,9 +3155,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -2389,9 +3199,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -2400,15 +3210,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" @@ -2422,9 +3232,9 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -2438,6 +3248,12 @@ dependencies = [ "slab", ] +[[package]] +name = "futures-utils-wasm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" + [[package]] name = "fxhash" version = "0.2.1" @@ -2508,9 +3324,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git2" @@ -2611,7 +3427,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -2630,7 +3446,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -2670,6 +3486,12 @@ dependencies = [ "rayon", ] +[[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" @@ -2686,6 +3508,12 @@ name = "hashbrown" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", + "serde", +] [[package]] name = "hashers" @@ -2719,6 +3547,9 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hex-literal" @@ -2913,6 +3744,22 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.30", + "log", + "rustls 0.21.12", + "rustls-native-certs 0.6.3", + "tokio", + "tokio-rustls 0.24.1", +] + [[package]] name = "hyper-rustls" version = "0.27.3" @@ -2923,14 +3770,27 @@ dependencies = [ "http 1.1.0", "hyper 1.4.1", "hyper-util", - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.0", "tower-service", "webpki-roots 0.26.6", ] +[[package]] +name = "hyper-timeout" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" +dependencies = [ + "hyper 1.4.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -3060,7 +3920,17 @@ dependencies = [ name = "indenter" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] [[package]] name = "indexmap" @@ -3070,6 +3940,7 @@ checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", "hashbrown 0.15.0", + "serde", ] [[package]] @@ -3199,9 +4070,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "0cb94a0ffd3f3ee755c20f7d8752f45cac88605a4dcf808abcff72873296ec7b" dependencies = [ "wasm-bindgen", ] @@ -3241,11 +4112,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "once_cell", "sha2 0.10.8", - "signature", + "signature 2.2.0", ] [[package]] @@ -3384,11 +4255,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -3406,6 +4277,16 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", +] + [[package]] name = "memchr" version = "2.7.4" @@ -3708,21 +4589,18 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" @@ -3811,12 +4689,29 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "outref" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" + [[package]] name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", +] + [[package]] name = "p3-air" version = "0.1.4-succinct" @@ -4228,7 +5123,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 2.6.0", ] [[package]] @@ -4243,18 +5138,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", @@ -4284,14 +5179,24 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", +] + [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.9", + "spki 0.7.3", ] [[package]] @@ -4462,6 +5367,28 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "proc-macro-hack" version = "0.5.20+deprecated" @@ -4470,9 +5397,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -4567,7 +5494,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.13", + "rustls 0.23.14", "socket2", "thiserror", "tokio", @@ -4584,7 +5511,7 @@ dependencies = [ "rand 0.8.5", "ring 0.17.8", "rustc-hash 2.0.0", - "rustls 0.23.13", + "rustls 0.23.14", "slab", "thiserror", "tinyvec", @@ -4641,6 +5568,7 @@ dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.4", + "serde", ] [[package]] @@ -4780,6 +5708,12 @@ dependencies = [ "regex-syntax 0.8.5", ] +[[package]] +name = "regex-lite" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" + [[package]] name = "regex-syntax" version = "0.6.29" @@ -4848,7 +5782,7 @@ dependencies = [ "http-body 1.0.1", "http-body-util", "hyper 1.4.1", - "hyper-rustls", + "hyper-rustls 0.27.3", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -4860,7 +5794,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", @@ -4870,7 +5804,7 @@ dependencies = [ "system-configuration 0.6.1", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.26.0", "tokio-util", "tower-service", "url", @@ -4897,6 +5831,17 @@ dependencies = [ "tower-service", ] +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac 0.12.1", + "zeroize", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -5094,24 +6039,62 @@ dependencies = [ "base64 0.13.1", "log", "ring 0.16.20", - "sct", + "sct 0.6.1", "webpki", ] [[package]] name = "rustls" -version = "0.23.13" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-webpki 0.101.7", + "sct 0.7.1", +] + +[[package]] +name = "rustls" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ + "log", "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.2.0", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -5136,6 +6119,16 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + [[package]] name = "rustls-webpki" version = "0.102.8" @@ -5196,7 +6189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "cfg-if", - "derive_more", + "derive_more 0.99.18", "parity-scale-codec", "scale-info-derive", ] @@ -5224,9 +6217,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] @@ -5279,22 +6272,46 @@ dependencies = [ "untrusted 0.7.1", ] +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + [[package]] name = "sdd" version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a7b59a5d9b0099720b417b6325d91a52cbf5b3dcb5041d864be53eefa58abc" +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct 0.1.1", + "der 0.6.1", + "generic-array 0.14.7", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct", - "der", + "base16ct 0.2.0", + "der 0.7.9", "generic-array 0.14.7", - "pkcs8", + "pkcs8 0.10.2", "subtle", "zeroize", ] @@ -5591,6 +6608,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + [[package]] name = "signature" version = "2.2.0" @@ -5693,7 +6720,7 @@ dependencies = [ [[package]] name = "sp1-build" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "anyhow", "cargo_metadata", @@ -5704,7 +6731,7 @@ dependencies = [ [[package]] name = "sp1-cli" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "anstyle", "anyhow", @@ -5732,7 +6759,7 @@ dependencies = [ [[package]] name = "sp1-core-executor" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "bincode", "bytemuck", @@ -5766,12 +6793,12 @@ dependencies = [ [[package]] name = "sp1-core-machine" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "bincode", "cfg-if", "criterion", - "elliptic-curve", + "elliptic-curve 0.13.8", "generic-array 1.1.0", "hashbrown 0.14.5", "hex", @@ -5815,7 +6842,7 @@ dependencies = [ [[package]] name = "sp1-cuda" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "bincode", "ctrlc", @@ -5832,12 +6859,12 @@ dependencies = [ [[package]] name = "sp1-curves" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "cfg-if", "curve25519-dalek", "dashu", - "elliptic-curve", + "elliptic-curve 0.13.8", "generic-array 1.1.0", "itertools 0.13.0", "k256", @@ -5854,7 +6881,7 @@ dependencies = [ [[package]] name = "sp1-derive" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "quote", "syn 1.0.109", @@ -5862,7 +6889,7 @@ dependencies = [ [[package]] name = "sp1-eval" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "anyhow", "bincode", @@ -5882,14 +6909,14 @@ dependencies = [ [[package]] name = "sp1-helper" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "sp1-build", ] [[package]] name = "sp1-lib" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "bincode", "serde", @@ -5897,7 +6924,7 @@ dependencies = [ [[package]] name = "sp1-perf" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "anyhow", "bincode", @@ -5918,7 +6945,7 @@ dependencies = [ [[package]] name = "sp1-primitives" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "bincode", "hex", @@ -5934,7 +6961,7 @@ dependencies = [ [[package]] name = "sp1-prover" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "anyhow", "bincode", @@ -5974,7 +7001,7 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "ff 0.13.0", "hashbrown 0.14.5", @@ -6010,7 +7037,7 @@ dependencies = [ [[package]] name = "sp1-recursion-compiler" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "backtrace", "criterion", @@ -6035,7 +7062,7 @@ dependencies = [ [[package]] name = "sp1-recursion-core" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "backtrace", "ff 0.13.0", @@ -6070,7 +7097,7 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "quote", "syn 1.0.109", @@ -6078,7 +7105,7 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-cli" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "bincode", "clap", @@ -6087,7 +7114,7 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-ffi" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "anyhow", "bincode", @@ -6111,11 +7138,16 @@ dependencies = [ [[package]] name = "sp1-sdk" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ - "alloy-sol-types", + "alloy-primitives 0.8.7", + "alloy-signer", + "alloy-signer-local", + "alloy-sol-types 0.7.7", "anyhow", "async-trait", + "aws-config", + "aws-sdk-s3", "bincode", "cfg-if", "dirs", @@ -6144,6 +7176,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", + "tonic", "tracing", "twirp-rs", "vergen", @@ -6151,7 +7184,7 @@ dependencies = [ [[package]] name = "sp1-stark" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "arrayref", "getrandom 0.2.15", @@ -6186,7 +7219,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "2.0.0" +version = "3.0.0-rc3" dependencies = [ "cfg-if", "getrandom 0.2.15", @@ -6221,6 +7254,16 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + [[package]] name = "spki" version = "0.7.3" @@ -6228,7 +7271,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der", + "der 0.7.9", ] [[package]] @@ -6401,6 +7444,18 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "syn-solidity" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20e7b52ad118b2153644eea95c6fc740b6c1555b2344fdab763fc9de4075f665" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -6550,6 +7605,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "time" version = "0.2.27" @@ -6694,17 +7758,38 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pki-types", "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.12" @@ -6745,7 +7830,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap", + "indexmap 2.6.0", "toml_datetime", "winnow 0.5.40", ] @@ -6756,13 +7841,66 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", "winnow 0.6.20", ] +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.22.1", + "bytes 1.7.2", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost", + "rustls-native-certs 0.8.0", + "rustls-pemfile 2.2.0", + "socket2", + "tokio", + "tokio-rustls 0.26.0", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower" version = "0.5.1" @@ -6928,7 +8066,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tower", + "tower 0.5.1", "url", ] @@ -7044,6 +8182,12 @@ dependencies = [ "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "utf-8" version = "0.7.6" @@ -7066,6 +8210,12 @@ dependencies = [ "serde", ] +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" + [[package]] name = "valuable" version = "0.1.0" @@ -7112,6 +8262,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + [[package]] name = "wait-timeout" version = "0.2.0" @@ -7160,9 +8316,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "ef073ced962d62984fb38a36e5fdc1a2b23c9e0e1fa0689bb97afa4202ef6887" dependencies = [ "cfg-if", "once_cell", @@ -7171,9 +8327,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "c4bfab14ef75323f4eb75fa52ee0a3fb59611977fd3240da19b2cf36ff85030e" dependencies = [ "bumpalo", "log", @@ -7186,9 +8342,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "65471f79c1022ffa5291d33520cbbb53b7687b01c2f8e83b57d102eed7ed479d" dependencies = [ "cfg-if", "js-sys", @@ -7198,9 +8354,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "a7bec9830f60924d9ceb3ef99d55c155be8afa76954edffbb5936ff4509474e7" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7208,9 +8364,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "4c74f6e152a76a2ad448e223b0fc0b6b5747649c3d769cc6bf45737bf97d0ed6" dependencies = [ "proc-macro2", "quote", @@ -7221,9 +8377,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "a42f6c679374623f295a8623adfe63d9284091245c3504bde47c17a3ce2777d9" [[package]] name = "wasm-streams" @@ -7240,9 +8396,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "44188d185b5bdcae1052d08bcbcf9091a5524038d4572cc4f4f2bb9d5554ddd9" dependencies = [ "js-sys", "wasm-bindgen", @@ -7582,6 +8738,12 @@ dependencies = [ "tap", ] +[[package]] +name = "xmlparser" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" + [[package]] name = "yansi" version = "1.0.1" diff --git a/Cargo.toml b/Cargo.toml index 2f8317616e..4c6d44ef34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "2.0.0" +version = "3.0.0-rc3" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/succinctlabs/sp1" @@ -46,26 +46,26 @@ debug-assertions = true [workspace.dependencies] # sp1 -sp1-build = { path = "crates/build", version = "2.0.0" } -sp1-cli = { path = "crates/cli", version = "2.0.0", default-features = false } -sp1-core-machine = { path = "crates/core/machine", version = "2.0.0" } -sp1-core-executor = { path = "crates/core/executor", version = "2.0.0" } -sp1-curves = { path = "crates/curves", version = "2.0.0" } -sp1-derive = { path = "crates/derive", version = "2.0.0" } -sp1-eval = { path = "crates/eval", version = "2.0.0" } -sp1-helper = { path = "crates/helper", version = "2.0.0", default-features = false } -sp1-primitives = { path = "crates/primitives", version = "2.0.0" } -sp1-prover = { path = "crates/prover", version = "2.0.0" } -sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "2.0.0" } -sp1-recursion-core = { path = "crates/recursion/core", version = "2.0.0", default-features = false } -sp1-recursion-derive = { path = "crates/recursion/derive", version = "2.0.0", default-features = false } -sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "2.0.0", default-features = false } -sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "2.0.0", default-features = false } -sp1-sdk = { path = "crates/sdk", version = "2.0.0" } -sp1-cuda = { path = "crates/cuda", version = "2.0.0" } -sp1-stark = { path = "crates/stark", version = "2.0.0" } -sp1-lib = { path = "crates/zkvm/lib", version = "2.0.0", default-features = false } -sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "2.0.0", default-features = false } +sp1-build = { path = "crates/build", version = "3.0.0-rc3" } +sp1-cli = { path = "crates/cli", version = "3.0.0-rc3", default-features = false } +sp1-core-machine = { path = "crates/core/machine", version = "3.0.0-rc3" } +sp1-core-executor = { path = "crates/core/executor", version = "3.0.0-rc3" } +sp1-curves = { path = "crates/curves", version = "3.0.0-rc3" } +sp1-derive = { path = "crates/derive", version = "3.0.0-rc3" } +sp1-eval = { path = "crates/eval", version = "3.0.0-rc3" } +sp1-helper = { path = "crates/helper", version = "3.0.0-rc3", default-features = false } +sp1-primitives = { path = "crates/primitives", version = "3.0.0-rc3" } +sp1-prover = { path = "crates/prover", version = "3.0.0-rc3" } +sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "3.0.0-rc3" } +sp1-recursion-core = { path = "crates/recursion/core", version = "3.0.0-rc3", default-features = false } +sp1-recursion-derive = { path = "crates/recursion/derive", version = "3.0.0-rc3", default-features = false } +sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "3.0.0-rc3", default-features = false } +sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "3.0.0-rc3", default-features = false } +sp1-sdk = { path = "crates/sdk", version = "3.0.0-rc3" } +sp1-cuda = { path = "crates/cuda", version = "3.0.0-rc3" } +sp1-stark = { path = "crates/stark", version = "3.0.0-rc3" } +sp1-lib = { path = "crates/zkvm/lib", version = "3.0.0-rc3", default-features = false } +sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "3.0.0-rc3", default-features = false } # p3 p3-air = "0.1.4-succinct" diff --git a/crates/cuda/src/lib.rs b/crates/cuda/src/lib.rs index f47ff81d5d..80859c4675 100644 --- a/crates/cuda/src/lib.rs +++ b/crates/cuda/src/lib.rs @@ -84,7 +84,7 @@ impl SP1CudaProver { /// [SP1ProverClient] that can be used to communicate with the container. pub fn new() -> Result> { let container_name = "sp1-gpu"; - let image_name = "public.ecr.aws/succinct-labs/sp1-gpu:a4e646b"; + let image_name = "public.ecr.aws/succinct-labs/sp1-gpu:8e355ce"; let cleaned_up = Arc::new(AtomicBool::new(false)); let cleanup_name = container_name; diff --git a/crates/perf/workflow.sh b/crates/perf/workflow.sh index 968a38d77f..d9c7cdbde1 100755 --- a/crates/perf/workflow.sh +++ b/crates/perf/workflow.sh @@ -24,26 +24,6 @@ CPU_WORKLOADS=( # Define the list of CUDA workloads. CUDA_WORKLOADS=( - "fibonacci-17k" - "ssz-withdrawals" - "tendermint" - "rsp-20526624" - "rsa" - "regex" - "chess" - "json" - "blobstream-01j6z63fgafrc8jeh0k12gbtvw" - "blobstream-01j6z95bdme9svevmfyc974bja" - "blobstream-01j6z9ak0ke9srsppgywgke6fj" - "vector-01j6xsv35re96tkgyda115320t" - "vector-01j6xzy366ff5tbkzcrs8pma02" - "vector-01j6y06de0fdaafemr8b1t69z3" - "raiko-a7-10" - "op-succinct-op-sepolia-range-17985900-17985905" -) - -# Define the list of network workloads. -NETWORK_WORKLOADS=( # "fibonacci-17k" # "ssz-withdrawals" # "tendermint" @@ -58,14 +38,34 @@ NETWORK_WORKLOADS=( # "vector-01j6xsv35re96tkgyda115320t" # "vector-01j6xzy366ff5tbkzcrs8pma02" # "vector-01j6y06de0fdaafemr8b1t69z3" - # "raiko-a7-10" - # "op-succinct-op-sepolia-1818303090-18303120" - # "op-succinct-op-sepolia-18200000-18200030" - # "op-succinct-op-sepolia-18250000-18250030" - # "op-succinct-op-sepolia-18303044-18303074" - # "op-succinct-op-sepolia-range-17685896-17685897" + # "raiko-a7-10" # "op-succinct-op-sepolia-range-17985900-17985905" - # "op-succinct-op-sepolia-range-18129400-18129401" +) + +# Define the list of network workloads. +NETWORK_WORKLOADS=( + "fibonacci-17k" + "ssz-withdrawals" + "tendermint" + "rsp-20526624" + "rsa" + "regex" + "chess" + "json" + "blobstream-01j6z63fgafrc8jeh0k12gbtvw" + "blobstream-01j6z95bdme9svevmfyc974bja" + "blobstream-01j6z9ak0ke9srsppgywgke6fj" + "vector-01j6xsv35re96tkgyda115320t" + "vector-01j6xzy366ff5tbkzcrs8pma02" + "vector-01j6y06de0fdaafemr8b1t69z3" + "raiko-a7-10" + "op-succinct-op-sepolia-1818303090-18303120" + "op-succinct-op-sepolia-18200000-18200030" + "op-succinct-op-sepolia-18250000-18250030" + "op-succinct-op-sepolia-18303044-18303074" + "op-succinct-op-sepolia-range-17685896-17685897" + "op-succinct-op-sepolia-range-17985900-17985905" + "op-succinct-op-sepolia-range-18129400-18129401" ) # Create a JSON object with the list of workloads. @@ -76,4 +76,4 @@ WORKLOADS=$(jq -n \ '{cpu_workloads: $cpu, cuda_workloads: $cuda, network_workloads: $network}') # Run the workflow with the list of workloads. -echo $WORKLOADS | gh workflow run suite.yml --ref $GIT_REF --json \ No newline at end of file +echo $WORKLOADS | gh workflow run suite.yml --ref $GIT_REF --json diff --git a/crates/prover/dummy_vk_map.bin b/crates/prover/dummy_vk_map.bin new file mode 100644 index 0000000000..0e1a2eaaa0 Binary files /dev/null and b/crates/prover/dummy_vk_map.bin differ diff --git a/crates/prover/src/lib.rs b/crates/prover/src/lib.rs index 8330b42b68..71a72ed4cc 100644 --- a/crates/prover/src/lib.rs +++ b/crates/prover/src/lib.rs @@ -18,7 +18,6 @@ pub mod types; pub mod utils; pub mod verify; -use std::path::PathBuf; use std::{ borrow::Borrow, collections::BTreeMap, @@ -39,7 +38,6 @@ use tracing::instrument; use p3_baby_bear::BabyBear; -use lazy_static::lazy_static; use p3_challenger::CanObserve; use p3_field::{AbstractField, PrimeField, PrimeField32}; use p3_matrix::dense::RowMajorMatrix; @@ -82,7 +80,6 @@ use sp1_stark::{ MachineProver, SP1CoreOpts, SP1ProverOpts, ShardProof, StarkGenericConfig, StarkVerifyingKey, Val, Word, DIGEST_SIZE, }; -use std::sync::Once; pub use types::*; use utils::{sp1_commited_values_digest_bn254, sp1_vkey_digest_bn254, words_to_bytes}; @@ -108,11 +105,13 @@ const CORE_CACHE_SIZE: usize = 5; const COMPRESS_CACHE_SIZE: usize = 3; pub const REDUCE_BATCH_SIZE: usize = 2; -const SHAPES_URL_PREFIX: &str = "https://sp1-circuits.s3.us-east-2.amazonaws.com/shapes"; -const SHAPES_VERSION: &str = "146079e0e"; -lazy_static! { - static ref SHAPES_INIT: Once = Once::new(); -} +// TODO: FIX +// +// const SHAPES_URL_PREFIX: &str = "https://sp1-circuits.s3.us-east-2.amazonaws.com/shapes"; +// const SHAPES_VERSION: &str = "146079e0e"; +// lazy_static! { +// static ref SHAPES_INIT: Once = Once::new(); +// } pub type CompressAir = RecursionAir; pub type ShrinkAir = RecursionAir; @@ -162,42 +161,46 @@ impl SP1Prover { /// Initializes a new [SP1Prover]. #[instrument(name = "initialize prover", level = "debug", skip_all)] pub fn new() -> Self { + // TODO: Enable + // // Initialize the shapes (only once). - SHAPES_INIT.call_once(|| { - let shapes_dir = Self::shapes_dir(); - if !shapes_dir.exists() { - std::fs::create_dir_all(&shapes_dir).expect("failed to create shapes directory"); - - let url = format!("{}-{}/allowed_vk_map.bin", SHAPES_URL_PREFIX, SHAPES_VERSION); - let allowed_vk_map_bytes = reqwest::blocking::get(url) - .expect("failed to download allowed_vk_map.bin") - .bytes() - .expect("failed to read response body"); - let allowed_vk_map_bytes = allowed_vk_map_bytes.as_ref().to_vec(); - std::fs::write(shapes_dir.join("allowed_vk_map.bin"), allowed_vk_map_bytes) - .unwrap(); - - let url = format!("{}-{}/dummy_vk_map.bin", SHAPES_URL_PREFIX, SHAPES_VERSION); - let dummy_vk_map_bytes = reqwest::blocking::get(url) - .expect("failed to download dummy_vk_map.bin") - .bytes() - .expect("failed to read response body"); - let dummy_vk_map_bytes = dummy_vk_map_bytes.as_ref().to_vec(); - std::fs::write(shapes_dir.join("dummy_vk_map.bin"), dummy_vk_map_bytes).unwrap(); - } - }); + // SHAPES_INIT.call_once(|| { + // let shapes_dir = Self::shapes_dir(); + // if !shapes_dir.exists() { + // std::fs::create_dir_all(&shapes_dir).expect("failed to create shapes directory"); + + // let url = format!("{}-{}/allowed_vk_map.bin", SHAPES_URL_PREFIX, SHAPES_VERSION); + // let allowed_vk_map_bytes = reqwest::blocking::get(url) + // .expect("failed to download allowed_vk_map.bin") + // .bytes() + // .expect("failed to read response body"); + // let allowed_vk_map_bytes = allowed_vk_map_bytes.as_ref().to_vec(); + // std::fs::write(shapes_dir.join("allowed_vk_map.bin"), allowed_vk_map_bytes) + // .unwrap(); + + // let url = format!("{}-{}/dummy_vk_map.bin", SHAPES_URL_PREFIX, SHAPES_VERSION); + // let dummy_vk_map_bytes = reqwest::blocking::get(url) + // .expect("failed to download dummy_vk_map.bin") + // .bytes() + // .expect("failed to read response body"); + // let dummy_vk_map_bytes = dummy_vk_map_bytes.as_ref().to_vec(); + // std::fs::write(shapes_dir.join("dummy_vk_map.bin"), dummy_vk_map_bytes).unwrap(); + // } + // }); Self::uninitialized() } - /// Get the shapes directory. - pub fn shapes_dir() -> PathBuf { - dirs::home_dir() - .expect("failed to get home directory") - .join(".sp1") - .join("shapes") - .join(SHAPES_VERSION) - } + // TODO: FIX + // + // Get the shapes directory. + // pub fn shapes_dir() -> PathBuf { + // dirs::home_dir() + // .expect("failed to get home directory") + // .join(".sp1") + // .join("shapes") + // .join(SHAPES_VERSION) + // } /// Creates a new [SP1Prover] with lazily initialized components. pub fn uninitialized() -> Self { @@ -248,13 +251,18 @@ impl SP1Prover { // Read the shapes from the shapes directory and deserialize them into memory. let allowed_vk_map: BTreeMap<[BabyBear; DIGEST_SIZE], usize> = if vk_verification { - let vk_allowed_map_bytes = - std::fs::read(Self::shapes_dir().join("allowed_vk_map.bin")).unwrap(); - bincode::deserialize(&vk_allowed_map_bytes).unwrap() + unreachable!() + // TODO: FIX + // + // let vk_allowed_map_bytes = + // std::fs::read(Self::shapes_dir().join("allowed_vk_map.bin")).unwrap(); + // bincode::deserialize(&vk_allowed_map_bytes).unwrap() } else { - let vk_dummy_map_bytes = - std::fs::read(Self::shapes_dir().join("dummy_vk_map.bin")).unwrap(); - bincode::deserialize(&vk_dummy_map_bytes).unwrap() + // TODO: FIX + // + // let vk_dummy_map_bytes = + // std::fs::read(Self::shapes_dir().join("dummy_vk_map.bin")).unwrap(); + bincode::deserialize(include_bytes!("../dummy_vk_map.bin")).unwrap() }; let (root, merkle_tree) = MerkleTree::commit(allowed_vk_map.keys().copied().collect()); diff --git a/crates/recursion/gnark-ffi/go/sp1/prove.go b/crates/recursion/gnark-ffi/go/sp1/prove.go index 723c9ab599..2ead9db55b 100644 --- a/crates/recursion/gnark-ffi/go/sp1/prove.go +++ b/crates/recursion/gnark-ffi/go/sp1/prove.go @@ -167,6 +167,7 @@ func ProveGroth16(dataDir string, witnessPath string) Proof { // Generate the proof. proof, err := groth16.Prove(globalR1cs, globalPk, witness) if err != nil { + fmt.Printf("Error: %v\n", err) panic(err) } fmt.Printf("Generating proof took %s\n", time.Since(start)) diff --git a/crates/sdk/Cargo.toml b/crates/sdk/Cargo.toml index 175b55cffa..aed06ebaf6 100644 --- a/crates/sdk/Cargo.toml +++ b/crates/sdk/Cargo.toml @@ -10,7 +10,7 @@ keywords = { workspace = true } categories = { workspace = true } [dependencies] -prost = "0.13" +prost = { version = "0.13", optional = true } serde = { version = "1.0.204", features = ["derive"] } twirp = { package = "twirp-rs", version = "0.13.0-succinct", optional = true } async-trait = "0.1.81" @@ -47,6 +47,12 @@ sp1-core-executor = { workspace = true } sp1-stark = { workspace = true } sp1-primitives = { workspace = true } itertools = "0.13.0" +tonic = { version = "0.12", features = ["tls", "tls-roots"], optional = true } +alloy-signer = { version = "0.3.6", optional = true } +alloy-signer-local = { version = "0.3.6", optional = true } +alloy-primitives = { version = "0.8.3", optional = true } +aws-sdk-s3 = { version = "1.53.0", optional = true } +aws-config = { version = "1.5.7", optional = true } [features] default = ["network"] @@ -55,6 +61,7 @@ native-gnark = ["sp1-prover/native-gnark"] # TODO: Once alloy has a 1.* release, we can likely remove this feature flag, as there will be less # dependency resolution issues. network = [ + "dep:prost", "dep:alloy-sol-types", "dep:tokio", "dep:ethers", @@ -62,6 +69,21 @@ network = [ "dep:twirp", "dep:reqwest-middleware", ] +network-v2 = [ + "dep:prost", + "dep:alloy-sol-types", + "dep:alloy-signer", + "dep:alloy-signer-local", + "dep:alloy-primitives", + "dep:tokio", + "dep:ethers", + "dep:reqwest", + "dep:twirp", + "dep:reqwest-middleware", + "dep:tonic", + "dep:aws-sdk-s3", + "dep:aws-config", +] cuda = ["sp1-cuda"] [build-dependencies] diff --git a/crates/sdk/src/artifacts.rs b/crates/sdk/src/artifacts.rs index 3a28a8b8ec..2ed25462c0 100644 --- a/crates/sdk/src/artifacts.rs +++ b/crates/sdk/src/artifacts.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; use anyhow::{Context, Result}; -#[cfg(feature = "network")] +#[cfg(any(feature = "network", feature = "network-v2"))] use { futures::StreamExt, indicatif::{ProgressBar, ProgressStyle}, @@ -72,7 +72,7 @@ pub fn export_solidity_groth16_bn254_verifier(output_dir: impl Into) -> Ok(()) } -#[cfg(feature = "network")] +#[cfg(any(feature = "network", feature = "network-v2"))] pub async fn download_file( client: &Client, url: &str, diff --git a/crates/sdk/src/install.rs b/crates/sdk/src/install.rs index 57532884c6..d8661df82d 100644 --- a/crates/sdk/src/install.rs +++ b/crates/sdk/src/install.rs @@ -1,7 +1,7 @@ use cfg_if::cfg_if; use std::path::PathBuf; -#[cfg(feature = "network")] +#[cfg(any(feature = "network", feature = "network-v2"))] use { crate::block_on, futures::StreamExt, @@ -43,7 +43,7 @@ pub fn try_install_circuit_artifacts(artifacts_type: &str) -> PathBuf { ); } else { cfg_if! { - if #[cfg(feature = "network")] { + if #[cfg(any(feature = "network", feature = "network-v2"))] { println!( "[sp1] {} circuit artifacts for version {} do not exist at {}. downloading...", artifacts_type, @@ -61,7 +61,7 @@ pub fn try_install_circuit_artifacts(artifacts_type: &str) -> PathBuf { /// /// This function will download the latest circuit artifacts from the S3 bucket and extract them /// to the directory specified by [groth16_bn254_artifacts_dir()]. -#[cfg(feature = "network")] +#[cfg(any(feature = "network", feature = "network-v2"))] pub fn install_circuit_artifacts(build_dir: PathBuf, artifacts_type: &str) { // Create the build directory. std::fs::create_dir_all(&build_dir).expect("failed to create build directory"); @@ -91,7 +91,7 @@ pub fn install_circuit_artifacts(build_dir: PathBuf, artifacts_type: &str) { } /// Download the file with a progress bar that indicates the progress. -#[cfg(feature = "network")] +#[cfg(any(feature = "network", feature = "network-v2"))] pub async fn download_file( client: &Client, url: &str, diff --git a/crates/sdk/src/lib.rs b/crates/sdk/src/lib.rs index 87ce882627..7f98fea0ba 100644 --- a/crates/sdk/src/lib.rs +++ b/crates/sdk/src/lib.rs @@ -5,18 +5,18 @@ //! Visit the [Getting Started](https://succinctlabs.github.io/sp1/getting-started.html) section //! in the official SP1 documentation for a quick start guide. -#[rustfmt::skip] -#[cfg(feature = "network")] -pub mod proto { - pub mod network; -} pub mod action; pub mod artifacts; pub mod install; #[cfg(feature = "network")] pub mod network; +#[cfg(feature = "network-v2")] +#[path = "network-v2/mod.rs"] +pub mod network_v2; #[cfg(feature = "network")] -pub use crate::network::prover::NetworkProver; +pub use crate::network::prover::NetworkProver as NetworkProverV1; +#[cfg(feature = "network-v2")] +pub use crate::network_v2::prover::NetworkProver as NetworkProverV2; #[cfg(feature = "cuda")] pub use crate::provers::CudaProver; @@ -33,7 +33,7 @@ use sp1_prover::components::DefaultProverComponents; use std::env; -#[cfg(feature = "network")] +#[cfg(any(feature = "network", feature = "network-v2"))] use {std::future::Future, tokio::task::block_in_place}; pub use provers::{CpuProver, MockProver, Prover}; @@ -84,9 +84,13 @@ impl ProverClient { }, "network" => { cfg_if! { - if #[cfg(feature = "network")] { + if #[cfg(feature = "network-v2")] { + Self { + prover: Box::new(NetworkProverV2::new()), + } + } else if #[cfg(feature = "network")] { Self { - prover: Box::new(NetworkProver::new()), + prover: Box::new(NetworkProverV1::new()), } } else { panic!("network feature is not enabled") @@ -145,9 +149,13 @@ impl ProverClient { /// ``` pub fn network() -> Self { cfg_if! { - if #[cfg(feature = "network")] { + if #[cfg(feature = "network-v2")] { + Self { + prover: Box::new(NetworkProverV2::new()), + } + } else if #[cfg(feature = "network")] { Self { - prover: Box::new(NetworkProver::new()), + prover: Box::new(NetworkProverV1::new()), } } else { panic!("network feature is not enabled") @@ -277,7 +285,7 @@ impl Default for ProverClient { /// /// If we're already in a tokio runtime, we'll block in place. Otherwise, we'll create a new /// runtime. -#[cfg(feature = "network")] +#[cfg(any(feature = "network", feature = "network-v2"))] pub fn block_on(fut: impl Future) -> T { // Handle case if we're already in an tokio runtime. if let Ok(handle) = tokio::runtime::Handle::try_current() { diff --git a/crates/sdk/src/network-v2/client.rs b/crates/sdk/src/network-v2/client.rs new file mode 100644 index 0000000000..a2ad18a2a8 --- /dev/null +++ b/crates/sdk/src/network-v2/client.rs @@ -0,0 +1,228 @@ +use std::{env, time::Duration}; + +use alloy_signer::SignerSync; +use alloy_signer_local::PrivateKeySigner; +use anyhow::{Context, Ok, Result}; +use aws_config::BehaviorVersion; +use aws_sdk_s3::Client as S3Client; +use reqwest_middleware::ClientWithMiddleware as HttpClientWithMiddleware; +use serde::de::DeserializeOwned; +use serde::Serialize; +use sp1_core_machine::io::SP1Stdin; +use sp1_prover::SP1VerifyingKey; +use std::str::FromStr; +use std::time::{SystemTime, UNIX_EPOCH}; +use tokio::sync::OnceCell; +use tokio::try_join; +use tonic::transport::Channel; + +use crate::network_v2::proto::artifact::{ + artifact_store_client::ArtifactStoreClient, CreateArtifactRequest, +}; +use crate::network_v2::proto::network::{ + prover_network_client::ProverNetworkClient, GetFilteredProofRequestsRequest, + GetFilteredProofRequestsResponse, GetNonceRequest, GetProofRequestStatusRequest, + GetProofRequestStatusResponse, ProofMode, ProofStatus, ProofStrategy, RequestProofRequest, + RequestProofRequestBody, RequestProofResponse, +}; +use crate::network_v2::Signable; + +/// The default RPC endpoint for the Succinct prover network. +pub const DEFAULT_PROVER_NETWORK_RPC: &str = "http://127.0.0.1:50051"; + +pub struct NetworkClient { + signer: PrivateKeySigner, + http: HttpClientWithMiddleware, + s3: OnceCell, +} + +impl NetworkClient { + /// Create a new network client with the given private key. + pub fn new(private_key: &str) -> Self { + let signer = PrivateKeySigner::from_str(private_key).unwrap(); + + let http_client = reqwest::Client::builder() + .pool_max_idle_per_host(0) + .pool_idle_timeout(Duration::from_secs(240)) + .build() + .unwrap(); + + Self { signer, http: http_client.into(), s3: OnceCell::new() } + } + + /// Returns the currently configured RPC endpoint for the Succinct prover network. + pub fn rpc_url() -> String { + env::var("PROVER_NETWORK_RPC").unwrap_or_else(|_| DEFAULT_PROVER_NETWORK_RPC.to_string()) + } + + /// Get a connected RPC client. + async fn get_rpc(&self) -> Result> { + let rpc_url = Self::rpc_url(); + let channel = Channel::from_shared(rpc_url)?.connect().await?; + Ok(ProverNetworkClient::new(channel.clone())) + } + + /// Get a connected artifact store client. + async fn get_store(&self) -> Result> { + let rpc_url = Self::rpc_url(); + let channel = Channel::from_shared(rpc_url)?.connect().await?; + Ok(ArtifactStoreClient::new(channel.clone())) + } + + /// Get the S3 client. + async fn get_s3_client(&self) -> &S3Client { + self.s3 + .get_or_init(|| async { + let config = aws_config::load_defaults(BehaviorVersion::latest()).await; + S3Client::new(&config) + }) + .await + } + + /// Get the latest nonce for this account's address. + pub async fn get_nonce(&self) -> Result { + let mut rpc = self.get_rpc().await?; + let res = + rpc.get_nonce(GetNonceRequest { address: self.signer.address().to_vec() }).await?; + Ok(res.into_inner().nonce) + } + + /// Get the status of a given proof. If the status is Fulfilled, the proof is also returned. + pub async fn get_proof_request_status( + &self, + request_id: &[u8], + ) -> Result<(GetProofRequestStatusResponse, Option

)> { + let mut rpc = self.get_rpc().await?; + let res = rpc + .get_proof_request_status(GetProofRequestStatusRequest { + request_id: request_id.to_vec(), + }) + .await? + .into_inner(); + let status = ProofStatus::try_from(res.status)?; + let proof = match status { + ProofStatus::Fulfilled => { + log::info!("Proof request fulfilled"); + let proof_uri = res + .proof_uri + .as_ref() + .ok_or_else(|| anyhow::anyhow!("No proof URL provided"))?; + let proof_bytes = self.download_artifact(proof_uri).await?; + Some(bincode::deserialize(&proof_bytes).context("Failed to deserialize proof")?) + } + _ => None, + }; + + Ok((res, proof)) + } + + /// Get all the proof requests for a given status. Also filter by version if provided. + pub async fn get_filtered_proof_requests( + &self, + status: ProofStatus, + version: Option<&str>, + ) -> Result { + let mut rpc = self.get_rpc().await?; + let res = rpc + .get_filtered_proof_requests(GetFilteredProofRequestsRequest { + status: status.into(), + version: version.map(|v| v.to_string()).unwrap_or_default(), + }) + .await? + .into_inner(); + + Ok(res) + } + + /// Creates a proof request with the given ELF and stdin. + #[allow(clippy::too_many_arguments)] + pub async fn request_proof( + &self, + elf: &[u8], + stdin: &SP1Stdin, + vk: &SP1VerifyingKey, + mode: ProofMode, + version: &str, + strategy: ProofStrategy, + timeout_secs: u64, + cycle_limit: u64, + ) -> Result { + // Calculate the deadline. + let start = SystemTime::now(); + let since_the_epoch = start.duration_since(UNIX_EPOCH).expect("Invalid start time"); + let deadline = since_the_epoch.as_secs() + timeout_secs; + + // Create the program and stdin artifacts. + let mut store = self.get_store().await?; + let mut store_clone = store.clone(); + let program_promise = self.create_artifact_with_content(&mut store, &elf); + let stdin_promise = self.create_artifact_with_content(&mut store_clone, &stdin); + let (program_uri, stdin_uri) = try_join!(program_promise, stdin_promise)?; + + // Serialize the vkey. + let vkey = bincode::serialize(&vk)?; + + // Send the request. + let mut rpc = self.get_rpc().await?; + let nonce = self.get_nonce().await?; + let request_body = RequestProofRequestBody { + nonce, + version: format!("sp1-{}", version), + vkey, + mode: mode.into(), + strategy: strategy.into(), + program_uri, + stdin_uri, + deadline, + cycle_limit, + }; + let request_response = rpc + .request_proof(RequestProofRequest { + signature: request_body.sign(&self.signer).into(), + body: Some(request_body), + }) + .await? + .into_inner(); + + Ok(request_response) + } + + /// Uses the artifact store to to create an artifact, upload the content, and return the URI. + async fn create_artifact_with_content( + &self, + store: &mut ArtifactStoreClient, + item: &T, + ) -> Result { + let signature = self.signer.sign_message_sync("create_artifact".as_bytes())?; + let request = CreateArtifactRequest { signature: signature.as_bytes().to_vec() }; + let response = store.create_artifact(request).await?.into_inner(); + + let presigned_url = response.artifact_presigned_url; + let uri = response.artifact_uri; + + let response = + self.http.put(&presigned_url).body(bincode::serialize::(item)?).send().await?; + + assert!(response.status().is_success()); + + Ok(uri) + } + + /// Download an artifact from S3. + async fn download_artifact(&self, uri: &str) -> Result> { + let s3_client = self.get_s3_client().await; + let uri = uri.strip_prefix("s3://").context("Invalid S3 URI")?; + let (bucket, key) = uri.split_once('/').context("Invalid S3 URI format")?; + + let resp = s3_client + .get_object() + .bucket(bucket) + .key(key) + .send() + .await + .context("Failed to get object from S3")?; + + let data = resp.body.collect().await.context("Failed to read S3 object body")?; + Ok(data.into_bytes().to_vec()) + } +} diff --git a/crates/sdk/src/network-v2/mod.rs b/crates/sdk/src/network-v2/mod.rs new file mode 100644 index 0000000000..e6444357b2 --- /dev/null +++ b/crates/sdk/src/network-v2/mod.rs @@ -0,0 +1,19 @@ +pub mod client; +pub mod prover; +mod sign_message; +#[rustfmt::skip] +pub mod proto; + +use alloy_signer::{Signature, SignerSync}; +use prost::Message; +pub use serde::{Deserialize, Serialize}; + +pub trait Signable: Message { + fn sign(&self, signer: &S) -> Signature; +} + +impl Signable for T { + fn sign(&self, signer: &S) -> Signature { + signer.sign_message_sync(&self.encode_to_vec()).unwrap() + } +} diff --git a/crates/sdk/src/network-v2/proto/artifact.rs b/crates/sdk/src/network-v2/proto/artifact.rs new file mode 100644 index 0000000000..f35dcdf8e3 --- /dev/null +++ b/crates/sdk/src/network-v2/proto/artifact.rs @@ -0,0 +1,278 @@ +// This file is @generated by prost-build. +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct CreateArtifactRequest { + /// The signature of the user on a pre-defined message. Used for authentication. + #[prost(bytes = "vec", tag = "1")] + pub signature: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct CreateArtifactResponse { + /// The unique resource identifier of the artifact. + #[prost(string, tag = "1")] + pub artifact_uri: ::prost::alloc::string::String, + /// The presigned url to upload the artifact. + #[prost(string, tag = "2")] + pub artifact_presigned_url: ::prost::alloc::string::String, +} +/// Generated client implementations. +pub mod artifact_store_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct ArtifactStoreClient { + inner: tonic::client::Grpc, + } + impl ArtifactStoreClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl ArtifactStoreClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> ArtifactStoreClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + std::marker::Send + std::marker::Sync, + { + ArtifactStoreClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// / Creates an artifact that can be used for proof requests. + pub async fn create_artifact( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/artifact.ArtifactStore/CreateArtifact"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("artifact.ArtifactStore", "CreateArtifact")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod artifact_store_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with ArtifactStoreServer. + #[async_trait] + pub trait ArtifactStore: std::marker::Send + std::marker::Sync + 'static { + /// / Creates an artifact that can be used for proof requests. + async fn create_artifact( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct ArtifactStoreServer { + inner: Arc, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + impl ArtifactStoreServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for ArtifactStoreServer + where + T: ArtifactStore, + B: Body + std::marker::Send + 'static, + B::Error: Into + std::marker::Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + match req.uri().path() { + "/artifact.ArtifactStore/CreateArtifact" => { + #[allow(non_camel_case_types)] + struct CreateArtifactSvc(pub Arc); + impl tonic::server::UnaryService + for CreateArtifactSvc + { + type Response = super::CreateArtifactResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_artifact(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = CreateArtifactSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header(http::header::CONTENT_TYPE, tonic::metadata::GRPC_CONTENT_TYPE) + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for ArtifactStoreServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + /// Generated gRPC service name + pub const SERVICE_NAME: &str = "artifact.ArtifactStore"; + impl tonic::server::NamedService for ArtifactStoreServer { + const NAME: &'static str = SERVICE_NAME; + } +} diff --git a/crates/sdk/src/network-v2/proto/mod.rs b/crates/sdk/src/network-v2/proto/mod.rs new file mode 100644 index 0000000000..48eb63675a --- /dev/null +++ b/crates/sdk/src/network-v2/proto/mod.rs @@ -0,0 +1,2 @@ +pub mod artifact; +pub mod network; diff --git a/crates/sdk/src/network-v2/proto/network.rs b/crates/sdk/src/network-v2/proto/network.rs new file mode 100644 index 0000000000..0ffa73ebf7 --- /dev/null +++ b/crates/sdk/src/network-v2/proto/network.rs @@ -0,0 +1,907 @@ +// This file is @generated by prost-build. +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct GetFilteredProofRequestsRequest { + /// The status of the proof requests to filter for. + #[prost(enumeration = "ProofStatus", tag = "1")] + pub status: i32, + /// The version of the proof requests to filter for. + #[prost(string, tag = "2")] + pub version: ::prost::alloc::string::String, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct ProofRequest { + /// The request identifier. + #[prost(string, tag = "1")] + pub request_id: ::prost::alloc::string::String, + /// The version of the prover to use. + #[prost(string, tag = "2")] + pub version: ::prost::alloc::string::String, + /// The mode for the proof. + #[prost(enumeration = "ProofMode", tag = "4")] + pub mode: i32, + /// The strategy for prover assignment. + #[prost(enumeration = "ProofStrategy", tag = "5")] + pub strategy: i32, + /// The program resource identifier. + #[prost(string, tag = "6")] + pub program_uri: ::prost::alloc::string::String, + /// The stdin resource identifier. + #[prost(string, tag = "7")] + pub stdin_uri: ::prost::alloc::string::String, + /// The deadline for the proof. + #[prost(uint64, tag = "8")] + pub deadline: u64, + /// The cycle limit for the proof. + #[prost(uint64, tag = "9")] + pub cycle_limit: u64, + /// The status of the proof request. + #[prost(enumeration = "ProofStatus", tag = "10")] + pub status: i32, + /// The requestor address. + #[prost(bytes = "vec", tag = "11")] + pub requester: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct GetFilteredProofRequestsResponse { + /// The proof requests for the given status. + #[prost(message, repeated, tag = "1")] + pub requests: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct RequestProofRequest { + /// The signature of the sender. + #[prost(bytes = "vec", tag = "1")] + pub signature: ::prost::alloc::vec::Vec, + /// The body of the request. + #[prost(message, optional, tag = "3")] + pub body: ::core::option::Option, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct RequestProofRequestBody { + /// The nonce of the request. + #[prost(uint64, tag = "1")] + pub nonce: u64, + /// The version of the prover to use. + #[prost(string, tag = "2")] + pub version: ::prost::alloc::string::String, + /// The verification key. + #[prost(bytes = "vec", tag = "3")] + pub vkey: ::prost::alloc::vec::Vec, + /// The mode for the proof. + #[prost(enumeration = "ProofMode", tag = "4")] + pub mode: i32, + /// The strategy for prover assignment. + #[prost(enumeration = "ProofStrategy", tag = "5")] + pub strategy: i32, + /// The program resource identifier. + #[prost(string, tag = "6")] + pub program_uri: ::prost::alloc::string::String, + /// The stdin resource identifier. + #[prost(string, tag = "7")] + pub stdin_uri: ::prost::alloc::string::String, + /// The deadline for the proof. + #[prost(uint64, tag = "8")] + pub deadline: u64, + /// The cycle limit for the proof. + #[prost(uint64, tag = "9")] + pub cycle_limit: u64, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct RequestProofResponse { + /// / The transaction hash. + #[prost(bytes = "vec", tag = "1")] + pub tx_hash: ::prost::alloc::vec::Vec, + /// / The body of the response. + #[prost(message, optional, tag = "2")] + pub body: ::core::option::Option, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct RequestProofResponseBody { + /// The identifier for the proof. + #[prost(bytes = "vec", tag = "1")] + pub request_id: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct FulfillProofRequest { + /// The signature of the sender. + #[prost(bytes = "vec", tag = "1")] + pub signature: ::prost::alloc::vec::Vec, + /// The body of the request. + #[prost(message, optional, tag = "3")] + pub body: ::core::option::Option, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct FulfillProofRequestBody { + /// The nonce of the request. + #[prost(uint64, tag = "1")] + pub nonce: u64, + /// The identifier for the proof. + #[prost(bytes = "vec", tag = "2")] + pub request_id: ::prost::alloc::vec::Vec, + /// The proof bytes. + #[prost(bytes = "vec", tag = "3")] + pub proof: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct FulfillProofResponse { + /// / The transaction hash. + #[prost(bytes = "vec", tag = "1")] + pub tx_hash: ::prost::alloc::vec::Vec, + /// / The body of the response. + #[prost(message, optional, tag = "2")] + pub body: ::core::option::Option, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, Copy, PartialEq, ::prost::Message)] +pub struct FulfillProofResponseBody {} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct GetBalanceRequest { + /// The address of the account. + #[prost(bytes = "vec", tag = "1")] + pub address: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct GetBalanceResponse { + /// The amount of the token owned by the account. + #[prost(string, tag = "1")] + pub amount: ::prost::alloc::string::String, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct GetNonceRequest { + /// The address of the account. + #[prost(bytes = "vec", tag = "1")] + pub address: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, Copy, PartialEq, ::prost::Message)] +pub struct GetNonceResponse { + /// The nonce of the account. + #[prost(uint64, tag = "1")] + pub nonce: u64, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct GetProofRequestStatusRequest { + /// The identifier for the proof request. + #[prost(bytes = "vec", tag = "1")] + pub request_id: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +pub struct GetProofRequestStatusResponse { + /// The status of the proof request. + #[prost(enumeration = "ProofStatus", tag = "1")] + pub status: i32, + /// The transaction hash of the proof request. + #[prost(bytes = "vec", tag = "2")] + pub request_tx_hash: ::prost::alloc::vec::Vec, + /// The optional transaction hash of the proof fulfill. Only included if the proof request has a + /// status of FULFILLED. + #[prost(bytes = "vec", optional, tag = "3")] + pub fulfill_tx_hash: ::core::option::Option<::prost::alloc::vec::Vec>, + /// The optional proof URI, where you can download the result of the proof request. Only included + /// if the proof has a status of FULFILLED. + #[prost(string, optional, tag = "4")] + pub proof_uri: ::core::option::Option<::prost::alloc::string::String>, + /// The optional error status code, if the request failed. + #[prost(uint32, optional, tag = "5")] + pub error_code: ::core::option::Option, + /// The optional error description details, if the request failed. + #[prost(string, optional, tag = "6")] + pub error_description: ::core::option::Option<::prost::alloc::string::String>, +} +#[derive( + serde::Serialize, + serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] +#[repr(i32)] +pub enum ProofMode { + UnspecifiedMode = 0, + Core = 1, + Compressed = 2, + Plonk = 3, + Groth16 = 4, +} +impl ProofMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::UnspecifiedMode => "UNSPECIFIED_MODE", + Self::Core => "CORE", + Self::Compressed => "COMPRESSED", + Self::Plonk => "PLONK", + Self::Groth16 => "GROTH16", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNSPECIFIED_MODE" => Some(Self::UnspecifiedMode), + "CORE" => Some(Self::Core), + "COMPRESSED" => Some(Self::Compressed), + "PLONK" => Some(Self::Plonk), + "GROTH16" => Some(Self::Groth16), + _ => None, + } + } +} +#[derive( + serde::Serialize, + serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] +#[repr(i32)] +pub enum ProofStrategy { + UnspecifiedStrategy = 0, + Hosted = 1, +} +impl ProofStrategy { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::UnspecifiedStrategy => "UNSPECIFIED_STRATEGY", + Self::Hosted => "HOSTED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNSPECIFIED_STRATEGY" => Some(Self::UnspecifiedStrategy), + "HOSTED" => Some(Self::Hosted), + _ => None, + } + } +} +#[derive( + serde::Serialize, + serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] +#[repr(i32)] +pub enum ProofStatus { + UnspecifiedStatus = 0, + Requested = 1, + Assigned = 2, + Fulfilled = 3, +} +impl ProofStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::UnspecifiedStatus => "UNSPECIFIED_STATUS", + Self::Requested => "REQUESTED", + Self::Assigned => "ASSIGNED", + Self::Fulfilled => "FULFILLED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNSPECIFIED_STATUS" => Some(Self::UnspecifiedStatus), + "REQUESTED" => Some(Self::Requested), + "ASSIGNED" => Some(Self::Assigned), + "FULFILLED" => Some(Self::Fulfilled), + _ => None, + } + } +} +/// Generated client implementations. +pub mod prover_network_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct ProverNetworkClient { + inner: tonic::client::Grpc, + } + impl ProverNetworkClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl ProverNetworkClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> ProverNetworkClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + std::marker::Send + std::marker::Sync, + { + ProverNetworkClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// Creates a proof. + pub async fn request_proof( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/network.ProverNetwork/RequestProof"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("network.ProverNetwork", "RequestProof")); + self.inner.unary(req, path, codec).await + } + /// Fulfills a proof. + pub async fn fulfill_proof( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/network.ProverNetwork/FulfillProof"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("network.ProverNetwork", "FulfillProof")); + self.inner.unary(req, path, codec).await + } + /// Get the proof requests the meet the filter criteria. + pub async fn get_filtered_proof_requests( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/network.ProverNetwork/GetFilteredProofRequests", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("network.ProverNetwork", "GetFilteredProofRequests")); + self.inner.unary(req, path, codec).await + } + /// Get the status of a proof request. + pub async fn get_proof_request_status( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/network.ProverNetwork/GetProofRequestStatus", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("network.ProverNetwork", "GetProofRequestStatus")); + self.inner.unary(req, path, codec).await + } + /// Get the balance of the account. + pub async fn get_balance( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/network.ProverNetwork/GetBalance"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("network.ProverNetwork", "GetBalance")); + self.inner.unary(req, path, codec).await + } + /// Get the nonce of the account. + pub async fn get_nonce( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/network.ProverNetwork/GetNonce"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("network.ProverNetwork", "GetNonce")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod prover_network_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with ProverNetworkServer. + #[async_trait] + pub trait ProverNetwork: std::marker::Send + std::marker::Sync + 'static { + /// Creates a proof. + async fn request_proof( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Fulfills a proof. + async fn fulfill_proof( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Get the proof requests the meet the filter criteria. + async fn get_filtered_proof_requests( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Get the status of a proof request. + async fn get_proof_request_status( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Get the balance of the account. + async fn get_balance( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Get the nonce of the account. + async fn get_nonce( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct ProverNetworkServer { + inner: Arc, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + impl ProverNetworkServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for ProverNetworkServer + where + T: ProverNetwork, + B: Body + std::marker::Send + 'static, + B::Error: Into + std::marker::Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + match req.uri().path() { + "/network.ProverNetwork/RequestProof" => { + #[allow(non_camel_case_types)] + struct RequestProofSvc(pub Arc); + impl tonic::server::UnaryService + for RequestProofSvc + { + type Response = super::RequestProofResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::request_proof(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = RequestProofSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/network.ProverNetwork/FulfillProof" => { + #[allow(non_camel_case_types)] + struct FulfillProofSvc(pub Arc); + impl tonic::server::UnaryService + for FulfillProofSvc + { + type Response = super::FulfillProofResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::fulfill_proof(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = FulfillProofSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/network.ProverNetwork/GetFilteredProofRequests" => { + #[allow(non_camel_case_types)] + struct GetFilteredProofRequestsSvc(pub Arc); + impl + tonic::server::UnaryService + for GetFilteredProofRequestsSvc + { + type Response = super::GetFilteredProofRequestsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_filtered_proof_requests(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = GetFilteredProofRequestsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/network.ProverNetwork/GetProofRequestStatus" => { + #[allow(non_camel_case_types)] + struct GetProofRequestStatusSvc(pub Arc); + impl + tonic::server::UnaryService + for GetProofRequestStatusSvc + { + type Response = super::GetProofRequestStatusResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_proof_request_status(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = GetProofRequestStatusSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/network.ProverNetwork/GetBalance" => { + #[allow(non_camel_case_types)] + struct GetBalanceSvc(pub Arc); + impl tonic::server::UnaryService for GetBalanceSvc { + type Response = super::GetBalanceResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_balance(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = GetBalanceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/network.ProverNetwork/GetNonce" => { + #[allow(non_camel_case_types)] + struct GetNonceSvc(pub Arc); + impl tonic::server::UnaryService for GetNonceSvc { + type Response = super::GetNonceResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_nonce(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = GetNonceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", tonic::Code::Unimplemented as i32) + .header(http::header::CONTENT_TYPE, tonic::metadata::GRPC_CONTENT_TYPE) + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for ProverNetworkServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + /// Generated gRPC service name + pub const SERVICE_NAME: &str = "network.ProverNetwork"; + impl tonic::server::NamedService for ProverNetworkServer { + const NAME: &'static str = SERVICE_NAME; + } +} diff --git a/crates/sdk/src/network-v2/prover.rs b/crates/sdk/src/network-v2/prover.rs new file mode 100644 index 0000000000..19746b71bb --- /dev/null +++ b/crates/sdk/src/network-v2/prover.rs @@ -0,0 +1,216 @@ +use std::{ + env, + time::{Duration, Instant}, +}; + +use crate::{ + network_v2::client::{NetworkClient, DEFAULT_PROVER_NETWORK_RPC}, + network_v2::proto::network::{ProofMode, ProofStatus, ProofStrategy}, + Prover, SP1Context, SP1ProofKind, SP1ProofWithPublicValues, SP1ProvingKey, SP1VerifyingKey, +}; +use anyhow::Result; +use serde::de::DeserializeOwned; +use sp1_core_machine::io::SP1Stdin; +use sp1_prover::{components::DefaultProverComponents, SP1Prover, SP1_CIRCUIT_VERSION}; +use sp1_stark::SP1ProverOpts; + +use {crate::block_on, tokio::time::sleep}; + +use crate::provers::{CpuProver, ProofOpts, ProverType}; + +/// The timeout for a proof request to be fulfilled. +const TIMEOUT_SECS: u64 = 3600; + +/// The default cycle limit for a proof request. +const DEFAULT_CYCLE_LIMIT: u64 = 1_000_000_000; + +/// An implementation of [crate::ProverClient] that can generate proofs on a remote RPC server. +pub struct NetworkProver { + client: NetworkClient, + local_prover: CpuProver, +} + +impl NetworkProver { + /// Creates a new [NetworkProver] with the private key set in `SP1_PRIVATE_KEY`. + pub fn new() -> Self { + let private_key = env::var("SP1_PRIVATE_KEY") + .unwrap_or_else(|_| panic!("SP1_PRIVATE_KEY must be set for remote proving")); + Self::new_from_key(&private_key) + } + + /// Creates a new [NetworkProver] with the given private key. + pub fn new_from_key(private_key: &str) -> Self { + let version = SP1_CIRCUIT_VERSION; + log::info!("Client circuit version: {}", version); + let local_prover = CpuProver::new(); + let client = NetworkClient::new(private_key); + Self { client, local_prover } + } + + /// Requests a proof from the prover network, returning the request ID. + pub async fn request_proof( + &self, + elf: &[u8], + stdin: SP1Stdin, + mode: ProofMode, + timeout: Option, + ) -> Result> { + // Simulate and get the cycle limit. + let skip_simulation = env::var("SKIP_SIMULATION").map(|val| val == "true").unwrap_or(false); + let cycle_limit = if !skip_simulation { + let (_, report) = + self.local_prover.sp1_prover().execute(elf, &stdin, Default::default())?; + let cycles = report.total_instruction_count(); + log::info!("Simulation complete, cycles: {}", cycles); + cycles + } else { + log::info!("Skipping simulation"); + DEFAULT_CYCLE_LIMIT + }; + + // Get the verifying key. + let (_, vk) = self.setup(elf); + + // Get the timeout. + let timeout_secs = timeout.map(|dur| dur.as_secs()).unwrap_or(TIMEOUT_SECS); + + log::info!("Requesting proof with cycle limit: {}", cycle_limit); + + // Request the proof. + let response = self + .client + .request_proof( + elf, + &stdin, + &vk, + mode, + SP1_CIRCUIT_VERSION, + ProofStrategy::Hosted, + timeout_secs, + cycle_limit, + ) + .await?; + + // Log the request ID and transaction hash. + let tx_hash_hex = "0x".to_string() + &hex::encode(response.tx_hash); + let request_id = response.body.unwrap().request_id; + let request_id_hex = "0x".to_string() + &hex::encode(request_id.clone()); + log::info!("Created request {} in transaction {}", request_id_hex, tx_hash_hex); + + if NetworkClient::rpc_url() == DEFAULT_PROVER_NETWORK_RPC { + log::info!("View in explorer: https://explorer-v2.succinct.xyz/{}", request_id_hex); + } + + Ok(request_id) + } + + /// Waits for a proof to be generated and returns the proof. If a timeout is supplied, the + /// function will return an error if the proof is not generated within the timeout. + pub async fn wait_proof( + &self, + request_id: &[u8], + timeout: Option, + ) -> Result

{ + let mut is_assigned = false; + let start_time = Instant::now(); + loop { + if let Some(timeout) = timeout { + if start_time.elapsed() > timeout { + return Err(anyhow::anyhow!("Proof request timed out.")); + } + } + + let (status, maybe_proof) = + self.client.get_proof_request_status::

(request_id).await?; + + match status.status() { + ProofStatus::Fulfilled => { + return Ok(maybe_proof.unwrap()); + } + ProofStatus::Assigned => { + if !is_assigned { + log::info!("Proof request assigned, proving..."); + is_assigned = true; + } + } + _ => {} + } + sleep(Duration::from_secs(2)).await; + } + } + + /// Requests a proof from the prover network and waits for it to be generated. + pub async fn prove( + &self, + elf: &[u8], + stdin: SP1Stdin, + mode: ProofMode, + timeout: Option, + ) -> Result { + let request_id = self.request_proof(elf, stdin, mode, timeout).await?; + self.wait_proof(&request_id, timeout).await + } +} + +impl Prover for NetworkProver { + fn id(&self) -> ProverType { + ProverType::Network + } + + fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey) { + self.local_prover.setup(elf) + } + + fn sp1_prover(&self) -> &SP1Prover { + self.local_prover.sp1_prover() + } + + fn prove<'a>( + &'a self, + pk: &SP1ProvingKey, + stdin: SP1Stdin, + opts: ProofOpts, + context: SP1Context<'a>, + kind: SP1ProofKind, + ) -> Result { + warn_if_not_default(&opts.sp1_prover_opts, &context); + block_on(self.prove(&pk.elf, stdin, kind.into(), opts.timeout)) + } +} + +impl Default for NetworkProver { + fn default() -> Self { + Self::new() + } +} + +/// Warns if `opts` or `context` are not default values, since they are currently unsupported. +fn warn_if_not_default(opts: &SP1ProverOpts, context: &SP1Context) { + let _guard = tracing::warn_span!("network_prover").entered(); + if opts != &SP1ProverOpts::default() { + tracing::warn!("non-default opts will be ignored: {:?}", opts.core_opts); + tracing::warn!("custom SP1ProverOpts are currently unsupported by the network prover"); + } + // Exhaustive match is done to ensure we update the warnings if the types change. + let SP1Context { hook_registry, subproof_verifier, .. } = context; + if hook_registry.is_some() { + tracing::warn!("non-default context.hook_registry will be ignored: {:?}", hook_registry); + tracing::warn!("custom runtime hooks are currently unsupported by the network prover"); + tracing::warn!("proving may fail due to missing hooks"); + } + if subproof_verifier.is_some() { + tracing::warn!("non-default context.subproof_verifier will be ignored"); + tracing::warn!("custom subproof verifiers are currently unsupported by the network prover"); + } +} + +impl From for ProofMode { + fn from(value: SP1ProofKind) -> Self { + match value { + SP1ProofKind::Core => Self::Core, + SP1ProofKind::Compressed => Self::Compressed, + SP1ProofKind::Plonk => Self::Plonk, + SP1ProofKind::Groth16 => Self::Groth16, + } + } +} diff --git a/crates/sdk/src/network-v2/sign_message.rs b/crates/sdk/src/network-v2/sign_message.rs new file mode 100644 index 0000000000..f8b794a5cb --- /dev/null +++ b/crates/sdk/src/network-v2/sign_message.rs @@ -0,0 +1,73 @@ +use alloy_primitives::{Address, Signature}; +use prost::Message; +use thiserror::Error; + +use crate::network_v2::proto::network::{FulfillProofRequest, RequestProofRequest}; + +#[allow(dead_code)] +pub trait SignedMessage { + fn signature(&self) -> Vec; + fn nonce(&self) -> Result; + fn message(&self) -> Result, MessageError>; + fn recover_sender(&self) -> Result; +} + +#[derive(Error, Debug)] +pub enum MessageError { + #[error("Empty message")] + EmptyMessage, +} + +#[derive(Error, Debug)] +pub enum RecoverSenderError { + #[error("Failed to deserialize signature: {0}")] + SignatureDeserializationError(String), + #[error("Empty message")] + EmptyMessage, + #[error("Failed to recover address: {0}")] + AddressRecoveryError(String), +} + +macro_rules! impl_signed_message { + ($type:ty) => { + impl SignedMessage for $type { + fn signature(&self) -> Vec { + self.signature.clone() + } + + fn nonce(&self) -> Result { + match &self.body { + Some(body) => Ok(body.nonce as u64), + None => Err(MessageError::EmptyMessage), + } + } + + fn message(&self) -> Result, MessageError> { + match &self.body { + Some(body) => Ok(body.encode_to_vec()), + None => Err(MessageError::EmptyMessage), + } + } + + fn recover_sender(&self) -> Result { + let message = self.message().map_err(|_| RecoverSenderError::EmptyMessage)?; + recover_sender_raw(self.signature.clone(), message) + } + } + }; +} + +impl_signed_message!(RequestProofRequest); +impl_signed_message!(FulfillProofRequest); + +pub fn recover_sender_raw( + signature: Vec, + message: Vec, +) -> Result { + let signature = Signature::try_from(signature.as_slice()) + .map_err(|e| RecoverSenderError::SignatureDeserializationError(e.to_string()))?; + + signature + .recover_address_from_msg(message) + .map_err(|e| RecoverSenderError::AddressRecoveryError(e.to_string())) +} diff --git a/crates/sdk/src/network/auth.rs b/crates/sdk/src/network/auth.rs index 7cb2c2ef7d..dbce5bb3e0 100644 --- a/crates/sdk/src/network/auth.rs +++ b/crates/sdk/src/network/auth.rs @@ -7,7 +7,7 @@ use ethers::{ types::H256, }; -use crate::proto::network::UnclaimReason; +use crate::network::proto::network::UnclaimReason; sol! { struct CreateProof { diff --git a/crates/sdk/src/network/client.rs b/crates/sdk/src/network/client.rs index f9bdd94ccd..893b5e6cca 100644 --- a/crates/sdk/src/network/client.rs +++ b/crates/sdk/src/network/client.rs @@ -2,7 +2,7 @@ use std::{env, time::Duration}; use crate::{ network::auth::NetworkAuth, - proto::network::{ + network::proto::network::{ ModifyCpuCyclesRequest, ModifyCpuCyclesResponse, UnclaimProofRequest, UnclaimReason, }, }; @@ -18,7 +18,7 @@ use std::{ }; use twirp::{Client as TwirpClient, ClientError}; -use crate::proto::network::{ +use crate::network::proto::network::{ ClaimProofRequest, ClaimProofResponse, CreateProofRequest, FulfillProofRequest, FulfillProofResponse, GetNonceRequest, GetProofRequestsRequest, GetProofRequestsResponse, GetProofStatusRequest, GetProofStatusResponse, NetworkServiceClient, ProofMode, ProofStatus, diff --git a/crates/sdk/src/network/mod.rs b/crates/sdk/src/network/mod.rs index 950aa10953..12d9b7b352 100644 --- a/crates/sdk/src/network/mod.rs +++ b/crates/sdk/src/network/mod.rs @@ -1,3 +1,6 @@ pub mod auth; pub mod client; pub mod prover; + +#[rustfmt::skip] +pub mod proto; diff --git a/crates/sdk/src/network/proto/mod.rs b/crates/sdk/src/network/proto/mod.rs new file mode 100644 index 0000000000..a61610bd4d --- /dev/null +++ b/crates/sdk/src/network/proto/mod.rs @@ -0,0 +1 @@ +pub mod network; diff --git a/crates/sdk/src/proto/network.rs b/crates/sdk/src/network/proto/network.rs similarity index 100% rename from crates/sdk/src/proto/network.rs rename to crates/sdk/src/network/proto/network.rs diff --git a/crates/sdk/src/network/prover.rs b/crates/sdk/src/network/prover.rs index d7561a123f..df7388d8e3 100644 --- a/crates/sdk/src/network/prover.rs +++ b/crates/sdk/src/network/prover.rs @@ -5,7 +5,7 @@ use std::{ use crate::{ network::client::{NetworkClient, DEFAULT_PROVER_NETWORK_RPC}, - proto::network::{ProofMode, ProofStatus}, + network::proto::network::{ProofMode, ProofStatus}, Prover, SP1Context, SP1ProofKind, SP1ProofWithPublicValues, SP1ProvingKey, SP1VerifyingKey, }; use anyhow::Result; @@ -14,7 +14,6 @@ use sp1_core_machine::io::SP1Stdin; use sp1_prover::{components::DefaultProverComponents, SP1Prover, SP1_CIRCUIT_VERSION}; use sp1_stark::SP1ProverOpts; -#[cfg(feature = "network")] use {crate::block_on, tokio::time::sleep}; use crate::provers::{CpuProver, ProofOpts, ProverType}; diff --git a/crates/zkvm/entrypoint/src/lib.rs b/crates/zkvm/entrypoint/src/lib.rs index fe7ba875d7..46dbed730d 100644 --- a/crates/zkvm/entrypoint/src/lib.rs +++ b/crates/zkvm/entrypoint/src/lib.rs @@ -102,6 +102,14 @@ macro_rules! entrypoint { #[no_mangle] fn main() { + // Link to the actual entrypoint only when compiling for zkVM. Doing this avoids + // compilation errors when building for the host target. + // + // Note that, however, it's generally considered wasted effort compiling zkVM + // programs against the host target. This just makes it such that doing so wouldn't + // result in an error, which can happen when building a Cargo workspace containing + // zkVM program crates. + #[cfg(target_os = "zkvm")] super::ZKVM_ENTRY() } } diff --git a/examples/json/program/src/main.rs b/examples/json/program/src/main.rs index 5c35470cf6..dea5ed9b37 100644 --- a/examples/json/program/src/main.rs +++ b/examples/json/program/src/main.rs @@ -4,7 +4,7 @@ sp1_zkvm::entrypoint!(main); use lib::{Account, Transaction}; // Custom structs. use serde_json::Value; // Generic JSON. -fn main() { +pub fn main() { // read generic JSON example inputs. let data_str = sp1_zkvm::io::read::(); let key = sp1_zkvm::io::read::(); diff --git a/examples/patch-testing/program/src/main.rs b/examples/patch-testing/program/src/main.rs index 758a015899..8a062717d7 100644 --- a/examples/patch-testing/program/src/main.rs +++ b/examples/patch-testing/program/src/main.rs @@ -185,7 +185,7 @@ fn test_secp256k1_patch() { } /// To add testing for a new patch, add a new case to the function below. -fn main() { +pub fn main() { // TODO: Specify which syscalls are linked to each function invocation, iterate // over this list that is shared between the program and script. test_keccak(); diff --git a/examples/patch-testing/script/src/main.rs b/examples/patch-testing/script/src/main.rs index 45f97198ff..57eb099335 100644 --- a/examples/patch-testing/script/src/main.rs +++ b/examples/patch-testing/script/src/main.rs @@ -3,7 +3,7 @@ use sp1_sdk::{utils, ProverClient, SP1Stdin}; const PATCH_TEST_ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); /// This script is used to test that SP1 patches are correctly applied and syscalls are triggered. -fn main() { +pub fn main() { utils::setup_logger(); let stdin = SP1Stdin::new(); diff --git a/examples/ssz-withdrawals/program/src/main.rs b/examples/ssz-withdrawals/program/src/main.rs index cdce58b998..1c7937e20e 100644 --- a/examples/ssz-withdrawals/program/src/main.rs +++ b/examples/ssz-withdrawals/program/src/main.rs @@ -14,7 +14,7 @@ use hex_literal::hex; use ssz_rs::prelude::*; use std::collections::HashMap; -fn main() { +pub fn main() { // Get inputs. let beacon_block_root = node_from_bytes(hex!("d00c4da1a3ad4d42bd35f128544227d19e163194569d69d54a3d14112e3c897c")); diff --git a/examples/tendermint/program/src/main.rs b/examples/tendermint/program/src/main.rs index e6d42390a3..53db8535e6 100644 --- a/examples/tendermint/program/src/main.rs +++ b/examples/tendermint/program/src/main.rs @@ -6,7 +6,7 @@ use tendermint_light_client_verifier::{ options::Options, types::LightBlock, ProdVerifier, Verdict, Verifier, }; -fn main() { +pub fn main() { // Normally we could just do this to read in the LightBlocks, but bincode doesn't work with LightBlock. // This is likely a bug in tendermint-rs. // let light_block_1 = sp1_zkvm::io::read::(); diff --git a/examples/tendermint/script/src/main.rs b/examples/tendermint/script/src/main.rs index 7b4d9a60f1..5bdc06936c 100644 --- a/examples/tendermint/script/src/main.rs +++ b/examples/tendermint/script/src/main.rs @@ -19,7 +19,7 @@ fn get_light_blocks() -> (LightBlock, LightBlock) { (light_block_1, light_block_2) } -fn main() { +pub fn main() { // Generate proof. utils::setup_logger(); diff --git a/tests/tendermint-benchmark/src/main.rs b/tests/tendermint-benchmark/src/main.rs index 3cd2111d1a..455c837b09 100644 --- a/tests/tendermint-benchmark/src/main.rs +++ b/tests/tendermint-benchmark/src/main.rs @@ -33,7 +33,7 @@ pub struct BlockValidatorSet { pub total: String, } -fn main() { +pub fn main() { let peer_id: [u8; 20] = [ 0x72, 0x6b, 0xc8, 0xd2, 0x60, 0x38, 0x7c, 0xf5, 0x6e, 0xcf, 0xad, 0x3a, 0x6b, 0xf6, 0xfe, 0xcd, 0x90, 0x3e, 0x18, 0xa2, diff --git a/tests/uint256-mul/src/main.rs b/tests/uint256-mul/src/main.rs index 89e5efba10..fa58a127a5 100644 --- a/tests/uint256-mul/src/main.rs +++ b/tests/uint256-mul/src/main.rs @@ -26,7 +26,7 @@ fn biguint_to_bytes_le(x: BigUint) -> [u8; 32] { } #[sp1_derive::cycle_tracker] -fn main() { +pub fn main() { for _ in 0..50 { // Test with random numbers. let mut rng = rand::thread_rng();