diff --git a/Cargo.lock b/Cargo.lock index 590a56b4..a2e99f2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -367,7 +367,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tracing", "url", ] @@ -607,7 +607,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tower", + "tower 0.4.13", "tracing", "url", ] @@ -622,7 +622,7 @@ dependencies = [ "alloy-transport", "reqwest 0.12.5", "serde_json", - "tower", + "tower 0.4.13", "tracing", "url", ] @@ -1134,7 +1134,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 0.1.2", "tokio", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -1365,7 +1365,6 @@ dependencies = [ "cc", "cfg-if", "constant_time_eq", - "rayon-core", ] [[package]] @@ -1432,29 +1431,39 @@ dependencies = [ [[package]] name = "bonsai-sdk" -version = "0.8.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7781292e9bcc1f54de6839dbab88b4032d2a20ab1d4fb3d8f045e9cecf5486e" +checksum = "94032d3eece78099780ba07605d8ba6943e47ee152f76d73f1682e2f40cf889c" dependencies = [ + "duplicate", + "maybe-async", "reqwest 0.12.5", - "risc0-groth16", "serde", "thiserror", - "tokio", ] [[package]] -name = "bonsai-sdk" -version = "0.9.0" +name = "borsh" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1553c9f015eb3fc4ff1bf2e142fceeb2256768a3c4d94a9486784a6c656484d" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" dependencies = [ - "duplicate", - "maybe-async", - "reqwest 0.12.5", - "risc0-groth16", - "serde", - "thiserror", + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" +dependencies = [ + "once_cell", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.72", + "syn_derive", ] [[package]] @@ -1649,6 +1658,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.38" @@ -1749,12 +1764,6 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" -[[package]] -name = "cobs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" - [[package]] name = "coins-bip32" version = "0.8.7" @@ -2469,6 +2478,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "docker-generate" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" + [[package]] name = "dotenv" version = "0.15.0" @@ -2593,12 +2608,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "embedded-io" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" - [[package]] name = "encode_unicode" version = "0.3.6" @@ -3159,9 +3168,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fastrlp" @@ -3257,6 +3266,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -3678,6 +3693,17 @@ dependencies = [ "serde", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + [[package]] name = "hashers" version = "1.0.1" @@ -3994,7 +4020,7 @@ dependencies = [ "pin-project-lite", "socket2 0.5.7", "tokio", - "tower", + "tower 0.4.13", "tower-service", "tracing", ] @@ -4318,9 +4344,9 @@ dependencies = [ [[package]] name = "lazy-regex" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" +checksum = "8d8e41c97e6bc7ecb552016274b99fbb5d035e8de288c582d9b933af6677bfda" dependencies = [ "lazy-regex-proc_macros", "once_cell", @@ -4329,9 +4355,9 @@ dependencies = [ [[package]] name = "lazy-regex-proc_macros" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" +checksum = "76e1d8b05d672c53cb9c7b920bbba8783845ae4f0b076e02a3db1d02c81b4163" dependencies = [ "proc-macro2", "quote", @@ -4356,9 +4382,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libflate" @@ -4475,11 +4501,11 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -4571,9 +4597,9 @@ checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" [[package]] name = "metal" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5637e166ea14be6063a3f8ba5ccb9a4159df7d8f6d61c02fc3d480b1f90dcfcb" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" dependencies = [ "bitflags 2.6.0", "block", @@ -4689,14 +4715,16 @@ dependencies = [ [[package]] name = "ndarray" -version = "0.15.6" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841" dependencies = [ "matrixmultiply", "num-complex", "num-integer", "num-traits", + "portable-atomic", + "portable-atomic-util", "rawpointer", "rayon", ] @@ -4966,12 +4994,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "oneshot" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e296cf87e61c9cfc1a61c3c63a0f7f286ed4554e0e22be84e8a38e1d264a2a29" - [[package]] name = "opaque-debug" version = "0.3.1" @@ -5061,9 +5083,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "p3-air" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e909ef66fa5d77ff0fd3cb5af4b33b27fa6fb68d02b9b1e70edbc29383e565" +checksum = "066f571b2e645505ed5972dd0e1e252ba03352150830c9566769ca711c0f1e9b" dependencies = [ "p3-field", "p3-matrix", @@ -5071,9 +5093,9 @@ dependencies = [ [[package]] name = "p3-baby-bear" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46965470aac1cddfe52f535424b59d52f2fffef0fdeb9dbed19da39b1d8f048a" +checksum = "ff00f571044d299310d9659c6e51c98422de3bf94b8577f7f30cf59cf2043e40" dependencies = [ "num-bigint 0.4.6", "p3-field", @@ -5086,9 +5108,9 @@ dependencies = [ [[package]] name = "p3-blake3" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ef32d6ea21dd5cf9fec8a31bf0c64e6ceee8901dbf50966b83a443093c2aba" +checksum = "cc4cb69ae54a279bbbd477566d1bdb71aa879b528fd658d0fcfc36f54b00217c" dependencies = [ "blake3", "p3-symmetric", @@ -5096,9 +5118,9 @@ dependencies = [ [[package]] name = "p3-bn254-fr" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3edfca6be3b3109adf8e3330baec30c3fc5f9f4d63d27aaec1b471ca51ed67" +checksum = "bf19917f986d45e9abb6d177e875824ced6eed096480d574fce16f2c45c721ea" dependencies = [ "ff 0.13.0", "num-bigint 0.4.6", @@ -5111,25 +5133,27 @@ dependencies = [ [[package]] name = "p3-challenger" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6662ea899a5d848b60c699944491d72757873b5e1fd46798e4712f90a03a4e9" +checksum = "3be7e4fbce4566a93091107eadfafa0b5374bd1ffd3e0f6b850da3ff72eb183f" dependencies = [ "p3-field", "p3-maybe-rayon", "p3-symmetric", "p3-util", + "serde", "tracing", ] [[package]] name = "p3-commit" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc3563918b5cc44ef5280bf9b51753e70dc78802de25e3fb81ed6c94617ccb6e" +checksum = "7a03eb0f99d68a712c41e658e9a7782a0705d4ffcfb6232a43bd3f1ef9591002" dependencies = [ "itertools 0.12.1", "p3-challenger", + "p3-dft", "p3-field", "p3-matrix", "p3-util", @@ -5138,9 +5162,9 @@ dependencies = [ [[package]] name = "p3-dft" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510095701819d83c9509fe825bbf1ebfe50426ae75149df5fe1dcfd18261323a" +checksum = "1556de968523fbe5d804ab50600ea306fcceea3500cfd7601e40882480524664" dependencies = [ "p3-field", "p3-matrix", @@ -5151,9 +5175,9 @@ dependencies = [ [[package]] name = "p3-field" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f1977a0a65789f719aa824119c332c4676b000bdbfe94d312fb6244a70d601" +checksum = "cec2af6e1ac47a2035af5165e668d64612c4b9ccabd06df37fc1fd381fdf8a71" dependencies = [ "itertools 0.12.1", "num-bigint 0.4.6", @@ -5165,9 +5189,9 @@ dependencies = [ [[package]] name = "p3-fri" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22ddb958f200d9289cc73ff68847b0167ca0c14557b791dd9e318f98c2d1b28" +checksum = "f351ee9f9d4256455164565cd91e3e6d2487cc2a5355515fa2b6d479269188dd" dependencies = [ "itertools 0.12.1", "p3-challenger", @@ -5184,30 +5208,20 @@ dependencies = [ [[package]] name = "p3-interpolation" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d032cda212f6b408d7d5b0b9a8270a9455acb93742fe55a0880d82be8e90e500" +checksum = "d24d0f2907a374ebe4545fcff3120d6376d9630cf0bef30feedcfc5908ea2c37" dependencies = [ "p3-field", "p3-matrix", "p3-util", ] -[[package]] -name = "p3-keccak" -version = "0.1.3-succinct" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c56abdd5a8a780049d2f8e92cea1df57b55a2ef50a40d1103f2732f7a00e4b1" -dependencies = [ - "p3-symmetric", - "tiny-keccak", -] - [[package]] name = "p3-keccak-air" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8398f1694ccc38513df0b8cab5f9ef7325423f27cd9e4fa20bdc77d5079cf1b" +checksum = "e66badd47cedf6570e91a0cabc389b80dfd53ba1a6e9a45a3923fd54b86122ff" dependencies = [ "p3-air", "p3-field", @@ -5215,15 +5229,13 @@ dependencies = [ "p3-maybe-rayon", "p3-util", "tracing", - "tracing-forest", - "tracing-subscriber 0.3.18", ] [[package]] name = "p3-matrix" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d548ee0b834f8e2ebc5037073acd101a3b0ca41a2d1d28a15ba0ccd9059495b0" +checksum = "fa272f3ae77ed8d73478aa7c89e712efb15bda3ff4aff10fadfe11a012cd5389" dependencies = [ "itertools 0.12.1", "p3-field", @@ -5236,18 +5248,18 @@ dependencies = [ [[package]] name = "p3-maybe-rayon" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55f5575d3d61bedb3e05681abb0f36b8bb339d65aa395d50756bfa64e9cd3f46" +checksum = "3eecad6292021858f282d643d9d1284ab112a200494d589863a9c4080e578ef0" dependencies = [ "rayon", ] [[package]] name = "p3-mds" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6e57ed310d59245f93e24ee805ea7aa16fc9c505551b76a15f5e50f29d177e" +checksum = "716c4dbe68a02f1541eb09149d07b8663a3a5951b1864a31cd67ff3bb0826e57" dependencies = [ "itertools 0.12.1", "p3-dft", @@ -5260,9 +5272,9 @@ dependencies = [ [[package]] name = "p3-merkle-tree" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af46b41cba75d483ec8a553cbab1d2d794935ae3403d75394acfa4fb2c977cce" +checksum = "ad7ebab52a03c26025988663a135aed62f5084a2e2ea262176dc8748efb593e5" dependencies = [ "itertools 0.12.1", "p3-commit", @@ -5277,22 +5289,23 @@ dependencies = [ [[package]] name = "p3-poseidon2" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adaba6f14c197203530e233badce0ca1126ba3bf3c9ff766505b497bdad0bee1" +checksum = "39c042efa15beab7a8c4d0ca9b9e4cbda7582be0c08e121e830fec45f082935b" dependencies = [ "gcd", "p3-field", "p3-mds", "p3-symmetric", "rand 0.8.5", + "serde", ] [[package]] name = "p3-symmetric" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ecc4282566eb14f48be7707f6745c4dff6be664984d59ec0fb1849cd82b5c2" +checksum = "b9896a831f5b688adc13f6fbe1dcf66ecfaa4622a500f81aa745610e777acb72" dependencies = [ "itertools 0.12.1", "p3-field", @@ -5301,9 +5314,9 @@ dependencies = [ [[package]] name = "p3-uni-stark" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1af5c038b22b058bf1d49fb1ea3dd6c240a3e46c3278fde5c444e0034f7ffe37" +checksum = "8437ebcd060c8a5479898030b114a93da8a86eb4c2e5f313d9eeaaf40c6e6f61" dependencies = [ "itertools 0.12.1", "p3-air", @@ -5314,18 +5327,15 @@ dependencies = [ "p3-matrix", "p3-maybe-rayon", "p3-util", - "postcard", "serde", "tracing", - "tracing-forest", - "tracing-subscriber 0.3.18", ] [[package]] name = "p3-util" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79f3fef0e00d9d7246385e758c4cd39b4efcbbcea31752471491ab502631385e" +checksum = "dedb9d27ba47ac314c6fac4ca54e55c3e486c864d51ec5ba55dbe47b75121157" dependencies = [ "serde", ] @@ -5610,14 +5620,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" [[package]] -name = "postcard" -version = "1.0.8" +name = "portable-atomic-util" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" +checksum = "fcdd8420072e66d54a407b3316991fe946ce3ab1083a7f575b2463866624704d" dependencies = [ - "cobs", - "embedded-io", - "serde", + "portable-atomic", ] [[package]] @@ -5797,9 +5805,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.6" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", "prost-derive", @@ -5807,12 +5815,12 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.13.0", "proc-macro2", "quote", "syn 2.0.72", @@ -5825,12 +5833,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] -name = "psm" -version = "0.1.21" +name = "puffin" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "fa9dae7b05c02ec1a6bc9bcf20d8bc64a7dcbf57934107902a872014899b741f" dependencies = [ - "cc", + "anyhow", + "byteorder", + "cfg-if", + "itertools 0.10.5", + "once_cell", + "parking_lot 0.12.3", ] [[package]] @@ -5996,7 +6009,7 @@ dependencies = [ "thiserror", "tokio", "tokio-util", - "tower", + "tower 0.4.13", "tower-http", "tracing", "tracing-appender", @@ -6110,7 +6123,7 @@ dependencies = [ "structopt", "thiserror", "tokio", - "tower", + "tower 0.4.13", "tracing", "tracing-appender", "tracing-subscriber 0.3.18", @@ -7274,11 +7287,12 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3432b33880fd2bb3fcff4f7f4764f782852e839a849f72f1b36ba021e6f15d0" +checksum = "543230f7117ce0e6b92b4797fbb3da722575973258cc38a48e28af8d3cf3a26d" dependencies = [ "anyhow", + "borsh", "elf", "risc0-zkp", "risc0-zkvm-platform", @@ -7286,11 +7300,30 @@ dependencies = [ "tracing", ] +[[package]] +name = "risc0-build" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c328bea983ffed4cf3721c92b06fa5076cc38c9e326e1488a9ae792e67a054c7" +dependencies = [ + "anyhow", + "cargo_metadata 0.18.1", + "dirs", + "docker-generate", + "hex", + "risc0-binfmt", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "serde_json", + "tempfile", +] + [[package]] name = "risc0-build-kernel" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4db08993d4922b319efb484353ca2702386230c8e5648c07b390ba3ae3d4294c" +checksum = "b186137d4b2b16f7fd017491032e888c56f55ba539812453adc7d3639eaf0113" dependencies = [ "cc", "directories", @@ -7311,23 +7344,25 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adde6018be5b1ba65854fbbf993e44e0dc076893bb5e6e8311d9e606503fca2a" +checksum = "436c762db677faf2cd616c55a69012d6b4f46c426b7d553c1b3d717e0c7e9438" dependencies = [ "anyhow", "bytemuck", + "cfg-if", "cust", "downloader", "hex", + "lazy-regex", "metal", - "nvtx", "rand 0.8.5", "rayon", "risc0-circuit-recursion-sys", "risc0-core", "risc0-sys", "risc0-zkp", + "serde", "sha2", "tracing", "zip 2.1.5", @@ -7335,9 +7370,9 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion-sys" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be7caf965981f44a8d3c8a065e2b09d9eb5852d2d623933dfcd70d08792570a" +checksum = "e632f0cba360b49ab69755b49eca1e6c33bd2302d5eec5693f4b3202e6cb3334" dependencies = [ "glob", "risc0-build-kernel", @@ -7348,9 +7383,9 @@ dependencies = [ [[package]] name = "risc0-circuit-rv32im" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fce940ee68935e3fbe224033fb8dc8447d23dcc7558aaa8bb8c21bc1de73bdf" +checksum = "21f81638d4349eb5a816f3fd6ea12b314007572fc63d45cdb83891bed64e2a2a" dependencies = [ "anyhow", "bytemuck", @@ -7361,7 +7396,6 @@ dependencies = [ "derive-debug", "lazy-regex", "metal", - "nvtx", "rand 0.8.5", "rayon", "risc0-binfmt", @@ -7377,9 +7411,9 @@ dependencies = [ [[package]] name = "risc0-circuit-rv32im-sys" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46e1be5f652b867b32cb1558805ff78baa0da9f28a6923023d7f808d51707172" +checksum = "b3eea90914f44cd1227a23b40c2c9d12bee9923a3a7566ef0e6b5b3f3a85db9e" dependencies = [ "glob", "risc0-build-kernel", @@ -7390,11 +7424,13 @@ dependencies = [ [[package]] name = "risc0-core" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be98b31168c4ff7dbe4c2744a1c189fdba6db200b0c581afd1272f0cc0d79aad" +checksum = "1714b8968a5e4583a15018dc2ae95878c76f4cdbc643268a34670fde5b08252a" dependencies = [ "bytemuck", + "nvtx", + "puffin", "rand_core 0.6.4", ] @@ -7406,7 +7442,7 @@ dependencies = [ "alloy-sol-types", "anyhow", "bincode", - "bonsai-sdk 0.8.0", + "bonsai-sdk", "bytemuck", "cfg-if", "ethers-contract 2.0.10", @@ -7431,9 +7467,9 @@ dependencies = [ [[package]] name = "risc0-groth16" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa298da93c2a8ea3c92bde5b2e12cbad3c4291bc4a5a70af5f1fd64a12353a5" +checksum = "e5f11beecdcabeac264fb868e0b5db22c7e2db5fa2ce68fd482d8ab9ffb88e5d" dependencies = [ "anyhow", "ark-bn254", @@ -7455,9 +7491,9 @@ dependencies = [ [[package]] name = "risc0-sys" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f580b53e5a196f12158b2d6910febad42e01741bb5fd1bdb6f02f4ffb108c5f" +checksum = "2a3afe2e8e95cec6317a75bb6eb13519f643e22c53c67a22a31c355117b7c447" dependencies = [ "cc", "cust", @@ -7467,12 +7503,13 @@ dependencies = [ [[package]] name = "risc0-zkp" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6186432695488efb2eb4794d4074cf1edf381962303ecdd1732e366662f88afe" +checksum = "285aa3993827b4a646d70e68240e138f71574680a02d2e97ad30b1db80efda80" dependencies = [ "anyhow", "blake2", + "borsh", "bytemuck", "cfg-if", "cust", @@ -7482,7 +7519,6 @@ dependencies = [ "hex-literal", "metal", "ndarray", - "nvtx", "parking_lot 0.12.3", "paste", "rand 0.8.5", @@ -7498,26 +7534,26 @@ dependencies = [ [[package]] name = "risc0-zkvm" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca4ee3b38d873affc146e48c741e5a70533f5ccb1e3b186d8d671459c51d1ba" +checksum = "614fad8046130321e3be9ca3a36d9edad6ff4c538549ae191ec4d82576bb3893" dependencies = [ "addr2line", "anyhow", "bincode", - "bonsai-sdk 0.9.0", + "bonsai-sdk", + "borsh", "bytemuck", "bytes", - "cfg-if", "elf", "getrandom 0.2.15", "hex", "lazy-regex", - "nvtx", "prost", "rand 0.8.5", "rayon", "risc0-binfmt", + "risc0-build", "risc0-circuit-recursion", "risc0-circuit-rv32im", "risc0-core", @@ -7529,6 +7565,7 @@ dependencies = [ "semver 1.0.23", "serde", "sha2", + "stability", "tempfile", "tracing", "typetag", @@ -7536,13 +7573,14 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0494a25344644aea2fe9bdb2f619a28e68eb4aff2c173c723a1331fceac56eea" +checksum = "b6acf0b0d7a55578f892e0460ed1f2ca06d0380e32440531d80ca82530d41272" dependencies = [ "bytemuck", "getrandom 0.2.15", "libm", + "stability", ] [[package]] @@ -7777,9 +7815,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -8478,16 +8516,15 @@ dependencies = [ [[package]] name = "sp1-core-executor" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9855631556145c827f959527a2f60cb2c6ededfb42afcee49e41dab5f507ce7b" +checksum = "4bcf4d12fdcdb59632dbb8491e9f1ed5090de774b46cb5ef26ce5fcd4d024e3e" dependencies = [ "bincode", "bytemuck", "elf", "enum-map", "eyre", - "generic-array 1.1.0", "hashbrown 0.14.5", "hex", "itertools 0.13.0", @@ -8495,14 +8532,11 @@ dependencies = [ "nohash-hasher", "num", "p3-field", - "p3-keccak-air", "p3-maybe-rayon", "rand 0.8.5", "rrs-succinct", "serde", - "serde_with 3.9.0", "sp1-curves", - "sp1-derive", "sp1-primitives", "sp1-stark", "strum 0.26.3", @@ -8516,18 +8550,12 @@ dependencies = [ [[package]] name = "sp1-core-machine" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d9c51416ef52b258fa637538c02a2ac06ecaeec79d075c620013a77f035dee" +checksum = "0a6f7b232d011a2db7a314d53ee37ef79e60c2e282e4c249c9b91041e4ff88ec" dependencies = [ - "anyhow", - "arrayref", "bincode", - "blake3", - "bytemuck", "cfg-if", - "curve25519-dalek", - "elf", "elliptic-curve", "generic-array 1.1.0", "hashbrown 0.14.5", @@ -8535,32 +8563,20 @@ dependencies = [ "itertools 0.13.0", "k256", "log", - "nohash-hasher", "num", - "num-bigint 0.4.6", "num_cpus", "p3-air", "p3-baby-bear", "p3-blake3", "p3-challenger", - "p3-commit", - "p3-dft", "p3-field", - "p3-fri", - "p3-keccak", "p3-keccak-air", "p3-matrix", "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", "p3-uni-stark", "p3-util", "rand 0.8.5", - "rayon-scan", - "rrs-succinct", "serde", - "serde_with 3.9.0", "size", "snowbridge-amcl", "sp1-core-executor", @@ -8582,10 +8598,11 @@ dependencies = [ [[package]] name = "sp1-curves" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c33d4d3f5e3590cc8c8d8a3d074097020bc0be0b9dd35fe43e04c586440c85" +checksum = "c1c2c7fb1a24a9dcd06ffc26c4377056163cba55d47b973b19eec81442217f57" dependencies = [ + "cfg-if", "curve25519-dalek", "dashu", "elliptic-curve", @@ -8603,11 +8620,10 @@ dependencies = [ [[package]] name = "sp1-derive" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e33825340e1b21b37a29f5304fbd18a1c7c97ba1376fa35b7c017fd95dd627e" +checksum = "1d6c88b3e7ead9192679bf2ef5b0c28b6e7b9a56f929bd76851820e5e5b947bb" dependencies = [ - "proc-macro2", "quote", "syn 1.0.109", ] @@ -8652,39 +8668,46 @@ dependencies = [ [[package]] name = "sp1-primitives" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbeba375fe59917f162f1808c280d2e39e4698dc7eeac83936b6e70c2f8dbbc" +checksum = "2567220b2d8170a0c42eba514dec66b76c5c87927c9a3232ee53a56310acee72" dependencies = [ - "itertools 0.13.0", + "bincode", + "hex", "lazy_static", + "num-bigint 0.4.6", "p3-baby-bear", "p3-field", "p3-poseidon2", "p3-symmetric", + "serde", + "sha2", ] [[package]] name = "sp1-prover" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "166e9f9fd29ecdfd4fd452d49052abdfbe735317f00016e94fde8410f90b4134" +checksum = "cb59f305b4768a441049f46bc52e0d1edfd2d3179d65a3440f7396baa74e1bda" dependencies = [ "anyhow", "bincode", "clap 4.5.9", "dirs", - "hex", + "eyre", "itertools 0.13.0", + "lazy_static", + "lru", "num-bigint 0.4.6", - "oneshot", "p3-baby-bear", "p3-bn254-fr", "p3-challenger", "p3-commit", "p3-field", "p3-matrix", + "p3-symmetric", "rayon", + "reqwest 0.11.27", "serde", "serde_json", "serial_test", @@ -8695,7 +8718,6 @@ dependencies = [ "sp1-recursion-compiler", "sp1-recursion-core", "sp1-recursion-gnark-ffi", - "sp1-recursion-program", "sp1-stark", "subtle-encoding", "tempfile", @@ -8706,53 +8728,54 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ccdda16cd078f32c6707212b8e8f3e423992eeff6ace898d3e15bf94e78a16" +checksum = "e08f45e8fa3caf412251a730cdad04b36285e745a6c1b409d865bae3338a5196" dependencies = [ - "bincode", + "hashbrown 0.14.5", "itertools 0.13.0", + "num-traits", "p3-air", "p3-baby-bear", "p3-bn254-fr", + "p3-challenger", "p3-commit", + "p3-dft", "p3-field", "p3-fri", "p3-matrix", + "p3-symmetric", "p3-util", + "rand 0.8.5", + "rayon", "serde", + "sp1-core-executor", "sp1-core-machine", + "sp1-derive", + "sp1-primitives", "sp1-recursion-compiler", "sp1-recursion-core", - "sp1-recursion-derive", - "sp1-recursion-program", + "sp1-recursion-gnark-ffi", "sp1-stark", + "tracing", ] [[package]] name = "sp1-recursion-compiler" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae17b6c8506b3521e78450cf28f76c2426b5b2f132bb89660d3d61eb155439c4" +checksum = "648941453ab9e8c69386df5cd660dedabe4d06c041450d8a2548ba6cefa6ed45" dependencies = [ "backtrace", "itertools 0.13.0", - "p3-air", "p3-baby-bear", "p3-bn254-fr", - "p3-commit", "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", "p3-symmetric", - "p3-util", - "rayon", "serde", "sp1-core-machine", "sp1-primitives", "sp1-recursion-core", - "sp1-recursion-core-v2", "sp1-recursion-derive", "sp1-stark", "tracing", @@ -8761,54 +8784,14 @@ dependencies = [ [[package]] name = "sp1-recursion-core" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8414c3d16cd2fedd293989cef601915d4e1efab662e3a08923606970dc8ae7e6" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.13.0", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "serde_with 3.9.0", - "sp1-core-executor", - "sp1-core-machine", - "sp1-derive", - "sp1-primitives", - "sp1-stark", - "static_assertions", - "tracing", - "zkhash", -] - -[[package]] -name = "sp1-recursion-core-v2" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0a2af67ca6f7db964b7f1ffdb48f6e26f10e3cc027a11bdd17b224f8747650" +checksum = "faf8c5dc0a2c33ef1dc7da7a137574e4f1783e45489681ca01aa3309abc6adee" dependencies = [ - "arrayref", "backtrace", "ff 0.13.0", "hashbrown 0.14.5", "itertools 0.13.0", - "num_cpus", "p3-air", "p3-baby-bear", "p3-bn254-fr", @@ -8824,12 +8807,9 @@ dependencies = [ "p3-symmetric", "p3-util", "serde", - "serde_with 3.9.0", - "sp1-core-executor", "sp1-core-machine", "sp1-derive", "sp1-primitives", - "sp1-recursion-core", "sp1-stark", "static_assertions", "thiserror", @@ -8840,20 +8820,19 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4921db3912a60ee3896242ce336203066377e6eddd1c26d099e8bf6b9c470a21" +checksum = "a7807dc1a72bb7b86f2e82c414cb58b9789d880ca459b2113f7406df814945ae" dependencies = [ - "proc-macro2", "quote", "syn 1.0.109", ] [[package]] name = "sp1-recursion-gnark-ffi" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718b2e92bfd3ce91fcef2ac0b3a8d31746dbc3ad4071f3bec45aa2e5e025adb1" +checksum = "bff667dda92cbe2f9382e36fe222641f60a4e794e0a3b6c7597cd6a74d79262d" dependencies = [ "anyhow", "bincode", @@ -8866,7 +8845,6 @@ dependencies = [ "p3-baby-bear", "p3-field", "p3-symmetric", - "rand 0.8.5", "serde", "serde_json", "sha2", @@ -8876,43 +8854,11 @@ dependencies = [ "tempfile", ] -[[package]] -name = "sp1-recursion-program" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "676661b42f5d55c64932ad400ec920bd8b8098b1500b13c483a541bf3b396dd1" -dependencies = [ - "itertools 0.13.0", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand 0.8.5", - "serde", - "sp1-core-executor", - "sp1-core-machine", - "sp1-primitives", - "sp1-recursion-compiler", - "sp1-recursion-core", - "sp1-stark", - "stacker", - "tracing", -] - [[package]] name = "sp1-sdk" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b289585392a3639f6541bce32dd89e03e7893f42e9b9bcf6bee7d54183d5e05" +checksum = "df9a960e85019f30d96a2269bb2faa4982fbc0af784bc7c5998ae5d8ee2ea033" dependencies = [ "alloy-sol-types", "anyhow", @@ -8922,31 +8868,25 @@ dependencies = [ "dirs", "ethers", "futures", - "getrandom 0.2.15", "hashbrown 0.14.5", "hex", "indicatif", "itertools 0.13.0", "log", - "num-bigint 0.4.6", "p3-baby-bear", - "p3-commit", "p3-field", "p3-fri", - "p3-matrix", "prost", "reqwest 0.12.5", "reqwest-middleware", "serde", - "serde_json", - "sha2", "sp1-core-executor", "sp1-core-machine", + "sp1-primitives", "sp1-prover", "sp1-stark", "strum 0.26.3", "strum_macros 0.26.4", - "sysinfo", "tempfile", "thiserror", "tokio", @@ -8957,14 +8897,15 @@ dependencies = [ [[package]] name = "sp1-stark" -version = "2.0.0" +version = "3.0.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4048fc99a6c1123f5040b5ade1ae2839ca1be421e4c427fc7d1fd9bbf6e174f5" +checksum = "ba8706930d1d65aa645d194b175f6c4c0f47ac7833640b4f46cf4da5964d2d1d" dependencies = [ "arrayref", "getrandom 0.2.15", "hashbrown 0.14.5", "itertools 0.13.0", + "num-traits", "p3-air", "p3-baby-bear", "p3-challenger", @@ -8983,7 +8924,10 @@ dependencies = [ "serde", "sp1-derive", "sp1-primitives", + "strum 0.26.3", + "strum_macros 0.26.4", "sysinfo", + "thiserror", "tracing", ] @@ -9011,32 +8955,29 @@ dependencies = [ [[package]] name = "sppark" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb266b15daead53670d477d7e136b8fc92d46e31bb9007ac46d304df23689a4b" +checksum = "c55f3833d30846a26110dccb1d5366314c2c52516a9173b74238c16b24b1a9f9" dependencies = [ "cc", "which 4.4.2", ] [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "stability" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" +dependencies = [ + "quote", + "syn 2.0.72", +] [[package]] -name = "stacker" -version = "0.1.15" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" -dependencies = [ - "cc", - "cfg-if", - "libc", - "psm", - "winapi", -] +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "static_assertions" @@ -9196,6 +9137,18 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -9252,14 +9205,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -9279,18 +9233,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -9585,6 +9539,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "tower-layer", + "tower-service", +] + [[package]] name = "tower-http" version = "0.5.2" @@ -9609,7 +9573,7 @@ dependencies = [ "pin-project-lite", "tokio", "tokio-util", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -9618,15 +9582,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -9798,13 +9762,12 @@ dependencies = [ [[package]] name = "twirp-rs" -version = "0.3.0" +version = "0.13.0-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa3161d8eee0abcad4e762f4215381a430cc1281870d575b0f1e4fbfc74b8ce" +checksum = "27dfcc06b8d9262bc2d4b8d1847c56af9971a52dd8a0076876de9db763227d0d" dependencies = [ "async-trait", "axum", - "bytes", "futures", "http 1.1.0", "http-body-util", @@ -9815,7 +9778,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tower", + "tower 0.5.1", "url", ] @@ -10354,6 +10317,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" diff --git a/Cargo.toml b/Cargo.toml index 04dfeaf3..ec2d62bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,13 +53,12 @@ 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 = "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" } +risc0-zkvm = { version = "=1.1.2", features = ["prove", "getrandom"] } +bonsai-sdk = { version = "=1.1.2" } +risc0-binfmt = { version = "=1.1.2" } # SP1 -sp1-sdk = { version = "2.0.0" } +sp1-sdk = { version = "=3.0.0-rc3" } sp1-zkvm = { version = "2.0.0" } sp1-helper = { version = "2.0.0" } diff --git a/Dockerfile.zk b/Dockerfile.zk index 8ccf7a4e..d6b8da1a 100644 --- a/Dockerfile.zk +++ b/Dockerfile.zk @@ -40,7 +40,7 @@ RUN echo "Building for sp1" ENV TARGET=sp1 RUN make install RUN make guest -RUN cargo build --release ${BUILD_FLAGS} --features "sp1,risc0,bonsai-auto-scaling" --features "docker_build" +RUN cargo build --release ${BUILD_FLAGS} --features "sp1,risc0" --features "docker_build" RUN mkdir -p \ ./bin \ diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index d00faf1e..3ba94aca 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -130,10 +130,11 @@ services: volumes: - /var/log/raiko:/var/log/raiko ports: - - "8081:8080" + - "8080:8080" environment: # you can use your own PCCS host # - PCCS_HOST=host.docker.internal:8081 + - RUST_LOG=${RUST_LOG:-info} - ZK=true - ETHEREUM_RPC=${ETHEREUM_RPC} - ETHEREUM_BEACON_RPC=${ETHEREUM_BEACON_RPC} @@ -145,11 +146,13 @@ services: - NETWORK=${NETWORK} - BONSAI_API_KEY=${BONSAI_API_KEY} - BONSAI_API_URL=${BONSAI_API_URL} - - MAX_BONSAI_GPU_NUM=15 + - MAX_BONSAI_GPU_NUM=300 - GROTH16_VERIFIER_RPC_URL=${GROTH16_VERIFIER_RPC_URL} - GROTH16_VERIFIER_ADDRESS=${GROTH16_VERIFIER_ADDRESS} - SP1_PRIVATE_KEY=${SP1_PRIVATE_KEY} - SKIP_SIMULATION=true + - SP1_VERIFIER_RPC_URL=${SP1_VERIFIER_RPC_URL} + - SP1_VERIFIER_ADDRESS=${SP1_VERIFIER_ADDRESS} pccs: build: context: .. diff --git a/host/src/proof.rs b/host/src/proof.rs index 095a2c2d..761b100d 100644 --- a/host/src/proof.rs +++ b/host/src/proof.rs @@ -105,15 +105,18 @@ impl ProofActor { pub async fn run_task(&mut self, proof_request: ProofRequest) { let cancel_token = CancellationToken::new(); - let Ok((chain_id, blockhash)) = get_task_data( + let (chain_id, blockhash) = match get_task_data( &proof_request.network, proof_request.block_number, &self.chain_specs, ) .await - else { - error!("Could not get task data for {proof_request:?}"); - return; + { + Ok(v) => v, + Err(e) => { + error!("Could not get task data for {proof_request:?}, error: {e}"); + return; + } }; let key = TaskDescriptor::from(( diff --git a/provers/risc0/driver/src/bonsai.rs b/provers/risc0/driver/src/bonsai.rs index 0c8d8565..f983d534 100644 --- a/provers/risc0/driver/src/bonsai.rs +++ b/provers/risc0/driver/src/bonsai.rs @@ -4,6 +4,7 @@ use crate::{ Risc0Response, }; use alloy_primitives::B256; +use bonsai_sdk::blocking::{Client, SessionId}; use log::{debug, error, info, warn}; use raiko_lib::{ primitives::keccak::keccak, @@ -19,14 +20,17 @@ use std::{ fs, path::{Path, PathBuf}, }; +use tokio::time::{sleep as tokio_async_sleep, Duration}; use crate::Risc0Param; +const MAX_REQUEST_RETRY: usize = 8; + #[derive(thiserror::Error, Debug)] pub enum BonsaiExecutionError { // common errors: include sdk error, or some others from non-bonsai code #[error(transparent)] - SdkFailure(#[from] bonsai_sdk::alpha::SdkErr), + SdkFailure(#[from] bonsai_sdk::SdkErr), #[error("bonsai execution error: {0}")] Other(String), // critical error like OOM, which is un-recoverable @@ -44,12 +48,12 @@ pub async fn verify_bonsai_receipt( max_retries: usize, ) -> Result<(String, Receipt), BonsaiExecutionError> { info!("Tracking receipt uuid: {uuid}"); - let session = bonsai_sdk::alpha::SessionId { uuid }; + let session = SessionId { uuid }; loop { let mut res = None; for attempt in 1..=max_retries { - let client = bonsai_sdk::alpha_async::get_client_from_env(risc0_zkvm::VERSION).await?; + let client = Client::from_env(risc0_zkvm::VERSION)?; match session.status(&client) { Ok(response) => { @@ -61,7 +65,7 @@ pub async fn verify_bonsai_receipt( return Err(BonsaiExecutionError::SdkFailure(err)); } warn!("Attempt {attempt}/{max_retries} for session status request: {err:?}"); - std::thread::sleep(std::time::Duration::from_secs(15)); + tokio_async_sleep(Duration::from_secs(15)).await; continue; } } @@ -72,17 +76,18 @@ pub async fn verify_bonsai_receipt( if res.status == "RUNNING" { info!( - "Current status: {} - state: {} - continue polling...", + "Current {session:?} status: {} - state: {} - continue polling...", res.status, res.state.unwrap_or_default() ); - std::thread::sleep(std::time::Duration::from_secs(15)); + tokio_async_sleep(Duration::from_secs(15)).await; } else if res.status == "SUCCEEDED" { // Download the receipt, containing the output + info!("Prove task {session:?} success."); let receipt_url = res .receipt_url .expect("API error, missing receipt on completed session"); - let client = bonsai_sdk::alpha_async::get_client_from_env(risc0_zkvm::VERSION).await?; + let client = Client::from_env(risc0_zkvm::VERSION)?; let receipt_buf = client.download(&receipt_url)?; let receipt: Receipt = bincode::deserialize(&receipt_buf).map_err(|e| { BonsaiExecutionError::Other(format!("Failed to deserialize receipt: {e:?}")) @@ -104,10 +109,10 @@ pub async fn verify_bonsai_receipt( } return Ok((session.uuid, receipt)); } else { - let client = bonsai_sdk::alpha_async::get_client_from_env(risc0_zkvm::VERSION).await?; + let client = Client::from_env(risc0_zkvm::VERSION)?; let bonsai_err_log = session.logs(&client); return Err(BonsaiExecutionError::Fatal(format!( - "Workflow exited: {} - | err: {} | log: {bonsai_err_log:?}", + "Workflow {session:?} exited: {} - | err: {} | log: {bonsai_err_log:?}", res.status, res.error_msg.unwrap_or_default(), ))); @@ -167,11 +172,11 @@ pub async fn maybe_prove { warn!("Bonsai SDK fail: {err:?}, keep tracking..."); - std::thread::sleep(std::time::Duration::from_secs(15)); + tokio_async_sleep(Duration::from_secs(15)).await; } Err(BonsaiExecutionError::Other(err)) => { warn!("Something wrong: {err:?}, keep tracking..."); - std::thread::sleep(std::time::Duration::from_secs(15)); + tokio_async_sleep(Duration::from_secs(15)).await; } Err(BonsaiExecutionError::Fatal(err)) => { error!("Fatal error on Bonsai: {err:?}"); @@ -228,13 +233,13 @@ pub async fn maybe_prove anyhow::Result { - let client = bonsai_sdk::alpha_async::get_client_from_env(risc0_zkvm::VERSION).await?; + let client = Client::from_env(risc0_zkvm::VERSION)?; Ok(client.upload_receipt(bincode::serialize(receipt)?)?) } pub async fn cancel_proof(uuid: String) -> anyhow::Result<()> { - let client = bonsai_sdk::alpha_async::get_client_from_env(risc0_zkvm::VERSION).await?; - let session = bonsai_sdk::alpha::SessionId { uuid }; + let client = Client::from_env(risc0_zkvm::VERSION)?; + let session = SessionId { uuid }; session.stop(&client)?; #[cfg(feature = "bonsai-auto-scaling")] auto_scaling::shutdown_bonsai().await?; @@ -257,7 +262,7 @@ pub async fn prove_bonsai( // Prepare input data let input_data = bytemuck::cast_slice(&encoded_input).to_vec(); - let client = bonsai_sdk::alpha_async::get_client_from_env(risc0_zkvm::VERSION).await?; + let client = Client::from_env(risc0_zkvm::VERSION)?; client.upload_img(&encoded_image_id, elf.to_vec())?; // upload input let input_id = client.upload_input(input_data.clone())?; @@ -266,6 +271,7 @@ pub async fn prove_bonsai( encoded_image_id.clone(), input_id.clone(), assumption_uuids.clone(), + false, )?; if let Some(id_store) = id_store { @@ -277,7 +283,13 @@ pub async fn prove_bonsai( })?; } - verify_bonsai_receipt(image_id, expected_output, session.uuid.clone(), 8).await + verify_bonsai_receipt( + image_id, + expected_output, + session.uuid.clone(), + MAX_REQUEST_RETRY, + ) + .await } pub async fn bonsai_stark_to_snark( @@ -286,10 +298,14 @@ pub async fn bonsai_stark_to_snark( input: B256, ) -> ProverResult { let image_id = Digest::from(RISC0_GUEST_ID); - let (snark_uuid, snark_receipt) = - stark2snark(image_id, stark_uuid.clone(), stark_receipt.clone()) - .await - .map_err(|err| format!("Failed to convert STARK to SNARK: {err:?}"))?; + let (snark_uuid, snark_receipt) = stark2snark( + image_id, + stark_uuid.clone(), + stark_receipt.clone(), + MAX_REQUEST_RETRY, + ) + .await + .map_err(|err| format!("Failed to convert STARK to SNARK: {err:?}"))?; info!("Validating SNARK uuid: {snark_uuid}"); @@ -382,8 +398,10 @@ pub fn load_receipt( pub fn save_receipt(receipt_label: &String, receipt_data: &(String, T)) { if !is_dev_mode() { + let cache_path = zkp_cache_path(receipt_label); + info!("Saving receipt to cache: {cache_path:?}"); fs::write( - zkp_cache_path(receipt_label), + cache_path, bincode::serialize(receipt_data).expect("Failed to serialize receipt!"), ) .expect("Failed to save receipt output file."); diff --git a/provers/risc0/driver/src/methods/risc0_aggregation.rs b/provers/risc0/driver/src/methods/risc0_aggregation.rs index bc199082..cea441f3 100644 --- a/provers/risc0/driver/src/methods/risc0_aggregation.rs +++ b/provers/risc0/driver/src/methods/risc0_aggregation.rs @@ -1,5 +1,5 @@ pub const RISC0_AGGREGATION_ELF: &[u8] = include_bytes!("../../../guest/target/riscv32im-risc0-zkvm-elf/release/risc0-aggregation"); pub const RISC0_AGGREGATION_ID: [u32; 8] = [ - 3593026424, 359928015, 3488866833, 2676323972, 1129344711, 55769507, 233041442, 3293280986, + 3190692238, 1991537256, 2457220677, 1764592515, 1585399420, 97928005, 276688816, 447831862, ]; diff --git a/provers/risc0/driver/src/methods/risc0_guest.rs b/provers/risc0/driver/src/methods/risc0_guest.rs index a4eb56b9..db222f4c 100644 --- a/provers/risc0/driver/src/methods/risc0_guest.rs +++ b/provers/risc0/driver/src/methods/risc0_guest.rs @@ -1,5 +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] = [ - 2522428380, 1790994278, 397707036, 244564411, 3780865207, 1282154214, 1673205005, 3172292887, + 3473581204, 2561439051, 2320161003, 3018340632, 1481329104, 1608433297, 3314099706, 2669934765, ]; diff --git a/provers/risc0/driver/src/snarks.rs b/provers/risc0/driver/src/snarks.rs index fdc11687..58a60101 100644 --- a/provers/risc0/driver/src/snarks.rs +++ b/provers/risc0/driver/src/snarks.rs @@ -17,7 +17,7 @@ use std::{str::FromStr, sync::Arc}; use alloy_primitives::B256; use alloy_sol_types::{sol, SolValue}; use anyhow::Result; -use bonsai_sdk::alpha::responses::SnarkReceipt; +use bonsai_sdk::blocking::Client; use ethers_contract::abigen; use ethers_core::types::H160; use ethers_providers::{Http, Provider, RetryClient}; @@ -27,6 +27,7 @@ use risc0_zkvm::{ sha::{Digest, Digestible}, Groth16ReceiptVerifierParameters, Receipt, }; +use tokio::time::{sleep as tokio_async_sleep, Duration}; use tracing::{error as tracing_err, info as tracing_info}; @@ -86,7 +87,8 @@ pub async fn stark2snark( image_id: Digest, stark_uuid: String, stark_receipt: Receipt, -) -> Result<(String, SnarkReceipt)> { + max_retries: usize, +) -> Result<(String, Receipt)> { info!("Submitting SNARK workload"); // Label snark output as journal digest let receipt_label = format!( @@ -106,20 +108,38 @@ pub async fn stark2snark( stark_uuid }; - let client = bonsai_sdk::alpha_async::get_client_from_env(risc0_zkvm::VERSION).await?; - let snark_uuid = client.create_snark(stark_uuid)?; + let client = Client::from_env(risc0_zkvm::VERSION)?; + let snark_uuid = client.create_snark(stark_uuid.clone())?; + let mut retry = 0; let snark_receipt = loop { let res = snark_uuid.status(&client)?; - if res.status == "RUNNING" { - info!("Current status: {} - continue polling...", res.status); - std::thread::sleep(std::time::Duration::from_secs(15)); + info!( + "Current {:?} status: {} - continue polling...", + &stark_uuid, res.status + ); + tokio_async_sleep(Duration::from_secs(15)).await; } else if res.status == "SUCCEEDED" { - break res + let download_url = res .output .expect("Bonsai response is missing SnarkReceipt."); + let receipt_buf = client.download(&download_url)?; + let snark_receipt: Receipt = bincode::deserialize(&receipt_buf)?; + break snark_receipt; } else { + if retry < max_retries { + retry += 1; + info!( + "Workflow {:?} exited: {} - | err: {} - retrying {}/{max_retries}", + stark_uuid, + res.status, + res.error_msg.unwrap_or_default(), + retry + ); + tokio_async_sleep(Duration::from_secs(15)).await; + continue; + } panic!( "Workflow exited: {} - | err: {}", res.status, @@ -129,7 +149,7 @@ pub async fn stark2snark( }; let stark_psd = stark_receipt.claim()?.as_value().unwrap().post.digest(); - let snark_psd = Digest::try_from(snark_receipt.post_state_digest.as_slice())?; + let snark_psd = snark_receipt.claim()?.as_value().unwrap().post.digest(); if stark_psd != snark_psd { error!("SNARK/STARK Post State Digest mismatch!"); @@ -137,7 +157,7 @@ pub async fn stark2snark( error!("SNARK: {}", hex::encode(snark_psd)); } - if snark_receipt.journal != stark_receipt.journal.bytes { + if snark_receipt.journal.bytes != stark_receipt.journal.bytes { error!("SNARK/STARK Receipt Journal mismatch!"); error!("STARK: {}", hex::encode(&stark_receipt.journal.bytes)); error!("SNARK: {}", hex::encode(&snark_receipt.journal)); @@ -152,11 +172,12 @@ pub async fn stark2snark( pub async fn verify_groth16_from_snark_receipt( image_id: Digest, - snark_receipt: SnarkReceipt, + snark_receipt: Receipt, ) -> Result> { - let seal = encode(snark_receipt.snark.to_vec())?; + let groth16_claim = snark_receipt.inner.groth16().unwrap(); + let seal = groth16_claim.seal.clone(); let journal_digest = snark_receipt.journal.digest(); - let post_state_digest = snark_receipt.post_state_digest.digest(); + let post_state_digest = snark_receipt.claim()?.as_value().unwrap().post.digest(); let encoded_proof = verify_groth16_snark_impl(image_id, seal, journal_digest, post_state_digest).await?; let proof = (encoded_proof, B256::from_slice(image_id.as_bytes())) diff --git a/provers/risc0/guest/Cargo.lock b/provers/risc0/guest/Cargo.lock index e51bad34..99d03626 100644 --- a/provers/risc0/guest/Cargo.lock +++ b/provers/risc0/guest/Cargo.lock @@ -660,6 +660,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.6.0" @@ -691,6 +697,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.10.4" @@ -725,6 +737,30 @@ dependencies = [ "zeroize", ] +[[package]] +name = "borsh" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.72", + "syn_derive", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -797,6 +833,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.38" @@ -892,12 +934,33 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" 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 = "core2" version = "0.4.0" @@ -1282,6 +1345,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.72", +] + +[[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" @@ -1690,6 +1780,15 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[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" version = "0.1.0" @@ -1705,6 +1804,21 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "metal" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" +dependencies = [ + "bitflags 2.6.0", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + [[package]] name = "metrics" version = "0.22.3" @@ -1898,6 +2012,15 @@ dependencies = [ "smallvec", ] +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -2073,7 +2196,7 @@ checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand", @@ -2714,7 +2837,7 @@ source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#337a98f982e1 dependencies = [ "alloy-primitives", "auto_impl", - "bitflags", + "bitflags 2.6.0", "bitvec", "c-kzg", "cfg-if", @@ -2748,11 +2871,12 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4003dd96f2e323dfef431b21a2aaddee1c6791fc32dea8eb2bff1b438bf5caf6" +checksum = "543230f7117ce0e6b92b4797fbb3da722575973258cc38a48e28af8d3cf3a26d" dependencies = [ "anyhow", + "borsh", "elf", "risc0-zkp", "risc0-zkvm-platform", @@ -2762,13 +2886,14 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c4154d2fbbde5af02a1c35c90340c2749044f5d5cd7834251b616ffa28d467" +checksum = "436c762db677faf2cd616c55a69012d6b4f46c426b7d553c1b3d717e0c7e9438" dependencies = [ "anyhow", "bytemuck", "hex", + "metal", "risc0-core", "risc0-zkp", "tracing", @@ -2776,11 +2901,12 @@ dependencies = [ [[package]] name = "risc0-circuit-rv32im" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce836e7c553e63cbd807d15925ba5dd641a80cdee7d123619eaa60bb555ab014" +checksum = "21f81638d4349eb5a816f3fd6ea12b314007572fc63d45cdb83891bed64e2a2a" dependencies = [ "anyhow", + "metal", "risc0-binfmt", "risc0-core", "risc0-zkp", @@ -2791,9 +2917,9 @@ dependencies = [ [[package]] name = "risc0-core" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "047cc26c68c092d664ded7488dcac0462d9e31190e1598a7820fe4246d313583" +checksum = "1714b8968a5e4583a15018dc2ae95878c76f4cdbc643268a34670fde5b08252a" dependencies = [ "bytemuck", "rand_core", @@ -2801,9 +2927,9 @@ dependencies = [ [[package]] name = "risc0-groth16" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3309c7acaf46ed3d21df3841185afd8ea4aab9fb63dbd1974694dfdae276970" +checksum = "e5f11beecdcabeac264fb868e0b5db22c7e2db5fa2ce68fd482d8ab9ffb88e5d" dependencies = [ "anyhow", "ark-bn254", @@ -2835,17 +2961,19 @@ dependencies = [ [[package]] name = "risc0-zkp" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae55272541351a2391e5051519b33bfdf41f5648216827cc2cb94a49b6937380" +checksum = "285aa3993827b4a646d70e68240e138f71574680a02d2e97ad30b1db80efda80" dependencies = [ "anyhow", "blake2", + "borsh", "bytemuck", "cfg-if", "digest 0.10.7", "hex", "hex-literal", + "metal", "paste", "rand_core", "risc0-core", @@ -2857,13 +2985,13 @@ dependencies = [ [[package]] name = "risc0-zkvm" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f234694d9dabc1172cf418b7a3ba65447caad15b994f450e9941d2a7cc89e045" +checksum = "614fad8046130321e3be9ca3a36d9edad6ff4c538549ae191ec4d82576bb3893" dependencies = [ "anyhow", + "borsh", "bytemuck", - "cfg-if", "getrandom", "hex", "risc0-binfmt", @@ -2877,18 +3005,20 @@ dependencies = [ "semver 1.0.23", "serde", "sha2 0.10.8", + "stability", "tracing", ] [[package]] name = "risc0-zkvm-platform" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16735dab52ae8bf0dc30df78fce901b674f469dfd7b5f5dfddd54caea22f14d5" +checksum = "b6acf0b0d7a55578f892e0460ed1f2ca06d0380e32440531d80ca82530d41272" dependencies = [ "bytemuck", "getrandom", "libm", + "stability", ] [[package]] @@ -3019,7 +3149,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -3298,6 +3428,16 @@ dependencies = [ "der", ] +[[package]] +name = "stability" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" +dependencies = [ + "quote", + "syn 2.0.72", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -3385,6 +3525,18 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "sysinfo" version = "0.30.13" diff --git a/provers/risc0/guest/Cargo.toml b/provers/risc0/guest/Cargo.toml index 190ac9a6..cecc0fa4 100644 --- a/provers/risc0/guest/Cargo.toml +++ b/provers/risc0/guest/Cargo.toml @@ -23,7 +23,7 @@ path = "src/benchmark/ecdsa.rs" [dependencies] raiko-lib = { path = "../../../lib", features = ["std", "risc0"] } -risc0-zkvm = { version = "1.0.1", default-features = false, features = [ +risc0-zkvm = { version = "=1.1.2", default-features = false, features = [ 'std', "getrandom", ] } diff --git a/provers/sp1/driver/src/lib.rs b/provers/sp1/driver/src/lib.rs index dd09c321..35c69a2b 100644 --- a/provers/sp1/driver/src/lib.rs +++ b/provers/sp1/driver/src/lib.rs @@ -1,7 +1,6 @@ #![cfg(feature = "enable")] #![feature(iter_advance_by)] -use once_cell::sync::Lazy; use raiko_lib::{ input::{ AggregationGuestInput, AggregationGuestOutput, GuestInput, GuestOutput, @@ -16,16 +15,11 @@ use serde_with::serde_as; use sp1_sdk::{ action, network::client::NetworkClient, - proto::network::{ProofMode, UnclaimReason}, - SP1Proof, SP1ProofWithPublicValues, SP1VerifyingKey, + network::proto::network::{ProofMode, UnclaimReason}, + NetworkProverV1 as NetworkProver, SP1Proof, SP1ProofWithPublicValues, SP1VerifyingKey, }; use sp1_sdk::{HashableKey, ProverClient, SP1Stdin}; -use std::{ - borrow::BorrowMut, - env, fs, - path::{Path, PathBuf}, - time::Duration, -}; +use std::{borrow::BorrowMut, env, time::Duration}; use tracing::{debug, error, info}; mod proof_verify; @@ -34,11 +28,6 @@ use proof_verify::remote_contract_verify::verify_sol_by_contract_call; pub const ELF: &[u8] = include_bytes!("../../guest/elf/sp1-guest"); pub const AGGREGATION_ELF: &[u8] = include_bytes!("../../guest/elf/sp1-aggregation"); const SP1_PROVER_CODE: u8 = 1; -static FIXTURE_PATH: Lazy = - Lazy::new(|| Path::new(env!("CARGO_MANIFEST_DIR")).join("../contracts/src/fixtures/")); -static CONTRACT_PATH: Lazy = - Lazy::new(|| Path::new(env!("CARGO_MANIFEST_DIR")).join("../contracts/src/exports/")); -pub static VERIFIER: Lazy> = Lazy::new(init_verifier); #[serde_as] #[derive(Clone, Debug, Serialize, Deserialize)] @@ -46,10 +35,12 @@ pub struct Sp1Param { #[serde(default = "RecursionMode::default")] pub recursion: RecursionMode, pub prover: Option, - #[serde(default = "bool::default")] + #[serde(default = "DEFAULT_TRUE")] pub verify: bool, } +const DEFAULT_TRUE: fn() -> bool = || true; + #[derive(Clone, Debug, Serialize, Deserialize, Default)] #[serde(rename_all = "lowercase")] pub enum RecursionMode { @@ -142,7 +133,7 @@ impl Prover for Sp1Prover { let prove_action = action::Prove::new(client.prover.as_ref(), &pk, stdin.clone()); let prove_result = if !matches!(mode, ProverMode::Network) { - tracing::debug!("Proving locally with recursion mode: {:?}", param.recursion); + debug!("Proving locally with recursion mode: {:?}", param.recursion); match param.recursion { RecursionMode::Core => prove_action.run(), RecursionMode::Compressed => prove_action.compressed().run(), @@ -150,7 +141,7 @@ impl Prover for Sp1Prover { } .map_err(|e| ProverError::GuestError(format!("Sp1: local proving failed: {e}")))? } else { - let network_prover = sp1_sdk::NetworkProver::new(); + let network_prover = NetworkProver::new(); let proof_id = network_prover .request_proof(ELF, stdin, param.recursion.clone().into()) @@ -186,7 +177,7 @@ impl Prover for Sp1Prover { } _ => prove_result.bytes(), }; - if param.verify { + if param.verify && !proof_bytes.is_empty() { let time = Measurement::start("verify", false); let pi_hash = prove_result .clone() @@ -196,7 +187,7 @@ impl Prover for Sp1Prover { let fixture = RaikoProofFixture { vkey: vk.bytes32(), public_values: B256::from_slice(&pi_hash).to_string(), - proof: reth_primitives::hex::encode_prefixed(&proof_bytes), + proof: proof_bytes.clone(), }; verify_sol_by_contract_call(&fixture).await?; @@ -284,7 +275,7 @@ impl Prover for Sp1Prover { .map_err(|e| ProverError::GuestError(format!("Failed to parse SP1 proof: {e}")))?; match sp1_proof { SP1Proof::Compressed(block_proof) => { - stdin.write_proof(block_proof, stark_vk.clone()); + stdin.write_proof(*block_proof, stark_vk.clone()); } _ => { error!("unsupported proof type for aggregation: {sp1_proof:?}"); @@ -318,17 +309,17 @@ impl Prover for Sp1Prover { .expect("proving failed"); let proof_bytes = prove_result.bytes(); - if param.verify { + if param.verify && !proof_bytes.is_empty() { let time = Measurement::start("verify", false); let aggregation_pi = prove_result.clone().borrow_mut().public_values.raw(); let fixture = RaikoProofFixture { vkey: vk.bytes32().to_string(), public_values: reth_primitives::hex::encode_prefixed(aggregation_pi), - proof: reth_primitives::hex::encode_prefixed(&proof_bytes), + proof: proof_bytes.clone(), }; - verify_sol(&fixture)?; - time.stop_with("==> Verification complete"); + verify_sol_by_contract_call(&fixture).await?; + time.stop_with("==> Aggregation verification complete"); } let proof = (!proof_bytes.is_empty()).then_some( @@ -366,65 +357,13 @@ fn get_env_mock() -> ProverMode { } } -fn init_verifier() -> Result { - // In cargo run, Cargo sets the working directory to the root of the workspace - let contract_path = &*CONTRACT_PATH; - info!("Contract dir: {contract_path:?}"); - let artifacts_dir = sp1_sdk::install::try_install_circuit_artifacts(); - // Create the destination directory if it doesn't exist - fs::create_dir_all(contract_path)?; - - // Read the entries in the source directory - for entry in fs::read_dir(artifacts_dir)? { - let entry = entry?; - let src = entry.path(); - - // Check if the entry is a file and ends with .sol - if src.is_file() && src.extension().map(|s| s == "sol").unwrap_or(false) { - let out = contract_path.join(src.file_name().unwrap()); - fs::copy(&src, &out)?; - println!("Copied: {:?}", src.file_name().unwrap()); - } - } - Ok(contract_path.clone()) -} - /// A fixture that can be used to test the verification of SP1 zkVM proofs inside Solidity. #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub(crate) struct RaikoProofFixture { vkey: String, public_values: String, - proof: String, -} - -fn verify_sol(fixture: &RaikoProofFixture) -> ProverResult<()> { - assert!(VERIFIER.is_ok()); - debug!("===> Fixture: {fixture:#?}"); - - // Save the fixture to a file. - let fixture_path = &*FIXTURE_PATH; - info!("Writing fixture to: {fixture_path:?}"); - - if !fixture_path.exists() { - std::fs::create_dir_all(fixture_path.clone()) - .map_err(|e| ProverError::GuestError(format!("Failed to create fixture path: {e}")))?; - } - std::fs::write( - fixture_path.join("fixture.json"), - serde_json::to_string_pretty(&fixture).unwrap(), - ) - .map_err(|e| ProverError::GuestError(format!("Failed to write fixture: {e}")))?; - - let child = std::process::Command::new("forge") - .arg("test") - .current_dir(&*CONTRACT_PATH) - .stdout(std::process::Stdio::inherit()) // Inherit the parent process' stdout - .spawn(); - info!("Verification started {child:?}"); - child.map_err(|e| ProverError::GuestError(format!("Failed to run forge: {e}")))?; - - Ok(()) + proof: Vec, } #[cfg(test)] @@ -454,11 +393,6 @@ mod test { println!("{json:?} {deserialized:?}"); } - #[test] - fn test_init_verifier() { - VERIFIER.as_ref().expect("Failed to init verifier"); - } - #[test] fn run_unittest_elf() { // TODO(Cecilia): imple GuestInput::mock() for unit test diff --git a/provers/sp1/driver/src/proof_verify/remote_contract_verify.rs b/provers/sp1/driver/src/proof_verify/remote_contract_verify.rs index 6606a041..d9e0d407 100644 --- a/provers/sp1/driver/src/proof_verify/remote_contract_verify.rs +++ b/provers/sp1/driver/src/proof_verify/remote_contract_verify.rs @@ -3,7 +3,7 @@ use alloy_provider::ProviderBuilder; use alloy_sol_types::sol; use raiko_lib::prover::ProverResult; use reth_primitives::B256; -use sp1_sdk::proto::network::twirp::url::Url; +use sp1_sdk::network::proto::network::twirp::url::Url; use std::{env, str::FromStr}; use tracing::{error, info}; @@ -32,7 +32,7 @@ pub(crate) async fn verify_sol_by_contract_call(fixture: &RaikoProofFixture) -> let provider = ProviderBuilder::new().on_http(Url::parse(&sp1_verifier_rpc_url).unwrap()); let program_key: B256 = B256::from_str(&fixture.vkey).unwrap(); - let public_value = fixture.public_values.clone(); + let public_value = reth_primitives::hex::decode(&fixture.public_values).unwrap(); let proof_bytes = fixture.proof.clone(); info!( diff --git a/provers/sp1/guest/Cargo.lock b/provers/sp1/guest/Cargo.lock index cfa9f3a4..dc5acccd 100644 --- a/provers/sp1/guest/Cargo.lock +++ b/provers/sp1/guest/Cargo.lock @@ -652,6 +652,20 @@ name = "bytemuck" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] [[package]] name = "byteorder" @@ -3372,8 +3386,7 @@ dependencies = [ [[package]] name = "sha3" version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +source = "git+https://github.com/sp1-patches/RustCrypto-hashes?branch=patch-sha3-v0.10.8#8f6d303c0861ba7e5adcc36207c0f41fe5edaabc" dependencies = [ "digest 0.10.7", "keccak", @@ -3677,13 +3690,17 @@ dependencies = [ [[package]] name = "substrate-bn" version = "0.6.0" -source = "git+https://github.com/sp1-patches/bn?branch=master#63f8c587356a67b33c7396af98e065b66fca5dda" +source = "git+https://github.com/sp1-patches/bn?branch=chris/v0.6.0#42511f883a8f370246c8a56bc62960b7839daf7f" dependencies = [ + "bytemuck", "byteorder", + "cfg-if", "crunchy", "lazy_static", + "num-bigint 0.4.6", "rand", "rustc-hex", + "sp1-lib 1.2.0-rc2", ] [[package]] @@ -4395,8 +4412,3 @@ dependencies = [ "quote", "syn 2.0.76", ] - -[[patch.unused]] -name = "bls12_381" -version = "0.8.0" -source = "git+https://github.com/0xWOLAND/bls12_381/?branch=bhargav/experiment#59604db0784cca4ef87a494903ecc102b0a6cb3b" diff --git a/provers/sp1/guest/Cargo.toml b/provers/sp1/guest/Cargo.toml index 3063cc5b..b741952e 100644 --- a/provers/sp1/guest/Cargo.toml +++ b/provers/sp1/guest/Cargo.toml @@ -65,10 +65,10 @@ c-kzg = { git = "https://github.com/brechtpd/c-kzg-4844", branch = "for-alpha7" blst = { git = "https://github.com/CeciliaZ030/blst.git", branch = "v0.3.12-serialize" } secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", branch = "patch-secp256k1-v0.29.0" } sha2 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", branch = "patch-v0.10.8", package = "sha2" } +sha3 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", branch = "patch-sha3-v0.10.8", package = "sha3" } ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", branch = "patch-ecdsa-v0.16.9" } tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", branch = "patch-v2.0.2" } -bls12_381 = { git = "https://github.com/0xWOLAND/bls12_381/", branch = "bhargav/experiment" } -bn = { package = "substrate-bn", git = "https://github.com/sp1-patches/bn", branch = "master" } +bn = { package = "substrate-bn", git = "https://github.com/sp1-patches/bn", branch = "chris/v0.6.0" } [features] default = ["sp1-cycle-tracker"] diff --git a/provers/sp1/guest/elf/sp1-aggregation b/provers/sp1/guest/elf/sp1-aggregation index ed3c2c31..8ab0b1bc 100755 Binary files a/provers/sp1/guest/elf/sp1-aggregation and b/provers/sp1/guest/elf/sp1-aggregation differ diff --git a/provers/sp1/guest/elf/sp1-guest b/provers/sp1/guest/elf/sp1-guest index 1a521385..0f7e946a 100755 Binary files a/provers/sp1/guest/elf/sp1-guest and b/provers/sp1/guest/elf/sp1-guest differ diff --git a/script/prove-block.sh b/script/prove-block.sh index 0c330630..e6322c2b 100755 --- a/script/prove-block.sh +++ b/script/prove-block.sh @@ -55,7 +55,7 @@ elif [ "$proof" == "sp1" ]; then "sp1": { "recursion": "plonk", "prover": "network", - "verify": false + "verify": true } ' elif [ "$proof" == "sp1-aggregation" ]; then diff --git a/script/setup-bonsai.sh b/script/setup-bonsai.sh index 505986fa..cbfc1c34 100755 --- a/script/setup-bonsai.sh +++ b/script/setup-bonsai.sh @@ -1,10 +1,25 @@ #!/usr/bin/env bash # Environment variables -BONSAI_API_KEY="1234" -BONSAI_API_URL="https://api.bonsai.xyzz/" -GROTH16_VERIFIER_ADDRESS="3d24C84FC1A2B26f9229e58ddDf11A8dfba802d0" -GROTH16_VERIFIER_RPC_URL="https://sepolia.infura.io/v3/4c76691f5f384d30bed910018c28ba1d" +# risc0 +BONSAI_API_KEY=$BONSAI_API_KEY +BONSAI_API_URL=$BONSAI_API_URL +# reference verifier was deployed in holesky +GROTH16_VERIFIER_RPC_URL=https://ethereum-holesky-rpc.publicnode.com +# v1.1.2 +GROTH16_VERIFIER_ADDRESS=0x3098D568e8E7E158D1a84233182C5fC60f50c16a + +# sp1 +SP1_PROVER=network +SKIP_SIMULATION=true +PROVER_NETWORK_RPC=$PROVER_NETWORK_RPC +SP1_PRIVATE_KEY=$SP1_PRIVATE_KEY +# reference verifier was deployed in holesky +SP1_VERIFIER_RPC_URL=https://ethereum-holesky-rpc.publicnode.com +# v2.0.0 +# export SP1_VERIFIER_ADDRESS=0x35500C6fdfc4d57582672CE32A55B9a3fB48292d +# v3.0.0-rc3 +SP1_VERIFIER_ADDRESS=0x7089666D4fEcca134D1a6d2636b03e2087B52e97 # Function to set environment variable persistently set_persistent_env() {