From d2b87e060097be26da622e43273fc036e15602af Mon Sep 17 00:00:00 2001 From: smtmfft <99081233+smtmfft@users.noreply.github.com> Date: Fri, 5 Jul 2024 13:48:05 +0800 Subject: [PATCH] feat(raiko): update risc0 toolchain to v1.0.1 (#311) * update risc0 toolchain to v1.0.1 Signed-off-by: smtmfft * fix lint & fmt Signed-off-by: smtmfft * fix fmt Signed-off-by: smtmfft * fix ci error Signed-off-by: smtmfft * fix CI build Signed-off-by: smtmfft * fix CI Signed-off-by: smtmfft * remove useless constant Signed-off-by: smtmfft * temporarily fix unittest Signed-off-by: smtmfft * fix fmt Signed-off-by: smtmfft * Update script/install.sh Co-authored-by: Brecht Devos --------- Signed-off-by: smtmfft Co-authored-by: Brecht Devos --- Cargo.lock | 405 ++++++++++-------- Cargo.toml | 8 +- core/src/interfaces.rs | 2 +- core/src/lib.rs | 2 +- host/src/lib.rs | 6 +- host/src/server/api/v1/proof.rs | 2 +- pipeline/src/risc0_util.rs | 2 - provers/risc0/driver/src/bonsai.rs | 2 +- provers/risc0/driver/src/lib.rs | 2 +- provers/risc0/driver/src/methods/ecdsa.rs | 4 +- .../risc0/driver/src/methods/risc0_guest.rs | 4 +- provers/risc0/driver/src/methods/sha256.rs | 4 +- .../driver/src/methods/test_risc0_guest.rs | 5 +- provers/risc0/driver/src/snarks.rs | 69 ++- provers/risc0/guest/Cargo.lock | 67 ++- provers/risc0/guest/Cargo.toml | 2 +- script/install.sh | 20 +- script/setup-bonsai.sh | 2 +- 18 files changed, 323 insertions(+), 285 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16e8689cf..a3f9fb144 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,28 +25,19 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "cpp_demangle", "fallible-iterator", - "gimli 0.28.1", - "memmap2 0.5.10", - "object 0.32.2", + "gimli", + "memmap2 0.9.4", + "object 0.35.0", "rustc-demangle", "smallvec", ] -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli 0.29.0", -] - [[package]] name = "adler" version = "1.0.2" @@ -739,6 +730,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "ark-bn254" version = "0.4.0" @@ -1104,15 +1104,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" -[[package]] -name = "autotools" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef941527c41b0fc0dd48511a8154cd5fc7e29200a0ff8b7203c5d777dbc795cf" -dependencies = [ - "cc", -] - [[package]] name = "axum" version = "0.7.5" @@ -1187,7 +1178,7 @@ version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ - "addr2line 0.22.0", + "addr2line", "cc", "cfg-if", "libc", @@ -1281,7 +1272,7 @@ dependencies = [ "rustc-hash", "shlex", "syn 2.0.68", - "which", + "which 4.4.2", ] [[package]] @@ -1440,11 +1431,11 @@ dependencies = [ [[package]] name = "bonsai-sdk" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e0f26687ed447c77b1a40a3665bf88e8327b6de65a74f521544bd225982f589" +checksum = "a7781292e9bcc1f54de6839dbab88b4032d2a20ab1d4fb3d8f045e9cecf5486e" dependencies = [ - "reqwest 0.11.27", + "reqwest 0.12.5", "risc0-groth16", "serde", "thiserror", @@ -1955,6 +1946,19 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + [[package]] name = "crossbeam-channel" version = "0.5.13" @@ -1983,6 +1987,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -2232,6 +2245,28 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-debug" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53ef7e1cf756fd5a8e74b9a0a9504ec446eddde86c3063a76ff26a13b7773b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "derive_more" version = "0.99.18" @@ -2332,6 +2367,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "doc-comment" version = "0.3.3" @@ -3067,12 +3113,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "flate2" version = "1.0.30" @@ -3333,20 +3373,14 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" dependencies = [ "fallible-iterator", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - [[package]] name = "git2" version = "0.18.3" @@ -3705,12 +3739,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "human-repr" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b778a5761513caf593693f8951c97a5b610841e754788400f32102eefdff1" - [[package]] name = "humantime" version = "2.1.0" @@ -4305,6 +4333,12 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "lockfree-object-pool" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" + [[package]] name = "log" version = "0.4.22" @@ -4374,18 +4408,18 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.5.10" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" dependencies = [ "libc", ] [[package]] name = "memmap2" -version = "0.7.1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" dependencies = [ "libc", ] @@ -4398,11 +4432,11 @@ checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" [[package]] name = "metal" -version = "0.25.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" +checksum = "5637e166ea14be6063a3f8ba5ccb9a4159df7d8f6d61c02fc3d480b1f90dcfcb" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "block", "core-graphics-types", "foreign-types 0.5.0", @@ -4496,12 +4530,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" -[[package]] -name = "multimap" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" - [[package]] name = "native-tls" version = "0.2.12" @@ -4618,17 +4646,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - [[package]] name = "num-integer" version = "0.1.46" @@ -4737,6 +4754,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "nvtx" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad2e855e8019f99e4b94ac33670eb4e4f570a2e044f3749a0b2c7f83b841e52c" +dependencies = [ + "cc", +] + [[package]] name = "nybbles" version = "0.2.1" @@ -4757,23 +4783,13 @@ 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]] name = "object" -version = "0.32.2" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" dependencies = [ "flate2", "memchr", @@ -5318,16 +5334,6 @@ dependencies = [ "ucd-trie", ] -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset", - "indexmap 2.2.6", -] - [[package]] name = "ph" version = "0.8.3" @@ -5602,27 +5608,6 @@ dependencies = [ "prost-derive", ] -[[package]] -name = "prost-build" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" -dependencies = [ - "bytes", - "heck 0.5.0", - "itertools 0.12.1", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.68", - "tempfile", -] - [[package]] name = "prost-derive" version = "0.12.6" @@ -5636,30 +5621,12 @@ dependencies = [ "syn 2.0.68", ] -[[package]] -name = "prost-types" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" -dependencies = [ - "prost", -] - [[package]] name = "protobuf" version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" -[[package]] -name = "protobuf-src" -version = "1.1.0+21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" -dependencies = [ - "autotools", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -6242,6 +6209,7 @@ dependencies = [ "base64 0.22.1", "bytes", "encoding_rs", + "futures-channel", "futures-core", "futures-util", "h2 0.4.5", @@ -7096,9 +7064,9 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae2939426c60756f910352184716a3538748208c9e11ade4a507db3b2757157" +checksum = "5a33ca13e8e2fe08fc283accbb08fcbabbfdd27acf88dddc9b39654d0e487b15" dependencies = [ "anyhow", "elf", @@ -7110,15 +7078,18 @@ dependencies = [ [[package]] name = "risc0-build-kernel" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc02fece98f870221c25c22241e5f226fb3a9230df9cdeab170907440a97f41b" +checksum = "3c4862bb372cb13984a9781b5fb29d722b2898dcf7238a18a4c7d17fa2634461" dependencies = [ "cc", "directories", + "glob", "hex", + "rayon", "sha2", "tempfile", + "which 6.0.1", ] [[package]] @@ -7130,9 +7101,9 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43cade35f73ad81ba974fe1d5e1513331f87052af8377b26b00a838f39c6920" +checksum = "5c12ea07079420272e5705baea6a0756b21c0dadeca7ed34a7866eb9c073b9a0" dependencies = [ "anyhow", "bytemuck", @@ -7140,61 +7111,78 @@ dependencies = [ "downloader", "hex", "metal", + "nvtx", "rand 0.8.5", "rayon", "risc0-circuit-recursion-sys", "risc0-core", + "risc0-sys", "risc0-zkp", "sha2", "tracing", - "zip", + "zip 2.1.3", ] [[package]] name = "risc0-circuit-recursion-sys" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad2b82cbb0e0cc22182f00287f513daea3ea8a5cc0b709d8afdd9d9180fb89a" +checksum = "1a4293a7925d708453cf93a68ffc6d3f82722bf8441ae9ac60764cf147f1e4da" dependencies = [ "glob", "risc0-build-kernel", "risc0-core", + "risc0-sys", + "sppark", ] [[package]] name = "risc0-circuit-rv32im" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31440989146b342a7d37c15079c9568c69b7f988f3b789f422c7d4ed76526ddb" +checksum = "5ef57b3afe8e59bec6f535c49c99dc7cd3fda7e93254fd499e5469ec17fec1d0" dependencies = [ "anyhow", + "bytemuck", + "cfg-if", + "crossbeam", + "crypto-bigint", "cust", + "derive-debug", + "lazy-regex", "metal", + "nvtx", "rand 0.8.5", "rayon", + "risc0-binfmt", "risc0-circuit-rv32im-sys", "risc0-core", + "risc0-sys", "risc0-zkp", "risc0-zkvm-platform", + "serde", + "sha2", "tracing", ] [[package]] name = "risc0-circuit-rv32im-sys" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d60a79888ec9416dbd3c88bac9b630b05e513c466b7acd64b7641eed48749" +checksum = "badf2c25b6ab844a5cc31f83919ff3100d6e0070e1c15b1c2668f259d8a5d43b" dependencies = [ "glob", "risc0-build-kernel", "risc0-core", + "risc0-sys", + "sppark", ] [[package]] name = "risc0-core" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0cbd09d03c23b572b66cd96a56143adb22bf895aca89c1a153ccebedaa0b4" +checksum = "f43b7bd8b9adb8bed7eaecfa5c152b6c676c4512aea1120d2cdc5fbbca4b2ffb" dependencies = [ "bytemuck", "rand_core 0.6.4", @@ -7228,19 +7216,20 @@ dependencies = [ [[package]] name = "risc0-groth16" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da1e9b8dae3f9c3862b6278b2812989a2f5a537975e5bd6a687f07cf1df68a36" +checksum = "2e275963cd541e1bc9b94f36e23e85b87798a96e04fdf7b013500c08b949a8c9" dependencies = [ "anyhow", "ark-bn254", + "ark-ec", "ark-groth16", "ark-serialize 0.4.2", "bytemuck", "hex", "num-bigint 0.4.6", - "num-derive", "num-traits", + "risc0-binfmt", "risc0-core", "risc0-zkp", "serde", @@ -7249,44 +7238,37 @@ dependencies = [ "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.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61168816f4921e3cf1c9ff98792a7aa58d3e6c2dc5072bd7666690310e99fea1" +checksum = "da2b303e69ff71b50aef5bf011f055be7503811bdb382e6a2bdef24c5d331688" dependencies = [ "cc", "cust", "risc0-build-kernel", - "risc0-sppark", + "sppark", ] [[package]] name = "risc0-zkp" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96b035f744ecaaa7e9809c699bc85cf669cbab6f297f141d918e9b4c8098b79" +checksum = "53342780aef2d31ccc0526e6d4b151dab69e678d2e1495b2270ed40f5e1df6f4" dependencies = [ "anyhow", "blake2", "bytemuck", + "cfg-if", "cust", "digest 0.10.7", "ff 0.13.0", "hex", - "lazy_static", + "hex-literal", "metal", "ndarray", + "nvtx", + "parking_lot 0.12.3", "paste", "rand 0.8.5", "rand_core 0.6.4", @@ -7301,28 +7283,24 @@ dependencies = [ [[package]] name = "risc0-zkvm" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1275834c86176efc122a172c2b5f271a8a5d792de7efbc47dfbecaaaff9432" +checksum = "774b03337fa1675204a067b3f15be740dbedde63fa46647017140fd023805afb" dependencies = [ - "addr2line 0.21.0", + "addr2line", "anyhow", "bincode", "bonsai-sdk", "bytemuck", "bytes", "cfg-if", - "crypto-bigint", "elf", "getrandom 0.2.15", "hex", - "human-repr", "lazy-regex", - "num-derive", - "num-traits", + "nvtx", "prost", - "prost-build", - "protobuf-src", + "rand 0.8.5", "rayon", "risc0-binfmt", "risc0-circuit-recursion", @@ -7343,9 +7321,9 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b6378c9e407be18a1560ed030fd87fb6056293c56263efac46c507ae97e0d7" +checksum = "3b8df83bfa425e078ef77ed115f5eff26b5ebc4a584253b31e4e7122fa2bcced" dependencies = [ "bytemuck", "getrandom 0.2.15", @@ -7685,9 +7663,9 @@ dependencies = [ [[package]] name = "ruzstd" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +checksum = "5174a470eeb535a721ae9fdd6e291c2411a906b96592182d05217591d5c5cf7b" dependencies = [ "byteorder", "derive_more", @@ -8176,6 +8154,12 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simple_asn1" version = "0.6.2" @@ -8608,6 +8592,16 @@ dependencies = [ "der", ] +[[package]] +name = "sppark" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb266b15daead53670d477d7e136b8fc92d46e31bb9007ac46d304df23689a4b" +dependencies = [ + "cc", + "which 4.4.2", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -9607,7 +9601,7 @@ dependencies = [ "serde", "serde_json", "utoipa", - "zip", + "zip 0.6.6", ] [[package]] @@ -9844,6 +9838,18 @@ dependencies = [ "rustix", ] +[[package]] +name = "which" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8211e4f58a2b2805adfbefbc07bab82958fc91e3836339b1ab7ae32465dce0d7" +dependencies = [ + "either", + "home", + "rustix", + "winsafe", +] + [[package]] name = "winapi" version = "0.3.9" @@ -10071,6 +10077,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -10180,6 +10192,23 @@ dependencies = [ "flate2", ] +[[package]] +name = "zip" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775a2b471036342aa69bc5a602bc889cb0a06cda00477d0c69566757d5553d39" +dependencies = [ + "arbitrary", + "crc32fast", + "crossbeam-utils", + "displaydoc", + "flate2", + "indexmap 2.2.6", + "memchr", + "thiserror", + "zopfli", +] + [[package]] name = "zkhash" version = "0.2.0" @@ -10206,6 +10235,20 @@ dependencies = [ "subtle", ] +[[package]] +name = "zopfli" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946" +dependencies = [ + "bumpalo", + "crc32fast", + "lockfree-object-pool", + "log", + "once_cell", + "simd-adler32", +] + [[package]] name = "zstd" version = "0.13.1" diff --git a/Cargo.toml b/Cargo.toml index a8130d811..83ef74500 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,10 +48,10 @@ reth-chainspec = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = reth-provider = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko", default-features = false } # risc zero -risc0-zkvm = { version = "0.21.0", features = ["prove", "getrandom"] } -bonsai-sdk = { version = "0.7.0", features = ["async"] } -risc0-build = { version = "0.21.0" } -risc0-binfmt = { version = "0.21.0" } +risc0-zkvm = { version = "1.0.1", features = ["prove", "getrandom"] } +bonsai-sdk = { version = "0.8.0", features = ["async"] } +risc0-build = { version = "1.0.1" } +risc0-binfmt = { version = "1.0.1" } # SP1 sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", branch = "main" } diff --git a/core/src/interfaces.rs b/core/src/interfaces.rs index e07619732..33ed25780 100644 --- a/core/src/interfaces.rs +++ b/core/src/interfaces.rs @@ -150,7 +150,7 @@ impl ProofType { let mut proof = match self { ProofType::Native => NativeProver::run(input.clone(), output, config) .await - .map_err(|e| e.into()), + .map_err(>::into), ProofType::Sp1 => { #[cfg(feature = "sp1")] return sp1_driver::Sp1Prover::run(input.clone(), output, config) diff --git a/core/src/lib.rs b/core/src/lib.rs index 71e99b8ae..35f6fdefe 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -307,7 +307,7 @@ mod tests { if !(is_ci() && proof_type == ProofType::Sp1) { let network = Network::Ethereum.to_string(); let l1_network = Network::Ethereum.to_string(); - let block_number = 19707175; + let block_number = 19907175; let taiko_chain_spec = SupportedChainSpecs::default() .get_chain_spec(&network) .unwrap(); diff --git a/host/src/lib.rs b/host/src/lib.rs index 80b59fe20..651496932 100644 --- a/host/src/lib.rs +++ b/host/src/lib.rs @@ -18,7 +18,7 @@ use raiko_task_manager::{get_task_manager, TaskManager, TaskManagerOpts, TaskSta use serde::{Deserialize, Serialize}; use serde_json::Value; use tokio::sync::mpsc; -use tracing::{error, info}; +use tracing::{debug, error, info}; use crate::{ interfaces::{HostError, HostResult}, @@ -211,6 +211,10 @@ impl ProverState { Ok(proof) => { let proof = proof.proof.unwrap_or_default(); let proof = proof.as_bytes(); + debug!( + "Proof generated for block {} on {} is {:?}", + proof_request.block_number, proof_request.network, proof + ); if manager .update_task_progress( chain_id, diff --git a/host/src/server/api/v1/proof.rs b/host/src/server/api/v1/proof.rs index 7c22b6769..e4a960705 100644 --- a/host/src/server/api/v1/proof.rs +++ b/host/src/server/api/v1/proof.rs @@ -289,7 +289,7 @@ mod test { async fn test_generate_input_from_cache() { let l1 = &Network::Holesky.to_string(); let l2 = &Network::TaikoA7.to_string(); - let block_number: u64 = 69627; + let block_number: u64 = 123456; let (input, provider) = create_cache_input(l1, l2, block_number).await; let cache_path = Some("./".into()); assert!(set_cached_input(&cache_path, block_number, l2, &input).is_ok()); diff --git a/pipeline/src/risc0_util.rs b/pipeline/src/risc0_util.rs index 15c6e9817..b9ffa1d42 100644 --- a/pipeline/src/risc0_util.rs +++ b/pipeline/src/risc0_util.rs @@ -49,12 +49,10 @@ impl GuestListEntry { let upper = self.name.to_uppercase().replace('-', "_"); let image_id: [u32; DIGEST_WORDS] = self.image_id; - let elf_path: &str = &self.path; format!( r##" pub const {upper}_ELF: &[u8] = include_bytes!("{relative_path}"); pub const {upper}_ID: [u32; 8] = {image_id:?}; -pub const {upper}_PATH: &str = r#"{elf_path}"#; "## ) } diff --git a/provers/risc0/driver/src/bonsai.rs b/provers/risc0/driver/src/bonsai.rs index 41ac540f8..c2f4f08a2 100644 --- a/provers/risc0/driver/src/bonsai.rs +++ b/provers/risc0/driver/src/bonsai.rs @@ -248,7 +248,7 @@ pub fn prove_locally( exec.run().unwrap() }; - session.prove().unwrap() + session.prove().unwrap().receipt } pub fn load_receipt( diff --git a/provers/risc0/driver/src/lib.rs b/provers/risc0/driver/src/lib.rs index 59e6642a4..841be9715 100644 --- a/provers/risc0/driver/src/lib.rs +++ b/provers/risc0/driver/src/lib.rs @@ -95,6 +95,6 @@ mod test { let env = ExecutorEnv::builder().build().unwrap(); let prover = default_prover(); let receipt = prover.prove(env, TEST_RISC0_GUEST_ELF).unwrap(); - receipt.verify(TEST_RISC0_GUEST_ID).unwrap(); + receipt.receipt.verify(TEST_RISC0_GUEST_ID).unwrap(); } } diff --git a/provers/risc0/driver/src/methods/ecdsa.rs b/provers/risc0/driver/src/methods/ecdsa.rs index c46b7bc31..b1df1a1ee 100644 --- a/provers/risc0/driver/src/methods/ecdsa.rs +++ b/provers/risc0/driver/src/methods/ecdsa.rs @@ -1,7 +1,5 @@ pub const ECDSA_ELF: &[u8] = include_bytes!("../../../guest/target/riscv32im-risc0-zkvm-elf/release/ecdsa"); pub const ECDSA_ID: [u32; 8] = [ - 2112349872, 662412126, 2552816809, 3712154546, 3455470029, 3928252579, 3471286672, 2002692558, + 3688490884, 2127892678, 3137078981, 1193344426, 4105663218, 3901516424, 3225864022, 13950036, ]; -pub const ECDSA_PATH: &str = - r#"/home/ubuntu/raiko/provers/risc0/guest/target/riscv32im-risc0-zkvm-elf/release/ecdsa"#; diff --git a/provers/risc0/driver/src/methods/risc0_guest.rs b/provers/risc0/driver/src/methods/risc0_guest.rs index e0f43b74d..a10258047 100644 --- a/provers/risc0/driver/src/methods/risc0_guest.rs +++ b/provers/risc0/driver/src/methods/risc0_guest.rs @@ -1,7 +1,5 @@ pub const RISC0_GUEST_ELF: &[u8] = include_bytes!("../../../guest/target/riscv32im-risc0-zkvm-elf/release/risc0-guest"); pub const RISC0_GUEST_ID: [u32; 8] = [ - 1106284168, 2121988569, 4030233466, 422073515, 2026351144, 1404012643, 690639581, 3252900346, + 3656027178, 4281856604, 2184891755, 3275826590, 1143313757, 1779451290, 3242125827, 14009949, ]; -pub const RISC0_GUEST_PATH: &str = - r#"/home/ubuntu/raiko/provers/risc0/guest/target/riscv32im-risc0-zkvm-elf/release/risc0-guest"#; diff --git a/provers/risc0/driver/src/methods/sha256.rs b/provers/risc0/driver/src/methods/sha256.rs index c87ca3413..581b6c564 100644 --- a/provers/risc0/driver/src/methods/sha256.rs +++ b/provers/risc0/driver/src/methods/sha256.rs @@ -1,7 +1,5 @@ pub const SHA256_ELF: &[u8] = include_bytes!("../../../guest/target/riscv32im-risc0-zkvm-elf/release/sha256"); pub const SHA256_ID: [u32; 8] = [ - 3212202202, 3880734562, 3977985800, 3462182722, 1762988696, 2700707388, 359464217, 3702618422, + 3390470592, 1661893947, 1504130727, 2880762366, 880654584, 3550598459, 34571735, 2700164568, ]; -pub const SHA256_PATH: &str = - r#"/home/ubuntu/raiko/provers/risc0/guest/target/riscv32im-risc0-zkvm-elf/release/sha256"#; diff --git a/provers/risc0/driver/src/methods/test_risc0_guest.rs b/provers/risc0/driver/src/methods/test_risc0_guest.rs index 7d70e1042..bb6a812ce 100644 --- a/provers/risc0/driver/src/methods/test_risc0_guest.rs +++ b/provers/risc0/driver/src/methods/test_risc0_guest.rs @@ -1,7 +1,6 @@ pub const TEST_RISC0_GUEST_ELF: &[u8] = include_bytes!( - "../../../guest/target/riscv32im-risc0-zkvm-elf/release/deps/risc0_guest-f2134d0a9dc1b778" + "../../../guest/target/riscv32im-risc0-zkvm-elf/release/deps/risc0_guest-9d0bc3658d2edeaa" ); pub const TEST_RISC0_GUEST_ID: [u32; 8] = [ - 3875868406, 1668916610, 1404967724, 4014172081, 1679226880, 1967164957, 1092356078, 3079385105, + 1938439720, 3200608207, 3901424709, 2031136574, 850058303, 3058786714, 2432413607, 2771178900, ]; -pub const TEST_RISC0_GUEST_PATH: &str = r#"provers/risc0/guest/target/riscv32im-risc0-zkvm-elf/release/deps/risc0_guest-f2134d0a9dc1b778"#; diff --git a/provers/risc0/driver/src/snarks.rs b/provers/risc0/driver/src/snarks.rs index 779e427a8..39a696c3b 100644 --- a/provers/risc0/driver/src/snarks.rs +++ b/provers/risc0/driver/src/snarks.rs @@ -14,19 +14,19 @@ use std::{str::FromStr, sync::Arc}; -use alloy_primitives::U256; -use alloy_sol_types::{sol, SolValue}; +use alloy_sol_types::sol; +use anyhow::Result; use bonsai_sdk::alpha::responses::SnarkReceipt; use ethers_contract::abigen; use ethers_core::types::H160; use ethers_providers::{Http, Provider, RetryClient}; use log::{error, info}; use raiko_lib::primitives::keccak::keccak; -use risc0_zkvm::Receipt; use risc0_zkvm::{ sha::{Digest, Digestible}, - Groth16Seal, + Groth16ReceiptVerifierParameters, Receipt, }; + use tracing::{error as tracing_err, info as tracing_info}; use crate::save_receipt; @@ -65,33 +65,32 @@ sol!( abigen!( IRiscZeroVerifier, r#"[ - function verify(bytes calldata seal, bytes32 imageId, bytes32 postStateDigest, bytes32 journalDigest) external view returns (bool) + function verify(bytes calldata seal, bytes32 imageId, bytes32 journalDigest) external view ]"# ); -fn to_u256_arr(be_vecs: &[Vec]) -> [U256; N] { - let tmp: Vec<_> = be_vecs - .iter() - .map(|v| U256::from_be_slice(v.as_slice())) - .collect(); - tmp.try_into().unwrap() -} - -impl From for Seal { - fn from(val: Groth16Seal) -> Self { - Seal { - a: to_u256_arr(&val.a), - b: [to_u256_arr(&val.b[0]), to_u256_arr(&val.b[1])], - c: to_u256_arr(&val.c), - } - } +// /// ABI encoding of the seal. +// pub fn abi_encode(seal: Vec) -> Result> { +// Ok(encode(seal)?.abi_encode()) +// } + +/// encoding of the seal with selector. +pub fn encode(seal: Vec) -> Result> { + let verifier_parameters_digest = Groth16ReceiptVerifierParameters::default().digest(); + let selector = &verifier_parameters_digest.as_bytes()[..4]; + // Create a new vector with the capacity to hold both selector and seal + let mut selector_seal = Vec::with_capacity(selector.len() + seal.len()); + selector_seal.extend_from_slice(selector); + selector_seal.extend_from_slice(&seal); + + Ok(selector_seal) } pub async fn stark2snark( image_id: Digest, stark_uuid: String, stark_receipt: Receipt, -) -> anyhow::Result<(String, SnarkReceipt)> { +) -> Result<(String, SnarkReceipt)> { info!("Submitting SNARK workload"); // Label snark output as journal digest let receipt_label = format!( @@ -133,7 +132,7 @@ pub async fn stark2snark( } }; - let stark_psd = stark_receipt.get_claim()?.post.digest(); + let stark_psd = stark_receipt.claim()?.as_value().unwrap().post.digest(); let snark_psd = Digest::try_from(snark_receipt.post_state_digest.as_slice())?; if stark_psd != snark_psd { @@ -155,10 +154,7 @@ pub async fn stark2snark( Ok(snark_data) } -pub async fn verify_groth16_snark( - image_id: Digest, - snark_receipt: SnarkReceipt, -) -> anyhow::Result<()> { +pub async fn verify_groth16_snark(image_id: Digest, snark_receipt: SnarkReceipt) -> Result<()> { let verifier_rpc_url = std::env::var("GROTH16_VERIFIER_RPC_URL").expect("env GROTH16_VERIFIER_RPC_URL"); let groth16_verifier_addr = { @@ -172,7 +168,7 @@ pub async fn verify_groth16_snark( 500, )?); - let seal = >::into(snark_receipt.snark).abi_encode(); + let seal = encode(snark_receipt.snark.to_vec())?; let journal_digest = snark_receipt.journal.digest(); tracing_info!("Verifying SNARK:"); tracing_info!("Seal: {}", hex::encode(&seal)); @@ -181,24 +177,19 @@ pub async fn verify_groth16_snark( "Post State Digest: {}", hex::encode(&snark_receipt.post_state_digest) ); - tracing_info!("Journal Digest: {}", hex::encode(journal_digest.as_bytes())); - let verification: bool = IRiscZeroVerifier::new(groth16_verifier_addr, http_client) + tracing_info!("Journal Digest: {}", hex::encode(journal_digest)); + let verify_call_res = IRiscZeroVerifier::new(groth16_verifier_addr, http_client) .verify( seal.into(), image_id.as_bytes().try_into().unwrap(), - snark_receipt - .post_state_digest - .as_slice() - .try_into() - .unwrap(), - journal_digest.as_bytes().try_into().unwrap(), + journal_digest.into(), ) - .await?; + .await; - if verification { + if verify_call_res.is_ok() { tracing_info!("SNARK verified successfully using {groth16_verifier_addr:?}!"); } else { - tracing_err!("SNARK verification failed!"); + tracing_err!("SNARK verification failed: {:?}!", verify_call_res); } Ok(()) diff --git a/provers/risc0/guest/Cargo.lock b/provers/risc0/guest/Cargo.lock index 691f3d8c8..a295e7acc 100644 --- a/provers/risc0/guest/Cargo.lock +++ b/provers/risc0/guest/Cargo.lock @@ -91,7 +91,7 @@ dependencies = [ "derive_more", "once_cell", "serde", - "sha2 0.10.6", + "sha2 0.10.8", ] [[package]] @@ -360,7 +360,7 @@ dependencies = [ "blake2", "derivative", "digest 0.10.7", - "sha2 0.10.6", + "sha2 0.10.8", ] [[package]] @@ -1587,7 +1587,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", - "sha2 0.10.6", + "sha2 0.10.8", "signature", ] @@ -1618,7 +1618,7 @@ dependencies = [ "bincode", "blst", "serde", - "sha2 0.10.6", + "sha2 0.10.8", "siphasher", ] @@ -1803,17 +1803,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - [[package]] name = "num-integer" version = "0.1.46" @@ -2698,7 +2687,7 @@ dependencies = [ "revm-primitives", "ripemd", "secp256k1", - "sha2 0.10.6", + "sha2 0.10.8", "substrate-bn", ] @@ -2743,9 +2732,9 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae2939426c60756f910352184716a3538748208c9e11ade4a507db3b2757157" +checksum = "5a33ca13e8e2fe08fc283accbb08fcbabbfdd27acf88dddc9b39654d0e487b15" dependencies = [ "anyhow", "elf", @@ -2757,9 +2746,9 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43cade35f73ad81ba974fe1d5e1513331f87052af8377b26b00a838f39c6920" +checksum = "5c12ea07079420272e5705baea6a0756b21c0dadeca7ed34a7866eb9c073b9a0" dependencies = [ "anyhow", "bytemuck", @@ -2771,22 +2760,24 @@ dependencies = [ [[package]] name = "risc0-circuit-rv32im" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31440989146b342a7d37c15079c9568c69b7f988f3b789f422c7d4ed76526ddb" +checksum = "5ef57b3afe8e59bec6f535c49c99dc7cd3fda7e93254fd499e5469ec17fec1d0" dependencies = [ "anyhow", + "risc0-binfmt", "risc0-core", "risc0-zkp", "risc0-zkvm-platform", + "serde", "tracing", ] [[package]] name = "risc0-core" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0cbd09d03c23b572b66cd96a56143adb22bf895aca89c1a153ccebedaa0b4" +checksum = "f43b7bd8b9adb8bed7eaecfa5c152b6c676c4512aea1120d2cdc5fbbca4b2ffb" dependencies = [ "bytemuck", "rand_core", @@ -2794,18 +2785,20 @@ dependencies = [ [[package]] name = "risc0-groth16" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da1e9b8dae3f9c3862b6278b2812989a2f5a537975e5bd6a687f07cf1df68a36" +checksum = "2e275963cd541e1bc9b94f36e23e85b87798a96e04fdf7b013500c08b949a8c9" dependencies = [ "anyhow", "ark-bn254", + "ark-ec", "ark-groth16", "ark-serialize 0.4.2", + "bytemuck", "hex", "num-bigint 0.4.6", - "num-derive", "num-traits", + "risc0-binfmt", "risc0-zkp", "serde", ] @@ -2826,37 +2819,37 @@ dependencies = [ [[package]] name = "risc0-zkp" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96b035f744ecaaa7e9809c699bc85cf669cbab6f297f141d918e9b4c8098b79" +checksum = "53342780aef2d31ccc0526e6d4b151dab69e678d2e1495b2270ed40f5e1df6f4" dependencies = [ "anyhow", "blake2", "bytemuck", + "cfg-if", "digest 0.10.7", "hex", + "hex-literal", "paste", "rand_core", "risc0-core", "risc0-zkvm-platform", "serde", - "sha2 0.10.6", + "sha2 0.10.8", "tracing", ] [[package]] name = "risc0-zkvm" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1275834c86176efc122a172c2b5f271a8a5d792de7efbc47dfbecaaaff9432" +checksum = "774b03337fa1675204a067b3f15be740dbedde63fa46647017140fd023805afb" dependencies = [ "anyhow", "bytemuck", "cfg-if", "getrandom", "hex", - "num-derive", - "num-traits", "risc0-binfmt", "risc0-circuit-recursion", "risc0-circuit-rv32im", @@ -2867,15 +2860,15 @@ dependencies = [ "rrs-lib", "semver 1.0.23", "serde", - "sha2 0.10.6", + "sha2 0.10.8", "tracing", ] [[package]] name = "risc0-zkvm-platform" -version = "0.21.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b6378c9e407be18a1560ed030fd87fb6056293c56263efac46c507ae97e0d7" +checksum = "3b8df83bfa425e078ef77ed115f5eff26b5ebc4a584253b31e4e7122fa2bcced" dependencies = [ "bytemuck", "getrandom", diff --git a/provers/risc0/guest/Cargo.toml b/provers/risc0/guest/Cargo.toml index 80853b59b..28091f3c9 100644 --- a/provers/risc0/guest/Cargo.toml +++ b/provers/risc0/guest/Cargo.toml @@ -19,7 +19,7 @@ path = "src/benchmark/ecdsa.rs" [dependencies] raiko-lib = { path = "../../../lib", features = ["std", "risc0"] } -risc0-zkvm = { version = "0.21.0", default-features = false, features = [ +risc0-zkvm = { version = "1.0.1", default-features = false, features = [ 'std', "getrandom", ] } diff --git a/script/install.sh b/script/install.sh index 2c46c057a..2c1b1f9dd 100755 --- a/script/install.sh +++ b/script/install.sh @@ -44,8 +44,24 @@ if [ -z "$1" ] || [ "$1" == "sgx" ]; then fi # RISC0 if [ -z "$1" ] || [ "$1" == "risc0" ]; then - cargo install cargo-risczero - cargo risczero install --version v2024-02-08.1 + echo "Current TERM: $TERM" + if [ -z "$TERM" ] || [ "$TERM" = "dumb" ]; then + # Set TERM to xterm-color256 + echo "Setting TERM to xterm" + export TERM=xterm + fi + curl -L https://risczero.com/install | bash + + if [ -z "${CI}" ] || [ ! command -v rzup &> /dev/null ]; then + PROFILE=$HOME/.bashrc + echo ${PROFILE} + source ${PROFILE} + rzup -v 1.0.1 + else + echo "/home/runner/.config/.risc0/bin" >> $GITHUB_PATH + echo $GITHUB_PATH + /home/runner/.config/.risc0/bin/rzup -v 1.0.1 + fi fi # SP1 if [ -z "$1" ] || [ "$1" == "sp1" ]; then diff --git a/script/setup-bonsai.sh b/script/setup-bonsai.sh index 6d281121d..505986fa9 100755 --- a/script/setup-bonsai.sh +++ b/script/setup-bonsai.sh @@ -3,7 +3,7 @@ # Environment variables BONSAI_API_KEY="1234" BONSAI_API_URL="https://api.bonsai.xyzz/" -GROTH16_VERIFIER_ADDRESS="850EC3780CeDfdb116E38B009d0bf7a1ef1b8b38" +GROTH16_VERIFIER_ADDRESS="3d24C84FC1A2B26f9229e58ddDf11A8dfba802d0" GROTH16_VERIFIER_RPC_URL="https://sepolia.infura.io/v3/4c76691f5f384d30bed910018c28ba1d" # Function to set environment variable persistently