From 4c8a3d602ba6602164d59d323fa20e703e27526a Mon Sep 17 00:00:00 2001 From: austbot Date: Thu, 20 Jun 2024 16:38:30 -0500 Subject: [PATCH] upgrade risc0 to 1.0 --- .gitignore | 2 +- Cargo.lock | 504 +++++++++++------- Cargo.toml | 33 +- onchain/channel/src/proof_handling.rs | 22 +- onchain/channel/src/verifying_key.rs | 8 +- relay/Cargo.toml | 2 +- relay/src/config.rs | 10 +- relay/src/prover/image.rs | 4 +- relay/src/prover/mod.rs | 108 ++-- .../src/channel_instruction_generated.rs | 10 +- schemas-rust/src/claim_v1_generated.rs | 8 +- schemas-rust/src/deploy_v1_generated.rs | 8 +- .../src/execution_request_v1_generated.rs | 8 +- schemas-rust/src/input_set_generated.rs | 8 +- schemas-rust/src/input_type_generated.rs | 8 +- schemas-rust/src/status_v1_generated.rs | 8 +- setup.dockerfile | 8 +- 17 files changed, 444 insertions(+), 315 deletions(-) diff --git a/.gitignore b/.gitignore index 193f50f..df94e48 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ target test-ledger relay/stark_verify node_modules -chart/bonsol-node/secret-values.yaml \ No newline at end of file +charts/bonsol-node/secret-values.yaml \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 68a4560..18d494f 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", - "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" @@ -235,6 +226,15 @@ dependencies = [ "syn 1.0.109", ] +[[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" @@ -631,7 +631,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", @@ -757,17 +757,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "bonsai-sdk" -version = "0.7.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" -dependencies = [ - "reqwest", - "risc0-groth16", - "serde", - "thiserror", -] - [[package]] name = "borsh" version = "0.9.3" @@ -785,7 +774,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ "borsh-derive 0.10.3", - "hashbrown 0.13.2", + "hashbrown 0.11.2", ] [[package]] @@ -1203,6 +1192,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" @@ -1231,6 +1233,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" @@ -1249,7 +1260,6 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "rand_core 0.6.4", "subtle", ] @@ -1446,6 +1456,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.66", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -2040,20 +2072,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 = "glam" version = "0.20.5" @@ -2269,12 +2295,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" @@ -2810,6 +2830,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.21" @@ -2886,6 +2912,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.7.1" @@ -3286,11 +3321,20 @@ 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 = "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", @@ -4158,8 +4202,8 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "anyhow", "elf", @@ -4171,30 +4215,35 @@ dependencies = [ [[package]] name = "risc0-build-kernel" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "cc", "directories", + "glob", "hex", + "rayon", "sha2 0.10.8", "tempfile", + "which 6.0.1", ] [[package]] name = "risc0-circuit-recursion" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "anyhow", "bytemuck", "cust", "downloader", "hex", + "nvtx", "rand 0.8.5", "rayon", "risc0-circuit-recursion-sys", "risc0-core", + "risc0-sys", "risc0-zkp", "sha2 0.10.8", "tracing", @@ -4203,44 +4252,59 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion-sys" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "glob", "risc0-build-kernel", "risc0-core", + "risc0-sys", + "sppark", ] [[package]] name = "risc0-circuit-rv32im" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "anyhow", + "bytemuck", + "cfg-if", + "crossbeam", + "crypto-bigint", "cust", + "derive-debug", + "lazy-regex", + "nvtx", "rand 0.8.5", "rayon", + "risc0-binfmt", "risc0-circuit-rv32im-sys", "risc0-core", + "risc0-sys", "risc0-zkp", "risc0-zkvm-platform", + "serde", + "sha2 0.10.8", "tracing", ] [[package]] name = "risc0-circuit-rv32im-sys" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "glob", "risc0-build-kernel", "risc0-core", + "risc0-sys", + "sppark", ] [[package]] name = "risc0-core" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "bytemuck", "rand_core 0.6.4", @@ -4248,18 +4312,19 @@ dependencies = [ [[package]] name = "risc0-groth16" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "anyhow", "ark-bn254", + "ark-ec", "ark-groth16", "ark-serialize", "bytemuck", "hex", "num-bigint 0.4.5", - "num-derive 0.4.2", "num-traits", + "risc0-binfmt", "risc0-core", "risc0-zkp", "serde", @@ -4268,41 +4333,34 @@ 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" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "cc", "cust", "risc0-build-kernel", - "risc0-sppark", + "sppark", ] [[package]] name = "risc0-zkp" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "anyhow", "blake2", "bytemuck", + "cfg-if", "cust", "digest 0.10.7", "ff", "hex", - "lazy_static", + "hex-literal", "ndarray", + "nvtx", + "parking_lot", "paste", "rand 0.8.5", "rand_core 0.6.4", @@ -4317,27 +4375,22 @@ dependencies = [ [[package]] name = "risc0-zkvm" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" 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 0.4.2", - "num-traits", + "nvtx", "prost", - "prost-build", - "protobuf-src", + "rand 0.8.5", "rayon", "risc0-binfmt", "risc0-circuit-recursion", @@ -4358,8 +4411,8 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "0.21.0" -source = "git+https://github.com/risc0/risc0?tag=v0.21.0#02fad7a498764d5c6cc851f246813b73b41c30b8" +version = "1.0.1" +source = "git+https://github.com/anagrambuild/risc0?branch=v1.0.1-bonsai-fix#189829d0b84d57e8928a85aa4fac60dd6ce45ea9" dependencies = [ "bytemuck", "getrandom 0.2.15", @@ -4491,9 +4544,9 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[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", @@ -4768,6 +4821,12 @@ version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "siphasher" version = "0.3.11" @@ -4811,9 +4870,9 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52346da8fbbac45fdfbb9c09f7a4e263fabd13f401352e1feedc55e1178a8ba2" +checksum = "b94ceb26c7d19530cb1bb49bf0f817647cb5fee691dae6779e19d33ac1d4fda1" dependencies = [ "Inflector", "base64 0.21.7", @@ -4836,9 +4895,9 @@ dependencies = [ [[package]] name = "solana-accounts-db" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9185bf67cd460369b37e9cbd8bcb6e6600a10186820c38276c0bb34ff976dbd9" +checksum = "e1ccab24e16797d4324444337b09555f3762b85c6a862ee5fba6a211bc6c6736" dependencies = [ "arrayref", "bincode", @@ -4857,7 +4916,7 @@ dependencies = [ "lazy_static", "log", "lz4", - "memmap2", + "memmap2 0.5.10", "modular-bitfield", "num-derive 0.4.2", "num-traits", @@ -4897,9 +4956,9 @@ dependencies = [ [[package]] name = "solana-address-lookup-table-program" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d6b9faa090d38028778dbefe6e9b8cf98e2152edd03a66ad97c94c6f89c69" +checksum = "195a93b87bd6794326a3c628cfcc8abaf70e476c4284bfb73545c873ba47c746" dependencies = [ "bincode", "bytemuck", @@ -4918,9 +4977,9 @@ dependencies = [ [[package]] name = "solana-banks-client" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973def28e8085a6a005eeb92bfd002da737052e170f1cc0bb58be402b9731d7a" +checksum = "493962c963bd1e64e2086d4b962ac87e0744bde7998eb90132e9dfdad251b8d2" dependencies = [ "borsh 1.5.1", "futures", @@ -4935,9 +4994,9 @@ dependencies = [ [[package]] name = "solana-banks-interface" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47daecbd489590c74db838da88040f7e2416bca43e599efb43dad79dc2e673ad" +checksum = "56d586b50a48b245369f359f043902f684abb3ad7599eff49a7387ea4641f19b" dependencies = [ "serde", "solana-sdk", @@ -4946,9 +5005,9 @@ dependencies = [ [[package]] name = "solana-banks-server" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01158f256f774cdf9055ebc6e9e3fa6f3fc4ef5045d84058c12b95f15fbc6a5a" +checksum = "0ee5ede19378812cf20c198a4be0c6ebf4b102d65cb0aa260f96c976030529a4" dependencies = [ "bincode", "crossbeam-channel", @@ -4966,9 +5025,9 @@ dependencies = [ [[package]] name = "solana-bpf-loader-program" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "641c08bd15950e54b4998db512bc4af1c16cb2c3f93d99b6497794146589b8cb" +checksum = "242706b2e7129926b929c6c5e7b9bf6659968a56bb666e7e07236167375eec99" dependencies = [ "bincode", "byteorder", @@ -4985,14 +5044,14 @@ dependencies = [ [[package]] name = "solana-bucket-map" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abde5d342d1132da622cf6bbcce3319594645b80ffb65f557fe8ae421df2f72a" +checksum = "e9d6de433be2c195c9139e7cba3b13c48e8db4b135cdb571e3225c34790d2adc" dependencies = [ "bv", "bytemuck", "log", - "memmap2", + "memmap2 0.5.10", "modular-bitfield", "num_enum 0.7.2", "rand 0.8.5", @@ -5003,9 +5062,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafd11f1614edd414adb414b96a481152b01ac45c14c3ff56fc757412698b228" +checksum = "32063b76137e13fba2f93fdf67f999d84ac587af962b48cb4115f272037b2fae" dependencies = [ "chrono", "clap 2.34.0", @@ -5020,9 +5079,9 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522922d51cc1fd3f0a6dd9ed0a8939f7ff46f5ebaa3a6d7eee3cd2516e6ac9e6" +checksum = "31f6eaf198c544d4f448e6a86a51f9af8b328f041a490a007164a75194edf341" dependencies = [ "async-trait", "bincode", @@ -5053,9 +5112,9 @@ dependencies = [ [[package]] name = "solana-compute-budget-program" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfefe6da1767534c45c61ee11bb796c485ecaa3b224ea146e47a7695368480eb" +checksum = "4a2af1d2aa3ea705147b99a34265b209393bae70930150d0583666305f91b958" dependencies = [ "solana-program-runtime", "solana-sdk", @@ -5063,9 +5122,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2010ba6fe2a1c4270ca3d3ef23ebfd893e3d2c980b9c0fc04451c4ce2f6b3deb" +checksum = "378259800dc9dad34828d8be4ce0de71146bac1cbbd310f8901f6f19d92c5ea3" dependencies = [ "bincode", "chrono", @@ -5077,9 +5136,9 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0acaf8e98f3f30596d73173183a80d7f83e23df1429a889a68cfe7be69abe39b" +checksum = "58b04571089f55754f5a09493ae0bcf8d8d5c8d9cd05be3e77c502f6b68c1a3b" dependencies = [ "async-trait", "bincode", @@ -5099,9 +5158,9 @@ dependencies = [ [[package]] name = "solana-cost-model" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c584432678c3e83550d419d0fa5fcdd3f5909b64e61ea7d2101f08d7a991e6" +checksum = "50c90655f4843a771d8cb94c6601c8dfac0ef0d5465bd12b0369047c0d12fd67" dependencies = [ "lazy_static", "log", @@ -5123,9 +5182,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c00a6aca244dfa904e2c4a26406ba7b0987344ceaec932f3cda0b35eff0babc" +checksum = "780402262644f9efe9ac7d885812d245007fe65fd56a3dfed83ed30d61b44c74" dependencies = [ "block-buffer 0.10.4", "bs58", @@ -5135,7 +5194,7 @@ dependencies = [ "im", "lazy_static", "log", - "memmap2", + "memmap2 0.5.10", "rustc_version", "serde", "serde_bytes", @@ -5148,9 +5207,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed58b27b9b8877893f69bc5cfd1c62e984315e0229d83cf8a32ad0933c0d6c9" +checksum = "df836de37aba77234c7afa1d857dc450fb9983572e4c6f595c84cdda65a63792" dependencies = [ "proc-macro2", "quote", @@ -5160,9 +5219,9 @@ dependencies = [ [[package]] name = "solana-loader-v4-program" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999b9a1a8f323981670f191a423db06e247d4aea4e19309191c42f88b8c98a2" +checksum = "c15f85c202dda9a5aaa5a3c4948a55cb9b37731dd5811198bb58ced1bbfbac40" dependencies = [ "log", "solana-measure", @@ -5173,9 +5232,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee2daf61ae582edf9634adf8e5021faf002df0d3f69078ecbcd6c7b41bdf833" +checksum = "9906be6edd0e1b579510736c153dbc51e5968808098d1b1f8c89dbea960aba58" dependencies = [ "env_logger", "lazy_static", @@ -5184,9 +5243,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "148512f384b82cf9e8bfe80503b688340d42a4cc17cfd572b88a6d803a488527" +checksum = "7dc77e7f99fa5e845437ac9a593cd4bd67b5f9e4ba4a9578355eef25d3e839e9" dependencies = [ "log", "solana-sdk", @@ -5194,9 +5253,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d734099c26f81621bd1aaddb8788908e20fd7fac28fb00402d564964eae4ea" +checksum = "b0a9f68887ac31f84ef69365bdc2d7ca6bf19d50a9c6ee10806adb033e24e318" dependencies = [ "crossbeam-channel", "gethostname", @@ -5209,9 +5268,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563911bb92bc6ae3ba4e7d9930dc560c61333ee57f7ba0421abe0cab14982e72" +checksum = "1ba07cceff31b644df6cd4acc909df077721fa047b624b9fa906d56bcc67435a" dependencies = [ "bincode", "clap 3.2.25", @@ -5237,9 +5296,9 @@ checksum = "8b8a731ed60e89177c8a7ab05fe0f1511cedd3e70e773f288f9de33a9cfdc21e" [[package]] name = "solana-perf" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b21bd999096d156dd122aed05eb4601fbc9dba016e229be72ba838aa5ff2a7df" +checksum = "0b7fa87b3344f96afe1395b5bb822db2ad03cdc2dbe8338636d57c58102a520b" dependencies = [ "ahash 0.8.11", "bincode", @@ -5266,9 +5325,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4908f360900d0a1aa81c7bad7937c78f0825c3f08ff0b22f1de0e43e5946f2" +checksum = "48ecc7af7594674687260a4d7bcfb0588cefdbe9d0f6c4e9f3140999107566c4" dependencies = [ "ark-bn254", "ark-ec", @@ -5321,9 +5380,9 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c8ace7f999a8278351ea86ed93f57e7833cb65fb04167a9ba9ea593e995288" +checksum = "0ef9218f50470228ebca12bb147650ca7052678aad915a4e19687ee215f8d947" dependencies = [ "base64 0.21.7", "bincode", @@ -5349,9 +5408,9 @@ dependencies = [ [[package]] name = "solana-program-test" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaef9ab295769e3ed53234ea9e3fa4537817fddb03fca5f64e9406c25fcdcb8" +checksum = "e8725c449e05bec85f7ced22dc2eb88f6d45f0c4862eaebabc5fa1061fabbb1d" dependencies = [ "assert_matches", "async-trait", @@ -5379,9 +5438,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfaebabf56720238919d8d1699211240cca485bda3b12f6189c737679a935912" +checksum = "60325aaab2bcd99ca51e1ff5a4673027a03591353a944151690b38d5dadc2c0f" dependencies = [ "crossbeam-channel", "futures-util", @@ -5404,9 +5463,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85f868c2bf7591835705298dd4350c38a8e9de07e53109fa243ebc55bbd33f03" +checksum = "d979690c6c392ffdb40a91e241a08ec3942eb217bddb0403b6174de0173ab61e" dependencies = [ "async-mutex", "async-trait", @@ -5431,9 +5490,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c9c928e5b6b1e37296e139c757695f9540e2d4f04794a1ae1915eba7076e68" +checksum = "6902079fb9d0bd4c455b97f5e48e2412d98e0e1facf635ec6fc6b783c0f3e2af" dependencies = [ "lazy_static", "num_cpus", @@ -5441,9 +5500,9 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d9f47fb9de096edd536bb39c1a8383372acf719f3fd49242bfe332ea216c3b" +checksum = "af88bad970c0dd63e98e7cc4c3c16a58acf32d4255aee79f611ea375592028ec" dependencies = [ "console", "dialoguer", @@ -5460,9 +5519,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2259b63faca1132e3a0c8b98438fb60e5d25897260dd3655bcf4ec8c6f2bf8" +checksum = "d1adab0dcdc851fc7bc6ca8c6926d9f56ed3982f1e4fabd67d362647b57143d3" dependencies = [ "async-trait", "base64 0.21.7", @@ -5486,9 +5545,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0aea25d581de77ba256b81f4ebd8d963b85ec01d70a74829365e85f6403d497" +checksum = "6d6764712822bbc0259bbb5413377798a11462221863d000082f39968ce5ad03" dependencies = [ "base64 0.21.7", "bs58", @@ -5508,9 +5567,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef5cbfb47707599ccb5734aa70b5161a2d437df54044021870be3f575eb0f1a" +checksum = "49489fe59d308c10a2b3e3ecd3bee1107b9b67a325c99ffd278ba0870a5619cd" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -5521,9 +5580,9 @@ dependencies = [ [[package]] name = "solana-runtime" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27c071752762034dc6292ce35aacd6fe96cac6e8be4994234dbf18eb7e6cdb53" +checksum = "1359ea01de4d1575c7c6004a57b257da66e7b8e636e72d728c91bc6768fd593f" dependencies = [ "aquamarine", "arrayref", @@ -5546,7 +5605,7 @@ dependencies = [ "log", "lru", "lz4", - "memmap2", + "memmap2 0.5.10", "mockall", "modular-bitfield", "num-derive 0.4.2", @@ -5598,9 +5657,9 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50ec330850953d4971b052ff98c74a8e67e7618b4aed9f4971b8d3b68fcd1cd" +checksum = "73bb113fa17e0607343afdc795c2c5230981c5b51c99b2c54fba91755879d65b" dependencies = [ "assert_matches", "base64 0.21.7", @@ -5622,7 +5681,7 @@ dependencies = [ "lazy_static", "libsecp256k1", "log", - "memmap2", + "memmap2 0.5.10", "num-derive 0.4.2", "num-traits", "num_enum 0.7.2", @@ -5653,9 +5712,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ef2ea49002d1bf52a4a8509570b2c3b88e7b6d0a131b11bbd637ca1e1df0ff" +checksum = "8fcdb3a94e2f04d856d2fba6feb4f6887a1da21a3ee0b64b69c08d15dc22d46c" dependencies = [ "bs58", "proc-macro2", @@ -5672,9 +5731,9 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-send-transaction-service" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbbe96c86deccb6383b9c4913137b194f8b6f3b4c9f0de60e2591d77ad848f31" +checksum = "7550c870a6648614b0a34dd3ebf69d98a8b80ab808050aac207e17fe77e8b2d8" dependencies = [ "crossbeam-channel", "log", @@ -5688,9 +5747,9 @@ dependencies = [ [[package]] name = "solana-stake-program" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a518323d52d8c8bb8b1e30c02940e65528951f8dbcfe65decb9dd2ab0b90bfff" +checksum = "3bfb5f94949dbd8839cfe5cefd38b077a395a64407fa2e339c38657295e0fede" dependencies = [ "bincode", "log", @@ -5703,9 +5762,9 @@ dependencies = [ [[package]] name = "solana-streamer" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29de0561c0aa6249292a2602be31e812977ae223be031b3a9e0715d98fb19b06" +checksum = "c0e6132c9eefb372202e69e654e8c2a30b4c06635343dd6474467b9cca4b9dd9" dependencies = [ "async-channel", "bytes", @@ -5736,9 +5795,9 @@ dependencies = [ [[package]] name = "solana-system-program" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7bd272efd8a596aab47dbe000267859f701743d02615e71ead8ed22ff18564" +checksum = "1338d45734fb10d4d378ccc84b8ff779111a7371719e92d045bcdf60db6c6ec4" dependencies = [ "bincode", "log", @@ -5750,9 +5809,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20b7c9b7214fe50e2e72090f833f11e07f3b00ba69b57872b6adcf5479cdf32" +checksum = "ca1c3ed492f61914aaa8074cf7a07f93bfd8d9adbf9846939e589b7b7c70fe39" dependencies = [ "bincode", "log", @@ -5765,9 +5824,9 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcbfd83d8d7da758b10d6e1075322843dce591a75d15d611e9eec5508e9c7233" +checksum = "c3fbfce5d27608f4853dcb0c0d964f59420710a7a4486409e7583717c610c3cf" dependencies = [ "async-trait", "bincode", @@ -5789,9 +5848,9 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0439563ffb7471a0b51446f0fff5c8b2108e31248bf7dbab8b9efaa2af3a4c27" +checksum = "6adbd8f3fccddeae87278a105dcf8a8792f8816c0f4fb5f7ae8f307af279ac49" dependencies = [ "Inflector", "base64 0.21.7", @@ -5814,9 +5873,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1160ce03865189e4c3327cc492aeacc8567863f195a269533d98f15485402b74" +checksum = "b90f8ebd26cac3cd563bf839ff8511f27698f2d220e58f7538b5d6d80d8970ed" dependencies = [ "async-trait", "solana-connection-cache", @@ -5829,9 +5888,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb25449b519a334103778e2fc1c5c0e3ea7862ae2c1ffe90fc82ce3c96058171" +checksum = "ac8714cf9f6caefc403e19770ad73ed2e4c866b7201e31dd17a9e06b6a693a57" dependencies = [ "log", "rustc_version", @@ -5845,9 +5904,9 @@ dependencies = [ [[package]] name = "solana-vote" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26648e8f72dab5488a1b31ed59c9f71ffb1a58d8b323cdaaa25bfde5a5c82c0c" +checksum = "6db24fb82cba851f6db063400db08405a2108f68b27c3d5f2d3ed1da9849734f" dependencies = [ "crossbeam-channel", "itertools 0.10.5", @@ -5864,9 +5923,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78899849d1131b2fbbe9f826080cc18cec5598da63a77357642c9cd8b1a86a86" +checksum = "b5de2428939c6e279901d4357bf02c809739e5b97164e8620e09a9e0b55c2327" dependencies = [ "bincode", "log", @@ -5886,9 +5945,9 @@ dependencies = [ [[package]] name = "solana-zk-token-proof-program" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f904d8cd4cdaf9c708237e59f9a54eabed6eb32c5082e459fe7b15b3d0895fe8" +checksum = "48d381b5205bd4ff1edfbb910895f48d00a235a0257493462ff0d102004bc337" dependencies = [ "bytemuck", "num-derive 0.4.2", @@ -5900,9 +5959,9 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.18.15" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cafb3df56516086f65e2a08a8cd03f504236f3b5348299abd45415d1d18ba32" +checksum = "8dad1753ec3b189879c8756ac35471467116dfc93d7aeb68cfd28f22a02c850d" dependencies = [ "aes-gcm-siv", "base64 0.21.7", @@ -6175,6 +6234,16 @@ dependencies = [ "spl-program-error", ] +[[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" @@ -7286,6 +7355,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" @@ -7493,6 +7574,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 = "write16" version = "1.0.0" @@ -7554,8 +7641,8 @@ dependencies = [ [[package]] name = "yellowstone-grpc-client" -version = "1.15.0+solana.1.18.15" -source = "git+https://github.com/rpcpool/yellowstone-grpc?tag=v1.15.0+solana.1.18.15#44bc8e8c87732e7c965e49c650f1475132a32826" +version = "1.15.0+solana.1.18.16" +source = "git+https://github.com/rpcpool/yellowstone-grpc?tag=v1.15.0+solana.1.18.16#b9d629c2fcd570e24040bf7784757981ca9be86e" dependencies = [ "bytes", "futures", @@ -7567,8 +7654,8 @@ dependencies = [ [[package]] name = "yellowstone-grpc-proto" -version = "1.14.0+solana.1.18.15" -source = "git+https://github.com/rpcpool/yellowstone-grpc?tag=v1.15.0+solana.1.18.15#44bc8e8c87732e7c965e49c650f1475132a32826" +version = "1.14.0+solana.1.18.16" +source = "git+https://github.com/rpcpool/yellowstone-grpc?tag=v1.15.0+solana.1.18.16#b9d629c2fcd570e24040bf7784757981ca9be86e" dependencies = [ "anyhow", "bincode", @@ -7690,14 +7777,33 @@ dependencies = [ [[package]] name = "zip" -version = "0.6.6" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +checksum = "775a2b471036342aa69bc5a602bc889cb0a06cda00477d0c69566757d5553d39" dependencies = [ - "byteorder", + "arbitrary", "crc32fast", "crossbeam-utils", + "displaydoc", "flate2", + "indexmap 2.2.6", + "memchr", + "thiserror", + "zopfli", +] + +[[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]] diff --git a/Cargo.toml b/Cargo.toml index 9c70524..001167c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,26 +9,25 @@ members = [ resolver = "2" [workspace.dependencies] -solana-program = "=1.18.15" -solana-sdk = "=1.18.15" +solana-sdk = "=1.18.16" thiserror = "1.0.57" flatbuffers = "23.5.26" anyhow = "1.0.40" -solana-program-test = "=1.18.15" -solana-rpc-client = "=1.18.15" -solana-rpc-client-api = "=1.18.15" -solana-pubsub-client = "=1.18.15" -solana-transaction-status = "=1.18.15" -yellowstone-grpc-client = {git = "https://github.com/rpcpool/yellowstone-grpc", tag="v1.15.0+solana.1.18.15"} -yellowstone-grpc-proto = {git = "https://github.com/rpcpool/yellowstone-grpc", tag="v1.15.0+solana.1.18.15" } -risc0-zkvm = { git = "https://github.com/risc0/risc0", tag = "v0.21.0"} -risc0-core = { git = "https://github.com/risc0/risc0", tag = "v0.21.0"} -risc0-zkp = { git = "https://github.com/risc0/risc0", tag = "v0.21.0"} -risc0-groth16 = { git = "https://github.com/risc0/risc0", tag = "v0.21.0"} -risc0-binfmt = { git = "https://github.com/risc0/risc0", tag = "v0.21.0"} -risc0-circuit-recursion = { git = "https://github.com/risc0/risc0", tag = "v0.21.0"} -risc0-sys = { git = "https:m//github.com/risc0/risc0", tag = "v0.21.0"} - +solana-program = "=1.18.16" +solana-program-test = "=1.18.16" +solana-rpc-client = "=1.18.16" +solana-rpc-client-api = "=1.18.16" +solana-pubsub-client = "=1.18.16" +solana-transaction-status = "=1.18.16" +yellowstone-grpc-client = {git = "https://github.com/rpcpool/yellowstone-grpc", tag="v1.15.0+solana.1.18.16"} +yellowstone-grpc-proto = {git = "https://github.com/rpcpool/yellowstone-grpc", tag="v1.15.0+solana.1.18.16" } +risc0-zkvm = { git = "https://github.com/anagrambuild/risc0", branch = "v1.0.1-bonsai-fix", features = ["prove"], default-features = false } +risc0-core = { git = "https://github.com/anagrambuild/risc0", branch = "v1.0.1-bonsai-fix"} +risc0-zkp = { git = "https://github.com/anagrambuild/risc0", branch = "v1.0.1-bonsai-fix"} +risc0-groth16 = { git = "https://github.com/anagrambuild/risc0",branch = "v1.0.1-bonsai-fix"} +risc0-binfmt = { git = "https://github.com/anagrambuild/risc0", branch = "v1.0.1-bonsai-fix"} +risc0-circuit-recursion = { git = "https://github.com/anagrambuild/risc0", branch = "v1.0.1-bonsai-fix"} +risc0-sys = { git = "https:m//github.com/anagrambuild/risc0", branch = "v1.0.1-bonsai-fix"} tokio-test = "0.4.3" [workspace.lints.clippy] diff --git a/onchain/channel/src/proof_handling.rs b/onchain/channel/src/proof_handling.rs index 68053ea..637a94e 100644 --- a/onchain/channel/src/proof_handling.rs +++ b/onchain/channel/src/proof_handling.rs @@ -59,16 +59,15 @@ pub fn verify_risc0(proof: &[u8], inputs: &[u8]) -> Result { .map_err(|_| ChannelError::ProofVerificationFailed) } -const CONTROL_ID_0_BYTES: [u8; 32] = - hex!("0000000000000000000000000000000051a3d73938c3681118ba0a2549f7c188"); -const CONTROL_ID_1_BYTES: [u8; 32] = - hex!("0000000000000000000000000000000044f39e6e6cef91de6d743e7f5b7a1e67"); +const CONTROL_ROOT: [u8; 32] = + hex!("a516a057c9fbf5629106300934d48e0e775d4230e41e503347cad96fcbde7e2e"); const BN254_CONTROL_ID_BYTES: [u8; 32] = - hex!("10ff834dbef62ccbba201ecd26a772e3036a075aacbaf47200679a11dcdcf10d"); + hex!("0eb6febcf06c5df079111be116f79bd8c7e85dc9448776ef9a59aaf2624ab551"); const OUTPUT_HASH: [u8; 32] = hex!("77eafeb366a78b47747de0d7bb176284085ff5564887009a5be63da32d3559d4"); const RECIEPT_CLAIM_HASH: [u8; 32] = hex!("cb1fefcd1f2d9a64975cbbbf6e161e2914434b0cbb9960b84df5d717e86b48af"); + pub fn output_digest( input_digest: &[u8], committed_outputs: &[u8], @@ -104,11 +103,12 @@ pub fn prepare_inputs( &4u16.to_le_bytes(), ]) .to_bytes(); + let (c0,c1) = split_digest(&mut CONTROL_ROOT.clone()).map_err(|_| ChannelError::InvalidFieldElement)?; let (half1_bytes, half2_bytes) = split_digest(&mut digest).map_err(|_| ChannelError::InvalidFieldElement)?; let inputs = [ - CONTROL_ID_0_BYTES, - CONTROL_ID_1_BYTES, + c0, + c1, half1_bytes.try_into().unwrap(), half2_bytes.try_into().unwrap(), BN254_CONTROL_ID_BYTES, @@ -117,14 +117,16 @@ pub fn prepare_inputs( Ok(inputs) } -pub fn split_digest(d: &mut [u8]) -> Result<(Vec, Vec), ChannelError> { +pub fn split_digest(d: &mut [u8]) -> Result<([u8;32], [u8;32]), ChannelError> { d.reverse(); - let (a, b) = d.split_at_mut(16); + let (a, b) = d.split_at(16); let af = to_fixed_array(a.to_vec()); let bf = to_fixed_array(b.to_vec()); - Ok((bf.to_vec(), af.to_vec())) + Ok((bf, af)) } + + fn to_fixed_array(input: Vec) -> [u8; 32] { let mut fixed_array = [0u8; 32]; let start = core::cmp::max(32, input.len()) - core::cmp::min(32, input.len()); diff --git a/onchain/channel/src/verifying_key.rs b/onchain/channel/src/verifying_key.rs index ac38c27..35cb187 100644 --- a/onchain/channel/src/verifying_key.rs +++ b/onchain/channel/src/verifying_key.rs @@ -23,10 +23,10 @@ pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { ], vk_delta_g2: [ - 38,153,133,144,151,161,115,136,76,254,199,220,115,110,43,211,105,187,201,52,188,5,219,74,151,136,97,26,240,28,185,167, - 37,65,73,129,95,195,74,195,126,214,114,44,238,145,2,23,218,128,210,58,2,138,13,157,39,245,201,161,118,30,79,35, - 36,88,220,217,167,65,128,5,18,91,115,49,226,25,188,232,242,86,37,156,85,112,220,8,255,16,142,55,160,234,206,20, - 44,235,245,117,151,175,6,77,121,151,214,162,157,185,66,212,58,68,97,241,3,249,244,169,218,3,122,140,127,159,136,226, + 3,176,60,213,239,250,149,172,155,238,148,241,245,239,144,113,87,189,164,129,44,207,11,76,145,244,43,182,41,248,58,28, + 26,160,133,255,40,23,154,18,217,34,219,160,84,112,87,204,170,233,75,157,105,207,170,78,96,64,31,234,127,62,3,51, + 17,12,16,19,79,32,11,25,246,73,8,70,213,24,201,174,168,104,54,110,251,114,40,202,92,145,210,148,13,3,7,98, + 30,96,243,31,203,247,87,232,55,232,103,23,131,24,131,45,11,45,116,213,158,47,234,28,113,66,223,24,125,63,198,211, ], vk_ic: &[ diff --git a/relay/Cargo.toml b/relay/Cargo.toml index 56c413d..5159a81 100644 --- a/relay/Cargo.toml +++ b/relay/Cargo.toml @@ -42,7 +42,7 @@ ark-std = { version = "0.4.0" } ark-crypto-primitives = { version = "0.4.0" } ark-groth16 = { version = "0.4.0" } rand = { version = "0.8.4" } -risc0-zkvm = { workspace = true, features = ["prove"] } +risc0-zkvm = { workspace = true, features = ["prove"], default-features = false } ark-serialize = "0.4.0" risc0-core = { workspace = true } risc0-zkp = { workspace = true } diff --git a/relay/src/config.rs b/relay/src/config.rs index 176f2bf..8260e43 100644 --- a/relay/src/config.rs +++ b/relay/src/config.rs @@ -55,7 +55,14 @@ pub struct ProverNodeConfig { pub transaction_sender_config: TransactionSenderConfig, #[serde(default = "default_signer_config")] pub signer_config: SignerConfig, + #[serde(default = "default_stark_compression_tools_path")] + pub stark_compression_tools_path: String, } + +fn default_stark_compression_tools_path() -> String { + "./stark ".to_string() +} + fn default_bonsol_program() -> String { "BoNsHRcyLLNdtnoDf8hiCNZpyehMC4FDMxs6NTxFi3ew".to_string() } @@ -120,7 +127,8 @@ impl Default for ProverNodeConfig { maximum_concurrent_proofs: default_maximum_concurrent_proofs(), ingester_config: default_ingester_config(), transaction_sender_config: default_transaction_sender_config(), - signer_config: default_signer_config() + signer_config: default_signer_config(), + stark_compression_tools_path: default_stark_compression_tools_path(), } } } diff --git a/relay/src/prover/image.rs b/relay/src/prover/image.rs index 3d6d1c7..39a9b3a 100644 --- a/relay/src/prover/image.rs +++ b/relay/src/prover/image.rs @@ -31,7 +31,7 @@ impl Image { let program = Image::load_elf(&bytes)?; let img = Image::mem_img(&program)?; Ok(Image { - id: img.compute_id()?.to_string(), + id: img.compute_id().to_string(), data: Some(program), size: img.pages.len() as u64 * PAGE_SIZE as u64, path: PathBuf::new(), @@ -45,7 +45,7 @@ impl Image { let img = Image::mem_img(&program)?; Ok(Image { - id: img.compute_id()?.to_string(), + id: img.compute_id().to_string(), data: Some(program), size: img.pages.len() as u64 * PAGE_SIZE as u64, path, diff --git a/relay/src/prover/mod.rs b/relay/src/prover/mod.rs index 54095b1..f4a24d2 100644 --- a/relay/src/prover/mod.rs +++ b/relay/src/prover/mod.rs @@ -32,7 +32,9 @@ use { use risc0_groth16::{ProofJson, Seal}; use risc0_zkp::verify::VerificationError; -use risc0_zkvm::{sha::Digest, Assumptions, CompositeReceipt}; +use risc0_zkvm::{ + sha::Digest, Assumptions, CompositeReceipt, InnerReceipt, MaybePruned, ReceiptClaim, +}; use tempfile::tempdir; use tokio::{fs::File, io::AsyncReadExt, process::Command, task::JoinSet}; @@ -204,7 +206,7 @@ impl Risc0Runner { return match status { None => true, Some(status) => { - if status.err.is_some() { + if status.err.is_some() { eprintln!("Claim failed"); } !status.err.is_some() @@ -232,7 +234,7 @@ impl Risc0Runner { eprint!("Received instruction"); tokio::spawn(async move { let bonsol_ix_type = parse_ix_data(&bix.data)?; - + let result = match bonsol_ix_type.ix_type() { ChannelInstructionIxType::DeployV1 => { eprintln!("Received deploy request"); @@ -395,21 +397,25 @@ pub async fn handle_claim<'a>( eprintln!("Inputs resolved, generating proof"); let (eid, inputs) = input_staging_area.remove(execution_id).unwrap(); let mem_image = image.get_memory_image()?; - let result: Result<(Journal, Digest, SuccinctReceipt), Risc0RunnerError> = - tokio::task::spawn_blocking(move || { - risc0_prove(mem_image, inputs).map_err(|e| { - eprintln!("Error generating proof: {:?}", e); - Risc0RunnerError::ProofGenerationError - }) + let result: Result< + (Journal, Digest, SuccinctReceipt), + Risc0RunnerError, + > = tokio::task::spawn_blocking(move || { + risc0_prove(mem_image, inputs).map_err(|e| { + eprintln!("Error generating proof: {:?}", e); + Risc0RunnerError::ProofGenerationError }) - .await?; + }) + .await?; if let Ok((journal, assumptions_digest, reciept)) = result { let compressed_receipt = - risc0_docker_compress_proof(reciept).await.map_err(|e| { - eprintln!("Error compressing proof: {:?}", e); - Risc0RunnerError::ProofCompressionError - })?; + risc0_compress_proof(config.stark_compression_tools_path.as_str(), reciept) + .await + .map_err(|e| { + eprintln!("Error compressing proof: {:?}", e); + Risc0RunnerError::ProofCompressionError + })?; let (input_digest, committed_outputs) = journal.bytes.split_at(32); let sig = transaction_sender @@ -659,7 +665,7 @@ async fn handle_image_deployment<'a>( fn risc0_prove( memory_image: MemoryImage, sorted_inputs: Vec, -) -> Result<(Journal, Digest, SuccinctReceipt)> { +) -> Result<(Journal, Digest, SuccinctReceipt)> { let mut env_builder = ExecutorEnv::builder(); for input in sorted_inputs.into_iter() { match input { @@ -678,23 +684,23 @@ fn risc0_prove( // Obtain the default prover. let opts = ProverOpts::default(); let ctx = VerifierContext::default(); - let prover = get_prover_server(&opts).unwrap(); - let receipt = prover.prove_session(&ctx, &session).unwrap(); - let composite_receipt = receipt.inner.composite().unwrap(); - let succinct_receipt = prover.compress(composite_receipt).unwrap(); - let ident_receipt = identity_p254(&succinct_receipt).unwrap(); - let assumptions = assumptions_claim(composite_receipt)?; - Ok((receipt.journal, assumptions.digest(), ident_receipt)) -} + let prover = get_prover_server(&opts)?; + let info = prover.prove_session(&ctx, &session)?; + if let InnerReceipt::Composite(cr) = &info.receipt.inner { + let sr = prover.composite_to_succinct(&cr)?; + let ident_receipt = identity_p254(&sr)?; + if let MaybePruned::Value(rc) = sr.claim { + if let MaybePruned::Value(Some(op)) = rc.output { + if let MaybePruned::Value(ass) = op.assumptions { + return Ok((info.receipt.journal, ass.digest(), ident_receipt)); + } + } + } + } -fn assumptions_claim(cr: &CompositeReceipt) -> Result { - Ok(Assumptions( - cr.assumptions - .iter() - .map(|a| Ok(a.get_claim()?.into())) - .collect::, _>>()?, - )) + return Err(Risc0RunnerError::ProofGenerationError.into()); } + pub struct CompressedReciept { pub execution_digest: Vec, pub exit_code_system: u32, @@ -703,8 +709,9 @@ pub struct CompressedReciept { } /// Compresses the proof to be sent to the blockchain /// This is a temporary solution until the wasm groth16 prover or a rust impl is working -async fn risc0_docker_compress_proof( - succint_receipt: SuccinctReceipt, +async fn risc0_compress_proof( + tools_path: &str, + succint_receipt: SuccinctReceipt, ) -> Result { let sealbytes = succint_receipt.get_seal_bytes(); if !(ARCH == "x86_64" || ARCH == "x86") { @@ -712,12 +719,13 @@ async fn risc0_docker_compress_proof( } let tmp = tempdir()?; let prove_dir = tmp.path(); + let root_path = Path::new(tools_path); let mut cursor = Cursor::new(&sealbytes); let inputs = prove_dir.join("input.json"); let witness = prove_dir.join("out.wtns"); let input_file = File::create(&inputs).await?; async_to_json(&mut cursor, input_file).await?; - let status = Command::new("stark/stark_verify") + let status = Command::new(root_path.join("stark_verify")) .arg(inputs.clone()) .arg(witness.clone()) .output() @@ -726,10 +734,10 @@ async fn risc0_docker_compress_proof( eprintln!("witness {:?}", status); return Err(Risc0RunnerError::ProofCompressionError.into()); } - let zkey = Path::new("stark/stark_verify_final.zkey"); + let zkey = root_path.join("stark_verify_final.zkey"); let proof_out = prove_dir.join("proof.json"); let public = prove_dir.join("public.json"); - let snark_status = Command::new("stark/rapidsnark") + let snark_status = Command::new(root_path.join("rapidsnark")) .arg(zkey) .arg(witness) .arg(proof_out.clone()) @@ -747,16 +755,22 @@ async fn risc0_docker_compress_proof( let proof: ProofJson = serde_json::from_slice(&bytes)?; let seal: Seal = proof.try_into()?; let claim = succint_receipt.claim; - let (system, user) = match claim.exit_code { - ExitCode::Halted(user_exit) => (0, user_exit), - ExitCode::Paused(user_exit) => (1, user_exit), - ExitCode::SystemSplit => (2, 0), - ExitCode::SessionLimit => (2, 2), - }; - Ok(CompressedReciept { - execution_digest: claim.post.digest().as_bytes().to_vec(), - exit_code_system: system, - exit_code_user: user, - proof: seal.to_vec(), - }) + if let MaybePruned::Value(rc)= claim { + let (system, user )= match rc.exit_code { + ExitCode::Halted(user_exit) => (0, user_exit), + ExitCode::Paused(user_exit) => (1, user_exit), + ExitCode::SystemSplit => (2, 0), + ExitCode::SessionLimit => (2, 2), + }; + Ok(CompressedReciept { + execution_digest: rc.post.digest().as_bytes().to_vec(), + exit_code_system: system, + exit_code_user: user, + proof: seal.to_vec() + }) + } + else { + Err(Risc0RunnerError::ProofCompressionError.into()) + } + } diff --git a/schemas-rust/src/channel_instruction_generated.rs b/schemas-rust/src/channel_instruction_generated.rs index d0c98ea..19d5774 100644 --- a/schemas-rust/src/channel_instruction_generated.rs +++ b/schemas-rust/src/channel_instruction_generated.rs @@ -7,12 +7,12 @@ use crate::execution_request_v1_generated::*; use crate::status_v1_generated::*; use crate::claim_v1_generated::*; use crate::deploy_v1_generated::*; -use crate::input_type_generated::*; -use core::mem; -use core::cmp::Ordering; + + + extern crate flatbuffers; -use self::flatbuffers::{EndianScalar, Follow}; +use self::flatbuffers::{Follow}; #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] pub const ENUM_MIN_CHANNEL_INSTRUCTION_IX_TYPE: u8 = 0; @@ -226,7 +226,7 @@ impl flatbuffers::Verifiable for ChannelInstruction<'_> { fn run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; + v.visit_table(pos)? .visit_field::("ix_type", Self::VT_IX_TYPE, false)? .visit_field::>>("execute_v1", Self::VT_EXECUTE_V1, false)? diff --git a/schemas-rust/src/claim_v1_generated.rs b/schemas-rust/src/claim_v1_generated.rs index c649fcf..7b76011 100644 --- a/schemas-rust/src/claim_v1_generated.rs +++ b/schemas-rust/src/claim_v1_generated.rs @@ -3,11 +3,11 @@ // @generated -use core::mem; -use core::cmp::Ordering; + + extern crate flatbuffers; -use self::flatbuffers::{EndianScalar, Follow}; + pub enum ClaimV1Offset {} #[derive(Copy, Clone, PartialEq)] @@ -65,7 +65,7 @@ impl flatbuffers::Verifiable for ClaimV1<'_> { fn run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; + v.visit_table(pos)? .visit_field::>("execution_id", Self::VT_EXECUTION_ID, false)? .visit_field::("block_commitment", Self::VT_BLOCK_COMMITMENT, false)? diff --git a/schemas-rust/src/deploy_v1_generated.rs b/schemas-rust/src/deploy_v1_generated.rs index 2a33aef..1faf5a6 100644 --- a/schemas-rust/src/deploy_v1_generated.rs +++ b/schemas-rust/src/deploy_v1_generated.rs @@ -4,11 +4,11 @@ // @generated use crate::input_type_generated::*; -use core::mem; -use core::cmp::Ordering; + + extern crate flatbuffers; -use self::flatbuffers::{EndianScalar, Follow}; + pub enum DeployV1Offset {} #[derive(Copy, Clone, PartialEq)] @@ -102,7 +102,7 @@ impl flatbuffers::Verifiable for DeployV1<'_> { fn run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; + v.visit_table(pos)? .visit_field::>>("owner", Self::VT_OWNER, false)? .visit_field::>("image_id", Self::VT_IMAGE_ID, false)? diff --git a/schemas-rust/src/execution_request_v1_generated.rs b/schemas-rust/src/execution_request_v1_generated.rs index 5a4d1ce..a1e9980 100644 --- a/schemas-rust/src/execution_request_v1_generated.rs +++ b/schemas-rust/src/execution_request_v1_generated.rs @@ -4,11 +4,11 @@ // @generated use crate::input_type_generated::*; -use core::mem; -use core::cmp::Ordering; + + extern crate flatbuffers; -use self::flatbuffers::{EndianScalar, Follow}; + pub enum ExecutionRequestV1Offset {} #[derive(Copy, Clone, PartialEq)] @@ -138,7 +138,7 @@ impl flatbuffers::Verifiable for ExecutionRequestV1<'_> { fn run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; + v.visit_table(pos)? .visit_field::("tip", Self::VT_TIP, false)? .visit_field::>("execution_id", Self::VT_EXECUTION_ID, false)? diff --git a/schemas-rust/src/input_set_generated.rs b/schemas-rust/src/input_set_generated.rs index d84061f..b2fad43 100644 --- a/schemas-rust/src/input_set_generated.rs +++ b/schemas-rust/src/input_set_generated.rs @@ -4,11 +4,11 @@ // @generated use crate::input_type_generated::*; -use core::mem; -use core::cmp::Ordering; + + extern crate flatbuffers; -use self::flatbuffers::{EndianScalar, Follow}; + pub enum InputSetOffset {} #[derive(Copy, Clone, PartialEq)] @@ -57,7 +57,7 @@ impl flatbuffers::Verifiable for InputSet<'_> { fn run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; + v.visit_table(pos)? .visit_field::>>>("inputs", Self::VT_INPUTS, false)? .finish(); diff --git a/schemas-rust/src/input_type_generated.rs b/schemas-rust/src/input_type_generated.rs index 48bb3ab..1caa049 100644 --- a/schemas-rust/src/input_type_generated.rs +++ b/schemas-rust/src/input_type_generated.rs @@ -3,11 +3,11 @@ // @generated -use core::mem; -use core::cmp::Ordering; + + extern crate flatbuffers; -use self::flatbuffers::{EndianScalar, Follow}; + #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] pub const ENUM_MIN_PROGRAM_INPUT_TYPE: u8 = 0; @@ -255,7 +255,7 @@ impl flatbuffers::Verifiable for Input<'_> { fn run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; + v.visit_table(pos)? .visit_field::("input_type", Self::VT_INPUT_TYPE, false)? .visit_field::>>("data", Self::VT_DATA, false)? diff --git a/schemas-rust/src/status_v1_generated.rs b/schemas-rust/src/status_v1_generated.rs index 48a38fe..626b04e 100644 --- a/schemas-rust/src/status_v1_generated.rs +++ b/schemas-rust/src/status_v1_generated.rs @@ -3,11 +3,11 @@ // @generated -use core::mem; -use core::cmp::Ordering; + + extern crate flatbuffers; -use self::flatbuffers::{EndianScalar, Follow}; + #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] pub const ENUM_MIN_STATUS_TYPES: u8 = 0; @@ -225,7 +225,7 @@ impl flatbuffers::Verifiable for StatusV1<'_> { fn run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; + v.visit_table(pos)? .visit_field::>("execution_id", Self::VT_EXECUTION_ID, false)? .visit_field::("status", Self::VT_STATUS, false)? diff --git a/setup.dockerfile b/setup.dockerfile index 9a42298..374ebbe 100644 --- a/setup.dockerfile +++ b/setup.dockerfile @@ -1,7 +1,7 @@ # syntax = docker/dockerfile:1.2 FROM scratch as chef WORKDIR /app -COPY --from=risczero/risc0-groth16-prover:v2024-04-03.2 /app/stark_verify /stark/stark_verify -COPY --from=risczero/risc0-groth16-prover:v2024-04-03.2 /app/stark_verify.dat /stark/stark_verify.dat -COPY --from=risczero/risc0-groth16-prover:v2024-04-03.2 /app/stark_verify_final.zkey /stark/stark_verify_final.zkey -COPY --from=risczero/risc0-groth16-prover:v2024-04-03.2 /usr/local/sbin/rapidsnark /stark/rapidsnark +COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /app/stark_verify /stark/stark_verify +COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /app/stark_verify.dat /stark/stark_verify.dat +COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /app/stark_verify_final.zkey /stark/stark_verify_final.zkey +COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /usr/local/sbin/rapidsnark /stark/rapidsnark