diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d43f24c4..65ef5e26 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,8 +17,8 @@ permissions: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RISC0_TOOLCHAIN_VERSION: v2024-01-31.1 - RISC0_CRATE_VERSION: "^0.20" + RISC0_TOOLCHAIN_VERSION: v2024-02-08.1 + RISC0_CRATE_VERSION: "^0.21" jobs: # see: https://github.com/orgs/community/discussions/26822 @@ -44,7 +44,7 @@ jobs: # Full history is required by license-check.py fetch-depth: 0 submodules: recursive - - uses: risc0/risc0/.github/actions/rustup@release-0.20 + - uses: risc0/risc0/.github/actions/rustup@release-0.21 - name: Install cargo-sort uses: risc0/cargo-install@b9307573043522ab0d3e3be64a51763b765b52a4 with: @@ -94,9 +94,9 @@ jobs: with: submodules: recursive - if: matrix.feature == 'cuda' - uses: risc0/risc0/.github/actions/cuda@release-0.20 - - uses: risc0/risc0/.github/actions/rustup@release-0.20 - - uses: risc0/risc0/.github/actions/sccache@release-0.20 + uses: risc0/risc0/.github/actions/cuda@release-0.21 + - uses: risc0/risc0/.github/actions/rustup@release-0.21 + - uses: risc0/risc0/.github/actions/sccache@release-0.21 with: key: ${{ matrix.os }}-${{ matrix.feature }} - run: cargo install --force --locked cargo-risczero@$RISC0_CRATE_VERSION -F $FEATURE @@ -125,11 +125,11 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - uses: risc0/risc0/.github/actions/rustup@release-0.20 + - uses: risc0/risc0/.github/actions/rustup@release-0.21 - uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f with: version: nightly-09fe3e041369a816365a020f715ad6f94dbce9f2 - - uses: risc0/risc0/.github/actions/sccache@release-0.20 + - uses: risc0/risc0/.github/actions/sccache@release-0.21 with: key: macOS-default - run: cargo install --force --locked cargo-risczero@$RISC0_CRATE_VERSION diff --git a/Cargo.lock b/Cargo.lock index 860aecf9..10e2ebc0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,9 +46,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", @@ -57,9 +57,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -110,9 +110,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0b5ab0cb07c21adf9d72e988b34e8200ce648c2bba8d009183bb1c50fb1216" +checksum = "e86ec0a47740b20bc5613b8712d0d321d031c4efc58e9645af96085d5cccfc27" dependencies = [ "const-hex", "dunce", @@ -121,16 +121,16 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-types" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c08f62ded7ce03513bfb60ef5cad4fff5d4f67eac6feb4df80426b7b9ffb06e" +checksum = "ad09ec5853fa700d12d778ad224dcdec636af424d29fad84fb9a2f16a5b0ef09" dependencies = [ "alloy-primitives", "alloy-sol-macro", @@ -155,9 +155,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -203,9 +203,18 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] [[package]] name = "ark-bn254" @@ -487,7 +496,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -503,13 +512,13 @@ dependencies = [ [[package]] name = "auto_impl" -version = "1.1.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "823b8bb275161044e2ac7a25879cb3e2480cb403e3943022c7c769c599b756aa" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -538,10 +547,10 @@ dependencies = [ "axum-macros", "bytes", "futures-util", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.1.0", + "hyper 1.2.0", "hyper-util", "itoa", "matchit", @@ -571,7 +580,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "http-body-util", "mime", @@ -592,7 +601,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -711,6 +720,12 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + [[package]] name = "block-buffer" version = "0.9.0" @@ -729,33 +744,14 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bonsai-rest-api-mock" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e326649da91b08b03c4543c40db9603459cd2a206614d4431ff1efde2403e821" -dependencies = [ - "anyhow", - "axum", - "bincode", - "bonsai-sdk", - "hex", - "risc0-zkvm", - "serde_json", - "thiserror", - "tokio", - "tower-http", - "tracing", - "uuid 1.7.0", -] - [[package]] name = "bonsai-sdk" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f0a6b186dce8b2f945bd3ecc5d35a36280400200ed57878c7c3f2aeb01632e" +checksum = "9e0f26687ed447c77b1a40a3665bf88e8327b6de65a74f521544bd225982f589" dependencies = [ "reqwest", + "risc0-groth16", "serde", "thiserror", "tokio", @@ -773,9 +769,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "byte-slice-cast" @@ -785,22 +781,22 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.14.3" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -865,7 +861,7 @@ checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" dependencies = [ "camino", "cargo-platform", - "semver 1.0.21", + "semver 1.0.22", "serde", "serde_json", "thiserror", @@ -879,7 +875,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.21", + "semver 1.0.22", "serde", "serde_json", "thiserror", @@ -887,9 +883,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ "jobserver", "libc", @@ -903,15 +899,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -926,9 +922,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.18" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" dependencies = [ "clap_builder", "clap_derive", @@ -936,9 +932,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -948,21 +944,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "coins-bip32" @@ -1024,9 +1020,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "const-hex" -version = "1.11.0" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d59688ad0945eaf6b84cb44fedbe93484c81b48970e98f09db8a22832d7961" +checksum = "5ba00838774b4ab0233e355d26710fbfc8327a05c017f6dc4873f876d1f79f78" dependencies = [ "cfg-if", "cpufeatures", @@ -1069,6 +1065,17 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + [[package]] name = "cpp_demangle" version = "0.4.3" @@ -1089,9 +1096,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -1168,6 +1175,52 @@ dependencies = [ "cipher", ] +[[package]] +name = "cust" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6cc71911e179f12483b9734120b45bd00bf64fab085cc4818428523eedd469" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "cust_core", + "cust_derive", + "cust_raw", + "find_cuda_helper", +] + +[[package]] +name = "cust_core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039f79662cb8f890cbf335e818cd522d6e3a53fe63f61d1aaaf859cd3d975f06" +dependencies = [ + "cust_derive", + "glam", + "mint", + "vek", +] + +[[package]] +name = "cust_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3bc95fe629aed92b2423de6ccff9e40174b21d19cb6ee6281a4d04ac72f66" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cust_raw" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf40d6ade12cb9828bbc844b9875c7b93d25e67a3c9bf61c7aa3ae09e402bf8" +dependencies = [ + "find_cuda_helper", +] + [[package]] name = "dashmap" version = "5.5.3" @@ -1334,7 +1387,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -1385,9 +1438,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "elf" @@ -1434,17 +1487,17 @@ dependencies = [ [[package]] name = "enr" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" +checksum = "2dc3eabaca59dc39ea5ed15062e4abc5bba9723b1cff7a4fea3faae0647f04c0" dependencies = [ + "alloy-rlp", "base64 0.21.7", "bytes", "hex", "k256", "log", "rand", - "rlp", "serde", "sha3", "zeroize", @@ -1471,9 +1524,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" +checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" dependencies = [ "serde", ] @@ -1560,9 +1613,9 @@ dependencies = [ [[package]] name = "ethers" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c7cd562832e2ff584fa844cd2f6e5d4f35bbe11b28c7c9b8df957b2e1d0c701" +checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -1576,9 +1629,9 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35dc9a249c066d17e8947ff52a4116406163cf92c7f0763cb8c001760b26403f" +checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" dependencies = [ "ethers-core", "once_cell", @@ -1588,9 +1641,9 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43304317c7f776876e47f2f637859f6d0701c1ec7930a150f169d5fbe7d76f5a" +checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" dependencies = [ "const-hex", "ethers-contract-abigen", @@ -1607,9 +1660,9 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f96502317bf34f6d71a3e3d270defaa9485d754d789e15a8e04a84161c95eb" +checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" dependencies = [ "Inflector", "const-hex", @@ -1624,16 +1677,16 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.48", + "syn 2.0.52", "toml", "walkdir", ] [[package]] name = "ethers-contract-derive" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452ff6b0a64507ce8d67ffd48b1da3b42f03680dcf5382244e9c93822cbbf5de" +checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" dependencies = [ "Inflector", "const-hex", @@ -1642,14 +1695,14 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] name = "ethers-core" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aab3cef6cc1c9fd7f787043c81ad3052eff2b96a3878ef1526aa446311bdbfc9" +checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ "arrayvec", "bytes", @@ -1668,7 +1721,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.48", + "syn 2.0.52", "tempfile", "thiserror", "tiny-keccak", @@ -1677,15 +1730,15 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d45b981f5fa769e1d0343ebc2a44cfa88c9bc312eb681b676318b40cef6fb1" +checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" dependencies = [ "chrono", "ethers-core", "ethers-solc", "reqwest", - "semver 1.0.21", + "semver 1.0.22", "serde", "serde_json", "thiserror", @@ -1694,9 +1747,9 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145211f34342487ef83a597c1e69f0d3e01512217a7c72cc8a25931854c7dca0" +checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" dependencies = [ "async-trait", "auto_impl", @@ -1721,9 +1774,9 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb6b15393996e3b8a78ef1332d6483c11d839042c17be58decc92fa8b1c3508a" +checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" dependencies = [ "async-trait", "auto_impl", @@ -1737,7 +1790,7 @@ dependencies = [ "futures-timer", "futures-util", "hashers", - "http 0.2.11", + "http 0.2.12", "instant", "jsonwebtoken", "once_cell", @@ -1759,9 +1812,9 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b125a103b56aef008af5d5fb48191984aa326b50bfd2557d231dc499833de3" +checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" dependencies = [ "async-trait", "coins-bip32", @@ -1781,9 +1834,9 @@ dependencies = [ [[package]] name = "ethers-solc" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d21df08582e0a43005018a858cc9b465c5fff9cf4056651be64f844e57d1f55f" +checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" dependencies = [ "cfg-if", "const-hex", @@ -1798,7 +1851,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.21", + "semver 1.0.22", "serde", "serde_json", "solang-parser", @@ -1873,6 +1926,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "find_cuda_helper" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad" +dependencies = [ + "glob", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1907,6 +1969,33 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1998,7 +2087,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -2015,9 +2104,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" dependencies = [ "gloo-timers", "send_wrapper 0.4.0", @@ -2082,6 +2171,15 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "glam" +version = "0.20.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" +dependencies = [ + "num-traits", +] + [[package]] name = "glob" version = "0.3.1" @@ -2122,7 +2220,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.11", + "http 0.2.12", "indexmap", "slab", "tokio", @@ -2141,7 +2239,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 1.0.0", + "http 1.1.0", "indexmap", "slab", "tokio", @@ -2181,9 +2279,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -2230,9 +2328,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -2241,9 +2339,9 @@ dependencies = [ [[package]] name = "http" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -2257,7 +2355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.11", + "http 0.2.12", "pin-project-lite", ] @@ -2268,18 +2366,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", - "http 1.0.0", + "http 1.1.0", ] [[package]] name = "http-body-util" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" dependencies = [ "bytes", - "futures-util", - "http 1.0.0", + "futures-core", + "http 1.1.0", "http-body 1.0.0", "pin-project-lite", ] @@ -2319,7 +2417,7 @@ dependencies = [ "futures-core", "futures-util", "h2 0.3.24", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", "httparse", "httpdate", @@ -2334,20 +2432,21 @@ dependencies = [ [[package]] name = "hyper" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" +checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" dependencies = [ "bytes", "futures-channel", "futures-util", "h2 0.4.2", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "httparse", "httpdate", "itoa", "pin-project-lite", + "smallvec", "tokio", "want", ] @@ -2358,7 +2457,7 @@ version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ - "http 0.2.11", + "http 0.2.12", "hyper 0.14.28", "log", "rustls 0.20.9", @@ -2374,7 +2473,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http 0.2.11", + "http 0.2.12", "hyper 0.14.28", "rustls 0.21.10", "tokio", @@ -2389,9 +2488,9 @@ checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" dependencies = [ "bytes", "futures-util", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", - "hyper 1.1.0", + "hyper 1.2.0", "pin-project-lite", "socket2", "tokio", @@ -2492,9 +2591,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -2533,12 +2632,12 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", + "libc", "windows-sys 0.52.0", ] @@ -2568,18 +2667,18 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -2633,31 +2732,33 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", - "itertools 0.10.5", + "itertools 0.11.0", "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", "string_cache", "term", "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +dependencies = [ + "regex-automata 0.4.6", +] [[package]] name = "lazy-regex" @@ -2679,7 +2780,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -2729,9 +2830,18 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] [[package]] name = "matchers" @@ -2794,6 +2904,21 @@ dependencies = [ "libc", ] +[[package]] +name = "metal" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + [[package]] name = "mime" version = "0.3.17" @@ -2819,11 +2944,17 @@ dependencies = [ "adler", ] +[[package]] +name = "mint" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" + [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -2911,24 +3042,23 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -2962,7 +3092,26 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", ] [[package]] @@ -2984,9 +3133,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "open-fastrlp" @@ -3142,9 +3291,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.7" +version = "2.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" +checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8" dependencies = [ "memchr", "thiserror", @@ -3201,7 +3350,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -3224,22 +3373,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -3266,9 +3415,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "powerfmt" @@ -3305,7 +3454,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -3376,9 +3525,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -3430,7 +3579,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.48", + "syn 2.0.52", "tempfile", "which", ] @@ -3445,7 +3594,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -3534,9 +3683,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" dependencies = [ "either", "rayon-core", @@ -3580,7 +3729,7 @@ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.6", "regex-syntax 0.8.2", ] @@ -3595,9 +3744,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -3610,12 +3759,6 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - [[package]] name = "regex-syntax" version = "0.8.2" @@ -3630,9 +3773,9 @@ checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "78bf93c4af7a8bb7d879d51cebe797356ff10ae8516ace542b5182d9dcac10b2" dependencies = [ "async-compression", "base64 0.21.7", @@ -3641,7 +3784,7 @@ dependencies = [ "futures-core", "futures-util", "h2 0.3.24", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", "hyper-rustls 0.24.2", @@ -3699,16 +3842,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3722,43 +3866,31 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d263c6370d7714d2a634b6d88deb3871d0fad1f9486a9da6d48139c1ac85b26" -dependencies = [ - "anyhow", - "elf", - "risc0-zkp 0.20.1", - "risc0-zkvm-platform 0.20.1", - "serde", - "tracing", -] - -[[package]] -name = "risc0-binfmt" -version = "0.21.0-alpha.1" -source = "git+https://github.com/risc0/risc0?rev=7f731662#7f731662eaeb2d91b332cf85d4cbd61c87fc5c67" +checksum = "2ae2939426c60756f910352184716a3538748208c9e11ade4a507db3b2757157" dependencies = [ "anyhow", "elf", - "risc0-zkp 0.21.0-alpha.1", - "risc0-zkvm-platform 0.21.0-alpha.1", + "risc0-zkp", + "risc0-zkvm-platform", "serde", "tracing", ] [[package]] name = "risc0-build" -version = "0.21.0-alpha.1" -source = "git+https://github.com/risc0/risc0?rev=7f731662#7f731662eaeb2d91b332cf85d4cbd61c87fc5c67" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a6a0138c9ae1d82eaa2ab6047535481a17641ba6c354890770bf94fbef8049" dependencies = [ "anyhow", "cargo-platform", "cargo_metadata 0.17.0", "docker-generate", - "risc0-binfmt 0.21.0-alpha.1", - "risc0-zkp 0.21.0-alpha.1", - "risc0-zkvm-platform 0.21.0-alpha.1", + "risc0-binfmt", + "risc0-zkp", + "risc0-zkvm-platform", "serde", "serde_json", "tempfile", @@ -3772,14 +3904,14 @@ dependencies = [ "hex", "pretty_assertions", "risc0-build", - "risc0-zkp 0.20.1", + "risc0-zkp", ] [[package]] name = "risc0-build-kernel" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa4cd0e10797e933d0e2056e24e5b15cc0bb324d5dfd44e145048a0029f7af5" +checksum = "cc02fece98f870221c25c22241e5f226fb3a9230df9cdeab170907440a97f41b" dependencies = [ "cc", "directories", @@ -3790,19 +3922,21 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9835069929a0e7b6b4b34e6a83f08aaa9d34b30023b9ccaf96ddbe20404eba" +checksum = "a43cade35f73ad81ba974fe1d5e1513331f87052af8377b26b00a838f39c6920" dependencies = [ "anyhow", "bytemuck", + "cust", "downloader", "hex", + "metal", "rand", "rayon", "risc0-circuit-recursion-sys", - "risc0-core 0.20.1", - "risc0-zkp 0.20.1", + "risc0-core", + "risc0-zkp", "sha2 0.10.8", "tracing", "zip", @@ -3810,56 +3944,49 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion-sys" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12fa422928ccae0ca6d39a3bdb784e417c65813f004b258f2113609095358ba" +checksum = "6ad2b82cbb0e0cc22182f00287f513daea3ea8a5cc0b709d8afdd9d9180fb89a" dependencies = [ "glob", "risc0-build-kernel", - "risc0-core 0.20.1", + "risc0-core", ] [[package]] name = "risc0-circuit-rv32im" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb1caa759ab74d08779e062fcf98f5bd34397dfde572516a52369f0ec46db650" +checksum = "31440989146b342a7d37c15079c9568c69b7f988f3b789f422c7d4ed76526ddb" dependencies = [ "anyhow", + "cust", + "metal", "rand", "rayon", "risc0-circuit-rv32im-sys", - "risc0-core 0.20.1", - "risc0-zkp 0.20.1", - "risc0-zkvm-platform 0.20.1", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", "tracing", ] [[package]] name = "risc0-circuit-rv32im-sys" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a88e4b25e30eeb49adab83fe014110bec18e69dd63a47a5f36b00ac48fe373" +checksum = "634d60a79888ec9416dbd3c88bac9b630b05e513c466b7acd64b7641eed48749" dependencies = [ "glob", "risc0-build-kernel", - "risc0-core 0.20.1", + "risc0-core", ] [[package]] name = "risc0-core" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be79c89bcd18886b376073e3da22f8b7963247a42dce7b49cf3d09853f51641e" -dependencies = [ - "bytemuck", - "rand_core", -] - -[[package]] -name = "risc0-core" -version = "0.21.0-alpha.1" -source = "git+https://github.com/risc0/risc0?rev=7f731662#7f731662eaeb2d91b332cf85d4cbd61c87fc5c67" +checksum = "02e0cbd09d03c23b572b66cd96a56143adb22bf895aca89c1a153ccebedaa0b4" dependencies = [ "bytemuck", "rand_core", @@ -3888,7 +4015,6 @@ dependencies = [ "axum", "backoff", "bincode", - "bonsai-rest-api-mock", "bonsai-sdk", "bytemuck", "clap", @@ -3944,56 +4070,74 @@ dependencies = [ "risc0-zkvm", ] +[[package]] +name = "risc0-groth16" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da1e9b8dae3f9c3862b6278b2812989a2f5a537975e5bd6a687f07cf1df68a36" +dependencies = [ + "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize 0.4.2", + "bytemuck", + "hex", + "num-bigint 0.4.4", + "num-derive", + "num-traits", + "risc0-core", + "risc0-zkp", + "serde", + "serde_json", + "tempfile", + "tracing", +] + +[[package]] +name = "risc0-sppark" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be1d1ff7fe501c9f420654bc1ff7461909b85e7f8fb3698a8812c0a8a787306" +dependencies = [ + "cc", + "which", +] + [[package]] name = "risc0-sys" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c40caeacec542a0187e44203dd90501edcecf194cad648d590f6b2b0e4e4e5b" +checksum = "61168816f4921e3cf1c9ff98792a7aa58d3e6c2dc5072bd7666690310e99fea1" dependencies = [ "cc", + "cust", "risc0-build-kernel", + "risc0-sppark", ] [[package]] name = "risc0-zkp" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e20a57e04840a5afadebb5d232546245f4fd8bd0e774bd69bf4bf25f8ab90c04" +checksum = "b96b035f744ecaaa7e9809c699bc85cf669cbab6f297f141d918e9b4c8098b79" dependencies = [ "anyhow", "blake2", "bytemuck", + "cust", "digest 0.10.7", "ff", "hex", "lazy_static", + "metal", "ndarray", "paste", "rand", "rand_core", "rayon", - "risc0-core 0.20.1", + "risc0-core", "risc0-sys", - "risc0-zkvm-platform 0.20.1", - "serde", - "sha2 0.10.8", - "tracing", -] - -[[package]] -name = "risc0-zkp" -version = "0.21.0-alpha.1" -source = "git+https://github.com/risc0/risc0?rev=7f731662#7f731662eaeb2d91b332cf85d4cbd61c87fc5c67" -dependencies = [ - "anyhow", - "blake2", - "bytemuck", - "digest 0.10.7", - "hex", - "paste", - "rand_core", - "risc0-core 0.21.0-alpha.1", - "risc0-zkvm-platform 0.21.0-alpha.1", + "risc0-zkvm-platform", "serde", "sha2 0.10.8", "tracing", @@ -4001,15 +4145,12 @@ dependencies = [ [[package]] name = "risc0-zkvm" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "922588cb4b884b3951316a65581ccdfd1174af93c54093190878366812073329" +checksum = "2a1275834c86176efc122a172c2b5f271a8a5d792de7efbc47dfbecaaaff9432" dependencies = [ "addr2line", "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize 0.4.2", "bincode", "bonsai-sdk", "bytemuck", @@ -4021,22 +4162,22 @@ dependencies = [ "hex", "human-repr", "lazy-regex", - "num-bigint 0.4.4", "num-derive", "num-traits", "prost", "prost-build", "protobuf-src", "rayon", - "risc0-binfmt 0.20.1", + "risc0-binfmt", "risc0-circuit-recursion", "risc0-circuit-rv32im", - "risc0-core 0.20.1", - "risc0-zkp 0.20.1", - "risc0-zkvm-platform 0.20.1", + "risc0-core", + "risc0-groth16", + "risc0-zkp", + "risc0-zkvm-platform", "rrs-lib", "rustc-demangle", - "semver 1.0.21", + "semver 1.0.22", "serde", "sha2 0.10.8", "tempfile", @@ -4046,20 +4187,15 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5819c0c3bfd8f20b1226c9d4ca1f342eb3d8385e71211a9383a879643d1dde" +checksum = "03b6378c9e407be18a1560ed030fd87fb6056293c56263efac46c507ae97e0d7" dependencies = [ "bytemuck", "getrandom", "libm", ] -[[package]] -name = "risc0-zkvm-platform" -version = "0.21.0-alpha.1" -source = "git+https://github.com/risc0/risc0?rev=7f731662#7f731662eaeb2d91b332cf85d4cbd61c87fc5c67" - [[package]] name = "rlp" version = "0.5.2" @@ -4117,15 +4253,15 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.48", + "syn 2.0.52", "unicode-ident", ] [[package]] name = "ruint" -version = "1.11.1" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608a5726529f2f0ef81b8fde9873c4bb829d6b5b5ca6be4d97345ddf0749c825" +checksum = "8f308135fef9fc398342da5472ce7c484529df23743fb7c734e0f3d472971e62" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", @@ -4147,9 +4283,9 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e666a5496a0b2186dbcd0ff6106e29e093c15591bde62c20d3842007c6978a09" +checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" [[package]] name = "rusoto_core" @@ -4162,7 +4298,7 @@ dependencies = [ "bytes", "crc32fast", "futures", - "http 0.2.11", + "http 0.2.12", "hyper 0.14.28", "hyper-rustls 0.23.2", "lazy_static", @@ -4221,7 +4357,7 @@ dependencies = [ "futures", "hex", "hmac 0.11.0", - "http 0.2.11", + "http 0.2.12", "hyper 0.14.28", "log", "md-5 0.9.1", @@ -4236,9 +4372,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "8.2.0" +version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82c0bbc10308ed323529fd3c1dce8badda635aa319a5ff0e6466f33b8101e3f" +checksum = "fb78f46d0066053d16d4ca7b898e9343bc3530f71c61d5ad84cd404ada068745" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -4247,23 +4383,23 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.2.0" +version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6227c01b1783cdfee1bcf844eb44594cd16ec71c35305bf1c9fb5aade2735e16" +checksum = "b91ac2a3c6c0520a3fb3dd89321177c3c692937c4eb21893378219da10c44fc8" dependencies = [ "proc-macro2", "quote", "rust-embed-utils", "shellexpand", - "syn 2.0.48", + "syn 2.0.52", "walkdir", ] [[package]] name = "rust-embed-utils" -version = "8.2.0" +version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb0a25bfbb2d4b4402179c2cf030387d9990857ce08a32592c6238db9fa8665" +checksum = "86f69089032567ffff4eada41c573fc43ff466c7db7c5688b2e7969584345581" dependencies = [ "sha2 0.10.8", "walkdir", @@ -4296,7 +4432,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.21", + "semver 1.0.22", ] [[package]] @@ -4331,7 +4467,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.7", + "ring 0.17.8", "rustls-webpki", "sct", ] @@ -4363,7 +4499,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -4398,9 +4534,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "salsa20" @@ -4422,9 +4558,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +checksum = "2ef2175c2907e7c8bc0a9c3f86aeb5ec1f3b275300ad58a44d0c3ae379a5e52e" dependencies = [ "cfg-if", "derive_more", @@ -4434,9 +4570,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "634d9b8eb8fd61c5cdd3390d9b2132300a7e7618955b98b8416f118c1b4e144f" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -4477,7 +4613,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -4529,9 +4665,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] @@ -4574,7 +4710,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -4590,9 +4726,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -4641,7 +4777,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -4777,12 +4913,12 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4848,30 +4984,30 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "strum" -version = "0.25.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.25.3" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -4891,7 +5027,7 @@ dependencies = [ "hex", "once_cell", "reqwest", - "semver 1.0.21", + "semver 1.0.22", "serde", "serde_json", "sha2 0.10.8", @@ -4913,9 +5049,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -4924,14 +5060,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63bef2e2c735acbc06874eca3a8506f02a3c4700e6e748afc92cc2e4220e8a03" +checksum = "cb3d0961cd53c23ea94eeec56ba940f636f6394788976e9f16ca5ee0aca7464a" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -4969,9 +5105,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", @@ -5016,14 +5152,14 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -5111,7 +5247,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -5177,14 +5313,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.4", + "toml_edit 0.22.7", ] [[package]] @@ -5204,7 +5340,7 @@ checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -5215,7 +5351,7 @@ checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -5226,20 +5362,20 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.4" +version = "0.22.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.5", ] [[package]] @@ -5260,13 +5396,13 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da193277a4e2c33e59e09b5861580c33dd0a637c3883d0fa74ba40c0374af2e" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ "bitflags 2.4.2", "bytes", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "http-body-util", "pin-project-lite", @@ -5307,7 +5443,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -5396,7 +5532,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 0.2.11", + "http 0.2.12", "httparse", "log", "rand", @@ -5425,9 +5561,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typetag" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43148481c7b66502c48f35b8eef38b6ccdc7a9f04bd4cc294226d901ccc9bc7" +checksum = "661d18414ec032a49ece2d56eee03636e43c4e8d577047ab334c0ba892e29aaf" dependencies = [ "erased-serde", "inventory", @@ -5438,13 +5574,13 @@ dependencies = [ [[package]] name = "typetag-impl" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291db8a81af4840c10d636e047cac67664e343be44e24dfdbd1492df9a5d3390" +checksum = "ac73887f47b9312552aa90ef477927ff014d63d1920ca8037c6c1951eab64bb1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -5494,9 +5630,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -5564,7 +5700,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.48", + "syn 2.0.52", "uuid 1.7.0", ] @@ -5652,6 +5788,18 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "vek" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8085882662f9bc47fc8b0cdafa5e19df8f592f650c02b9083da8d45ac9eebd17" +dependencies = [ + "approx", + "num-integer", + "num-traits", + "rustc_version 0.4.0", +] + [[package]] name = "version_check" version = "0.9.4" @@ -5669,9 +5817,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -5694,9 +5842,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5704,24 +5852,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -5731,9 +5879,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5741,22 +5889,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-streams" @@ -5773,9 +5921,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -5787,7 +5935,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -5846,7 +5994,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -5864,7 +6012,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -5884,17 +6032,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -5905,9 +6053,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -5917,9 +6065,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -5929,9 +6077,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -5941,9 +6089,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -5953,9 +6101,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -5965,9 +6113,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -5977,15 +6125,24 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winnow" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] [[package]] name = "winnow" -version = "0.5.39" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] @@ -6011,9 +6168,9 @@ dependencies = [ "base64 0.21.7", "deadpool", "futures", - "http 1.0.0", + "http 1.1.0", "http-body-util", - "hyper 1.1.0", + "hyper 1.2.0", "hyper-util", "log", "once_cell", @@ -6081,7 +6238,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -6101,7 +6258,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8bfbf186..8a595f09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,18 +11,16 @@ repository = "https://github.com/risc0/risc0-ethereum/" [workspace.dependencies] # Intra-workspace dependencies +risc0-build-ethereum = { version = "0.8.0-alpha.1", default-features = false, path = "build" } risc0-ethereum-contracts = { version = "0.8.0-alpha.1", default-features = false, path = "contracts" } -risc0-forge-ffi = { version = "0.8.0-alpha.1", default-features = false, path = "ffi" } risc0-ethereum-relay = { version = "0.8.0-alpha.1", default-features = false, path = "relay" } +risc0-forge-ffi = { version = "0.8.0-alpha.1", default-features = false, path = "ffi" } alloy-primitives = { version = "0.6", default-features = false, features = ["rlp", "serde", "std"] } alloy-sol-types = { version = "0.6" } anyhow = { version = "1.0.75" } bincode = { version = "1.3" } -bonsai-rest-api-mock = { version = "0.6.1", default-features = false } -bonsai-sdk = { version = "0.6.1", default-features = false } -risc0-zkvm = { version = "0.20", default-features = false } -risc0-zkp = { version = "0.20", default-features = false } -# NOTE: Using a git rev temporarily to get an unreleased version of risc0-build. -# Once the referenced commit is in a released version of risc0-build, this will go back to using a version. -risc0-build = { git = "https://github.com/risc0/risc0", rev = "7f731662", default-features = false } +bonsai-sdk = { version = "0.7", default-features = false } +risc0-build = { version = "0.21", default-features = false } +risc0-zkp = { version = "0.21", default-features = false } +risc0-zkvm = { version = "0.21", default-features = false } diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 34e054e0..a53476ba 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -17,7 +17,7 @@ anyhow = { workspace = true } bonsai-sdk = { workspace = true } ethers = { version = "2.0", features = ["rustls", "ws"] } hex = { version = "0.4", optional = true } -risc0-zkvm = { workspace = true, optional = true } +risc0-zkvm = { workspace = true } [dev-dependencies] tokio = { version = "1", features = ["macros", "rt"] } @@ -27,4 +27,4 @@ doctest = false [features] default = [] -control-id = ["dep:risc0-zkvm", "dep:hex", "risc0-zkvm/prove"] +control-id = ["dep:hex", "risc0-zkvm/prove"] diff --git a/contracts/src/groth16.rs b/contracts/src/groth16.rs index f113dace..df82b5dc 100644 --- a/contracts/src/groth16.rs +++ b/contracts/src/groth16.rs @@ -15,7 +15,7 @@ use alloy_primitives::U256; use alloy_sol_types::{sol, SolValue}; use anyhow::{ensure, Result}; -use bonsai_sdk::alpha as bonsai_sdk; +use risc0_zkvm::Groth16Seal; sol! { /// Groth16 seal construction from [RiscZeroGroth16Verifier.sol]. @@ -31,16 +31,16 @@ sol! { impl Seal { /// ABI encoding of the seal. - pub fn abi_encode(seal: bonsai_sdk::responses::Groth16Seal) -> Result> { + pub fn abi_encode(seal: Groth16Seal) -> Result> { let seal = Seal::try_from(seal)?; Ok(seal.abi_encode()) } } -impl TryFrom for Seal { +impl TryFrom for Seal { type Error = anyhow::Error; - fn try_from(seal: bonsai_sdk::responses::Groth16Seal) -> Result { + fn try_from(seal: Groth16Seal) -> Result { ensure!( seal.a.len() == 2, "seal.a has invalid length: {}", diff --git a/contracts/src/groth16/ControlID.sol b/contracts/src/groth16/ControlID.sol index 5481047e..5107cea6 100644 --- a/contracts/src/groth16/ControlID.sol +++ b/contracts/src/groth16/ControlID.sol @@ -20,6 +20,6 @@ pragma solidity ^0.8.9; library ControlID { - uint256 public constant CONTROL_ID_0 = 0x447d7e12291364db4bc5421164880129; - uint256 public constant CONTROL_ID_1 = 0x12c49ad247d28a32147e13615c6c81f9; + uint256 public constant CONTROL_ID_0 = 0x39ff805954f4eb2868d338764408f76d; + uint256 public constant CONTROL_ID_1 = 0x15cf3a5f4097269e3a6d921c18625531; } diff --git a/contracts/src/groth16/Groth16Verifier.sol b/contracts/src/groth16/Groth16Verifier.sol index 1c92b3a5..b680e729 100644 --- a/contracts/src/groth16/Groth16Verifier.sol +++ b/contracts/src/groth16/Groth16Verifier.sol @@ -37,25 +37,25 @@ contract Groth16Verifier { uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781; uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531; uint256 constant gammay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930; - uint256 constant deltax1 = 18518940221910320856687047018635785128750837022059566906616608708313475199865; - uint256 constant deltax2 = 9492326610711013918333865133991413442330971822743127449106067493230447878125; - uint256 constant deltay1 = 19483644759748826533215810634368877792922012485854314246298395665859158607201; - uint256 constant deltay2 = 21375251776817431660251933179512026180139877181625068362970095925425149918084; + uint256 constant deltax1 = 20637939757332191985219466750514112514830176492003070298908178796582256423445; + uint256 constant deltax2 = 21015870987554935578856562994563796394452175083269944606559673949460277152483; + uint256 constant deltay1 = 7308971620370004609743038871778988943972318366181842608509263947408591078846; + uint256 constant deltay2 = 19578762133483017273429849028797807252406479590275449312036317638112265649126; - uint256 constant IC0x = 5283414572476013565779278723585415063371186194506872223482170607932178811733; - uint256 constant IC0y = 18704069070102836155408936676819275373965966640372164023392964533091458933020; + uint256 constant IC0x = 4595639739788529313135927846153489513260052783364743523344328896305419933627; + uint256 constant IC0y = 13577843718844184042346095806470311065274840502864234728407198439361979518223; - uint256 constant IC1x = 4204832149120840018317309580010992142700029278901617154852760187580780425598; - uint256 constant IC1y = 12454324579480242399557363837918019584959512625719173397955145140913291575910; + uint256 constant IC1x = 19125733112813331880180112762042920784001527126678496097978721184513458499861; + uint256 constant IC1y = 470495054354753477176064253439657941845200056447070007550476843795069859530; - uint256 constant IC2x = 14956117485756386823219519866025248834283088288522682527835557402788427995664; - uint256 constant IC2y = 6968527870554016879785099818512699922114301060378071349626144898778340839382; + uint256 constant IC2x = 9798632009143333403145042225641105799474060066926099950339875153142594918323; + uint256 constant IC2y = 15467851970301286525906423722646678659414362276892586739627188622113917076355; - uint256 constant IC3x = 6512168907754184210144919576616764035747139382744482291187821746087116094329; - uint256 constant IC3y = 17156131719875889332084290091263207055049222677188492681713268727972722760739; + uint256 constant IC3x = 4677856832410602822119633312864839150180396112709578634305606190993420950086; + uint256 constant IC3y = 21413789555508871663216491538642005537595601774930793267108872091881334409985; - uint256 constant IC4x = 5195346330747727606774560791771406703229046454464300598774280139349802276261; - uint256 constant IC4y = 16279160127031959334335024858510026085227931356896384961436876214395869945425; + uint256 constant IC4x = 17622463197037705164686879153818888337611670039316323149958751021262085916949; + uint256 constant IC4y = 10546326028888365743245970980969672597991412490319907398941581639510925080455; // Memory data uint16 constant pVk = 0; diff --git a/contracts/test/TestReceipt.sol b/contracts/test/TestReceipt.sol index bd46af8f..b3f8b67d 100644 --- a/contracts/test/TestReceipt.sol +++ b/contracts/test/TestReceipt.sol @@ -21,8 +21,8 @@ pragma solidity ^0.8.13; library TestReceipt { bytes public constant SEAL = - hex"0b79052f45ac3c4873607632575e2f8777ee1776e702eb09c419487a80228fd51ae4c3bec6344ddcc9c31f180ea571326102d5f640e2f2a17dec9f608007e63802f4c00951d50a256afc2fb6829d3679748b5ea57931bf6921ab07a7492ca3751fddf7493b473b6f99c3c036004f9f1c0d985fb00cbd6d64d4ddb5cabafd49fc29c7ac262d12fc190522384f0b77b3139fcc51516eefc088a6bc49093b28029827d7612bff120f2880eab4b7bb1aa1cdaa563193827f01119f8e57cef6daf6a516d8c0445ea5f5514fdbe9e3a1e2b6d4cc4ac7983982bbc8cffee7a9177032a32382aadee5f7017ab25b2a7c82b355d46e7c9cbe13587d552cebd14a816b448e"; - bytes32 public constant POST_DIGEST = bytes32(0xb8e6dde26b99d84dd257eef56a4f9adc1b03a0bb88ca5a3ad39a91e367f5c3f7); + hex"24900daf58fe808c62915fd7bdb6824905e3fe1803ce5403f9f8d9dc7093a82427b1eebb7e758e809071b9c7b552453ab7c7350934fc692ac3378b9aabf615fa0570e34568aa3a1eb73e68ff2390ddb4fb93b7b2d970411fe80ba0e81fec787a2c970d93996fb4c77f1bd50857c76c855cfeb75146121e30d72aceda613968122b934d84e93bc51aae5a41587f0e33918db801631f03eeae6b31e534554b0f180f1f4cb9da9d57a75f6c5cfbe465cb147da61fc5ae7b2e30129fe162ec8ba86018a03bcbd34f8357022d2b1438936d10ffad01a225dbbead509a46d3f62ea43328a2112dc0a104e629366ad95e1eec3152df91865ed10fe0014c69f498906da1"; + bytes32 public constant POST_DIGEST = bytes32(0x9a1a653b6ac4ab399d7ca5939ffc3ff35d6c8f225af26c80d9d7846e26ab77a8); bytes public constant JOURNAL = hex""; - bytes32 public constant IMAGE_ID = bytes32(0x35e14f92e1c7989a467611bb39d2cf7f46dc4488404f8e8179960cc7be13f8a8); + bytes32 public constant IMAGE_ID = bytes32(0xb1b5572254d75b231b1cdcc07cfa7bdb61a0ef2701965a0483d207c25cd9a77f); } diff --git a/relay/Cargo.toml b/relay/Cargo.toml index 42b109d9..4ee9fe08 100644 --- a/relay/Cargo.toml +++ b/relay/Cargo.toml @@ -13,7 +13,6 @@ async-trait = "0.1" axum = { version = "0.7", features = ["macros"] } backoff = { version = "0.4", features = ["tokio"] } bincode = "1.3" -bonsai-rest-api-mock = { workspace = true } bonsai-sdk = { workspace = true, features = ["async"] } clap = { version = "4.1", features = ["derive", "env"] } displaydoc = "0.2" @@ -40,10 +39,12 @@ tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } utoipa = { version = "4.1", features = ["axum_extras", "time", "uuid"] } utoipa-swagger-ui = { version = "5.0", features = ["axum", "debug-embed"] } +uuid = { version = "1.4", features = ["v4", "serde"] } validator = { version = "0.16", features = ["derive"] } [dev-dependencies] bincode = "1" +bonsai-sdk = { workspace = true, features = ["async"] } bytemuck = "1.14" risc0-ethereum-relay-test-methods = { path = "./tests/methods" } rstest = "0.18" @@ -51,3 +52,9 @@ serial_test = "2.0" time = "0.3" uuid = { version = "1.3", features = ["v4", "serde"] } wiremock = "0.6" + +[features] +cuda = ["risc0-zkvm/cuda"] +default = [] +metal = ["risc0-zkvm/metal"] +prove = ["risc0-zkvm/prove"] diff --git a/relay/src/bin/bonsai-rest-api-mock.rs b/relay/src/bin/bonsai-rest-api-mock.rs new file mode 100644 index 00000000..3d6cb1e7 --- /dev/null +++ b/relay/src/bin/bonsai-rest-api-mock.rs @@ -0,0 +1,22 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use risc0_ethereum_relay::bonsai_rest_api_mock; +use tokio::net::TcpListener; + +#[tokio::main] +async fn main() { + let listener = TcpListener::bind("0.0.0.0:8081").await.unwrap(); + let _ = bonsai_rest_api_mock::serve(listener).await; +} diff --git a/relay/src/main.rs b/relay/src/bin/risc0-ethereum-relay.rs similarity index 100% rename from relay/src/main.rs rename to relay/src/bin/risc0-ethereum-relay.rs diff --git a/relay/src/bonsai_rest_api_mock/error.rs b/relay/src/bonsai_rest_api_mock/error.rs new file mode 100644 index 00000000..69d31639 --- /dev/null +++ b/relay/src/bonsai_rest_api_mock/error.rs @@ -0,0 +1,153 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use std::{ + error::Error as StdError, + fmt::{self, Debug}, + num::TryFromIntError, + sync::PoisonError, +}; + +use axum::{http::StatusCode, response}; +use tokio::task::JoinError; + +#[derive(thiserror::Error, Debug)] +pub(crate) enum Error { + #[error("ImageIdExists")] + ImageIdExists, + #[error("Bincode error")] + Bincode(#[from] bincode::Error), + #[error("Hex decode error")] + Hex(#[from] hex::FromHexError), + #[error("IO error")] + IO(#[from] std::io::Error), + #[error("Serde JSON error")] + SerdeJson(#[from] serde_json::Error), + #[error("JoinHandle error")] + Join(#[from] JoinError), + #[error("Unspecified error")] + Unspecified(#[from] anyhow::Error), + #[error("Poisoned lock")] + Poisoned, +} + +impl From> for Error { + fn from(_: PoisonError) -> Self { + Self::Poisoned + } +} + +impl Error { + pub fn status_code(&self) -> StatusCode { + match self { + Error::ImageIdExists { .. } => StatusCode::NO_CONTENT, + Error::Poisoned + | Error::Bincode { .. } + | Error::Unspecified { .. } + | Error::Hex { .. } + | Error::IO { .. } + | Error::SerdeJson { .. } + | Error::Join { .. } => StatusCode::INTERNAL_SERVER_ERROR, + } + } +} + +impl From for Error { + fn from(err: TryFromIntError) -> Self { + Self::Unspecified(err.into()) + } +} + +/// Convert [`Error`] into an HTTP response. +impl response::IntoResponse for Error { + fn into_response(self) -> response::Response { + let status = self.status_code(); + // log errors as one line with all its causes + if status.is_client_error() || status.is_server_error() { + tracing::error!( + "Error response: {} ({:?})", + DisplayErrorCauses(&self), + &self + ); + } + // prepare an error message + let message = match status { + // for 500 Internal Server Error, we only return the error name, e.g.: + // "IO Error" + StatusCode::INTERNAL_SERVER_ERROR => self.to_string(), + // otherwise, use the alternative anyhow formatting: colon-separated chain, e.g.: + // "IO error: broken pipe" + _ => format!("{}", DisplayErrorCauses(&self)), + }; + + // return the message as simple text + (status, message).into_response() + } +} + +/// Provides a `Display` impl for `Error` that outputs the full chain of errors. +#[derive(Debug)] +pub(crate) struct DisplayErrorCauses(pub E); + +impl fmt::Display for DisplayErrorCauses { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write_err(f, &self.0) + } +} + +fn write_err(f: &mut fmt::Formatter<'_>, err: &dyn StdError) -> fmt::Result { + write!(f, "{}", err)?; + if let Some(source) = err.source() { + write!(f, ": ")?; + write_err(f, source)?; + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use std::io; + + use anyhow::{anyhow, Context}; + + use super::*; + + #[test] + fn test_errors() { + fn propagate_error() -> Result<(), Error> { + Err(anyhow!("inner error"))? + } + + let option: Option = None; + // use context to consume an option or a Result. The returned error will be of + // type anyhow i.e., 500 error status code + assert!(option.clone().context("option is none").is_err()); + assert!(propagate_error().context("caller").is_err()); + } + + fn io_err>>(error: E) -> Error { + let io_err = io::Error::new(io::ErrorKind::Other, error); + io_err.into() + } + + #[test] + fn test_display() { + let err = io_err(io_err("mocked")); + assert_eq!(format!("{}", &err), "IO error"); + assert_eq!( + format!("{}", DisplayErrorCauses(&err)), + "IO error: IO error: mocked" + ); + } +} diff --git a/relay/src/bonsai_rest_api_mock/mod.rs b/relay/src/bonsai_rest_api_mock/mod.rs new file mode 100644 index 00000000..2464a645 --- /dev/null +++ b/relay/src/bonsai_rest_api_mock/mod.rs @@ -0,0 +1,186 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub(crate) mod error; +pub(crate) mod prover; +pub(crate) mod routes; +pub(crate) mod state; + +use std::sync::{Arc, RwLock}; + +use anyhow::Context; +use axum::{ + extract::DefaultBodyLimit, + routing::{get, post, put}, + Extension, Router, +}; +use tokio::{net::TcpListener, sync::mpsc}; +use tower_http::trace::{DefaultOnRequest, TraceLayer}; +use tracing::{info, Level}; + +use { + prover::{Prover, ProverHandle}, + routes::{ + create_session, create_snark, get_image_upload, get_input_upload, get_receipt, + get_receipt_upload, put_image_upload, put_input_upload, put_receipt, session_status, + snark_status, + }, + state::BonsaiState, +}; + +fn app(state: Arc>, prover_handle: ProverHandle) -> Router { + Router::new() + .route("/images/upload/:image_id", get(get_image_upload)) + .route("/images/:image_id", put(put_image_upload)) + .route("/inputs/upload", get(get_input_upload)) + .route("/inputs/:input_id", put(put_input_upload)) + .route("/sessions/create", post(create_session)) + .route("/sessions/status/:session_id", get(session_status)) + .route("/snark/create", post(create_snark)) + .route("/snark/status/:snark_id", get(snark_status)) + .route("/receipts/:session_id", get(get_receipt)) + .route("/receipts/:session_id", put(put_receipt)) + .route("/receipts/upload", get(get_receipt_upload)) + .layer(Extension(prover_handle)) + .with_state(state) + .layer(DefaultBodyLimit::max(256 * 1024 * 1024)) + .layer(TraceLayer::new_for_http().on_request( + DefaultOnRequest::new().level(Level::TRACE), // make on_request less visible + )) +} + +/// Starts a mock of Bonsai on localhost at the given port. It exposes the same +/// REST API of Bonsai alpha. +/// +/// Note that this mock only performs execution, no proving. +pub async fn serve(listener: TcpListener) -> anyhow::Result<()> { + let local_addr = listener.local_addr().unwrap(); + let port = local_addr.port(); + let local_url = format!("http://127.0.0.1:{port}"); + let state = Arc::new(RwLock::new(BonsaiState::new(local_url))); + + let (sender, receiver) = mpsc::channel(8); + let mut prover = Prover::new(receiver, Arc::clone(&state)); + + let prover_handle = ProverHandle { sender }; + + tokio::spawn(async move { prover.run().await }); + + info!("Local Bonsai started on {local_addr}"); + + axum::serve(listener, app(state, prover_handle)) + .await + .context(format!("failed to serve Local Bonsai API on {local_addr}")) +} + +#[cfg(test)] +mod test { + use std::time::Duration; + + use anyhow::{bail, Result}; + use bonsai_sdk::alpha_async as bonsai_sdk; + use risc0_ethereum_relay_test_methods::HELLO_COMMIT_ELF; + use risc0_zkvm::compute_image_id; + use tokio::net::TcpListener; + + use super::serve; + + async fn run_bonsai(bonsai_api_url: String, bonsai_api_key: String, elf: &[u8]) -> Result<()> { + let client = + bonsai_sdk::get_client_from_parts(bonsai_api_url, bonsai_api_key, risc0_zkvm::VERSION) + .await?; + + // Compute the image_id, then upload the ELF with the image_id as its key. + // TODO: it would be nice if `bonsai_sdk::upload_img` only took the ELF + // so that the image_id can be computed server-side. + let image_id = hex::encode(compute_image_id(elf)?); + bonsai_sdk::upload_img(client.clone(), image_id.clone(), elf.to_vec()).await?; + + // Prepare input data and upload it. + let input_id = bonsai_sdk::upload_input(client.clone(), vec![]).await?; + + // Prepare symbolic list of receipt data and upload it. + let receipts_ids = vec![bonsai_sdk::upload_receipt(client.clone(), vec![]).await?]; + + // Start a session running the prover + let session = + bonsai_sdk::create_session(client.clone(), image_id, input_id, receipts_ids).await?; + loop { + let res = bonsai_sdk::session_status(client.clone(), session.clone()).await?; + if res.status == "RUNNING" { + std::thread::sleep(Duration::from_secs(15)); + continue; + } + if res.status == "SUCCEEDED" { + // Download the receipt, containing the output + let receipt_url = res + .receipt_url + .expect("API error, missing receipt on completed session"); + bonsai_sdk::download(client.clone(), receipt_url) + .await + .unwrap(); + } else { + bail!("Error"); + } + + break; + } + + Ok(()) + } + + #[tokio::test] + async fn local_bonsai() { + use std::{thread::sleep, time::Duration}; + + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let local_addr = listener.local_addr().unwrap(); + let local_bonsai_handle = tokio::spawn(async move { serve(listener).await }); + + // wait for the service to be up + sleep(Duration::from_secs(1)); + + run_bonsai( + format!("http://{local_addr}"), + "test_key".to_string(), + HELLO_COMMIT_ELF, + ) + .await + .unwrap(); + + local_bonsai_handle.abort(); + } + + #[tokio::test] + async fn local_bonsai_wrong_elf() { + use std::{thread::sleep, time::Duration}; + + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let local_addr = listener.local_addr().unwrap(); + let local_bonsai_handle = tokio::spawn(async move { serve(listener).await }); + + // wait for the service to be up + sleep(Duration::from_secs(1)); + + assert!(run_bonsai( + format!("http://{local_addr}"), + "test_key".to_string(), + b"wrong ELF" + ) + .await + .is_err()); + + local_bonsai_handle.abort(); + } +} diff --git a/relay/src/bonsai_rest_api_mock/prover.rs b/relay/src/bonsai_rest_api_mock/prover.rs new file mode 100644 index 00000000..ee79b143 --- /dev/null +++ b/relay/src/bonsai_rest_api_mock/prover.rs @@ -0,0 +1,185 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use std::{ + fmt, + sync::{Arc, RwLock}, +}; + +use anyhow::Context; +use risc0_zkvm::{ + default_executor, sha::Digest, ExecutorEnv, InnerReceipt, MaybePruned, Receipt, ReceiptClaim, +}; +use tokio::sync::mpsc; + +use super::{error::Error, state::BonsaiState}; + +#[derive(Debug, Clone)] +pub(crate) struct Task { + pub session_id: String, + pub image_id: String, + pub input_id: String, + pub assumptions: Vec, +} + +#[derive(Debug)] +pub(crate) enum ProverMessage { + RunSession(Task), +} + +impl fmt::Display for ProverMessage { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + ProverMessage::RunSession(task) => { + write!(f, "ProverMessage::RunSession: {{ task: {:?} }}", task) + } + } + } +} + +#[derive(Clone)] +pub(crate) struct ProverHandle { + pub sender: mpsc::Sender, +} + +impl ProverHandle { + pub(crate) async fn execute(&self, task: Task) { + let msg = ProverMessage::RunSession(task); + + if (self.sender.send(msg).await).is_err() { + tracing::info!("receiver dropped"); + assert!(self.sender.is_closed()); + } + } +} + +pub(crate) struct Prover { + pub(crate) receiver: mpsc::Receiver, + pub(crate) storage: Arc>, +} + +impl Prover { + pub(crate) fn new( + receiver: mpsc::Receiver, + storage: Arc>, + ) -> Self { + Prover { receiver, storage } + } + + pub async fn handle_message(&mut self, msg: &ProverMessage) -> Result<(), Error> { + match msg { + ProverMessage::RunSession(task) => { + tracing::info!("Running task..."); + let image = self.get_image(task).await?; + let input = self.get_input(task).await?; + let receipts = self.get_receipts(task).await?; + let elf = image.as_slice(); + + let mut env = ExecutorEnv::builder(); + for receipt in receipts { + if receipt.is_empty() { + continue; + } + let deserialized_receipt: Receipt = bincode::deserialize(&receipt)?; + env.add_assumption(deserialized_receipt); + } + + let env = env + .write_slice(&input) + .session_limit(None) + .segment_limit_po2(20) + .build() + .map_err(|e| { + anyhow::anyhow!("failed to build executor environment: {:?}", e) + })?; + let exec = default_executor(); + let session = exec + .execute(env, elf) + .context("Executor failed to generate a successful session")?; + + let receipt = Receipt { + inner: InnerReceipt::Fake { + claim: ReceiptClaim { + pre: MaybePruned::Pruned(Digest::ZERO), + post: MaybePruned::Pruned(Digest::ZERO), + exit_code: session.exit_code, + input: Digest::ZERO, + output: None.into(), + }, + }, + journal: session.journal, + }; + let receipt_bytes = bincode::serialize(&receipt)?; + self.storage + .write()? + .put_receipt(task.session_id.clone(), receipt_bytes); + self.storage + .write()? + .put_session(task.session_id.clone(), "SUCCEEDED".to_string()); + } + } + + Ok(()) + } + + pub(crate) async fn run(&mut self) -> Result<(), Error> { + while let Some(msg) = self.receiver.recv().await { + tracing::info!("Receiver: {}", &msg); + match self.handle_message(&msg).await { + Ok(_) => tracing::info!("Task done!"), + Err(err) => { + match &msg { + ProverMessage::RunSession(task) => self + .storage + .write()? + .put_session(task.session_id.clone(), "FAILED".to_string()), + }; + tracing::error!("Task {} failed! - {:?}", msg, err) + } + } + } + Ok(()) + } + + async fn get_image(&self, task: &Task) -> Result, Error> { + Ok(self + .storage + .read()? + .get_image(&task.image_id) + .ok_or_else(|| anyhow::anyhow!("Failed to get image for ID: {:?}", task.image_id))?) + } + + async fn get_input(&self, task: &Task) -> Result, Error> { + Ok(self + .storage + .read()? + .get_input(&task.input_id) + .ok_or_else(|| anyhow::anyhow!("Failed to get input for ID: {:?}", task.input_id))?) + } + + async fn get_receipts(&self, task: &Task) -> Result>, Error> { + let mut assumptions: Vec> = vec![]; + for receipt_id in &task.assumptions { + let receipt = self + .storage + .read()? + .get_receipt(receipt_id) + .ok_or_else(|| { + anyhow::anyhow!("Failed to get input for ID: {:?}", task.input_id) + })?; + assumptions.push(receipt); + } + Ok(assumptions) + } +} diff --git a/relay/src/bonsai_rest_api_mock/routes.rs b/relay/src/bonsai_rest_api_mock/routes.rs new file mode 100644 index 00000000..55f2fbfe --- /dev/null +++ b/relay/src/bonsai_rest_api_mock/routes.rs @@ -0,0 +1,197 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use std::vec; + +use axum::{ + body::Bytes, + extract::{Path, State}, + Extension, Json, +}; +use bonsai_sdk::alpha::responses::{ + CreateSessRes, ImgUploadRes, ProofReq, SessionStatusRes, SnarkReceipt, SnarkReq, + SnarkStatusRes, UploadRes, +}; +use risc0_zkvm::{Groth16Seal, Receipt}; +use tracing::info; + +use super::{ + error::Error, + prover::{ProverHandle, Task}, + state::AppState, +}; + +pub(crate) async fn get_image_upload( + State(s): State, + Path(image_id): Path, +) -> Result, Error> { + let state = &s.read()?; + match state.get_image(&image_id) { + Some(_) => Err(Error::ImageIdExists), + None => Ok(Json(ImgUploadRes { + url: format!("{}/images/{}", state.local_url, image_id), + })), + } +} + +pub(crate) async fn put_image_upload( + State(s): State, + Path(image_id): Path, + body: Bytes, +) -> Result<(), Error> { + s.write()?.put_image(image_id.clone(), body.to_vec()); + info!("ImageID {image_id} uploaded"); + Ok(()) +} + +pub(crate) async fn get_input_upload(State(s): State) -> Result, Error> { + let state = &s.read()?; + let input_id = uuid::Uuid::new_v4(); + Ok(Json(UploadRes { + url: format!("{}/inputs/{}", state.local_url, input_id), + uuid: input_id.to_string(), + })) +} + +pub(crate) async fn put_input_upload( + State(s): State, + Path(input_id): Path, + body: Bytes, +) -> Result<(), Error> { + s.write()?.put_input(input_id, body.to_vec()); + Ok(()) +} + +pub(crate) async fn create_session( + Extension(prover_handle): Extension, + State(s): State, + Json(request): Json, +) -> Result, Error> { + let session_id = uuid::Uuid::new_v4(); + s.write()? + .put_session(session_id.to_string(), "RUNNING".to_string()); + let task = Task { + image_id: request.img, + input_id: request.input, + session_id: session_id.to_string(), + assumptions: request.assumptions, + }; + prover_handle.execute(task).await; + + Ok(Json(CreateSessRes { + uuid: session_id.to_string(), + })) +} + +pub(crate) async fn session_status( + State(s): State, + Path(session_id): Path, +) -> Result, Error> { + let storage = s.read()?; + let status = storage + .get_session(&session_id) + .ok_or_else(|| anyhow::anyhow!("Session not found for session id: {:?}", &session_id))?; + let receipt = storage.get_receipt(&session_id); + match receipt { + Some(_) => Ok(Json(SessionStatusRes { + status, + receipt_url: Some(format!("{}/receipts/{}", storage.local_url, session_id)), + error_msg: None, + state: None, + elapsed_time: None, + stats: None, + })), + None => Ok(Json(SessionStatusRes { + status, + receipt_url: None, + error_msg: None, + state: None, + elapsed_time: None, + stats: None, + })), + } +} + +pub(crate) async fn create_snark( + Json(request): Json, +) -> Result, Error> { + Ok(Json(CreateSessRes { + uuid: request.session_id, + })) +} + +pub(crate) async fn snark_status( + State(s): State, + Path(snark_id): Path, +) -> Result, Error> { + let storage = s.read()?; + storage + .get_session(&snark_id) + .ok_or_else(|| anyhow::anyhow!("Snark status not found for snark id: {:?}", &snark_id))?; + let receipt = storage.get_receipt(&snark_id); + match receipt { + Some(bytes) => { + let receipt: Receipt = bincode::deserialize(&bytes)?; + Ok(Json(SnarkStatusRes { + status: "SUCCEEDED".to_string(), + output: Some(SnarkReceipt { + snark: Groth16Seal { + a: vec![], + b: vec![], + c: vec![], + }, + post_state_digest: vec![], + journal: receipt.journal.bytes, + }), + error_msg: None, + })) + } + None => Ok(Json(SnarkStatusRes { + status: "RUNNING".to_string(), + output: None, + error_msg: None, + })), + } +} + +pub(crate) async fn get_receipt( + State(s): State, + Path(session_id): Path, +) -> Result, Error> { + let storage = s.read()?; + let receipt = storage + .get_receipt(&session_id) + .ok_or_else(|| anyhow::anyhow!("Receipt not found for session id: {:?}", &session_id))?; + Ok(receipt) +} + +pub(crate) async fn get_receipt_upload( + State(s): State, +) -> Result, Error> { + let state = &s.read()?; + let receipt_id = uuid::Uuid::new_v4(); + Ok(Json(UploadRes { + url: format!("{}/receipts/{}", state.local_url, receipt_id), + uuid: receipt_id.to_string(), + })) +} + +pub(crate) async fn put_receipt( + State(s): State, + Path(receipt_id): Path, + body: Bytes, +) -> Result<(), Error> { + s.write()?.put_receipt(receipt_id.clone(), body.to_vec()); + Ok(()) +} diff --git a/relay/src/bonsai_rest_api_mock/state.rs b/relay/src/bonsai_rest_api_mock/state.rs new file mode 100644 index 00000000..c3f84e30 --- /dev/null +++ b/relay/src/bonsai_rest_api_mock/state.rs @@ -0,0 +1,69 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use std::{ + collections::HashMap, + sync::{Arc, RwLock}, +}; + +pub(crate) type AppState = Arc>; + +#[derive(Clone, Default)] +pub(crate) struct BonsaiState { + pub(crate) local_url: String, + // ImageID - MemoryImage + pub(crate) images: HashMap>, + // InputID - input + pub(crate) inputs: HashMap>, + // SessionID - Status + pub(crate) sessions: HashMap, + // SessionID - Receipts + pub(crate) receipts: HashMap>, +} + +impl BonsaiState { + pub(crate) fn new(local_url: String) -> Self { + Self { + local_url, + images: HashMap::new(), + inputs: HashMap::new(), + sessions: HashMap::new(), + receipts: HashMap::new(), + } + } + pub(crate) fn put_image(&mut self, image_id: String, image: Vec) -> Option> { + self.images.insert(image_id, image) + } + pub(crate) fn get_image(&self, image_id: impl AsRef) -> Option> { + self.images.get(image_id.as_ref()).cloned() + } + pub(crate) fn put_input(&mut self, input_id: String, input: Vec) -> Option> { + self.inputs.insert(input_id, input) + } + pub(crate) fn get_input(&self, input_id: impl AsRef) -> Option> { + self.inputs.get(input_id.as_ref()).cloned() + } + pub(crate) fn put_session(&mut self, session_id: String, status: String) -> Option { + self.sessions.insert(session_id, status) + } + pub(crate) fn get_session(&self, session_id: impl AsRef) -> Option { + self.sessions.get(session_id.as_ref()).cloned() + } + pub(crate) fn put_receipt(&mut self, session_id: String, receipt: Vec) -> Option> { + self.receipts.insert(session_id, receipt) + } + pub(crate) fn get_receipt(&self, session_id: impl AsRef) -> Option> { + self.receipts.get(session_id.as_ref()).cloned() + } +} diff --git a/relay/src/lib.rs b/relay/src/lib.rs index 14a34d31..6650f056 100644 --- a/relay/src/lib.rs +++ b/relay/src/lib.rs @@ -15,6 +15,7 @@ #![doc = include_str!("../README.md")] mod api; +pub mod bonsai_rest_api_mock; pub mod client_config; mod downloader; pub mod sdk; diff --git a/relay/src/tests/utils.rs b/relay/src/tests/utils.rs index 7d3d5182..2336e7e4 100644 --- a/relay/src/tests/utils.rs +++ b/relay/src/tests/utils.rs @@ -13,13 +13,13 @@ // limitations under the License. use bonsai_sdk::alpha::{ - responses::{CreateSessRes, Groth16Seal, SessionStatusRes, SnarkReceipt, SnarkStatusRes}, + responses::{CreateSessRes, SessionStatusRes, SnarkReceipt, SnarkStatusRes}, SessionId, }; use ethers::types::{Address, Bytes, H256}; use risc0_ethereum_contracts::i_bonsai_relay::CallbackRequestFilter; use risc0_zkvm::{ - sha::Digest, ExitCode, InnerReceipt, Journal, MaybePruned, Receipt, ReceiptClaim, + sha::Digest, ExitCode, Groth16Seal, InnerReceipt, Journal, MaybePruned, Receipt, ReceiptClaim, }; use uuid::Uuid; use wiremock::{ @@ -38,6 +38,8 @@ pub(crate) async fn get_test_bonsai_server() -> (SessionId, MockServer) { // Mock receipt response let status_response = SessionStatusRes { status: "SUCCEEDED".to_string(), + elapsed_time: None, + stats: None, receipt_url: Some(format!("{}/fake/receipt/path", server.uri())), error_msg: None, state: None, @@ -66,14 +68,8 @@ pub(crate) async fn get_test_bonsai_server() -> (SessionId, MockServer) { vec![zeroes.clone(), zeroes.clone()], ]; let c = vec![zeroes.clone(), zeroes.clone()]; - let public = vec![ - zeroes.clone(), - zeroes.clone(), - zeroes.clone(), - zeroes.clone(), - ]; let dummy_snark = Some(SnarkReceipt { - snark: Groth16Seal { a, b, c, public }, + snark: Groth16Seal { a, b, c }, post_state_digest: vec![], journal: vec![], }); diff --git a/relay/src/uploader/completed_proofs/snark.rs b/relay/src/uploader/completed_proofs/snark.rs index 95398671..afca61de 100644 --- a/relay/src/uploader/completed_proofs/snark.rs +++ b/relay/src/uploader/completed_proofs/snark.rs @@ -15,13 +15,14 @@ use std::time::Duration; use bonsai_sdk::{ - alpha::{responses::Groth16Seal, Client, SessionId, SnarkId}, + alpha::{Client, SessionId, SnarkId}, alpha_async::{create_snark, snark_status}, }; use ethers::{ abi::{Token, Tokenizable}, types::U256, }; +use risc0_zkvm::Groth16Seal; use super::error::CompleteProofError; use crate::api; diff --git a/relay/tests/methods/guest/Cargo.lock b/relay/tests/methods/guest/Cargo.lock index e93de24f..1ad26db5 100644 --- a/relay/tests/methods/guest/Cargo.lock +++ b/relay/tests/methods/guest/Cargo.lock @@ -477,9 +477,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "risc0-binfmt" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d263c6370d7714d2a634b6d88deb3871d0fad1f9486a9da6d48139c1ac85b26" +checksum = "2ae2939426c60756f910352184716a3538748208c9e11ade4a507db3b2757157" dependencies = [ "anyhow", "elf", @@ -491,9 +491,9 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9835069929a0e7b6b4b34e6a83f08aaa9d34b30023b9ccaf96ddbe20404eba" +checksum = "a43cade35f73ad81ba974fe1d5e1513331f87052af8377b26b00a838f39c6920" dependencies = [ "anyhow", "bytemuck", @@ -505,9 +505,9 @@ dependencies = [ [[package]] name = "risc0-circuit-rv32im" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb1caa759ab74d08779e062fcf98f5bd34397dfde572516a52369f0ec46db650" +checksum = "31440989146b342a7d37c15079c9568c69b7f988f3b789f422c7d4ed76526ddb" dependencies = [ "anyhow", "risc0-core", @@ -518,9 +518,9 @@ dependencies = [ [[package]] name = "risc0-core" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be79c89bcd18886b376073e3da22f8b7963247a42dce7b49cf3d09853f51641e" +checksum = "02e0cbd09d03c23b572b66cd96a56143adb22bf895aca89c1a153ccebedaa0b4" dependencies = [ "bytemuck", "rand_core", @@ -533,11 +533,28 @@ dependencies = [ "risc0-zkvm", ] +[[package]] +name = "risc0-groth16" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da1e9b8dae3f9c3862b6278b2812989a2f5a537975e5bd6a687f07cf1df68a36" +dependencies = [ + "anyhow", + "ark-bn254", + "ark-groth16", + "ark-serialize", + "hex", + "num-bigint", + "num-derive", + "risc0-zkp", + "serde", +] + [[package]] name = "risc0-zkp" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e20a57e04840a5afadebb5d232546245f4fd8bd0e774bd69bf4bf25f8ab90c04" +checksum = "b96b035f744ecaaa7e9809c699bc85cf669cbab6f297f141d918e9b4c8098b79" dependencies = [ "anyhow", "blake2", @@ -555,24 +572,21 @@ dependencies = [ [[package]] name = "risc0-zkvm" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "922588cb4b884b3951316a65581ccdfd1174af93c54093190878366812073329" +checksum = "2a1275834c86176efc122a172c2b5f271a8a5d792de7efbc47dfbecaaaff9432" dependencies = [ "anyhow", - "ark-bn254", - "ark-groth16", - "ark-serialize", "bytemuck", "cfg-if", "getrandom", "hex", - "num-bigint", "num-derive", "risc0-binfmt", "risc0-circuit-recursion", "risc0-circuit-rv32im", "risc0-core", + "risc0-groth16", "risc0-zkp", "risc0-zkvm-platform", "rrs-lib", @@ -584,9 +598,9 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5819c0c3bfd8f20b1226c9d4ca1f342eb3d8385e71211a9383a879643d1dde" +checksum = "03b6378c9e407be18a1560ed030fd87fb6056293c56263efac46c507ae97e0d7" dependencies = [ "bytemuck", "getrandom", diff --git a/relay/tests/methods/guest/Cargo.toml b/relay/tests/methods/guest/Cargo.toml index cfe31865..16a2d55a 100644 --- a/relay/tests/methods/guest/Cargo.toml +++ b/relay/tests/methods/guest/Cargo.toml @@ -6,4 +6,16 @@ edition = "2021" [workspace] [dependencies] -risc0-zkvm = { version = "0.20", default-features = false } +risc0-zkvm = { version = "0.21", default-features = false } + +[profile.release] +lto = true +opt-level = 3 +debug = 1 + +[profile.release.package.risc0-ethereum-relay-test-guests] +# Include debug symbols so we can test the profiler. +debug = 1 + +[package.metadata.release] +release = false diff --git a/relay/tests/methods/guest/src/bin/hello_commit.rs b/relay/tests/methods/guest/src/bin/hello_commit.rs new file mode 100644 index 00000000..ae951edf --- /dev/null +++ b/relay/tests/methods/guest/src/bin/hello_commit.rs @@ -0,0 +1,24 @@ +// Copyright 2024 RISC Zero, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![no_std] +#![no_main] + +use risc0_zkvm::guest::env; + +risc0_zkvm::entry!(main); + +fn main() { + env::commit_slice(b"hello world"); +} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index d5da6114..fe20bca2 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "stable" +channel = "1.74" components = ["clippy", "rustfmt", "rust-src"] targets = [] profile = "minimal"