From c4215bde45675d57e7a16f32107146b3b9756e75 Mon Sep 17 00:00:00 2001 From: Brecht Devos Date: Tue, 7 May 2024 01:27:47 +0200 Subject: [PATCH] feat(raiko): raiko object (#149) * Raiko object + update revm/alloy to reth versions * fix risc0 * fix risc0 ci * batch fetch block data * remove unnecessary box * fmt * update toolchains * fix risc0 * Fix compile issue * Fix build script not erroring out when a process encountered an error * Enable SP1 mock prover * fix fmt and compile error in test --- .github/workflows/ci.yml | 2 +- Cargo.lock | 1451 +++++++++++------- Cargo.toml | 41 +- README.md | 11 +- host/src/execution.rs | 158 -- host/src/lib.rs | 9 +- host/src/preflight.rs | 187 +-- host/src/provider_db.rs | 376 +---- host/src/raiko.rs | 283 ++++ host/src/request.rs | 4 +- host/src/rpc_provider.rs | 262 ++++ host/src/server/api/proof.rs | 42 +- lib/src/builder/execute.rs | 40 +- lib/src/builder/mod.rs | 7 +- lib/src/builder/prepare.rs | 8 +- lib/src/consts.rs | 22 + lib/src/input.rs | 13 +- lib/src/mem_db.rs | 4 +- lib/src/protocol_instance.rs | 17 +- lib/src/prover.rs | 4 +- lib/src/utils.rs | 42 +- makefile | 4 +- prove_block.sh | 3 + provers/risc0/driver/rust-toolchain.toml | 2 +- provers/risc0/driver/src/lib.rs | 2 +- provers/risc0/guest/Cargo.lock | 413 +++-- provers/sgx/prover/src/lib.rs | 2 +- provers/sgx/prover/src/sgx_register_utils.rs | 20 +- provers/sp1/driver/rust-toolchain.toml | 2 +- provers/sp1/driver/src/lib.rs | 12 +- provers/sp1/guest/Cargo.lock | 364 +++-- rust-toolchain | 2 +- scripts/install.sh | 1 + scripts/run.sh | 9 +- 34 files changed, 2321 insertions(+), 1498 deletions(-) delete mode 100644 host/src/execution.rs create mode 100644 host/src/raiko.rs create mode 100644 host/src/rpc_provider.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83dc16de..a40b4a0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: submodules: recursive - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2024-02-06 + toolchain: nightly-2024-04-17 profile: minimal - name: Install cargo-binstall uses: cargo-bins/cargo-binstall@v1.6.4 diff --git a/Cargo.lock b/Cargo.lock index e5d91f77..f415eae7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -113,12 +113,13 @@ dependencies = [ [[package]] name = "alloy-consensus" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ - "alloy-eips 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-eips 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-serde 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "c-kzg", "serde", "sha2", ] @@ -139,16 +140,16 @@ dependencies = [ [[package]] name = "alloy-contract" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-primitives", - "alloy-provider 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-provider 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-sol-types", - "alloy-transport 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-transport 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "futures", "futures-util", "thiserror", @@ -174,9 +175,9 @@ dependencies = [ [[package]] name = "alloy-core" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcbd9ee412dfb4e81d23cd1ae816d828c494a77d1eb00358035043695d4c5808" +checksum = "e30b83573b348305b9629a094b5331093a030514cd5713433799495cb283fea1" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -186,9 +187,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "872f239c15befa27cc4f0d3d82a70b3365c2d0202562bf906eb93b299fa31882" +checksum = "545885d9b0b2c30fd344ae291439b4bfe59e48dd62fbc862f8503d98088967dc" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -198,17 +199,17 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.6", + "winnow 0.6.8", ] [[package]] name = "alloy-eips" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-serde 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "c-kzg", "once_cell", "serde", @@ -230,11 +231,12 @@ dependencies = [ [[package]] name = "alloy-genesis" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", - "alloy-serde 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-serde 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "serde", + "serde_json", ] [[package]] @@ -249,9 +251,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a35ddfd27576474322a5869e4c123e5f3e7b2177297c18e4e82ea501cb125b" +checksum = "786689872ec4e7d354810ab0dffd48bb40b838c047522eb031cbd47d15634849" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -262,12 +264,13 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "serde", "serde_json", "thiserror", + "tracing", ] [[package]] @@ -284,17 +287,17 @@ dependencies = [ [[package]] name = "alloy-network" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-eips 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-json-rpc 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-eips 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-json-rpc 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-primitives", - "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-signer 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-signer 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-sol-types", "async-trait", "futures-utils-wasm", - "serde", "thiserror", ] @@ -317,9 +320,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99bbad0a6b588ef4aec1b5ddbbfdacd9ef04e00b979617765b03174318ee1f3a" +checksum = "525448f6afc1b70dd0f9d0a8145631bf2f5e434678ab23ab18409ca264cae6b3" dependencies = [ "alloy-rlp", "bytes", @@ -340,21 +343,23 @@ dependencies = [ [[package]] name = "alloy-provider" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ - "alloy-json-rpc 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-eips 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-json-rpc 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-primitives", - "alloy-rpc-client 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-rpc-trace-types", - "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-transport 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-transport-http 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-rpc-client 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-rpc-types-trace 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-transport 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-transport-http 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "async-stream", "async-trait", "auto_impl", "dashmap", "futures", + "futures-utils-wasm", "lru", "reqwest 0.12.4", "serde_json", @@ -373,7 +378,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-client 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bfd0fda)", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bfd0fda)", - "alloy-rpc-types-trace", + "alloy-rpc-types-trace 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bfd0fda)", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bfd0fda)", "alloy-transport-http 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bfd0fda)", "async-stream", @@ -408,17 +413,17 @@ checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] name = "alloy-rpc-client" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ - "alloy-json-rpc 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-transport 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-transport-http 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-json-rpc 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-transport 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-transport-http 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "futures", "pin-project", "reqwest 0.12.4", @@ -451,29 +456,17 @@ dependencies = [ "url", ] -[[package]] -name = "alloy-rpc-trace-types" -version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" -dependencies = [ - "alloy-primitives", - "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-serde 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "serde", - "serde_json", -] - [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-eips 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-genesis 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-eips 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-genesis 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-serde 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-sol-types", "itertools 0.12.1", "serde", @@ -499,6 +492,18 @@ dependencies = [ "thiserror", ] +[[package]] +name = "alloy-rpc-types-trace" +version = "0.1.0" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-serde 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "serde", + "serde_json", +] + [[package]] name = "alloy-rpc-types-trace" version = "0.1.0" @@ -514,7 +519,7 @@ dependencies = [ [[package]] name = "alloy-serde" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "serde", @@ -534,7 +539,7 @@ dependencies = [ [[package]] name = "alloy-signer" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "async-trait", @@ -560,12 +565,12 @@ dependencies = [ [[package]] name = "alloy-signer-wallet" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-primitives", - "alloy-signer 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-signer 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "async-trait", "k256", "rand", @@ -589,9 +594,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452d929748ac948a10481fff4123affead32c553cf362841c5103dd508bdfc16" +checksum = "89c80a2cb97e7aa48611cbb63950336f9824a174cdf670527cc6465078a26ea1" dependencies = [ "alloy-json-abi", "alloy-sol-macro-input", @@ -601,16 +606,16 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df64e094f6d2099339f9e82b5b38440b159757b6920878f28316243f8166c8d1" +checksum = "c58894b58ac50979eeac6249661991ac40b9d541830d9a725f7714cc9ef08c23" dependencies = [ "alloy-json-abi", "const-hex", @@ -619,24 +624,24 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.59", + "syn 2.0.60", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715f4d09a330cc181fc7c361b5c5c2766408fa59a0bac60349dcb7baabd404cc" +checksum = "7da8e71ea68e780cc203919e03f69f59e7afe92d2696fb1dcb6662f61e4031b6" dependencies = [ - "winnow 0.6.6", + "winnow 0.6.8", ] [[package]] name = "alloy-sol-types" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bc2d6dfc2a19fd56644494479510f98b1ee929e04cf0d4aa45e98baa3e545b" +checksum = "399287f68d1081ed8b1f4903c49687658b95b142207d7cb4ae2f4813915343ef" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -648,10 +653,10 @@ dependencies = [ [[package]] name = "alloy-transport" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ - "alloy-json-rpc 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "base64 0.22.0", + "alloy-json-rpc 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "base64 0.22.1", "futures-util", "futures-utils-wasm", "serde", @@ -669,7 +674,7 @@ version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" dependencies = [ "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bfd0fda)", - "base64 0.22.0", + "base64 0.22.1", "futures-util", "futures-utils-wasm", "serde", @@ -684,10 +689,10 @@ dependencies = [ [[package]] name = "alloy-transport-http" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ - "alloy-json-rpc 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-transport 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-json-rpc 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-transport 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "reqwest 0.12.4", "serde_json", "tower", @@ -733,47 +738,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -781,9 +787,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "approx" @@ -1028,6 +1034,12 @@ dependencies = [ "rand", ] +[[package]] +name = "array-macro" +version = "2.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "220a2c618ab466efe41d0eace94dfeff1c35e3aa47891bdb95e1c0fefffd3c99" + [[package]] name = "arrayref" version = "0.3.7" @@ -1090,7 +1102,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -1101,7 +1113,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -1128,9 +1140,9 @@ dependencies = [ [[package]] name = "aurora-engine-modexp" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfacad86e9e138fca0670949eb8ed4ffdf73a55bded8887efe0863cd1a3a6f70" +checksum = "0aef7712851e524f35fbbb74fa6599c5cd8692056a1c36f9ca0d2001b670e7e5" dependencies = [ "hex", "num", @@ -1144,14 +1156,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "autotools" @@ -1176,7 +1188,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.0", + "hyper 1.3.1", "hyper-util", "itoa", "matchit", @@ -1227,7 +1239,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -1243,6 +1255,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", + "serde", ] [[package]] @@ -1265,9 +1278,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-serde" @@ -1346,6 +1359,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "blake2b_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + [[package]] name = "blake3" version = "1.5.1" @@ -1380,6 +1404,19 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "bls12_381" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3c196a77437e7cc2fb515ce413a6401291578b5afc8ecb29a3c7ab957f05941" +dependencies = [ + "ff 0.12.1", + "group 0.12.1", + "pairing", + "rand_core", + "subtle", +] + [[package]] name = "blst" version = "0.3.11" @@ -1466,7 +1503,7 @@ checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -1501,7 +1538,7 @@ dependencies = [ [[package]] name = "c-kzg-taiko" version = "1.0.0" -source = "git+https://github.com/smtmfft/c-kzg-4844?branch=for-alpha7#5c1ba94f98c2d9e0f68b550f7528c2f6cc2285a7" +source = "git+https://github.com/smtmfft/c-kzg-4844?branch=for-alpha7#77e9ba0a65e10e6a470832da2914b17a968da791" dependencies = [ "blst", "cc", @@ -1526,9 +1563,9 @@ source = "git+https://github.com/brechtpd/cap?branch=more-stats#a75714150823408c [[package]] name = "cargo-platform" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -1576,12 +1613,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.94" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -1649,7 +1687,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -1660,9 +1698,9 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "console" @@ -1777,6 +1815,19 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" +[[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.12" @@ -1805,6 +1856,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.19" @@ -1863,7 +1923,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -1933,7 +1993,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -1944,7 +2004,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -1960,7 +2020,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -1968,9 +2028,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der" @@ -2152,9 +2212,9 @@ dependencies = [ "base16ct", "crypto-bigint", "digest 0.10.7", - "ff", + "ff 0.13.0", "generic-array 0.14.7", - "group", + "group 0.13.0", "pkcs8", "rand_core", "sec1", @@ -2205,7 +2265,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -2216,7 +2276,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -2349,7 +2409,7 @@ dependencies = [ "regex", "serde", "serde_json", - "syn 2.0.59", + "syn 2.0.60", "toml", "walkdir", ] @@ -2366,7 +2426,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -2391,7 +2451,7 @@ dependencies = [ "serde", "serde_json", "strum 0.25.0", - "syn 2.0.59", + "syn 2.0.60", "tempfile", "thiserror", "tiny-keccak", @@ -2453,9 +2513,9 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fastrlp" @@ -2468,6 +2528,17 @@ dependencies = [ "bytes", ] +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "bitvec", + "rand_core", + "subtle", +] + [[package]] name = "ff" version = "0.13.0" @@ -2499,9 +2570,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" +checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" [[package]] name = "find_cuda_helper" @@ -2532,9 +2603,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -2573,7 +2644,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -2659,7 +2730,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -2740,14 +2811,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe739944a5406424e080edccb6add95685130b9f160d5407c639c7df0c5836b0" dependencies = [ + "serde", "typenum", ] [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -2764,6 +2836,19 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "git2" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" +dependencies = [ + "bitflags 2.5.0", + "libc", + "libgit2-sys", + "log", + "url", +] + [[package]] name = "glam" version = "0.20.5" @@ -2791,13 +2876,25 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "memuse", + "rand_core", + "subtle", +] + [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.0", "rand_core", "subtle", ] @@ -2840,6 +2937,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "halo2" +version = "0.1.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a23c779b38253fe1538102da44ad5bd5378495a61d2c4ee18d64eaa61ae5995" +dependencies = [ + "halo2_proofs", +] + +[[package]] +name = "halo2_proofs" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e925780549adee8364c7f2b685c753f6f3df23bde520c67416e93bf615933760" +dependencies = [ + "blake2b_simd", + "ff 0.12.1", + "group 0.12.1", + "pasta_curves 0.4.1", + "rand_core", + "rayon", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -2857,9 +2977,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -2938,9 +3058,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hickory-proto" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" +checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" dependencies = [ "async-trait", "cfg-if", @@ -2962,9 +3082,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" +checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" dependencies = [ "cfg-if", "futures-util", @@ -3068,9 +3188,9 @@ dependencies = [ [[package]] name = "http-range-header" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce4ef31cda248bbdb6e6820603b82dfcd9e833db65a43e997a0ccec777d11fe" +checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" [[package]] name = "httparse" @@ -3122,9 +3242,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f24ce812868d86d19daa79bf3bf9175bc44ea323391147a5e3abde2a283871b" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", @@ -3176,7 +3296,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.3.0", + "hyper 1.3.1", "hyper-util", "native-tls", "tokio", @@ -3195,7 +3315,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.3.0", + "hyper 1.3.1", "pin-project-lite", "socket2", "tokio", @@ -3315,7 +3435,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -3347,17 +3467,6 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ipconfig" version = "0.3.2" @@ -3387,19 +3496,16 @@ dependencies = [ ] [[package]] -name = "itertools" -version = "0.10.5" +name = "is_terminal_polyfill" +version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itertools" -version = "0.11.0" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -3421,9 +3527,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] @@ -3451,6 +3557,20 @@ dependencies = [ "simple_asn1", ] +[[package]] +name = "jubjub" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a575df5f985fe1cd5b2b05664ff6accfc46559032b954529fd225a2168d27b0f" +dependencies = [ + "bitvec", + "bls12_381", + "ff 0.12.1", + "group 0.12.1", + "rand_core", + "subtle", +] + [[package]] name = "k256" version = "0.13.3" @@ -3504,7 +3624,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -3518,15 +3638,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libflate" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7d5654ae1795afc7ff76f4365c2c8791b0feb18e8996a96adad8ffd7c3b2bf" +checksum = "45d9dfdc14ea4ef0900c1cddbc8dcd553fbaacd8a4a282cf4018ae9dd04fb21e" dependencies = [ "adler32", "core2", @@ -3537,15 +3657,27 @@ dependencies = [ [[package]] name = "libflate_lz77" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5f52fb8c451576ec6b79d3f4deb327398bc05bbdbd99021a6e77a4c855d524" +checksum = "e6e0d73b369f386f1c44abd9c570d5318f55ccde816ff4b562fa452e5182863d" dependencies = [ "core2", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "rle-decode-fast", ] +[[package]] +name = "libgit2-sys" +version = "0.16.2+1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" +dependencies = [ + "cc", + "libc", + "libz-sys", + "pkg-config", +] + [[package]] name = "libm" version = "0.2.8" @@ -3563,16 +3695,22 @@ dependencies = [ ] [[package]] -name = "linked-hash-map" -version = "0.5.6" +name = "libz-sys" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] [[package]] -name = "linux-raw-sys" -version = "0.1.4" +name = "linked-hash-map" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" @@ -3582,9 +3720,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -3602,7 +3740,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -3675,6 +3813,12 @@ dependencies = [ "libc", ] +[[package]] +name = "memuse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" + [[package]] name = "metal" version = "0.25.0" @@ -3845,7 +3989,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -3859,9 +4003,9 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -3882,9 +4026,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -3936,10 +4080,19 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 2.0.2", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", ] [[package]] @@ -4036,7 +4189,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -4072,7 +4225,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "p3-air" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "p3-field", "p3-matrix", @@ -4081,7 +4234,7 @@ dependencies = [ [[package]] name = "p3-baby-bear" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "num-bigint 0.4.4", "p3-field", @@ -4095,16 +4248,30 @@ dependencies = [ [[package]] name = "p3-blake3" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "blake3", "p3-symmetric", ] +[[package]] +name = "p3-bn254-fr" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" +dependencies = [ + "ff 0.13.0", + "num-bigint 0.4.4", + "p3-field", + "p3-poseidon2", + "p3-symmetric", + "rand", + "serde", +] + [[package]] name = "p3-challenger" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "p3-field", "p3-maybe-rayon", @@ -4116,7 +4283,7 @@ dependencies = [ [[package]] name = "p3-commit" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "itertools 0.12.1", "p3-challenger", @@ -4129,7 +4296,7 @@ dependencies = [ [[package]] name = "p3-dft" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "p3-field", "p3-matrix", @@ -4141,7 +4308,7 @@ dependencies = [ [[package]] name = "p3-field" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "itertools 0.12.1", "num-bigint 0.4.4", @@ -4154,7 +4321,7 @@ dependencies = [ [[package]] name = "p3-fri" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "itertools 0.12.1", "p3-challenger", @@ -4169,26 +4336,10 @@ dependencies = [ "tracing", ] -[[package]] -name = "p3-goldilocks" -version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" -dependencies = [ - "num-bigint 0.4.4", - "p3-dft", - "p3-field", - "p3-mds", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", -] - [[package]] name = "p3-interpolation" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "p3-field", "p3-matrix", @@ -4198,7 +4349,7 @@ dependencies = [ [[package]] name = "p3-keccak" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "p3-symmetric", "tiny-keccak", @@ -4207,11 +4358,12 @@ dependencies = [ [[package]] name = "p3-keccak-air" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "p3-air", "p3-field", "p3-matrix", + "p3-maybe-rayon", "p3-util", "tracing", ] @@ -4219,7 +4371,7 @@ dependencies = [ [[package]] name = "p3-matrix" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "itertools 0.12.1", "p3-field", @@ -4233,7 +4385,7 @@ dependencies = [ [[package]] name = "p3-maybe-rayon" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "rayon", ] @@ -4241,9 +4393,9 @@ dependencies = [ [[package]] name = "p3-mds" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ - "itertools 0.11.0", + "itertools 0.12.1", "p3-dft", "p3-field", "p3-matrix", @@ -4255,7 +4407,7 @@ dependencies = [ [[package]] name = "p3-merkle-tree" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "itertools 0.12.1", "p3-commit", @@ -4271,7 +4423,7 @@ dependencies = [ [[package]] name = "p3-poseidon2" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "gcd", "p3-field", @@ -4283,7 +4435,7 @@ dependencies = [ [[package]] name = "p3-symmetric" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "itertools 0.12.1", "p3-field", @@ -4293,7 +4445,7 @@ dependencies = [ [[package]] name = "p3-uni-stark" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "itertools 0.12.1", "p3-air", @@ -4311,11 +4463,20 @@ dependencies = [ [[package]] name = "p3-util" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#04d4c6e15a0296798331db82e696d29c455bafe1" dependencies = [ "serde", ] +[[package]] +name = "pairing" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135590d8bdba2b31346f9cd1fb2a912329f5135e832a4f422942eb6ead8b6b3b" +dependencies = [ + "group 0.12.1", +] + [[package]] name = "parity-scale-codec" version = "3.6.9" @@ -4336,7 +4497,7 @@ version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 2.0.2", "proc-macro2", "quote", "syn 1.0.109", @@ -4344,9 +4505,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -4354,23 +4515,53 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] -name = "paste" -version = "1.0.14" +name = "pasta_curves" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - +checksum = "5cc65faf8e7313b4b1fbaa9f7ca917a0eed499a9663be71477f87993604341d8" +dependencies = [ + "blake2b_simd", + "ff 0.12.1", + "group 0.12.1", + "lazy_static", + "rand", + "static_assertions", + "subtle", +] + +[[package]] +name = "pasta_curves" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" +dependencies = [ + "blake2b_simd", + "ff 0.13.0", + "group 0.13.0", + "lazy_static", + "rand", + "static_assertions", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "pem" version = "1.1.1" @@ -4386,7 +4577,7 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "serde", ] @@ -4398,9 +4589,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.9" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -4444,7 +4635,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -4533,7 +4724,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" dependencies = [ "proc-macro2", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -4562,20 +4753,12 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ - "toml_edit 0.21.1", + "toml_datetime", + "toml_edit 0.20.2", ] [[package]] @@ -4604,31 +4787,41 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "procfs" -version = "0.14.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de8dacb0873f77e6aefc6d71e044761fcc68060290f5b1089fcdf84626bb69" +checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 1.3.2", - "byteorder", + "bitflags 2.5.0", "hex", "lazy_static", - "rustix 0.36.17", + "procfs-core", + "rustix", +] + +[[package]] +name = "procfs-core" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" +dependencies = [ + "bitflags 2.5.0", + "hex", ] [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ "cfg-if", "fnv", @@ -4688,7 +4881,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.59", + "syn 2.0.60", "tempfile", ] @@ -4702,7 +4895,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -4754,16 +4947,16 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" name = "raiko-host" version = "0.1.0" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-primitives", - "alloy-provider 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-provider 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-rlp", "alloy-rlp-derive", - "alloy-rpc-client 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-rpc-client 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-sol-types", - "alloy-transport-http 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-transport-http 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "anyhow", "assert_cmd", "axum", @@ -4776,7 +4969,7 @@ dependencies = [ "env_logger", "ethers-core", "flate2", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hyper 0.14.28", "lazy_static", "lru_time_cache", @@ -4813,19 +5006,19 @@ dependencies = [ name = "raiko-lib" version = "0.1.0" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-primitives", "alloy-rlp", "alloy-rlp-derive", - "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-sol-types", "anyhow", "bincode", "c-kzg-taiko", "chrono", "flate2", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "lazy_static", "libflate", @@ -4862,16 +5055,16 @@ name = "raiko-primitives" version = "0.1.0" dependencies = [ "alloy-dyn-abi", - "alloy-eips 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-eips 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-primitives", "alloy-rlp", "alloy-rlp-derive", - "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-sol-types", "anyhow", "bincode", "c-kzg", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex-literal", "once_cell", "revm-primitives", @@ -4888,16 +5081,16 @@ dependencies = [ name = "raiko-setup" version = "0.1.0" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-consensus 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-network 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-primitives", - "alloy-provider 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-provider 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-rlp", "alloy-rlp-derive", - "alloy-rpc-client 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-rpc-client 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-rpc-types 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-sol-types", - "alloy-transport-http 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-transport-http 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "anyhow", "assert_cmd", "bincode", @@ -4909,7 +5102,7 @@ dependencies = [ "env_logger", "ethers-core", "flate2", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hyper 0.14.28", "lazy_static", "lru_time_cache", @@ -5014,11 +5207,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] @@ -5078,9 +5271,9 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "relative-path" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "reqwest" @@ -5119,10 +5312,12 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls", + "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "webpki-roots", "winreg 0.50.0", @@ -5134,7 +5329,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", @@ -5143,7 +5338,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.0", + "hyper 1.3.1", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -5197,8 +5392,8 @@ dependencies = [ [[package]] name = "revm" -version = "7.2.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "8.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "auto_impl", "cfg-if", @@ -5206,12 +5401,13 @@ dependencies = [ "revm-interpreter", "revm-precompile", "serde", + "serde_json", ] [[package]] name = "revm-interpreter" -version = "3.4.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "4.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "revm-primitives", "serde", @@ -5219,23 +5415,25 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "5.1.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "6.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "aurora-engine-modexp", + "c-kzg", "k256", "once_cell", "revm-primitives", "ripemd", + "secp256k1 0.28.2", "sha2", - "sp1-precompiles 0.1.0 (git+https://github.com/succinctlabs/sp1.git)", + "sp1-precompiles", "substrate-bn", ] [[package]] name = "revm-primitives" -version = "3.1.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "3.1.1" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "alloy-primitives", "auto_impl", @@ -5246,7 +5444,7 @@ dependencies = [ "derive_more", "dyn-clone", "enumn", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "once_cell", "serde", @@ -5490,7 +5688,7 @@ dependencies = [ "bytemuck", "cust", "digest 0.10.7", - "ff", + "ff 0.13.0", "hex", "lazy_static", "metal", @@ -5633,7 +5831,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.59", + "syn 2.0.60", "unicode-ident", ] @@ -5687,7 +5885,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.59", + "syn 2.0.60", "walkdir", ] @@ -5733,36 +5931,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", @@ -5785,15 +5969,15 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" [[package]] name = "rustls-webpki" @@ -5873,6 +6057,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scc" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" +dependencies = [ + "sdd", +] + [[package]] name = "schannel" version = "0.1.23" @@ -5898,6 +6091,12 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "sdd" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b84345e4c9bd703274a082fb80caaa99b7612be48dfaa1dd9266577ec412309d" + [[package]] name = "sec1" version = "0.7.3" @@ -5919,7 +6118,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ "rand", - "secp256k1-sys", + "secp256k1-sys 0.8.1", +] + +[[package]] +name = "secp256k1" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +dependencies = [ + "rand", + "secp256k1-sys 0.9.2", ] [[package]] @@ -5931,13 +6140,22 @@ dependencies = [ "cc", ] +[[package]] +name = "secp256k1-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +dependencies = [ + "cc", +] + [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -5946,9 +6164,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -5996,30 +6214,31 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -6058,11 +6277,11 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", @@ -6076,39 +6295,39 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] name = "serial_test" -version = "3.0.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ad9342b3aaca7cb43c45c097dd008d4907070394bd0751a0aa8817e5a018d" +checksum = "4b4b487fe2acf240a021cf57c6b2b4903b1e78ca0ecd862a71b71d2a51fed77d" dependencies = [ - "dashmap", "futures", - "lazy_static", "log", + "once_cell", "parking_lot", + "scc", "serial_test_derive", ] [[package]] name = "serial_test_derive" -version = "3.0.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" +checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -6126,7 +6345,7 @@ dependencies = [ "raiko-primitives", "rand", "rand_core", - "secp256k1", + "secp256k1 0.27.0", "serde", "serde_json", "sha3", @@ -6137,13 +6356,13 @@ dependencies = [ name = "sgx-prover" version = "0.1.0" dependencies = [ - "alloy-contract 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-provider 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-rpc-client 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-signer 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", - "alloy-signer-wallet 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-contract 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-provider 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-rpc-client 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-signer 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", + "alloy-signer-wallet 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "alloy-sol-types", - "alloy-transport-http 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175)", + "alloy-transport-http 0.1.0 (git+https://github.com/brechtpd/alloy?branch=175_4e22b9e)", "bincode", "once_cell", "pem 3.0.4", @@ -6209,9 +6428,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -6259,11 +6478,21 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "snowbridge-amcl" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460a9ed63cdf03c1b9847e8a12a5f5ba19c4efd5869e4a737e05be25d7c427e5" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -6279,24 +6508,21 @@ dependencies = [ [[package]] name = "sp1-core" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#12c841b29f596b3949d446ea923ee60efa0350f5" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" dependencies = [ "anyhow", + "arrayref", "bincode", "blake3", "blake3-zkvm", "cfg-if", - "clap 4.5.4", "curve25519-dalek", "elf", "elliptic-curve", - "flate2", "generic-array 1.0.0", - "hashbrown 0.14.3", "hex", "itertools 0.12.1", "k256", - "lazy_static", "log", "nohash-hasher", "num", @@ -6309,42 +6535,38 @@ dependencies = [ "p3-dft", "p3-field", "p3-fri", - "p3-goldilocks", "p3-keccak", "p3-keccak-air", "p3-matrix", "p3-maybe-rayon", - "p3-mds", "p3-merkle-tree", "p3-poseidon2", "p3-symmetric", "p3-uni-stark", "p3-util", - "petgraph", "rayon-scan", "rrs-lib 0.1.0 (git+https://github.com/GregAC/rrs.git)", "serde", - "serde_json", "serde_with", "serial_test", "size", + "snowbridge-amcl", "sp1-derive", - "sp1-zkvm", + "sp1-primitives", "strum 0.26.2", "strum_macros 0.26.2", "tempfile", - "tiny-keccak", "tracing", "tracing-forest", - "tracing-log", "tracing-subscriber 0.3.18", "typenum", + "web-time", ] [[package]] name = "sp1-derive" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#12c841b29f596b3949d446ea923ee60efa0350f5" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" dependencies = [ "proc-macro2", "quote", @@ -6370,7 +6592,7 @@ dependencies = [ [[package]] name = "sp1-helper" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#12c841b29f596b3949d446ea923ee60efa0350f5" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" dependencies = [ "cargo_metadata 0.18.1", "chrono", @@ -6379,41 +6601,220 @@ dependencies = [ [[package]] name = "sp1-precompiles" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#12c841b29f596b3949d446ea923ee60efa0350f5" +source = "git+https://github.com/succinctlabs/sp1.git#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" dependencies = [ "anyhow", "bincode", "cfg-if", "getrandom", + "hex", "k256", + "num", "rand", "serde", + "snowbridge-amcl", ] [[package]] -name = "sp1-precompiles" +name = "sp1-primitives" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git#12c841b29f596b3949d446ea923ee60efa0350f5" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sp1-prover" +version = "0.1.0" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" dependencies = [ "anyhow", + "backtrace", "bincode", - "cfg-if", - "getrandom", - "k256", + "clap 4.5.4", + "dirs", + "futures", + "hex", + "indicatif", + "itertools 0.12.1", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest 0.11.27", + "serde", + "serde_json", + "sha2", + "size", + "sp1-core", + "sp1-primitives", + "sp1-recursion-circuit", + "sp1-recursion-compiler", + "sp1-recursion-core", + "sp1-recursion-gnark-ffi", + "sp1-recursion-program", + "subtle-encoding", + "tempfile", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber 0.3.18", +] + +[[package]] +name = "sp1-recursion-circuit" +version = "0.1.0" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sp1-core", + "sp1-recursion-compiler", + "sp1-recursion-core", + "sp1-recursion-derive", + "sp1-recursion-program", +] + +[[package]] +name = "sp1-recursion-compiler" +version = "0.1.0" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "serde_json", + "serial_test", + "sp1-core", + "sp1-recursion-core", + "sp1-recursion-derive", + "tracing", +] + +[[package]] +name = "sp1-recursion-core" +version = "0.1.0" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "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", + "serde", + "serde_with", + "sp1-core", + "sp1-derive", + "sp1-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sp1-recursion-derive" +version = "0.1.0" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sp1-recursion-gnark-ffi" +version = "0.1.0" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" +dependencies = [ + "crossbeam", + "log", + "p3-field", "rand", + "reqwest 0.11.27", "serde", + "serde_json", + "sp1-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sp1-recursion-program" +version = "0.1.0" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" +dependencies = [ + "array-macro", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sp1-core", + "sp1-recursion-compiler", + "sp1-recursion-core", + "tracing", ] [[package]] name = "sp1-sdk" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#12c841b29f596b3949d446ea923ee60efa0350f5" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" dependencies = [ "alloy", "anyhow", "async-trait", "axum", "bincode", + "dirs", "dotenv", "futures", "hex", @@ -6428,27 +6829,14 @@ dependencies = [ "reqwest-middleware", "serde", "serde_json", + "sha2", "sp1-core", + "sp1-prover", + "tempfile", "tokio", "tracing", "twirp", -] - -[[package]] -name = "sp1-zkvm" -version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#12c841b29f596b3949d446ea923ee60efa0350f5" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "libm", - "once_cell", - "rand", - "serde", - "sha2", - "sp1-precompiles 0.1.0 (git+https://github.com/succinctlabs/sp1.git?branch=main)", + "vergen", ] [[package]] @@ -6552,7 +6940,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -6565,7 +6953,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -6587,6 +6975,15 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "subtle-encoding" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcb1ed7b8330c5eed5441052651dd7a12c75e2ed88f2ec024ae1fa3a5e59945" +dependencies = [ + "zeroize", +] + [[package]] name = "syn" version = "1.0.109" @@ -6600,9 +6997,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.59" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -6611,14 +7008,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4497156948bd342b52038035a6fa514a89626e37af9d2c52a5e8d8ebcc7ee479" +checksum = "5aa0cefd02f532035d83cfec82647c6eb53140b0485220760e669f4bad489e36" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -6671,7 +7068,7 @@ checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "rustix 0.38.32", + "rustix", "windows-sys 0.52.0", ] @@ -6692,22 +7089,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -6757,7 +7154,9 @@ checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "libc", "num-conv", + "num_threads", "powerfmt", "serde", "time-core", @@ -6831,7 +7230,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -6883,16 +7282,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -6909,9 +7307,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] @@ -6931,20 +7329,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap 2.2.6", "toml_datetime", @@ -7047,7 +7434,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -7163,7 +7550,7 @@ dependencies = [ [[package]] name = "twirp" version = "0.3.0" -source = "git+https://github.com/github/twirp-rs.git#90244e417d27bf9233e96de37bbab8121e983020" +source = "git+https://github.com/github/twirp-rs.git?rev=93d4e4b#93d4e4b4a48f9112c943d2925e8dbb1106bd6a18" dependencies = [ "async-trait", "axum", @@ -7171,7 +7558,7 @@ dependencies = [ "futures", "http 1.1.0", "http-body-util", - "hyper 1.3.0", + "hyper 1.3.1", "prost", "reqwest 0.11.27", "serde", @@ -7219,7 +7606,7 @@ checksum = "ac73887f47b9312552aa90ef477927ff014d63d1920ca8037c6c1951eab64bb1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -7284,9 +7671,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode-xid" @@ -7331,9 +7718,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "utoipa" -version = "4.2.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "272ebdfbc99111033031d2f10e018836056e4d2c8e2acda76450ec7974269fa7" +checksum = "e95b8d4503ee98939fb7024f6da083f7c48ff033cc3cba7521360e1bc6c1470b" dependencies = [ "indexmap 2.2.6", "serde", @@ -7343,15 +7730,15 @@ dependencies = [ [[package]] name = "utoipa-gen" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c9f4d08338c1bfa70dde39412a040a884c6f318b3d09aaaf3437a1e52027fc" +checksum = "7bf0e16c02bc4bf5322ab65f10ab1149bdbcaa782cba66dc7057370a3f8190be" dependencies = [ "proc-macro-error", "proc-macro2", "quote", "regex", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -7409,6 +7796,19 @@ dependencies = [ "rustc_version 0.4.0", ] +[[package]] +name = "vergen" +version = "8.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +dependencies = [ + "anyhow", + "cfg-if", + "git2", + "rustversion", + "time", +] + [[package]] name = "version_check" version = "0.9.4" @@ -7470,7 +7870,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", "wasm-bindgen-shared", ] @@ -7504,7 +7904,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7515,6 +7915,19 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +[[package]] +name = "wasm-streams" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "web-sys" version = "0.3.69" @@ -7525,6 +7938,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "webpki-roots" version = "0.25.4" @@ -7540,7 +7963,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.32", + "rustix", ] [[package]] @@ -7567,11 +7990,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -7589,15 +8012,6 @@ dependencies = [ "windows-targets 0.52.5", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -7616,21 +8030,6 @@ dependencies = [ "windows-targets 0.52.5", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -7662,12 +8061,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.5", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -7680,12 +8073,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -7698,12 +8085,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -7722,12 +8103,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -7740,12 +8115,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -7758,12 +8127,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -7776,12 +8139,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -7805,9 +8162,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] @@ -7862,22 +8219,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "087eca3c1eaf8c47b94d02790dd086cd594b912d2043d4de4bfdd466b3befb7c" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "6f4b6c273f496d8fd4eaf18853e6b448760225dc030ff2c485a786859aea6393" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -7897,7 +8254,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -7912,6 +8269,32 @@ dependencies = [ "flate2", ] +[[package]] +name = "zkhash" +version = "0.2.0" +source = "git+https://github.com/HorizenLabs/poseidon2#bb476b9ca38198cf5092487283c8b8c5d4317c4e" +dependencies = [ + "ark-ff 0.4.2", + "ark-std 0.4.0", + "bitvec", + "blake2", + "bls12_381", + "byteorder", + "cfg-if", + "group 0.12.1", + "group 0.13.0", + "halo2", + "hex", + "jubjub", + "lazy_static", + "pasta_curves 0.5.1", + "rand", + "serde", + "sha2", + "sha3", + "subtle", +] + [[package]] name = "zstd" version = "0.13.1" diff --git a/Cargo.toml b/Cargo.toml index 49f41b6c..03b876eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,11 +35,12 @@ raiko-lib = { path = "./lib", features = ["std"] } raiko-primitives = { path = "./primitives" } # revm -revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "fix-ecrecover", default-features = false } -revm = { git = "https://github.com/taikoxyz/revm.git", branch = "fix-ecrecover", default-features = false, features = [ +revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v35_taiko", default-features = false } +revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v35_taiko", default-features = false, features = [ "serde", + "std", "taiko", -] } +]} # risc zero risc0-zkvm = { version = "0.21.0", features = ["prove", "getrandom"] } @@ -53,29 +54,29 @@ sp1-zkvm = { git = "https://github.com/succinctlabs/sp1.git", branch = "main" } sp1-helper = { git = "https://github.com/succinctlabs/sp1.git", branch = "main" } # alloy -alloy-rlp = { version = "0.3", default-features = false } -alloy-rlp-derive = { version = "0.3", default-features = false } -alloy-core = { version = "0.7.0", default-features = false } -alloy-dyn-abi = { version = "0.7.0", default-features = false } -alloy-json-abi = { version = "0.7.0", default-features = false } -alloy-primitives = { version = "0.7.0", default-features = false } -alloy-sol-types = { version = "0.7.0", default-features = false } -alloy-rpc-types = { git = "https://github.com/brechtpd/alloy", branch = "175" } -alloy-rpc-client = { git = "https://github.com/brechtpd/alloy", branch = "175" } -alloy-consensus = { git = "https://github.com/brechtpd/alloy", branch = "175", features = [ +alloy-rlp = { version = "0.3.4", default-features = false } +alloy-rlp-derive = { version = "0.3.4", default-features = false } +alloy-core = { version = "0.7.1", default-features = false } +alloy-dyn-abi = { version = "0.7.1", default-features = false } +alloy-json-abi = { version = "0.7.1", default-features = false } +alloy-primitives = { version = "0.7.1", default-features = false } +alloy-sol-types = { version = "0.7.1", default-features = false } +alloy-rpc-types = { git = "https://github.com/brechtpd/alloy", branch = "175_4e22b9e" } +alloy-rpc-client = { git = "https://github.com/brechtpd/alloy", branch = "175_4e22b9e" } +alloy-consensus = { git = "https://github.com/brechtpd/alloy", branch = "175_4e22b9e", features = [ "serde", ] } -alloy-network = { git = "https://github.com/brechtpd/alloy", branch = "175", features = [ +alloy-network = { git = "https://github.com/brechtpd/alloy", branch = "175_4e22b9e", features = [ "k256", ] } -alloy-contract = { git = "https://github.com/brechtpd/alloy", branch = "175" } -alloy-eips = { git = "https://github.com/brechtpd/alloy", branch = "175", features = [ +alloy-contract = { git = "https://github.com/brechtpd/alloy", branch = "175_4e22b9e" } +alloy-eips = { git = "https://github.com/brechtpd/alloy", branch = "175_4e22b9e", features = [ "serde", ] } -alloy-provider = { git = "https://github.com/brechtpd/alloy", branch = "175" } -alloy-transport-http = { git = "https://github.com/brechtpd/alloy", branch = "175" } -alloy-signer = { git = "https://github.com/brechtpd/alloy", branch = "175" } -alloy-signer-wallet = { git = "https://github.com/brechtpd/alloy", branch = "175" } +alloy-provider = { git = "https://github.com/brechtpd/alloy", branch = "175_4e22b9e" } +alloy-transport-http = { git = "https://github.com/brechtpd/alloy", branch = "175_4e22b9e" } +alloy-signer = { git = "https://github.com/brechtpd/alloy", branch = "175_4e22b9e" } +alloy-signer-wallet = { git = "https://github.com/brechtpd/alloy", branch = "175_4e22b9e" } # ethers (TODO: remove) ethers-contract = { git = "https://github.com/smtmfft/ethers-rs", branch = "ethers-core-2.0.10" } diff --git a/README.md b/README.md index e056bd25..b8654e32 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,13 @@ Build using TARGET="risc0" make build ``` -#### Running +#### CPU ``` TARGET="risc0" make run ``` +Prepend `RISC0_DEV_MODE=1` to enable the mock prover. + #### Bonsai ``` # edit run_bonsai.sh and run @@ -67,11 +69,6 @@ run_bonsai.sh prove_block.sh taiko_a7 risc0-bonsai 10 ``` -#### CPU -``` -TARGET="risc0" make run -``` - #### GPU ``` @@ -90,6 +87,8 @@ TARGET="sp1" make build TARGET="sp1" make run ``` +Prepend `SP1_PROVER=mock` to enable the mock prover. + ### SGX: ``` TARGET="sgx" make build diff --git a/host/src/execution.rs b/host/src/execution.rs deleted file mode 100644 index e6e1a5ec..00000000 --- a/host/src/execution.rs +++ /dev/null @@ -1,158 +0,0 @@ -use alloy_primitives::B256; -use raiko_lib::{ - builder::{BlockBuilderStrategy, TaikoStrategy}, - input::{GuestInput, GuestOutput, TaikoProverData, WrappedHeader}, - protocol_instance::{assemble_protocol_instance, ProtocolInstance}, - prover::{to_proof, Proof, Prover, ProverError, ProverResult}, - utils::HeaderHasher, - Measurement, -}; -use serde::{Deserialize, Serialize}; -use tracing::{info, trace, warn}; - -use crate::{ - error::HostResult, - memory, - metrics::{inc_guest_req_count, observe_guest_time, observe_prepare_input_time}, - preflight::preflight, - request::ProofRequest, -}; - -/// Execute the proof generation. -pub async fn execute( - proof_request: &ProofRequest, - cached_input: Option, -) -> HostResult<(GuestInput, Proof)> { - // 1. Prepare input - use cached input if available, otherwise prepare new input - let input = if let Some(cached_input) = cached_input { - println!("Using cached input"); - cached_input - } else { - memory::reset_stats(); - let measurement = Measurement::start("Generating input...", false); - let input = prepare_input(proof_request.clone()).await; - let input_time = measurement.stop_with("=> Input generated"); - observe_prepare_input_time( - proof_request.block_number, - input_time.as_millis(), - input.is_ok(), - ); - memory::print_stats("Input generation peak memory used: "); - input? - }; - - // 2. Test run the block - memory::reset_stats(); - let build_result = TaikoStrategy::build_from(&input); - let output = match &build_result { - Ok((header, _mpt_node)) => { - info!("Verifying final state using provider data ..."); - info!("Final block hash derived successfully. {}", header.hash()); - info!("Final block header derived successfully. {header:?}"); - let pi = proof_request - .proof_type - .instance_hash(assemble_protocol_instance(&input, header)?)?; - // Make sure the blockhash from the node matches the one from the builder - assert_eq!(header.hash(), input.block_hash, "block hash unexpected"); - GuestOutput::Success(( - WrappedHeader { - header: header.clone(), - }, - pi, - )) - } - Err(_) => { - warn!("Proving bad block construction!"); - GuestOutput::Failure - } - }; - memory::print_stats("Guest program peak memory used: "); - - // 3. Prove - memory::reset_stats(); - let measurement = Measurement::start("Generating proof...", false); - inc_guest_req_count(&proof_request.proof_type, proof_request.block_number); - let res = proof_request - .proof_type - .run_prover(input.clone(), output, &serde_json::to_value(proof_request)?) - .await - .map(|proof| (input, proof)); - let guest_time = measurement.stop_with("=> Proof generated"); - observe_guest_time( - &proof_request.proof_type, - proof_request.block_number, - guest_time.as_millis(), - res.is_ok(), - ); - memory::print_stats("Prover peak memory used: "); - - res -} - -/// prepare input data for provers -pub async fn prepare_input( - ProofRequest { - block_number, - rpc, - l1_rpc, - beacon_rpc, - network, - graffiti, - prover, - .. - }: ProofRequest, -) -> HostResult { - tokio::task::spawn_blocking(move || { - preflight( - Some(rpc), - block_number, - network, - TaikoProverData { graffiti, prover }, - Some(l1_rpc), - Some(beacon_rpc), - ) - .expect("Failed to fetch required data for block") - }) - .await - .map_err(|e| e.into()) -} - -pub struct NativeProver; - -#[derive(Clone, Serialize, Deserialize)] -pub struct NativeResponse { - output: GuestOutput, -} - -impl Prover for NativeProver { - async fn run( - input: GuestInput, - output: GuestOutput, - _request: &serde_json::Value, - ) -> ProverResult { - trace!("Running the native prover for input {:?}", input); - match output.clone() { - GuestOutput::Success((wraped_header, _)) => { - assemble_protocol_instance(&input, &wraped_header.header) - .map_err(|e| ProverError::GuestError(e.to_string()))?; - } - _ => return Err(ProverError::GuestError("Unexpected output".to_string())), - } - - to_proof(Ok(NativeResponse { output })) - } - - fn instance_hash(_pi: ProtocolInstance) -> B256 { - B256::default() - } -} - -#[cfg(test)] -mod tests { - #[tokio::test] - async fn test_async_block() { - let result = async { Result::<(), &'static str>::Err("error") }; - println!("must here"); - assert!(result.await.is_err()); - } -} diff --git a/host/src/lib.rs b/host/src/lib.rs index 61fc5c85..61eec070 100644 --- a/host/src/lib.rs +++ b/host/src/lib.rs @@ -13,15 +13,18 @@ // limitations under the License. pub mod error; -pub mod execution; pub mod metrics; pub mod preflight; pub mod provider_db; +pub mod raiko; pub mod request; +pub mod rpc_provider; pub mod server; -use std::{alloc, fmt::Debug, path::PathBuf}; +use std::{alloc, collections::HashMap, fmt::Debug, path::PathBuf}; +use alloy_primitives::Address; +use alloy_rpc_types::EIP1186AccountProofResponse; use anyhow::{Context, Result}; use cap::Cap; use clap::Parser; @@ -30,6 +33,8 @@ use serde_json::Value; use crate::{error::HostError, request::ProofRequestOpt}; +type MerkleProof = HashMap; + #[global_allocator] static ALLOCATOR: Cap = Cap::new(alloc::System, usize::MAX); diff --git a/host/src/preflight.rs b/host/src/preflight.rs index 59c1fe37..14c5095b 100644 --- a/host/src/preflight.rs +++ b/host/src/preflight.rs @@ -1,27 +1,22 @@ -use std::sync::Arc; - use alloy_consensus::{ SignableTransaction, TxEip1559, TxEip2930, TxEip4844, TxEip4844Variant, TxEnvelope, TxLegacy, }; pub use alloy_primitives::*; -use alloy_provider::{Provider, ProviderBuilder, ReqwestProvider, RootProvider}; -use alloy_rpc_types::{ - Block as AlloyBlock, BlockTransactions, Filter, Transaction as AlloyRpcTransaction, -}; +use alloy_provider::{Provider, ReqwestProvider}; +use alloy_rpc_types::{Block, BlockTransactions, Filter, Transaction as AlloyRpcTransaction}; use alloy_sol_types::{SolCall, SolEvent}; -use anyhow::{anyhow, bail, Result}; +use anyhow::{bail, Result}; use c_kzg::{Blob, KzgCommitment}; -use hashbrown::HashSet; use raiko_lib::{ builder::{ prepare::TaikoHeaderPrepStrategy, BlockBuilder, OptimisticDatabase, TkoTxExecStrategy, }, - consts::{get_network_spec, Network}, + consts::{ChainSpec, Network}, input::{ decode_anchor, proposeBlockCall, taiko_a6::BlockProposed as TestnetBlockProposed, BlockProposed, GuestInput, TaikoGuestInput, TaikoProverData, }, - utils::{generate_transactions, to_header}, + utils::{generate_transactions, to_header, zlib_compress_data}, Measurement, }; use raiko_primitives::{ @@ -29,36 +24,35 @@ use raiko_primitives::{ mpt::proofs_to_tries, }; use serde::{Deserialize, Serialize}; +use std::{collections::HashSet, sync::Arc}; -use crate::provider_db::ProviderDb; +use crate::{ + provider_db::ProviderDb, raiko::BlockDataProvider, rpc_provider::RpcBlockDataProvider, +}; -pub fn preflight( - rpc_url: Option, +pub async fn preflight( + provider: BDP, block_number: u64, - network: Network, + chain_spec: ChainSpec, prover_data: TaikoProverData, l1_rpc_url: Option, beacon_rpc_url: Option, ) -> Result { - let provider = ProviderBuilder::new().provider(RootProvider::new_http( - reqwest::Url::parse(&rpc_url.clone().unwrap()).expect("invalid rpc url"), - )); - let is_local = provider.client().is_local(); - let measurement = Measurement::start("Fetching block data...", true); - let block = get_block(&provider, block_number, true).unwrap(); - let parent_block = get_block(&provider, block_number - 1, false).unwrap(); + // Get the block and the parent block + let blocks = provider + .get_blocks(&vec![(block_number, true), (block_number - 1, false)]) + .await?; + let (block, parent_block) = (&blocks[0], &blocks[1]); println!("\nblock.hash: {:?}", block.header.hash.unwrap()); println!("block.parent_hash: {:?}", block.header.parent_hash); - println!("block gas used: {:?}", block.header.gas_used.as_limbs()[0]); + println!("block gas used: {:?}", block.header.gas_used); println!("block transactions: {:?}", block.transactions.len()); - let taiko_guest_input = if network.is_taiko() { - let provider_l1 = ProviderBuilder::new().provider(RootProvider::new_http( - reqwest::Url::parse(&l1_rpc_url.clone().unwrap()).expect("invalid rpc url"), - )); + let taiko_guest_input = if chain_spec.is_taiko() { + let provider_l1 = RpcBlockDataProvider::new(&l1_rpc_url.clone().unwrap(), block_number); // Decode the anchor tx to find out which L1 blocks we need to fetch let anchor_tx = match &block.transactions { @@ -73,9 +67,16 @@ pub fn preflight( println!("anchor L1 block id: {:?}", anchor_call.l1BlockId); println!("anchor L1 state root: {:?}", anchor_call.l1StateRoot); - // Get the L1 state block header so that we can prove the L1 state root - let l1_inclusion_block = get_block(&provider_l1, l1_inclusion_block_number, false).unwrap(); - let l1_state_block = get_block(&provider_l1, l1_state_block_number, false).unwrap(); + // Get the L1 block in which the L2 block was included so we can fetch the DA data. + // Also get the L1 state block header so that we can prove the L1 state root. + let l1_blocks = provider_l1 + .get_blocks(&vec![ + (l1_inclusion_block_number, false), + (l1_state_block_number, false), + ]) + .await?; + let (l1_inclusion_block, l1_state_block) = (&l1_blocks[0], &l1_blocks[1]); + println!( "l1_state_root_block hash: {:?}", l1_state_block.header.hash.unwrap() @@ -83,11 +84,12 @@ pub fn preflight( // Get the block proposal data let (proposal_tx, proposal_event) = get_block_proposed_event( - &provider_l1, - network, + provider_l1.provider(), + chain_spec.clone(), l1_inclusion_block.header.hash.unwrap(), block_number, - )?; + ) + .await?; // Fetch the tx data from either calldata or blobdata let (tx_data, tx_blob_hash) = if proposal_event.meta.blobUsed { @@ -97,14 +99,13 @@ pub fn preflight( assert!(!blob_hashes.is_empty()); // Currently the protocol enforces the first blob hash to be used let blob_hash = blob_hashes[0]; - let l2_chain_spec = get_network_spec(network); // Get the blob data for this block let slot_id = block_time_to_block_slot( - l1_inclusion_block.header.timestamp.as_limbs()[0], - l2_chain_spec.genesis_time, - l2_chain_spec.seconds_per_slot, + l1_inclusion_block.header.timestamp, + chain_spec.genesis_time, + chain_spec.seconds_per_slot, )?; - let blobs = get_blob_data(&beacon_rpc_url.clone().unwrap(), slot_id)?; + let blobs = get_blob_data(&beacon_rpc_url.clone().unwrap(), slot_id).await?; assert!(!blobs.data.is_empty(), "blob data not available anymore"); // Get the blob data for the blob storing the tx list let tx_blob = blobs @@ -148,23 +149,24 @@ pub fn preflight( // For Ethereum blocks we just convert the block transactions in a tx_list // so that we don't have to supports separate paths. TaikoGuestInput { - tx_data: alloy_rlp::encode(&get_transactions_from_block(&block)), + tx_data: zlib_compress_data(&alloy_rlp::encode(&get_transactions_from_block(&block)))?, ..Default::default() } }; measurement.stop(); let input = GuestInput { - network, + chain_spec: chain_spec.clone(), block_number, gas_used: block.header.gas_used.try_into().unwrap(), - block_hash: block.header.hash.unwrap(), + block_hash_reference: block.header.hash.unwrap(), + block_header_reference: to_header(&block.header), beneficiary: block.header.miner, gas_limit: block.header.gas_limit.try_into().unwrap(), timestamp: block.header.timestamp.try_into().unwrap(), - extra_data: block.header.extra_data, + extra_data: block.header.extra_data.clone(), mix_hash: block.header.mix_hash.unwrap(), - withdrawals: block.withdrawals.unwrap_or_default(), + withdrawals: block.withdrawals.clone().unwrap_or_default(), parent_state_trie: Default::default(), parent_storage: Default::default(), contracts: Default::default(), @@ -180,15 +182,17 @@ pub fn preflight( // Create the block builder, run the transactions and extract the DB let provider_db = ProviderDb::new( provider, - network, + chain_spec, parent_block.header.number.unwrap().try_into().unwrap(), - )?; + ) + .await?; let mut builder = BlockBuilder::new(&input) .with_db(provider_db) .prepare_header::()?; // Optimize data gathering by executing the transactions multiple times so data can be requested in batches + let is_local = false; let max_iterations = if is_local { 1 } else { 50 }; let mut done = false; let mut num_iterations = 0; @@ -196,7 +200,7 @@ pub fn preflight( println!("Execution iteration {num_iterations}..."); builder.mut_db().unwrap().optimistic = num_iterations + 1 < max_iterations; builder = builder.execute_transactions::()?; - if builder.mut_db().unwrap().fetch_data() { + if builder.mut_db().unwrap().fetch_data().await { done = true; } num_iterations += 1; @@ -206,7 +210,7 @@ pub fn preflight( // Gather inclusion proofs for the initial and final state let measurement = Measurement::start("Fetching storage proofs...", true); - let (parent_proofs, proofs, num_storage_proofs) = provider_db.get_proofs()?; + let (parent_proofs, proofs, num_storage_proofs) = provider_db.get_proofs().await?; measurement.stop_with_count(&format!( "[{} Account/{num_storage_proofs} Storage]", parent_proofs.len() + proofs.len(), @@ -220,7 +224,7 @@ pub fn preflight( // Gather proofs for block history let measurement = Measurement::start("Fetching historical block headers...", true); - let ancestor_headers = provider_db.get_ancestor_headers()?; + let ancestor_headers = provider_db.get_ancestor_headers().await?; measurement.stop(); // Get the contracts from the initial db. @@ -277,28 +281,25 @@ fn calc_blob_versioned_hash(blob_str: &str) -> [u8; 32] { version_hash } -fn get_blob_data(beacon_rpc_url: &str, block_id: u64) -> Result { - let tokio_handle = tokio::runtime::Handle::current(); - tokio_handle.block_on(async { - let url = format!( - "{}/eth/v1/beacon/blob_sidecars/{block_id}", - beacon_rpc_url.trim_end_matches('/'), +async fn get_blob_data(beacon_rpc_url: &str, block_id: u64) -> Result { + let url = format!( + "{}/eth/v1/beacon/blob_sidecars/{block_id}", + beacon_rpc_url.trim_end_matches('/'), + ); + let response = reqwest::get(url.clone()).await?; + if response.status().is_success() { + let blob_response: GetBlobsResponse = response.json().await?; + Ok(blob_response) + } else { + println!( + "Request {url} failed with status code: {}", + response.status() ); - let response = reqwest::get(url.clone()).await?; - if response.status().is_success() { - let blob_response: GetBlobsResponse = response.json().await?; - Ok(blob_response) - } else { - println!( - "Request {url} failed with status code: {}", - response.status() - ); - Err(anyhow::anyhow!( - "Request failed with status code: {}", - response.status() - )) - } - }) + Err(anyhow::anyhow!( + "Request failed with status code: {}", + response.status() + )) + } } // Blob data from the beacon chain @@ -325,29 +326,16 @@ struct GetBlobsResponse { pub data: Vec, } -pub fn get_block(provider: &ReqwestProvider, block_number: u64, full: bool) -> Result { - let tokio_handle = tokio::runtime::Handle::current(); - let response = tokio_handle.block_on(async { - provider - .get_block_by_number((block_number).into(), full) - .await - })?; - match response { - Some(out) => Ok(out), - None => Err(anyhow!("No data for {block_number:?}")), - } -} - -fn get_block_proposed_event( +async fn get_block_proposed_event( provider: &ReqwestProvider, - network: Network, + chain_spec: ChainSpec, block_hash: B256, l2_block_number: u64, ) -> Result<(AlloyRpcTransaction, BlockProposed)> { - let tokio_handle = tokio::runtime::Handle::current(); + // Get the address that emited the event + let l1_address = chain_spec.l1_contract.unwrap(); - // Get the address that emitted the event - let l1_address = get_network_spec(network).l1_contract.unwrap(); + let network = chain_spec.network().unwrap(); // Get the event signature (value can differ between chains) let event_signature = if network == Network::TaikoA6 { @@ -361,7 +349,7 @@ fn get_block_proposed_event( .at_block_hash(block_hash) .event_signature(event_signature); // Now fetch the events - let logs = tokio_handle.block_on(async { provider.get_logs(&filter).await })?; + let logs = provider.get_logs(&filter).await?; // Run over the logs returned to find the matching event for the specified L2 block number // (there can be multiple blocks proposed in the same block and even same tx) @@ -378,12 +366,9 @@ fn get_block_proposed_event( ) .unwrap(); if event.blockId == raiko_primitives::U256::from(l2_block_number) { - let tx = tokio_handle - .block_on(async { - provider - .get_transaction_by_hash(log.transaction_hash.unwrap()) - .await - }) + let tx = provider + .get_transaction_by_hash(log.transaction_hash.unwrap()) + .await .expect("could not find the propose tx"); return Ok((tx, event.data.into())); } @@ -399,12 +384,9 @@ fn get_block_proposed_event( ) .unwrap(); if event.blockId == raiko_primitives::U256::from(l2_block_number) { - let tx = tokio_handle - .block_on(async { - provider - .get_transaction_by_hash(log.transaction_hash.unwrap()) - .await - }) + let tx = provider + .get_transaction_by_hash(log.transaction_hash.unwrap()) + .await .expect("could not find the propose tx"); return Ok((tx, event.data)); } @@ -413,7 +395,7 @@ fn get_block_proposed_event( bail!("No BlockProposed event found for block {l2_block_number}"); } -fn get_transactions_from_block(block: &AlloyBlock) -> Vec { +fn get_transactions_from_block(block: &Block) -> Vec { let mut transactions: Vec = Vec::new(); if !block.transactions.is_empty() { match &block.transactions { @@ -439,7 +421,7 @@ fn from_block_tx(tx: &AlloyRpcTransaction) -> TxEnvelope { tx.signature.unwrap().v.as_limbs()[0], ) .unwrap(); - match tx.transaction_type.unwrap_or_default().as_limbs()[0] { + match tx.transaction_type.unwrap_or_default() { 0 => TxEnvelope::Legacy( TxLegacy { chain_id: tx.chain_id, @@ -514,7 +496,7 @@ fn from_block_tx(tx: &AlloyRpcTransaction) -> TxEnvelope { #[cfg(test)] mod test { use ethers_core::types::Transaction; - use raiko_lib::utils::decode_transactions; + use raiko_lib::{consts::get_network_spec, utils::decode_transactions}; use raiko_primitives::{eip4844::parse_kzg_trusted_setup, kzg::KzgSettings}; use super::*; @@ -750,6 +732,7 @@ mod test { // .unwrap(); // } + #[ignore] #[test] fn test_slot_block_num_mapping() { let chain_spec = get_network_spec(Network::TaikoA6); diff --git a/host/src/provider_db.rs b/host/src/provider_db.rs index 22b4a349..ef163c95 100644 --- a/host/src/provider_db.rs +++ b/host/src/provider_db.rs @@ -14,28 +14,19 @@ use std::{collections::HashSet, mem::take}; use alloy_consensus::Header as AlloyConsensusHeader; -use alloy_primitives::{Bytes, StorageKey, Uint}; -use alloy_provider::{Provider, ReqwestProvider}; -use alloy_rpc_client::{ClientBuilder, RpcClient}; -use alloy_rpc_types::{Block, BlockId, BlockNumberOrTag, EIP1186AccountProofResponse}; -use alloy_transport_http::Http; -use raiko_lib::{ - builder::OptimisticDatabase, clear_line, consts::Network, inplace_print, mem_db::MemDb, - utils::to_header, -}; +use alloy_primitives::Bytes; +use raiko_lib::{builder::OptimisticDatabase, consts::ChainSpec, mem_db::MemDb, utils::to_header}; use raiko_primitives::{Address, B256, U256}; -use reqwest_alloy::Client; use revm::{ primitives::{Account, AccountInfo, Bytecode, HashMap}, Database, DatabaseCommit, }; use tokio::runtime::Handle; -use crate::preflight::get_block; +use crate::{raiko::BlockDataProvider, MerkleProof}; -pub struct ProviderDb { - pub provider: ReqwestProvider, - pub client: RpcClient>, +pub struct ProviderDb { + pub provider: BDP, pub block_number: u64, pub initial_db: MemDb, pub initial_headers: HashMap, @@ -49,20 +40,14 @@ pub struct ProviderDb { pub pending_block_hashes: HashSet, } -type StorageProofs = HashMap; - -impl ProviderDb { - pub fn new( - provider: ReqwestProvider, - network: Network, +impl ProviderDb { + pub async fn new( + provider: BDP, + chain_spec: ChainSpec, block_number: u64, ) -> Result { - let client = ClientBuilder::default() - .reqwest_http(reqwest::Url::parse(provider.client().transport().url()).unwrap()); - let mut provider_db = ProviderDb { provider, - client, block_number, initial_db: Default::default(), initial_headers: Default::default(), @@ -74,12 +59,14 @@ impl ProviderDb { pending_slots: HashSet::new(), pending_block_hashes: HashSet::new(), }; - if network.is_taiko() { + if chain_spec.is_taiko() { // Get the 256 history block hashes from the provider at first time for anchor // transaction. let start = block_number.saturating_sub(255); - let block_numbers = (start..=block_number).collect::>(); - let initial_history_blocks = provider_db.fetch_blocks(&block_numbers)?; + let block_numbers = (start..=block_number) + .map(|block_number| (block_number, false)) + .collect::>(); + let initial_history_blocks = provider_db.provider.get_blocks(&block_numbers).await?; for block in initial_history_blocks { let block_number: u64 = block.header.number.unwrap().try_into().unwrap(); let block_hash = block.header.hash.unwrap(); @@ -94,237 +81,7 @@ impl ProviderDb { Ok(provider_db) } - fn fetch_blocks(&mut self, block_numbers: &[u64]) -> Result, anyhow::Error> { - let mut all_blocks = Vec::new(); - - let max_batch_size = 32; - for block_numbers in block_numbers.chunks(max_batch_size) { - let mut batch = self.client.new_batch(); - let mut requests = vec![]; - - for block_number in block_numbers.iter() { - requests.push(Box::pin(batch.add_call( - "eth_getBlockByNumber", - &(BlockNumberOrTag::from(*block_number), false), - )?)); - } - - let mut blocks = self.async_executor.block_on(async { - batch.send().await?; - let mut blocks = vec![]; - // Collect the data from the batch - for request in requests.into_iter() { - blocks.push(request.await?); - } - Ok::<_, anyhow::Error>(blocks) - })?; - - all_blocks.append(&mut blocks); - } - - Ok(all_blocks) - } - - fn fetch_accounts(&self, accounts: &[Address]) -> Result, anyhow::Error> { - let mut all_accounts = Vec::new(); - - let max_batch_size = 250; - for accounts in accounts.chunks(max_batch_size) { - let mut batch = self.client.new_batch(); - - let mut nonce_requests = Vec::new(); - let mut balance_requests = Vec::new(); - let mut code_requests = Vec::new(); - - for address in accounts { - nonce_requests.push(Box::pin( - batch - .add_call::<_, Uint<64, 1>>( - "eth_getTransactionCount", - &(address, Some(BlockId::from(self.block_number))), - ) - .unwrap(), - )); - balance_requests.push(Box::pin( - batch - .add_call::<_, Uint<256, 4>>( - "eth_getBalance", - &(address, Some(BlockId::from(self.block_number))), - ) - .unwrap(), - )); - code_requests.push(Box::pin( - batch - .add_call::<_, Bytes>( - "eth_getCode", - &(address, Some(BlockId::from(self.block_number))), - ) - .unwrap(), - )); - } - - let mut accounts = self.async_executor.block_on(async { - batch.send().await?; - let mut accounts = vec![]; - // Collect the data from the batch - for (nonce_request, (balance_request, code_request)) in nonce_requests - .into_iter() - .zip(balance_requests.into_iter().zip(code_requests.into_iter())) - { - let (nonce, balance, code) = ( - nonce_request.await?, - balance_request.await?, - code_request.await?, - ); - - let account_info = AccountInfo::new( - balance, - nonce.try_into().unwrap(), - Bytecode::new_raw(code.clone()).hash_slow(), - Bytecode::new_raw(code), - ); - - accounts.push(account_info); - } - Ok::<_, anyhow::Error>(accounts) - })?; - - all_accounts.append(&mut accounts); - } - - Ok(all_accounts) - } - - fn fetch_storage_slots( - &self, - accounts: &[(Address, U256)], - ) -> Result, anyhow::Error> { - let mut all_values = Vec::new(); - - let max_batch_size = 1000; - for accounts in accounts.chunks(max_batch_size) { - let mut batch = self.client.new_batch(); - - let mut requests = Vec::new(); - - for (address, key) in accounts { - requests.push(Box::pin( - batch - .add_call::<_, U256>( - "eth_getStorageAt", - &(address, key, Some(BlockId::from(self.block_number))), - ) - .unwrap(), - )); - } - - let mut values = self.async_executor.block_on(async { - batch.send().await?; - let mut values = vec![]; - // Collect the data from the batch - for request in requests.into_iter() { - values.push(request.await?); - } - Ok::<_, anyhow::Error>(values) - })?; - - all_values.append(&mut values); - } - - Ok(all_values) - } - - fn get_storage_proofs( - &mut self, - block_number: u64, - accounts: HashMap>, - offset: usize, - num_storage_proofs: usize, - ) -> Result { - let mut storage_proofs: HashMap = HashMap::new(); - let mut idx = offset; - - let mut accounts = accounts.clone(); - - let batch_limit = 1000; - while !accounts.is_empty() { - inplace_print(&format!( - "fetching storage proof {idx}/{num_storage_proofs}..." - )); - - // Create a batch for all storage proofs - let mut batch = self.client.new_batch(); - - // Collect all requests - let mut requests = Vec::new(); - - let mut batch_size = 0; - while !accounts.is_empty() && batch_size < batch_limit { - let mut address_to_remove = None; - if let Some((address, keys)) = accounts.iter_mut().next() { - // Calculate how many keys we can still process - let num_keys_to_process = if batch_size + keys.len() < batch_limit { - keys.len() - } else { - batch_limit - batch_size - }; - - // If we can process all keys, remove the address from the map after the loop - if num_keys_to_process == keys.len() { - address_to_remove = Some(*address); - } - - // Extract the keys to process - let keys_to_process = keys - .drain(0..num_keys_to_process) - .map(StorageKey::from) - .collect::>(); - - // Add the request - requests.push(Box::pin( - batch - .add_call::<_, EIP1186AccountProofResponse>( - "eth_getProof", - &( - address, - keys_to_process.clone(), - BlockId::from(block_number), - ), - ) - .unwrap(), - )); - - // Keep track of how many keys were processed - // Add an additional 1 for the account proof itself - batch_size += 1 + keys_to_process.len(); - } - - // Remove the address if all keys were processed for this account - if let Some(address) = address_to_remove { - accounts.remove(&address); - } - } - - // Send the batch - self.async_executor.block_on(async { batch.send().await })?; - - // Collect the data from the batch - for request in requests.into_iter() { - let mut proof = self.async_executor.block_on(request)?; - idx += proof.storage_proof.len(); - if let Some(map_proof) = storage_proofs.get_mut(&proof.address) { - map_proof.storage_proof.append(&mut proof.storage_proof); - } else { - storage_proofs.insert(proof.address, proof); - } - } - } - clear_line(); - - Ok(storage_proofs) - } - - pub fn get_proofs(&mut self) -> Result<(StorageProofs, StorageProofs, usize), anyhow::Error> { + pub async fn get_proofs(&mut self) -> Result<(MerkleProof, MerkleProof, usize), anyhow::Error> { // Latest proof keys let mut storage_keys = self.initial_db.storage_keys(); for (address, mut indices) in self.current_db.storage_keys() { @@ -347,44 +104,50 @@ impl ProviderDb { let num_storage_proofs = num_initial_values + num_latest_values; // Initial proofs - let initial_proofs = self.get_storage_proofs( - self.block_number, - self.initial_db.storage_keys(), - 0, - num_storage_proofs, - )?; - let latest_proofs = self.get_storage_proofs( - self.block_number + 1, - storage_keys, - num_initial_values, - num_storage_proofs, - )?; + let initial_proofs = self + .provider + .get_merkle_proofs( + self.block_number, + self.initial_db.storage_keys(), + 0, + num_storage_proofs, + ) + .await?; + let latest_proofs = self + .provider + .get_merkle_proofs( + self.block_number + 1, + storage_keys, + num_initial_values, + num_storage_proofs, + ) + .await?; Ok((initial_proofs, latest_proofs, num_storage_proofs)) } - pub fn get_ancestor_headers(&mut self) -> Result, anyhow::Error> { + pub async fn get_ancestor_headers( + &mut self, + ) -> Result, anyhow::Error> { let earliest_block = self .initial_db .block_hashes .keys() .min() .unwrap_or(&self.block_number); - let headers = (*earliest_block..self.block_number) - .rev() - .map(|block_number| { + + let mut headers = Vec::new(); + for block_number in (*earliest_block..self.block_number).rev() { + if !self.initial_headers.contains_key(&block_number) { + let block = &self + .provider + .get_blocks(&vec![(block_number, false)]) + .await?[0]; self.initial_headers - .get(&block_number) - .cloned() - .unwrap_or_else(|| { - to_header( - &get_block(&self.provider, block_number, false) - .unwrap() - .header, - ) - }) - }) - .collect(); + .insert(block_number, to_header(&block.header)); + } + headers.push(self.initial_headers[&block_number].clone()); + } Ok(headers) } @@ -395,7 +158,7 @@ impl ProviderDb { } } -impl Database for ProviderDb { +impl Database for ProviderDb { type Error = anyhow::Error; fn basic(&mut self, address: Address) -> Result, Self::Error> { @@ -429,12 +192,15 @@ impl Database for ProviderDb { } // Fetch the account - let account = self.fetch_accounts(&[address])?[0].clone(); + let account = &tokio::task::block_in_place(|| { + self.async_executor + .block_on(self.provider.get_accounts(&vec![address])) + })?[0]; // Insert the account into the initial database. self.initial_db .insert_account_info(address, account.clone()); - Ok(Some(account)) + Ok(Some(account.clone())) } fn storage(&mut self, address: Address, index: U256) -> Result { @@ -464,8 +230,10 @@ impl Database for ProviderDb { self.initial_db.basic(address)?; // Fetch the storage value - let value = self.fetch_storage_slots(&[(address, index)])?[0]; - + let value = tokio::task::block_in_place(|| { + self.async_executor + .block_on(self.provider.get_storage_values(&vec![(address, index)])) + })?[0]; self.initial_db .insert_account_storage(&address, index, value); Ok(value) @@ -491,14 +259,17 @@ impl Database for ProviderDb { return Ok(B256::default()); } - // Fetch the block hash - let block_hash = self.fetch_blocks(&[block_number])?[0] + // Get the block hash from the provider. + let block_hash = tokio::task::block_in_place(|| { + self.async_executor + .block_on(self.provider.get_blocks(&vec![(block_number, false)])) + }) + .unwrap()[0] .header .hash .unwrap() .0 .into(); - self.initial_db.insert_block_hash(block_number, block_hash); Ok(block_hash) } @@ -508,14 +279,14 @@ impl Database for ProviderDb { } } -impl DatabaseCommit for ProviderDb { +impl DatabaseCommit for ProviderDb { fn commit(&mut self, changes: HashMap) { self.current_db.commit(changes) } } -impl OptimisticDatabase for ProviderDb { - fn fetch_data(&mut self) -> bool { +impl OptimisticDatabase for ProviderDb { + async fn fetch_data(&mut self) -> bool { //println!("all accounts touched: {:?}", self.pending_accounts); //println!("all slots touched: {:?}", self.pending_slots); //println!("all block hashes touched: {:?}", self.pending_block_hashes); @@ -524,7 +295,9 @@ impl OptimisticDatabase for ProviderDb { let valid_run = self.is_valid_run(); let accounts = self - .fetch_accounts(&self.pending_accounts.iter().cloned().collect::>()) + .provider + .get_accounts(&self.pending_accounts.iter().cloned().collect::>()) + .await .unwrap(); for (address, account) in take(&mut self.pending_accounts) .into_iter() @@ -535,7 +308,9 @@ impl OptimisticDatabase for ProviderDb { } let slots = self - .fetch_storage_slots(&self.pending_slots.iter().cloned().collect::>()) + .provider + .get_storage_values(&self.pending_slots.iter().cloned().collect::>()) + .await .unwrap(); for ((address, index), value) in take(&mut self.pending_slots).into_iter().zip(slots.iter()) { @@ -544,13 +319,16 @@ impl OptimisticDatabase for ProviderDb { } let blocks = self - .fetch_blocks( + .provider + .get_blocks( &self .pending_block_hashes .iter() .cloned() + .map(|block_number| (block_number, false)) .collect::>(), ) + .await .unwrap(); for (block_number, block) in take(&mut self.pending_block_hashes) .into_iter() diff --git a/host/src/raiko.rs b/host/src/raiko.rs new file mode 100644 index 00000000..59a4f38b --- /dev/null +++ b/host/src/raiko.rs @@ -0,0 +1,283 @@ +use alloy_primitives::{Address, FixedBytes, B256, U256}; +use alloy_rpc_types::Block; +use anyhow::Result; +use raiko_lib::builder::{BlockBuilderStrategy, TaikoStrategy}; +use raiko_lib::consts::ChainSpec; +use raiko_lib::input::{GuestInput, GuestOutput, TaikoProverData, WrappedHeader}; +use raiko_lib::protocol_instance::{assemble_protocol_instance, ProtocolInstance}; +use raiko_lib::prover::{to_proof, Proof, Prover, ProverError, ProverResult}; +use raiko_lib::utils::HeaderHasher; +use revm::primitives::AccountInfo; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use tracing::{trace, warn}; + +use crate::error::{self, HostError}; +use crate::preflight::preflight; +use crate::request::ProofRequest; +use crate::MerkleProof; + +#[allow(async_fn_in_trait)] +pub trait BlockDataProvider { + async fn get_blocks( + &self, + blocks_to_fetch: &[(u64, bool)], + ) -> Result, anyhow::Error>; + async fn get_accounts(&self, accounts: &[Address]) -> Result, anyhow::Error>; + async fn get_storage_values( + &self, + accounts: &[(Address, U256)], + ) -> Result, anyhow::Error>; + async fn get_merkle_proofs( + &self, + block_number: u64, + accounts: HashMap>, + offset: usize, + num_storage_proofs: usize, + ) -> Result; +} + +pub struct Raiko { + chain_spec: ChainSpec, + request: ProofRequest, +} + +impl Raiko { + pub fn new(chain_spec: ChainSpec, request: ProofRequest) -> Self { + Self { + chain_spec, + request, + } + } + + pub async fn generate_input( + &self, + provider: BDP, + ) -> Result { + preflight( + provider, + self.request.block_number, + self.chain_spec.clone(), + TaikoProverData { + graffiti: self.request.graffiti, + prover: self.request.prover, + }, + Some(self.request.l1_rpc.clone()), + Some(self.request.beacon_rpc.clone()), + ) + .await + .map_err(Into::::into) + } + + pub fn get_output(&self, input: &GuestInput) -> Result { + match TaikoStrategy::build_from(input) { + Ok((header, _mpt_node)) => { + println!("Verifying final state using provider data ..."); + println!("Final block hash derived successfully. {}", header.hash()); + println!("Final block header derived successfully. {:?}", header); + let pi = self + .request + .proof_type + .instance_hash(assemble_protocol_instance(&input, &header)?)?; + + // Check against the expected value of all fields for easy debugability + let exp = &input.block_header_reference; + check_eq(exp.parent_hash, header.parent_hash, "base_fee_per_gas"); + check_eq(exp.ommers_hash, header.ommers_hash, "ommers_hash"); + check_eq(exp.beneficiary, header.beneficiary, "beneficiary"); + check_eq(exp.state_root, header.state_root, "state_root"); + check_eq( + exp.transactions_root, + header.transactions_root, + "transactions_root", + ); + check_eq(exp.receipts_root, header.receipts_root, "receipts_root"); + check_eq( + exp.withdrawals_root, + header.withdrawals_root, + "withdrawals_root", + ); + check_eq(exp.logs_bloom, header.logs_bloom, "logs_bloom"); + check_eq(exp.difficulty, header.difficulty, "difficulty"); + check_eq(exp.number, header.number, "number"); + check_eq(exp.gas_limit, header.gas_limit, "gas_limit"); + check_eq(exp.gas_used, header.gas_used, "gas_used"); + check_eq(exp.timestamp, header.timestamp, "timestamp"); + check_eq(exp.mix_hash, header.mix_hash, "mix_hash"); + check_eq(exp.nonce, header.nonce, "nonce"); + check_eq( + exp.base_fee_per_gas, + header.base_fee_per_gas, + "base_fee_per_gas", + ); + check_eq(exp.blob_gas_used, header.blob_gas_used, "blob_gas_used"); + check_eq( + exp.excess_blob_gas, + header.excess_blob_gas, + "excess_blob_gas", + ); + check_eq( + exp.parent_beacon_block_root, + header.parent_beacon_block_root, + "parent_beacon_block_root", + ); + check_eq( + exp.extra_data.clone(), + header.extra_data.clone(), + "extra_data", + ); + + // Make sure the blockhash from the node matches the one from the builder + assert_eq!( + Into::>::into(header.hash().0), + input.block_hash_reference, + "block hash unexpected" + ); + let output = GuestOutput::Success(( + WrappedHeader { + header: header.clone(), + }, + pi, + )); + + Ok(output) + } + Err(e) => { + warn!("Proving bad block construction!"); + Err(HostError::GuestError( + raiko_lib::prover::ProverError::GuestError(e.to_string()), + )) + } + } + } + + pub async fn prove( + &self, + input: GuestInput, + output: &GuestOutput, + ) -> Result { + self.request + .proof_type + .run_prover( + input.clone(), + output, + &serde_json::to_value(self.request.clone())?, + ) + .await + } +} + +pub struct NativeProver; + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct NativeResponse { + pub output: GuestOutput, +} + +impl Prover for NativeProver { + async fn run( + input: GuestInput, + output: &GuestOutput, + _request: &serde_json::Value, + ) -> ProverResult { + trace!("Running the native prover for input {:?}", input); + match output.clone() { + GuestOutput::Success((wrapped_header, _)) => { + assemble_protocol_instance(&input, &wrapped_header.header) + .map_err(|e| ProverError::GuestError(e.to_string()))?; + } + _ => return Err(ProverError::GuestError("Unexpected output".to_string())), + } + + to_proof(Ok(NativeResponse { + output: output.clone(), + })) + } + + fn instance_hash(_pi: ProtocolInstance) -> B256 { + B256::default() + } +} + +fn check_eq(expected: T, actual: T, message: &str) { + if expected != actual { + println!( + "Assertion failed: {} - Expected: {:?}, Found: {:?}", + message, expected, actual + ); + } +} + +#[cfg(test)] +mod tests { + use crate::raiko::{ChainSpec, NativeResponse, Raiko}; + use crate::request::{ProofRequest, ProofType}; + use crate::rpc_provider::RpcBlockDataProvider; + use alloy_primitives::Address; + use raiko_lib::{ + consts::{get_network_spec, Network}, + input::GuestOutput, + }; + use raiko_primitives::B256; + use std::collections::HashMap; + + async fn prove_block(chain_spec: ChainSpec, proof_request: ProofRequest) { + let provider = + RpcBlockDataProvider::new(&proof_request.rpc.clone(), proof_request.block_number - 1); + let raiko = Raiko::new(chain_spec, proof_request); + let input = raiko + .generate_input(provider) + .await + .expect("input generation failed"); + let output = raiko.get_output(&input).expect("output generation failed"); + let proof = raiko + .prove(input, &output) + .await + .expect("proof generation failed"); + let response: NativeResponse = serde_json::from_value(proof).unwrap(); + match response.output { + GuestOutput::Success(_) => {} + GuestOutput::Failure => unreachable!(), + }; + } + + #[tokio::test(flavor = "multi_thread")] + async fn test_prove_block_taiko_a7() { + let network = Network::TaikoA7; + let block_number = 39367; + let chain_spec = get_network_spec(network); + let proof_request = ProofRequest { + block_number, + rpc: "https://rpc.hekla.taiko.xyz/".to_string(), + l1_rpc: "https://l1rpc.hekla.taiko.xyz/".to_string(), + beacon_rpc: "https://l1beacon.hekla.taiko.xyz".to_string(), + network, + graffiti: B256::ZERO, + prover: Address::ZERO, + l1_network: Network::Ethereum.to_string(), + proof_type: ProofType::Native, + prover_args: HashMap::new(), + }; + prove_block(chain_spec, proof_request).await; + } + + #[tokio::test(flavor = "multi_thread")] + async fn test_prove_block_ethereum() { + let network = Network::Ethereum; + let block_number = 19707175; + let chain_spec = get_network_spec(network); + let proof_request = ProofRequest { + block_number, + rpc: "https://rpc.ankr.com/eth".to_string(), + l1_rpc: String::new(), + beacon_rpc: String::new(), + network, + graffiti: B256::ZERO, + prover: Address::ZERO, + l1_network: Network::Ethereum.to_string(), + proof_type: ProofType::Native, + prover_args: HashMap::new(), + }; + prove_block(chain_spec, proof_request).await; + } +} diff --git a/host/src/request.rs b/host/src/request.rs index 9768d4c1..a188110f 100644 --- a/host/src/request.rs +++ b/host/src/request.rs @@ -16,8 +16,8 @@ use utoipa::ToSchema; use crate::{ error::{HostError, HostResult}, - execution::NativeProver, merge, + raiko::NativeProver, }; #[derive( @@ -98,7 +98,7 @@ impl ProofType { pub async fn run_prover( &self, input: GuestInput, - output: GuestOutput, + output: &GuestOutput, config: &Value, ) -> HostResult { match self { diff --git a/host/src/rpc_provider.rs b/host/src/rpc_provider.rs new file mode 100644 index 00000000..df2f6229 --- /dev/null +++ b/host/src/rpc_provider.rs @@ -0,0 +1,262 @@ +pub use alloy_primitives::*; +use alloy_provider::{ProviderBuilder, ReqwestProvider, RootProvider}; +use alloy_rpc_client::{ClientBuilder, RpcClient}; +use alloy_rpc_types::{Block, BlockId, BlockNumberOrTag, EIP1186AccountProofResponse}; +use alloy_transport_http::Http; +use anyhow::Result; +use raiko_lib::{clear_line, inplace_print}; +use reqwest_alloy::Client; +use revm::primitives::{AccountInfo, Bytecode}; +use std::collections::HashMap; + +use crate::{raiko::BlockDataProvider, MerkleProof}; + +pub struct RpcBlockDataProvider { + pub provider: ReqwestProvider, + pub client: RpcClient>, + block_number: u64, +} + +impl RpcBlockDataProvider { + pub fn new(url: &str, block_number: u64) -> Self { + let url = reqwest::Url::parse(&url).expect("invalid rpc url"); + Self { + provider: ProviderBuilder::new().on_provider(RootProvider::new_http(url.clone())), + client: ClientBuilder::default().http(url), + block_number, + } + } + + pub fn provider(&self) -> &ReqwestProvider { + &self.provider + } +} + +impl BlockDataProvider for RpcBlockDataProvider { + async fn get_blocks( + &self, + blocks_to_fetch: &[(u64, bool)], + ) -> Result, anyhow::Error> { + let mut all_blocks = Vec::new(); + + let max_batch_size = 32; + for blocks_to_fetch in blocks_to_fetch.chunks(max_batch_size) { + let mut batch = self.client.new_batch(); + let mut requests = vec![]; + + for (block_number, full) in blocks_to_fetch.iter() { + requests.push(Box::pin(batch.add_call( + "eth_getBlockByNumber", + &(BlockNumberOrTag::from(*block_number), full), + )?)); + } + + batch.send().await?; + + let mut blocks = vec![]; + // Collect the data from the batch + for request in requests.into_iter() { + blocks.push(request.await?); + } + + all_blocks.append(&mut blocks); + } + + Ok(all_blocks) + } + + async fn get_accounts(&self, accounts: &[Address]) -> Result, anyhow::Error> { + let mut all_accounts = Vec::new(); + + let max_batch_size = 250; + for accounts in accounts.chunks(max_batch_size) { + let mut batch = self.client.new_batch(); + + let mut nonce_requests = Vec::new(); + let mut balance_requests = Vec::new(); + let mut code_requests = Vec::new(); + + for address in accounts { + nonce_requests.push(Box::pin( + batch + .add_call::<_, Uint<64, 1>>( + "eth_getTransactionCount", + &(address, Some(BlockId::from(self.block_number))), + ) + .unwrap(), + )); + balance_requests.push(Box::pin( + batch + .add_call::<_, Uint<256, 4>>( + "eth_getBalance", + &(address, Some(BlockId::from(self.block_number))), + ) + .unwrap(), + )); + code_requests.push(Box::pin( + batch + .add_call::<_, Bytes>( + "eth_getCode", + &(address, Some(BlockId::from(self.block_number))), + ) + .unwrap(), + )); + } + + batch.send().await?; + + let mut accounts = vec![]; + // Collect the data from the batch + for (nonce_request, (balance_request, code_request)) in nonce_requests + .into_iter() + .zip(balance_requests.into_iter().zip(code_requests.into_iter())) + { + let (nonce, balance, code) = ( + nonce_request.await?, + balance_request.await?, + code_request.await?, + ); + + let account_info = AccountInfo::new( + balance, + nonce.try_into().unwrap(), + Bytecode::new_raw(code.clone()).hash_slow(), + Bytecode::new_raw(code), + ); + + accounts.push(account_info); + } + + all_accounts.append(&mut accounts); + } + + Ok(all_accounts) + } + + async fn get_storage_values( + &self, + accounts: &[(Address, U256)], + ) -> Result, anyhow::Error> { + let mut all_values = Vec::new(); + + let max_batch_size = 1000; + for accounts in accounts.chunks(max_batch_size) { + let mut batch = self.client.new_batch(); + + let mut requests = Vec::new(); + + for (address, key) in accounts { + requests.push(Box::pin( + batch + .add_call::<_, U256>( + "eth_getStorageAt", + &(address, key, Some(BlockId::from(self.block_number))), + ) + .unwrap(), + )); + } + + batch.send().await?; + + let mut values = vec![]; + // Collect the data from the batch + for request in requests.into_iter() { + values.push(request.await?); + } + + all_values.append(&mut values); + } + + Ok(all_values) + } + + async fn get_merkle_proofs( + &self, + block_number: u64, + accounts: HashMap>, + offset: usize, + num_storage_proofs: usize, + ) -> Result { + let mut storage_proofs: MerkleProof = HashMap::new(); + let mut idx = offset; + + let mut accounts = accounts.clone(); + + let batch_limit = 1000; + while !accounts.is_empty() { + inplace_print(&format!( + "fetching storage proof {idx}/{num_storage_proofs}..." + )); + + // Create a batch for all storage proofs + let mut batch = self.client.new_batch(); + + // Collect all requests + let mut requests = Vec::new(); + + let mut batch_size = 0; + while !accounts.is_empty() && batch_size < batch_limit { + let mut address_to_remove = None; + if let Some((address, keys)) = accounts.iter_mut().next() { + // Calculate how many keys we can still process + let num_keys_to_process = if batch_size + keys.len() < batch_limit { + keys.len() + } else { + batch_limit - batch_size + }; + + // If we can process all keys, remove the address from the map after the loop + if num_keys_to_process == keys.len() { + address_to_remove = Some(address.clone()); + } + + // Extract the keys to process + let keys_to_process = keys + .drain(0..num_keys_to_process) + .map(|v| StorageKey::from(v)) + .collect::>(); + + // Add the request + requests.push(Box::pin( + batch + .add_call::<_, EIP1186AccountProofResponse>( + "eth_getProof", + &( + address.clone(), + keys_to_process.clone(), + BlockId::from(block_number), + ), + ) + .unwrap(), + )); + + // Keep track of how many keys were processed + // Add an additional 1 for the account proof itself + batch_size += 1 + keys_to_process.len(); + } + + // Remove the address if all keys were processed for this account + if let Some(address) = address_to_remove { + accounts.remove(&address); + } + } + + // Send the batch + batch.send().await?; + + // Collect the data from the batch + for request in requests.into_iter() { + let mut proof = request.await?; + idx += proof.storage_proof.len(); + if let Some(map_proof) = storage_proofs.get_mut(&proof.address) { + map_proof.storage_proof.append(&mut proof.storage_proof); + } else { + storage_proofs.insert(proof.address, proof); + } + } + } + clear_line(); + + Ok(storage_proofs) + } +} diff --git a/host/src/server/api/proof.rs b/host/src/server/api/proof.rs index a5b2e4a2..a1e22d5a 100644 --- a/host/src/server/api/proof.rs +++ b/host/src/server/api/proof.rs @@ -1,7 +1,10 @@ use std::{fs::File, path::PathBuf}; +use crate::metrics::observe_guest_time; +use crate::metrics::observe_prepare_input_time; use axum::{debug_handler, extract::State, routing::post, Json, Router}; use raiko_lib::{ + consts::get_network_spec, input::{get_input_path, GuestInput}, Measurement, }; @@ -10,12 +13,14 @@ use utoipa::OpenApi; use crate::{ error::{HostError, HostResult}, - execution::execute, + memory, metrics::{ dec_current_req, inc_current_req, inc_guest_error, inc_guest_success, inc_host_error, inc_host_req_count, observe_total_time, }, + raiko::Raiko, request::ProofRequest, + rpc_provider::RpcBlockDataProvider, ProverState, }; @@ -96,9 +101,33 @@ async fn proof_handler( &proof_request.network.to_string(), ); + let chain_spec = get_network_spec(proof_request.network); + // Execute the proof generation. let total_time = Measurement::start("", false); - let (input, proof) = execute(&proof_request, cached_input).await.map_err(|e| { + + let raiko = Raiko::new(chain_spec, proof_request.clone()); + let input = if let Some(cached_input) = cached_input { + println!("Using cached input"); + cached_input + } else { + memory::reset_stats(); + let measurement = Measurement::start("Generating input...", false); + let provider = + RpcBlockDataProvider::new(&proof_request.rpc.clone(), proof_request.block_number - 1); + let input = raiko.generate_input(provider).await?; + let input_time = measurement.stop_with("=> Input generated"); + observe_prepare_input_time(proof_request.block_number, input_time.as_millis(), true); + memory::print_stats("Input generation peak memory used: "); + input + }; + memory::reset_stats(); + let output = raiko.get_output(&input)?; + memory::print_stats("Guest program peak memory used: "); + + memory::reset_stats(); + let measurement = Measurement::start("Generating proof...", false); + let proof = raiko.prove(input.clone(), &output).await.map_err(|e| { dec_current_req(); let total_time = total_time.stop_with("====> Proof generation failed"); observe_total_time(proof_request.block_number, total_time.as_millis(), false); @@ -113,6 +142,15 @@ async fn proof_handler( } } })?; + let guest_time = measurement.stop_with("=> Proof generated"); + observe_guest_time( + &proof_request.proof_type, + proof_request.block_number, + guest_time.as_millis(), + true, + ); + memory::print_stats("Prover peak memory used: "); + inc_guest_success(&proof_request.proof_type, proof_request.block_number); let total_time = total_time.stop_with("====> Complete proof generated"); observe_total_time(proof_request.block_number, total_time.as_millis(), true); diff --git a/lib/src/builder/execute.rs b/lib/src/builder/execute.rs index 3ed23966..fbca2e10 100644 --- a/lib/src/builder/execute.rs +++ b/lib/src/builder/execute.rs @@ -36,7 +36,7 @@ use super::{OptimisticDatabase, TxExecStrategy}; use crate::{ builder::BlockBuilder, clear_line, - consts::{get_network_spec, GWEI_TO_WEI}, + consts::GWEI_TO_WEI, guest_mem_forget, inplace_print, print_duration, time::{AddAssign, Duration, Instant}, utils::{check_anchor_tx, generate_transactions}, @@ -71,15 +71,15 @@ impl TxExecStrategy for TkoTxExecStrategy { if !SpecId::enabled(spec_id, MIN_SPEC_ID) { bail!("Invalid protocol version: expected >= {MIN_SPEC_ID:?}, got {spec_id:?}") } - let chain_id = block_builder.chain_spec.chain_id(); - println!("spec_id: {spec_id:?}"); - let network = block_builder.input.network; - let is_taiko = network.is_taiko(); + let chain_spec = &block_builder.input.chain_spec; + let chain_id = chain_spec.chain_id(); + let is_taiko = chain_spec.is_taiko(); + println!("spec_id: {spec_id:?}"); // generate the transactions from the tx list // For taiko blocks, insert the anchor tx as the first transaction - let anchor_tx = if block_builder.input.network.is_taiko() { + let anchor_tx = if chain_spec.is_taiko() { Some(serde_json::from_str(&block_builder.input.taiko.anchor_tx.clone()).unwrap()) } else { None @@ -108,7 +108,7 @@ impl TxExecStrategy for TkoTxExecStrategy { blk_env.basefee = header.base_fee_per_gas.unwrap().try_into().unwrap(); blk_env.gas_limit = block_builder.input.gas_limit.try_into().unwrap(); if let Some(excess_blob_gas) = header.excess_blob_gas { - blk_env.set_blob_excess_gas_and_price(excess_blob_gas) + blk_env.set_blob_excess_gas_and_price(excess_blob_gas.try_into().unwrap()) } }); let evm = if is_taiko { @@ -172,11 +172,11 @@ impl TxExecStrategy for TkoTxExecStrategy { let tx_env = &mut evm.env_mut().tx; fill_eth_tx_env(tx_env, &tx)?; // Set and check some taiko specific values - if network.is_taiko() { + if chain_spec.is_taiko() { // set if the tx is the anchor tx tx_env.taiko.is_anchor = is_anchor; // set the treasury address - tx_env.taiko.treasury = get_network_spec(network).l2_contract.unwrap_or_default(); + tx_env.taiko.treasury = chain_spec.l2_contract.unwrap_or_default(); // Data blobs are not allowed on L2 ensure!(tx_env.blob_hashes.len() == 0); @@ -198,13 +198,8 @@ impl TxExecStrategy for TkoTxExecStrategy { // verify the anchor tx if is_anchor { - check_anchor_tx( - &block_builder.input, - &tx, - &tx_env.caller, - block_builder.input.network, - ) - .expect("invalid anchor tx"); + check_anchor_tx(&block_builder.input, &tx, &tx_env.caller) + .expect("invalid anchor tx"); } // verify transaction gas @@ -338,12 +333,12 @@ impl TxExecStrategy for TkoTxExecStrategy { header.transactions_root = tx_trie.hash(); header.receipts_root = receipt_trie.hash(); header.logs_bloom = logs_bloom; - header.gas_used = cumulative_gas_used; + header.gas_used = cumulative_gas_used.try_into().unwrap(); if spec_id >= SpecId::SHANGHAI { header.withdrawals_root = Some(withdrawals_trie.hash()); }; if spec_id >= SpecId::CANCUN { - header.blob_gas_used = Some(blob_gas_used); + header.blob_gas_used = Some(blob_gas_used.into()); } measurement.stop(); @@ -365,7 +360,7 @@ pub fn fill_eth_tx_env(tx_env: &mut TxEnv, tx: &TxEnvelope) -> Result<(), Error> TxEnvelope::Legacy(tx) => { tx_env.caller = tx.recover_signer().unwrap_or_default(); let tx = tx.tx(); - tx_env.gas_limit = tx.gas_limit; + tx_env.gas_limit = tx.gas_limit.try_into().unwrap(); tx_env.gas_price = tx.gas_price.try_into().unwrap(); tx_env.gas_priority_fee = None; tx_env.transact_to = if let TxKind::Call(to_addr) = tx.to { @@ -382,7 +377,7 @@ pub fn fill_eth_tx_env(tx_env: &mut TxEnv, tx: &TxEnvelope) -> Result<(), Error> TxEnvelope::Eip2930(tx) => { tx_env.caller = tx.recover_signer().unwrap_or_default(); let tx = tx.tx(); - tx_env.gas_limit = tx.gas_limit; + tx_env.gas_limit = tx.gas_limit.try_into().unwrap(); tx_env.gas_price = tx.gas_price.try_into().unwrap(); tx_env.gas_priority_fee = None; tx_env.transact_to = if let TxKind::Call(to_addr) = tx.to { @@ -399,7 +394,7 @@ pub fn fill_eth_tx_env(tx_env: &mut TxEnv, tx: &TxEnvelope) -> Result<(), Error> TxEnvelope::Eip1559(tx) => { tx_env.caller = tx.recover_signer().unwrap_or_default(); let tx = tx.tx(); - tx_env.gas_limit = tx.gas_limit; + tx_env.gas_limit = tx.gas_limit.try_into().unwrap(); tx_env.gas_price = tx.max_fee_per_gas.try_into().unwrap(); tx_env.gas_priority_fee = Some(tx.max_priority_fee_per_gas.try_into().unwrap()); tx_env.transact_to = if let TxKind::Call(to_addr) = tx.to { @@ -416,7 +411,7 @@ pub fn fill_eth_tx_env(tx_env: &mut TxEnv, tx: &TxEnvelope) -> Result<(), Error> TxEnvelope::Eip4844(tx) => { tx_env.caller = tx.recover_signer().unwrap_or_default(); let tx = tx.tx().tx(); - tx_env.gas_limit = tx.gas_limit; + tx_env.gas_limit = tx.gas_limit.try_into().unwrap(); tx_env.gas_price = tx.max_fee_per_gas.try_into().unwrap(); tx_env.gas_priority_fee = Some(tx.max_priority_fee_per_gas.try_into().unwrap()); tx_env.transact_to = TransactTo::Call(tx.to); @@ -428,6 +423,7 @@ pub fn fill_eth_tx_env(tx_env: &mut TxEnv, tx: &TxEnvelope) -> Result<(), Error> tx_env.blob_hashes.clone_from(&tx.blob_versioned_hashes); tx_env.max_fee_per_blob_gas = Some(U256::from(tx.max_fee_per_blob_gas)); } + _ => todo!(), }; Ok(()) } diff --git a/lib/src/builder/mod.rs b/lib/src/builder/mod.rs index aeaca08e..100ca16d 100644 --- a/lib/src/builder/mod.rs +++ b/lib/src/builder/mod.rs @@ -24,7 +24,7 @@ use crate::{ initialize::{DbInitStrategy, MemDbInitStrategy}, prepare::{HeaderPrepStrategy, TaikoHeaderPrepStrategy}, }, - consts::{get_network_spec, ChainSpec}, + consts::ChainSpec, input::GuestInput, mem_db::MemDb, }; @@ -35,9 +35,10 @@ mod initialize; pub mod prepare; /// Optimistic database +#[allow(async_fn_in_trait)] pub trait OptimisticDatabase { /// Handle post execution work - fn fetch_data(&mut self) -> bool; + async fn fetch_data(&mut self) -> bool; /// If the current database is optimistic fn is_optimistic(&self) -> bool; @@ -60,7 +61,7 @@ where /// Creates a new block builder. pub fn new(input: &GuestInput) -> BlockBuilder { BlockBuilder { - chain_spec: get_network_spec(input.network), + chain_spec: input.chain_spec.clone(), db: None, header: None, input: input.clone(), diff --git a/lib/src/builder/prepare.rs b/lib/src/builder/prepare.rs index 8a8e29c6..9a8ab6ca 100644 --- a/lib/src/builder/prepare.rs +++ b/lib/src/builder/prepare.rs @@ -57,15 +57,15 @@ impl HeaderPrepStrategy for TaikoHeaderPrepStrategy { number: number .checked_add(1) .with_context(|| "Invalid block number: too large")?, - base_fee_per_gas: Some(block_builder.input.base_fee_per_gas), + base_fee_per_gas: Some(block_builder.input.base_fee_per_gas.into()), // Initialize metadata from input beneficiary: block_builder.input.beneficiary, - gas_limit: block_builder.input.gas_limit, + gas_limit: block_builder.input.gas_limit.into(), timestamp: block_builder.input.timestamp, mix_hash: block_builder.input.mix_hash, extra_data: block_builder.input.extra_data.clone(), - blob_gas_used: block_builder.input.blob_gas_used, - excess_blob_gas: block_builder.input.excess_blob_gas, + blob_gas_used: block_builder.input.blob_gas_used.map(|b| b.into()), + excess_blob_gas: block_builder.input.excess_blob_gas.map(|b| b.into()), parent_beacon_block_root: block_builder.input.parent_beacon_block_root, // do not fill the remaining fields ..Default::default() diff --git a/lib/src/consts.rs b/lib/src/consts.rs index d7f30233..667b92f2 100644 --- a/lib/src/consts.rs +++ b/lib/src/consts.rs @@ -46,6 +46,7 @@ lazy_static! { /// The Ethereum mainnet specification. pub static ref ETH_MAINNET_CHAIN_SPEC: ChainSpec = ChainSpec { + name: Network::Ethereum.to_string(), chain_id: 1, max_spec_id: SpecId::CANCUN, hard_forks: BTreeMap::from([ @@ -66,11 +67,13 @@ lazy_static! { sgx_verifier_address: None, genesis_time: 0u64, seconds_per_slot: 1u64, + is_taiko: false, }; /// The Ethereum testnet "holesky" specification. pub static ref ETH_HOLESKY_CHAIN_SPEC: ChainSpec = ChainSpec { + name: Network::Holesky.to_string(), chain_id: 17000, max_spec_id: SpecId::CANCUN, hard_forks: BTreeMap::from([ @@ -90,10 +93,12 @@ lazy_static! { sgx_verifier_address: None, genesis_time: 0u64, seconds_per_slot: 1u64, + is_taiko: false, }; /// The Taiko A6 specification. pub static ref TAIKO_A6_CHAIN_SPEC: ChainSpec = ChainSpec { + name: Network::TaikoA6.to_string(), chain_id: 167008, max_spec_id: SpecId::SHANGHAI, hard_forks: BTreeMap::from([ @@ -113,10 +118,12 @@ lazy_static! { ), genesis_time: 0u64, seconds_per_slot: 1u64, + is_taiko: true, }; /// The Taiko A7 specification. pub static ref TAIKO_A7_CHAIN_SPEC: ChainSpec = ChainSpec { + name: Network::TaikoA7.to_string(), chain_id: 167009, max_spec_id: SpecId::SHANGHAI, hard_forks: BTreeMap::from([ @@ -136,6 +143,7 @@ lazy_static! { ), genesis_time: 1695902400u64, seconds_per_slot: 12u64, + is_taiko: true, }; } @@ -194,6 +202,7 @@ impl Default for Eip1559Constants { /// Specification of a specific chain. #[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct ChainSpec { + pub name: String, pub chain_id: ChainId, pub max_spec_id: SpecId, pub hard_forks: BTreeMap, @@ -203,16 +212,20 @@ pub struct ChainSpec { pub sgx_verifier_address: Option
, pub genesis_time: u64, pub seconds_per_slot: u64, + pub is_taiko: bool, } impl ChainSpec { /// Creates a new configuration consisting of only one specification ID. pub fn new_single( + name: String, chain_id: ChainId, spec_id: SpecId, eip_1559_constants: Eip1559Constants, + is_taiko: bool, ) -> Self { ChainSpec { + name, chain_id, max_spec_id: spec_id, hard_forks: BTreeMap::from([(spec_id, ForkCondition::Block(0))]), @@ -222,6 +235,7 @@ impl ChainSpec { sgx_verifier_address: None, genesis_time: 0u64, seconds_per_slot: 1u64, + is_taiko, } } /// Returns the network chain ID. @@ -255,6 +269,14 @@ impl ChainSpec { } None } + + pub fn is_taiko(&self) -> bool { + self.is_taiko + } + + pub fn network(&self) -> Option { + Network::from_str(&self.name).ok() + } } #[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq, Eq)] diff --git a/lib/src/input.rs b/lib/src/input.rs index 8bcf6d36..99f54886 100644 --- a/lib/src/input.rs +++ b/lib/src/input.rs @@ -26,7 +26,7 @@ use serde_with::serde_as; #[cfg(not(feature = "std"))] use crate::no_std::*; -use crate::{consts::Network, serde_with::RlpBytes}; +use crate::{consts::ChainSpec, serde_with::RlpBytes}; /// Represents the state of an account's storage. /// The storage trie together with the used storage slots allow us to reconstruct all the @@ -38,13 +38,16 @@ pub type StorageEntry = (MptNode, Vec); #[derive(Debug, Clone, Default, Deserialize, Serialize)] pub struct GuestInput { /// The network to generate the proof for - pub network: Network, + pub chain_spec: ChainSpec, /// Block number pub block_number: u64, /// Block gas used pub gas_used: u64, /// Block hash - for reference! - pub block_hash: B256, + pub block_hash_reference: B256, + /// Block header - for reference! + #[serde_as(as = "RlpBytes")] + pub block_header_reference: AlloyConsensusHeader, /// Previous block header #[serde_as(as = "RlpBytes")] pub parent_header: AlloyConsensusHeader, @@ -178,7 +181,7 @@ sol! { bytes32 graffiti; } - #[derive(Debug, Default, Clone, Deserialize, Serialize)] + #[derive(Debug, Default, Deserialize, Serialize)] event BlockProposed( uint256 indexed blockId, address indexed assignedProver, @@ -261,7 +264,7 @@ pub mod taiko_a6 { bytes32 graffiti; } - #[derive(Debug, Default, Clone, Deserialize, Serialize)] + #[derive(Debug, Default, Deserialize, Serialize)] event BlockProposed( uint256 indexed blockId, address indexed assignedProver, diff --git a/lib/src/mem_db.rs b/lib/src/mem_db.rs index 4c2bd98a..95dd46a4 100644 --- a/lib/src/mem_db.rs +++ b/lib/src/mem_db.rs @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. use anyhow::anyhow; -use hashbrown::{hash_map::Entry, HashMap}; use raiko_primitives::{Address, B256, U256}; use revm::{ primitives::{Account, AccountInfo, Bytecode}, Database, DatabaseCommit, }; use serde::{Deserialize, Serialize}; +use std::collections::{hash_map::Entry, HashMap}; use thiserror_no_std::Error as ThisError; use crate::builder::OptimisticDatabase; @@ -283,7 +283,7 @@ impl DatabaseCommit for MemDb { } impl OptimisticDatabase for MemDb { - fn fetch_data(&mut self) -> bool { + async fn fetch_data(&mut self) -> bool { true } diff --git a/lib/src/protocol_instance.rs b/lib/src/protocol_instance.rs index 6b6a78bb..e715de25 100644 --- a/lib/src/protocol_instance.rs +++ b/lib/src/protocol_instance.rs @@ -10,7 +10,6 @@ use super::utils::ANCHOR_GAS_LIMIT; #[cfg(not(feature = "std"))] use crate::no_std::*; use crate::{ - consts::get_network_spec, input::{BlockMetadata, EthDeposit, GuestInput, Transition}, utils::HeaderHasher, }; @@ -125,8 +124,7 @@ pub fn assemble_protocol_instance( }) .collect::>(); - let chain_spec = get_network_spec(input.network); - let gas_limit: u64 = header.gas_limit; + let gas_limit: u64 = header.gas_limit.try_into().unwrap(); let pi = ProtocolInstance { transition: Transition { parentHash: header.parent_hash, @@ -142,7 +140,12 @@ pub fn assemble_protocol_instance( depositsHash: keccak(deposits.abi_encode()).into(), coinbase: header.beneficiary, id: header.number, - gasLimit: (gas_limit - ANCHOR_GAS_LIMIT) as u32, + gasLimit: (gas_limit + - if input.chain_spec.is_taiko() { + ANCHOR_GAS_LIMIT + } else { + 0 + }) as u32, timestamp: header.timestamp, l1Height: input.taiko.l1_header.number, minTier: input.taiko.block_proposed.meta.minTier, @@ -151,12 +154,12 @@ pub fn assemble_protocol_instance( sender: input.taiko.block_proposed.meta.sender, }, prover: input.taiko.prover_data.prover, - chain_id: chain_spec.chain_id, - sgx_verifier_address: chain_spec.sgx_verifier_address.unwrap_or_default(), + chain_id: input.chain_spec.chain_id, + sgx_verifier_address: input.chain_spec.sgx_verifier_address.unwrap_or_default(), }; // Sanity check - if input.network.is_taiko() { + if input.chain_spec.is_taiko() { ensure!( pi.block_metadata.abi_encode() == input.taiko.block_proposed.meta.abi_encode(), format!( diff --git a/lib/src/prover.rs b/lib/src/prover.rs index 8f8496db..0e2eec91 100644 --- a/lib/src/prover.rs +++ b/lib/src/prover.rs @@ -32,11 +32,11 @@ pub type ProverResult = core::result::Result; pub type ProverConfig = serde_json::Value; pub type Proof = serde_json::Value; +#[allow(async_fn_in_trait)] pub trait Prover { - #[allow(async_fn_in_trait)] async fn run( input: GuestInput, - output: GuestOutput, + output: &GuestOutput, config: &ProverConfig, ) -> ProverResult; diff --git a/lib/src/utils.rs b/lib/src/utils.rs index b1263bb0..23dbf3c2 100644 --- a/lib/src/utils.rs +++ b/lib/src/utils.rs @@ -1,6 +1,7 @@ use core::str::FromStr; // TODO(Cecilia): fix for no-std use std::io::Read; +use std::io::Write; use alloy_consensus::{Header as AlloyConsensusHeader, Signed, TxEip1559, TxEnvelope}; use alloy_primitives::{uint, Address, Signature, TxKind, U256}; @@ -9,12 +10,13 @@ use alloy_rpc_types::{Header as AlloyHeader, Transaction as AlloyTransaction}; use anyhow::{anyhow, bail, ensure, Context, Result}; use lazy_static::lazy_static; use libflate::zlib::Decoder as zlibDecoder; +use libflate::zlib::Encoder as zlibEncoder; use raiko_primitives::{keccak256, B256}; #[cfg(not(feature = "std"))] use crate::no_std::*; use crate::{ - consts::{get_network_spec, Network}, + consts::Network, input::{decode_anchor, GuestInput}, }; @@ -59,9 +61,9 @@ pub fn generate_transactions( // Decode the tx list from the raw data posted onchain let tx_list = &if is_blob_data { let compressed_tx_list = decode_blob_data(tx_list); - zlib_decompress_blob(&compressed_tx_list).unwrap_or_default() + zlib_decompress_data(&compressed_tx_list).unwrap_or_default() } else if validate_calldata_tx_list(tx_list) { - zlib_decompress_blob(tx_list).unwrap_or_default() + zlib_decompress_data(tx_list).unwrap_or_default() } else { vec![] }; @@ -205,13 +207,20 @@ fn reassemble_bytes( opos } -fn zlib_decompress_blob(blob: &[u8]) -> Result> { - let mut decoder = zlibDecoder::new(blob)?; +pub fn zlib_decompress_data(data: &[u8]) -> Result> { + let mut decoder = zlibDecoder::new(data)?; let mut decoded_buf = Vec::new(); decoder.read_to_end(&mut decoded_buf)?; Ok(decoded_buf) } +pub fn zlib_compress_data(data: &[u8]) -> Result> { + let mut encoder = zlibEncoder::new(Vec::new())?; + encoder.write_all(data).unwrap(); + let res = encoder.finish().into_result()?; + Ok(res.clone()) +} + /// check the anchor signature with fixed K value fn check_anchor_signature(anchor: &Signed) -> Result<()> { let sign = anchor.signature(); @@ -239,12 +248,7 @@ fn check_anchor_signature(anchor: &Signed) -> Result<()> { )) } -pub fn check_anchor_tx( - input: &GuestInput, - anchor: &TxEnvelope, - from: &Address, - network: Network, -) -> Result<()> { +pub fn check_anchor_tx(input: &GuestInput, anchor: &TxEnvelope, from: &Address) -> Result<()> { match anchor { TxEnvelope::Eip1559(tx) => { // Check the signature @@ -265,7 +269,7 @@ pub fn check_anchor_tx( ); // Check that the L2 contract is being called ensure!( - to == get_network_spec(network).l2_contract.unwrap(), + to == input.chain_spec.l2_contract.unwrap(), "anchor transaction to mismatch" ); // Tx can't have any ETH attached @@ -275,7 +279,7 @@ pub fn check_anchor_tx( ); // Tx needs to have the expected gas limit ensure!( - tx.gas_limit == ANCHOR_GAS_LIMIT, + tx.gas_limit == ANCHOR_GAS_LIMIT.into(), "anchor transaction gas price mismatch" ); // Check needs to have the base fee set to the block base fee @@ -291,7 +295,7 @@ pub fn check_anchor_tx( anchor_call.l1Hash == input.taiko.l1_header.hash(), "L1 hash mismatch" ); - if network == Network::TaikoA7 { + if input.chain_spec.network().unwrap() == Network::TaikoA7 { ensure!( anchor_call.l1StateRoot == input.taiko.l1_header.state_root, "L1 state root mismatch" @@ -345,8 +349,14 @@ pub fn to_header(header: &AlloyHeader) -> AlloyConsensusHeader { timestamp: header.timestamp.try_into().unwrap(), extra_data: header.extra_data.clone(), mix_hash: header.mix_hash.unwrap(), - nonce: u64::from_be_bytes(header.nonce.unwrap().0), - base_fee_per_gas: Some(header.base_fee_per_gas.unwrap().try_into().unwrap()), + nonce: header.nonce.unwrap(), + base_fee_per_gas: Some( + header + .base_fee_per_gas + .unwrap_or_default() + .try_into() + .unwrap(), + ), withdrawals_root: header.withdrawals_root, blob_gas_used: header.blob_gas_used.map(|x| x.try_into().unwrap()), excess_blob_gas: header.excess_blob_gas.map(|x| x.try_into().unwrap()), diff --git a/makefile b/makefile index 0fb5fcff..47190d41 100644 --- a/makefile +++ b/makefile @@ -15,5 +15,5 @@ fmt: @cargo fmt --all --check clippy: - @cargo +nightly-2024-02-06 check --features "sgx,sp1,risc0" - @cargo +nightly-2024-02-06 clippy --workspace --features "sgx,sp1,risc0" --all-targets -- -Dwarnings + @cargo +nightly-2024-04-17 check --features "sgx,sp1,risc0" + @cargo +nightly-2024-04-17 clippy --workspace --features "sgx,sp1,risc0" --all-targets -- -Dwarnings diff --git a/prove_block.sh b/prove_block.sh index 35c549c7..bdc780c0 100755 --- a/prove_block.sh +++ b/prove_block.sh @@ -95,6 +95,7 @@ if [ "$rangeStart" == "sync" ]; then sync="true" rangeStart=$(getBlockNumber) rangeEnd=$((rangeStart + 1000000)) + sleep 1.0 fi if [ "$rangeStart" == "" ]; then @@ -118,6 +119,8 @@ for block in $(eval echo {$rangeStart..$rangeEnd}); do sleep 0.1 # Wait for 100ms block_number=$(getBlockNumber) # Query again to get the updated block number done + # Sleep a bit longer because sometimes the block data isn't available yet + sleep 1.0 fi echo "- proving block $block" diff --git a/provers/risc0/driver/rust-toolchain.toml b/provers/risc0/driver/rust-toolchain.toml index e6111854..43ead7bf 100644 --- a/provers/risc0/driver/rust-toolchain.toml +++ b/provers/risc0/driver/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "stable" +channel = "nightly-2024-04-17" components = ["clippy", "rustfmt", "rust-src"] profile = "minimal" \ No newline at end of file diff --git a/provers/risc0/driver/src/lib.rs b/provers/risc0/driver/src/lib.rs index f74b3350..f33f3bc3 100644 --- a/provers/risc0/driver/src/lib.rs +++ b/provers/risc0/driver/src/lib.rs @@ -48,7 +48,7 @@ use serde_json::json; impl Prover for Risc0Prover { async fn run( input: GuestInput, - output: GuestOutput, + output: &GuestOutput, config: &ProverConfig, ) -> ProverResult { println!("config: {:?}", config); diff --git a/provers/risc0/guest/Cargo.lock b/provers/risc0/guest/Cargo.lock index 6d417210..535df5c6 100644 --- a/provers/risc0/guest/Cargo.lock +++ b/provers/risc0/guest/Cargo.lock @@ -16,9 +16,9 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -28,28 +28,29 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-consensus" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", "alloy-serde", + "c-kzg", "serde", "sha2", ] [[package]] name = "alloy-dyn-abi" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "872f239c15befa27cc4f0d3d82a70b3365c2d0202562bf906eb93b299fa31882" +checksum = "545885d9b0b2c30fd344ae291439b4bfe59e48dd62fbc862f8503d98088967dc" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -57,13 +58,13 @@ dependencies = [ "alloy-sol-types", "const-hex", "itoa", - "winnow 0.6.5", + "winnow 0.6.8", ] [[package]] name = "alloy-eips" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -76,18 +77,19 @@ dependencies = [ [[package]] name = "alloy-genesis" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "alloy-serde", "serde", + "serde_json", ] [[package]] name = "alloy-json-abi" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a35ddfd27576474322a5869e4c123e5f3e7b2177297c18e4e82ea501cb125b" +checksum = "786689872ec4e7d354810ab0dffd48bb40b838c047522eb031cbd47d15634849" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -97,18 +99,19 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "serde", "serde_json", "thiserror", + "tracing", ] [[package]] name = "alloy-network" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-consensus", "alloy-eips", @@ -116,17 +119,17 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types", "alloy-signer", + "alloy-sol-types", "async-trait", "futures-utils-wasm", - "serde", "thiserror", ] [[package]] name = "alloy-primitives" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99bbad0a6b588ef4aec1b5ddbbfdacd9ef04e00b979617765b03174318ee1f3a" +checksum = "525448f6afc1b70dd0f9d0a8145631bf2f5e434678ab23ab18409ca264cae6b3" dependencies = [ "alloy-rlp", "bytes", @@ -163,13 +166,13 @@ checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-consensus", "alloy-eips", @@ -187,7 +190,7 @@ dependencies = [ [[package]] name = "alloy-serde" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "serde", @@ -197,7 +200,7 @@ dependencies = [ [[package]] name = "alloy-signer" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "async-trait", @@ -209,9 +212,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452d929748ac948a10481fff4123affead32c553cf362841c5103dd508bdfc16" +checksum = "89c80a2cb97e7aa48611cbb63950336f9824a174cdf670527cc6465078a26ea1" dependencies = [ "alloy-sol-macro-input", "const-hex", @@ -220,40 +223,40 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df64e094f6d2099339f9e82b5b38440b159757b6920878f28316243f8166c8d1" +checksum = "c58894b58ac50979eeac6249661991ac40b9d541830d9a725f7714cc9ef08c23" dependencies = [ "const-hex", "dunce", "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715f4d09a330cc181fc7c361b5c5c2766408fa59a0bac60349dcb7baabd404cc" +checksum = "7da8e71ea68e780cc203919e03f69f59e7afe92d2696fb1dcb6662f61e4031b6" dependencies = [ - "winnow 0.6.5", + "winnow 0.6.8", ] [[package]] name = "alloy-sol-types" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bc2d6dfc2a19fd56644494479510f98b1ee929e04cf0d4aa45e98baa3e545b" +checksum = "399287f68d1081ed8b1f4903c49687658b95b142207d7cb4ae2f4813915343ef" dependencies = [ "alloy-primitives", "alloy-sol-macro", @@ -277,9 +280,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "ark-bn254" @@ -523,20 +526,20 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] name = "aurora-engine-modexp" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfacad86e9e138fca0670949eb8ed4ffdf73a55bded8887efe0863cd1a3a6f70" +checksum = "0aef7712851e524f35fbbb74fa6599c5cd8692056a1c36f9ca0d2001b670e7e5" dependencies = [ "hex", "num", @@ -550,14 +553,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "base16ct" @@ -567,9 +570,9 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -655,9 +658,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -682,7 +685,7 @@ checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -717,7 +720,7 @@ dependencies = [ [[package]] name = "c-kzg-taiko" version = "1.0.0" -source = "git+https://github.com/smtmfft/c-kzg-4844?branch=for-alpha7#5c1ba94f98c2d9e0f68b550f7528c2f6cc2285a7" +source = "git+https://github.com/smtmfft/c-kzg-4844?branch=for-alpha7#77e9ba0a65e10e6a470832da2914b17a968da791" dependencies = [ "blst", "cc", @@ -728,9 +731,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.90" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" [[package]] name = "cfg-if" @@ -740,9 +743,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -858,7 +861,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -869,7 +872,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -880,9 +883,9 @@ checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -945,9 +948,9 @@ dependencies = [ [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dunce" @@ -977,9 +980,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "elf" @@ -1015,7 +1018,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -1036,9 +1039,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fastrlp" @@ -1076,9 +1079,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -1124,9 +1127,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1174,9 +1177,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1302,7 +1305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -1382,15 +1385,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libflate" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7d5654ae1795afc7ff76f4365c2c8791b0feb18e8996a96adad8ffd7c3b2bf" +checksum = "45d9dfdc14ea4ef0900c1cddbc8dcd553fbaacd8a4a282cf4018ae9dd04fb21e" dependencies = [ "adler32", "core2", @@ -1401,12 +1404,12 @@ dependencies = [ [[package]] name = "libflate_lz77" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5f52fb8c451576ec6b79d3f4deb327398bc05bbdbd99021a6e77a4c855d524" +checksum = "e6e0d73b369f386f1c44abd9c570d5318f55ccde816ff4b562fa452e5182863d" dependencies = [ "core2", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "rle-decode-fast", ] @@ -1445,9 +1448,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +checksum = "3135b08af27d103b0a51f2ae0f8632117b7b185ccf931445affa8df530576a41" dependencies = [ "num-bigint", "num-complex", @@ -1491,7 +1494,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -1505,9 +1508,9 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -1528,9 +1531,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -1572,7 +1575,7 @@ version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 2.0.2", "proc-macro2", "quote", "syn 1.0.109", @@ -1592,9 +1595,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.8" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -1603,9 +1606,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pkcs8" @@ -1640,6 +1643,16 @@ dependencies = [ "uint", ] +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + [[package]] name = "proc-macro-crate" version = "2.0.2" @@ -1647,7 +1660,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ "toml_datetime", - "toml_edit", + "toml_edit 0.20.2", ] [[package]] @@ -1676,9 +1689,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -1711,9 +1724,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1739,7 +1752,7 @@ dependencies = [ "c-kzg-taiko", "chrono", "flate2", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "lazy_static", "libflate", @@ -1768,7 +1781,7 @@ dependencies = [ "alloy-rpc-types", "alloy-sol-types", "anyhow", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "revm-primitives", "rlp", "serde", @@ -1823,8 +1836,8 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "revm" -version = "7.2.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "8.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "auto_impl", "cfg-if", @@ -1832,12 +1845,13 @@ dependencies = [ "revm-interpreter", "revm-precompile", "serde", + "serde_json", ] [[package]] name = "revm-interpreter" -version = "3.4.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "4.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "revm-primitives", "serde", @@ -1845,14 +1859,16 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "5.1.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "6.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "aurora-engine-modexp", + "c-kzg", "k256", "once_cell", "revm-primitives", "ripemd", + "secp256k1", "sha2", "sp1-precompiles", "substrate-bn", @@ -1860,8 +1876,8 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "3.1.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "3.1.1" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "alloy-primitives", "auto_impl", @@ -1871,7 +1887,7 @@ dependencies = [ "cfg-if", "dyn-clone", "enumn", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "serde", ] @@ -2114,9 +2130,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags", "errno", @@ -2143,6 +2159,30 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +[[package]] +name = "scale-info" +version = "2.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" +dependencies = [ + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "sec1" version = "0.7.3" @@ -2157,6 +2197,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "secp256k1" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +dependencies = [ + "rand", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +dependencies = [ + "cc", +] + [[package]] name = "semver" version = "0.11.0" @@ -2183,30 +2242,31 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.197" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -2214,9 +2274,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ "base64", "chrono", @@ -2232,14 +2292,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -2283,18 +2343,31 @@ dependencies = [ "rand_core", ] +[[package]] +name = "snowbridge-amcl" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460a9ed63cdf03c1b9847e8a12a5f5ba19c4efd5869e4a737e05be25d7c427e5" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + [[package]] name = "sp1-precompiles" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git#14bd4b2e9a2fdafc5667bfb0472dd382046e2521" +source = "git+https://github.com/succinctlabs/sp1.git#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" dependencies = [ "anyhow", "bincode", "cfg-if", "getrandom", + "hex", "k256", + "num", "rand", "serde", + "snowbridge-amcl", ] [[package]] @@ -2357,9 +2430,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.55" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -2368,14 +2441,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4497156948bd342b52038035a6fa514a89626e37af9d2c52a5e8d8ebcc7ee479" +checksum = "5aa0cefd02f532035d83cfec82647c6eb53140b0485220760e669f4bad489e36" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -2398,22 +2471,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -2447,9 +2520,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -2468,9 +2541,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -2506,6 +2579,17 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + [[package]] name = "toml_edit" version = "0.20.2" @@ -2537,7 +2621,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -2669,7 +2753,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", "wasm-bindgen-shared", ] @@ -2691,7 +2775,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2722,13 +2806,14 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", + "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", @@ -2737,45 +2822,51 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" @@ -2788,9 +2879,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" [[package]] name = "wyz" @@ -2803,22 +2894,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "087eca3c1eaf8c47b94d02790dd086cd594b912d2043d4de4bfdd466b3befb7c" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "6f4b6c273f496d8fd4eaf18853e6b448760225dc030ff2c485a786859aea6393" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -2838,7 +2929,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[patch.unused]] diff --git a/provers/sgx/prover/src/lib.rs b/provers/sgx/prover/src/lib.rs index 6880a549..c7ea9ef2 100644 --- a/provers/sgx/prover/src/lib.rs +++ b/provers/sgx/prover/src/lib.rs @@ -59,7 +59,7 @@ pub struct SgxProver; impl Prover for SgxProver { async fn run( input: GuestInput, - _output: GuestOutput, + _output: &GuestOutput, config: &ProverConfig, ) -> ProverResult { let sgx_param = SgxParam::deserialize(config.get("sgx").unwrap()).unwrap(); diff --git a/provers/sgx/prover/src/sgx_register_utils.rs b/provers/sgx/prover/src/sgx_register_utils.rs index 1e4f079f..1ce06f10 100644 --- a/provers/sgx/prover/src/sgx_register_utils.rs +++ b/provers/sgx/prover/src/sgx_register_utils.rs @@ -6,7 +6,10 @@ use alloy_signer::Signer; use alloy_sol_types::sol; use alloy_transport_http::Http; use pem::parse_many; -use raiko_primitives::{hex, Address, Bytes, FixedBytes, U256}; +use raiko_primitives::{ + alloy_eips::{BlockId, BlockNumberOrTag}, + hex, Address, Bytes, FixedBytes, U256, +}; use url::Url; sol! { @@ -244,20 +247,21 @@ pub async fn register_sgx_instance( // init rpc conn let http = Http::new(Url::parse(l1_rpc_url).expect("invalid rpc url")); let provider = ProviderBuilder::new() + .with_recommended_fillers() .signer(EthereumSigner::from(wallet.clone())) - .with_recommended_layers() - .provider(RootProvider::new(RpcClient::new(http, false))); + .on_provider(RootProvider::new(RpcClient::new(http, false))); let sgx_verifier_contract = SgxVerifier::new(sgx_verifier_addr, &provider); // init account - let balance = provider.get_balance(wallet.address(), None).await?; + let tag = BlockId::Number(BlockNumberOrTag::Latest); + let balance = provider.get_balance(wallet.address(), tag).await?; let nonce = provider - .get_transaction_count(wallet.address(), None) + .get_transaction_count(wallet.address(), tag) .await?; let gas_price = provider.get_gas_price().await?; - let gas_limit = U256::from(4000000u64); + let gas_limit = 4000000u128; assert!( - balance > gas_price * gas_limit, + balance > U256::from(gas_price * gas_limit), "insufficient balance to send tx" ); @@ -265,7 +269,7 @@ pub async fn register_sgx_instance( let call_builder = sgx_verifier_contract .registerInstance(parsed_quote) .from(wallet.address()) - .nonce(nonce.as_limbs()[0]) + .nonce(nonce) .value(U256::from(0)) .gas_price(gas_price) .gas(gas_limit); diff --git a/provers/sp1/driver/rust-toolchain.toml b/provers/sp1/driver/rust-toolchain.toml index 6718f2d2..3a306210 100644 --- a/provers/sp1/driver/rust-toolchain.toml +++ b/provers/sp1/driver/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-02-06" +channel = "nightly-2024-04-17" components = ["llvm-tools", "rustc-dev"] \ No newline at end of file diff --git a/provers/sp1/driver/src/lib.rs b/provers/sp1/driver/src/lib.rs index d80761b5..a945aab6 100644 --- a/provers/sp1/driver/src/lib.rs +++ b/provers/sp1/driver/src/lib.rs @@ -26,7 +26,7 @@ pub struct Sp1Prover; impl Prover for Sp1Prover { async fn run( input: GuestInput, - _output: GuestOutput, + _output: &GuestOutput, _config: &ProverConfig, ) -> ProverResult { // Write the input. @@ -35,14 +35,15 @@ impl Prover for Sp1Prover { // Generate the proof for the given program. let client = ProverClient::new(); - let mut proof = client.prove(ELF, stdin).expect("Sp1: proving failed"); + let (pk, vk) = client.setup(ELF); + let mut proof = client.prove(&pk, stdin).expect("Sp1: proving failed"); // Read the output. let output = proof.public_values.read::(); // Verify proof. client - .verify(ELF, &proof) + .verify(&proof, &vk) .expect("Sp1: verification failed"); // Save the proof. @@ -81,8 +82,9 @@ fn test_example() { let mut stdin = SP1Stdin::new(); stdin.write(&GuestInput::default()); - let mut proof = client.prove(TEST_ELF, stdin).expect("Sp1: proving failed"); + let (pk, vk) = client.setup(TEST_ELF); + let mut proof = client.prove(&pk, stdin).expect("Sp1: proving failed"); client - .verify(TEST_ELF, &proof) + .verify(&proof, &vk) .expect("Sp1: verification failed"); } diff --git a/provers/sp1/guest/Cargo.lock b/provers/sp1/guest/Cargo.lock index 235f0707..70eb4ec4 100644 --- a/provers/sp1/guest/Cargo.lock +++ b/provers/sp1/guest/Cargo.lock @@ -35,21 +35,22 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-consensus" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", "alloy-serde", + "c-kzg", "serde", "sha2", ] [[package]] name = "alloy-dyn-abi" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "872f239c15befa27cc4f0d3d82a70b3365c2d0202562bf906eb93b299fa31882" +checksum = "545885d9b0b2c30fd344ae291439b4bfe59e48dd62fbc862f8503d98088967dc" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -57,13 +58,13 @@ dependencies = [ "alloy-sol-types", "const-hex", "itoa", - "winnow 0.6.6", + "winnow 0.6.8", ] [[package]] name = "alloy-eips" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -76,18 +77,19 @@ dependencies = [ [[package]] name = "alloy-genesis" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "alloy-serde", "serde", + "serde_json", ] [[package]] name = "alloy-json-abi" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a35ddfd27576474322a5869e4c123e5f3e7b2177297c18e4e82ea501cb125b" +checksum = "786689872ec4e7d354810ab0dffd48bb40b838c047522eb031cbd47d15634849" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -97,18 +99,19 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "serde", "serde_json", "thiserror", + "tracing", ] [[package]] name = "alloy-network" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-consensus", "alloy-eips", @@ -116,17 +119,17 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types", "alloy-signer", + "alloy-sol-types", "async-trait", "futures-utils-wasm", - "serde", "thiserror", ] [[package]] name = "alloy-primitives" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99bbad0a6b588ef4aec1b5ddbbfdacd9ef04e00b979617765b03174318ee1f3a" +checksum = "525448f6afc1b70dd0f9d0a8145631bf2f5e434678ab23ab18409ca264cae6b3" dependencies = [ "alloy-rlp", "bytes", @@ -163,13 +166,13 @@ checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-consensus", "alloy-eips", @@ -187,7 +190,7 @@ dependencies = [ [[package]] name = "alloy-serde" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "serde", @@ -197,7 +200,7 @@ dependencies = [ [[package]] name = "alloy-signer" version = "0.1.0" -source = "git+https://github.com/brechtpd/alloy?branch=175#55a8fb3b1cee4a867851eb19bef0b71e26859d27" +source = "git+https://github.com/brechtpd/alloy?branch=175_4e22b9e#5f972199a8208969e838203c3db48f467c629d49" dependencies = [ "alloy-primitives", "async-trait", @@ -209,9 +212,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452d929748ac948a10481fff4123affead32c553cf362841c5103dd508bdfc16" +checksum = "89c80a2cb97e7aa48611cbb63950336f9824a174cdf670527cc6465078a26ea1" dependencies = [ "alloy-sol-macro-input", "const-hex", @@ -220,40 +223,40 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df64e094f6d2099339f9e82b5b38440b159757b6920878f28316243f8166c8d1" +checksum = "c58894b58ac50979eeac6249661991ac40b9d541830d9a725f7714cc9ef08c23" dependencies = [ "const-hex", "dunce", "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715f4d09a330cc181fc7c361b5c5c2766408fa59a0bac60349dcb7baabd404cc" +checksum = "7da8e71ea68e780cc203919e03f69f59e7afe92d2696fb1dcb6662f61e4031b6" dependencies = [ - "winnow 0.6.6", + "winnow 0.6.8", ] [[package]] name = "alloy-sol-types" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bc2d6dfc2a19fd56644494479510f98b1ee929e04cf0d4aa45e98baa3e545b" +checksum = "399287f68d1081ed8b1f4903c49687658b95b142207d7cb4ae2f4813915343ef" dependencies = [ "alloy-primitives", "alloy-sol-macro", @@ -277,9 +280,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "ark-ff" @@ -419,14 +422,14 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] name = "aurora-engine-modexp" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfacad86e9e138fca0670949eb8ed4ffdf73a55bded8887efe0863cd1a3a6f70" +checksum = "0aef7712851e524f35fbbb74fa6599c5cd8692056a1c36f9ca0d2001b670e7e5" dependencies = [ "hex", "num", @@ -440,14 +443,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "base16ct" @@ -457,9 +460,9 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -578,7 +581,7 @@ dependencies = [ [[package]] name = "c-kzg-taiko" version = "1.0.0" -source = "git+https://github.com/smtmfft/c-kzg-4844?branch=for-alpha7#5c1ba94f98c2d9e0f68b550f7528c2f6cc2285a7" +source = "git+https://github.com/smtmfft/c-kzg-4844?branch=for-alpha7#77e9ba0a65e10e6a470832da2914b17a968da791" dependencies = [ "blst", "cc", @@ -589,9 +592,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.94" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" [[package]] name = "cfg-if" @@ -719,7 +722,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -730,7 +733,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -864,7 +867,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -885,9 +888,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fastrlp" @@ -925,9 +928,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -973,9 +976,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1014,18 +1017,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1151,7 +1145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -1232,15 +1226,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libflate" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7d5654ae1795afc7ff76f4365c2c8791b0feb18e8996a96adad8ffd7c3b2bf" +checksum = "45d9dfdc14ea4ef0900c1cddbc8dcd553fbaacd8a4a282cf4018ae9dd04fb21e" dependencies = [ "adler32", "core2", @@ -1251,12 +1245,12 @@ dependencies = [ [[package]] name = "libflate_lz77" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5f52fb8c451576ec6b79d3f4deb327398bc05bbdbd99021a6e77a4c855d524" +checksum = "e6e0d73b369f386f1c44abd9c570d5318f55ccde816ff4b562fa452e5182863d" dependencies = [ "core2", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "rle-decode-fast", ] @@ -1344,9 +1338,9 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -1367,9 +1361,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -1411,7 +1405,7 @@ version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 2.0.2", "proc-macro2", "quote", "syn 1.0.109", @@ -1431,15 +1425,21 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.9" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", "ucd-trie", ] +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + [[package]] name = "pkcs8" version = "0.10.2" @@ -1473,6 +1473,16 @@ dependencies = [ "uint", ] +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + [[package]] name = "proc-macro-crate" version = "2.0.2" @@ -1480,7 +1490,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ "toml_datetime", - "toml_edit", + "toml_edit 0.20.2", ] [[package]] @@ -1509,9 +1519,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -1572,7 +1582,7 @@ dependencies = [ "c-kzg-taiko", "chrono", "flate2", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "lazy_static", "libflate", @@ -1601,7 +1611,7 @@ dependencies = [ "alloy-rpc-types", "alloy-sol-types", "anyhow", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "revm-primitives", "rlp", "serde", @@ -1656,8 +1666,8 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "revm" -version = "7.2.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "8.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "auto_impl", "cfg-if", @@ -1665,12 +1675,13 @@ dependencies = [ "revm-interpreter", "revm-precompile", "serde", + "serde_json", ] [[package]] name = "revm-interpreter" -version = "3.4.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "4.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "revm-primitives", "serde", @@ -1678,14 +1689,16 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "5.1.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "6.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "aurora-engine-modexp", + "c-kzg", "k256", "once_cell", "revm-primitives", "ripemd", + "secp256k1", "sha2", "sp1-precompiles", "substrate-bn", @@ -1693,8 +1706,8 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "3.1.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=fix-ecrecover#8d1d50fb5f0840811613feb565ad1dc56cab1cbc" +version = "3.1.1" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko#f2cc49f87cb3bd2bc2b5be2e93f3a25aa930f414" dependencies = [ "alloy-primitives", "auto_impl", @@ -1704,7 +1717,7 @@ dependencies = [ "cfg-if", "dyn-clone", "enumn", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "serde", ] @@ -1800,9 +1813,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags", "errno", @@ -1829,6 +1842,30 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +[[package]] +name = "scale-info" +version = "2.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" +dependencies = [ + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "sec1" version = "0.7.3" @@ -1843,6 +1880,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "secp256k1" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +dependencies = [ + "rand", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +dependencies = [ + "cc", +] + [[package]] name = "semver" version = "0.11.0" @@ -1869,30 +1925,31 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.197" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -1900,9 +1957,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ "base64", "chrono", @@ -1918,14 +1975,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -1968,6 +2025,16 @@ dependencies = [ "rand_core", ] +[[package]] +name = "snowbridge-amcl" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460a9ed63cdf03c1b9847e8a12a5f5ba19c4efd5869e4a737e05be25d7c427e5" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + [[package]] name = "sp1-guest" version = "0.1.0" @@ -1980,21 +2047,24 @@ dependencies = [ [[package]] name = "sp1-precompiles" version = "0.1.0" -source = "git+https://www.github.com/succinctlabs/sp1.git?branch=main#0d5a6c3e83b809bd1d5270b995d620a57fc062f4" +source = "git+https://www.github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" dependencies = [ "anyhow", "bincode", "cfg-if", "getrandom", + "hex", "k256", + "num", "rand", "serde", + "snowbridge-amcl", ] [[package]] name = "sp1-zkvm" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#0d5a6c3e83b809bd1d5270b995d620a57fc062f4" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#02c6ea68c07ce92ceaa0a426e91e66173eccaf49" dependencies = [ "bincode", "cfg-if", @@ -2068,9 +2138,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.59" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -2079,14 +2149,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4497156948bd342b52038035a6fa514a89626e37af9d2c52a5e8d8ebcc7ee479" +checksum = "5aa0cefd02f532035d83cfec82647c6eb53140b0485220760e669f4bad489e36" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -2109,22 +2179,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -2217,6 +2287,17 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + [[package]] name = "toml_edit" version = "0.20.2" @@ -2228,6 +2309,37 @@ dependencies = [ "winnow 0.5.40", ] +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2338,7 +2450,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", "wasm-bindgen-shared", ] @@ -2360,7 +2472,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2464,9 +2576,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" [[package]] name = "wyz" @@ -2479,22 +2591,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "087eca3c1eaf8c47b94d02790dd086cd594b912d2043d4de4bfdd466b3befb7c" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "6f4b6c273f496d8fd4eaf18853e6b448760225dc030ff2c485a786859aea6393" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] [[package]] @@ -2514,5 +2626,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn 2.0.60", ] diff --git a/rust-toolchain b/rust-toolchain index 870bbe4e..1ab6e4e1 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -stable \ No newline at end of file +nightly-2024-04-17 \ No newline at end of file diff --git a/scripts/install.sh b/scripts/install.sh index 11d07785..836b3437 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e # toolchain necessary to compile c-kzg in SP1/risc0 if [ -z "$1" ] || [ "$1" == "sp1" ] || [ "$1" == "risc0" ]; then diff --git a/scripts/run.sh b/scripts/run.sh index c017f09a..8b5c563b 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash +set -e -TOOLCHAIN_RISC0=+stable -TOOLCHAIN_SP1=+nightly-2024-02-06 -TOOLCHAIN_SGX=+stable +TOOLCHAIN_RISC0=+nightly-2024-04-17 +TOOLCHAIN_SP1=+nightly-2024-04-17 +TOOLCHAIN_SGX=+nightly-2024-04-17 if [ -z "${DEBUG}" ]; then FLAGS=--release @@ -38,6 +39,6 @@ if [ -z "$1" ] || [ "$1" == "sp1" ]; then cargo ${TOOLCHAIN_SP1} run --bin sp1-builder cargo ${TOOLCHAIN_SP1} ${COMMAND} ${FLAGS} --features sp1 else - cargo ${TOOLCHAIN_SP1} test ${FLAGS} -p sp1-driver --features enable + SP1_PROVER=mock cargo ${TOOLCHAIN_SP1} test ${FLAGS} -p sp1-driver --features enable fi fi \ No newline at end of file