diff --git a/.github/workflows/ci-all.yml b/.github/workflows/ci-all.yml index a7a4480f..00c98701 100644 --- a/.github/workflows/ci-all.yml +++ b/.github/workflows/ci-all.yml @@ -6,13 +6,11 @@ on: paths: - "host/**" - "lib/**" - - "primitives/**" - "script/**" pull_request: paths: - "host/**" - "lib/**" - - "primitives/**" - "script/**" env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/ci-build-test-reusable.yml b/.github/workflows/ci-build-test-reusable.yml index 09a91f67..539652df 100644 --- a/.github/workflows/ci-build-test-reusable.yml +++ b/.github/workflows/ci-build-test-reusable.yml @@ -50,7 +50,3 @@ jobs: - name: Test ${{ inputs.version_name }} prover run: make test - - - name: Build with tracer - if: ${{ inputs.version_name }} == native - run: cargo build -F tracer diff --git a/Cargo.lock b/Cargo.lock index 17428f35..e9adb8e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,7 +32,7 @@ dependencies = [ "cpp_demangle", "fallible-iterator", "gimli 0.28.1", - "memmap2", + "memmap2 0.5.10", "object 0.32.2", "rustc-demangle", "smallvec", @@ -59,6 +59,28 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher 0.3.0", + "cpufeatures", + "ctr 0.8.0", + "opaque-debug", +] + [[package]] name = "aes" version = "0.8.4" @@ -66,10 +88,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", - "cipher", + "cipher 0.4.4", "cpufeatures", ] +[[package]] +name = "aes-gcm" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc3be92e19a7ef47457b8e6f90707e12b6ac5d20c6f3866584fa3be0787d839f" +dependencies = [ + "aead", + "aes 0.7.5", + "cipher 0.3.0", + "ctr 0.7.0", + "ghash", + "subtle", +] + [[package]] name = "ahash" version = "0.8.11" @@ -77,6 +113,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -112,10 +149,23 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "alloy-chains" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +dependencies = [ + "alloy-rlp", + "num_enum 0.7.2", + "serde", + "strum 0.26.3", +] + [[package]] name = "alloy-consensus" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a016bfa21193744d4c38b3f3ab845462284d129e5e23c7cc0fafca7e92d9db37" dependencies = [ "alloy-eips", "alloy-primitives", @@ -123,20 +173,20 @@ dependencies = [ "alloy-serde", "c-kzg", "serde", - "sha2", ] [[package]] name = "alloy-contract" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e47b2a620fd588d463ccf0f5931b41357664b293a8d31592768845a2a101bb9e" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", "alloy-network", "alloy-primitives", "alloy-provider", - "alloy-rpc-types", + "alloy-rpc-types-eth", "alloy-sol-types", "alloy-transport", "futures", @@ -163,26 +213,29 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d6d8118b83b0489cfb7e6435106948add2b35217f4a5004ef895f613f60299" dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-serde", "c-kzg", + "derive_more", "once_cell", "serde", + "sha2", ] [[package]] name = "alloy-genesis" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "894f33a7822abb018db56b10ab90398e63273ce1b5a33282afd186c132d764a6" dependencies = [ "alloy-primitives", "alloy-serde", "serde", - "serde_json", ] [[package]] @@ -199,8 +252,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61f0ae6e93b885cc70fe8dae449e7fd629751dbee8f59767eaaa7285333c5727" dependencies = [ "alloy-primitives", "serde", @@ -211,17 +265,20 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc122cbee2b8523854cc11d87bcd5773741602c553d2d2d106d82eeb9c16924a" dependencies = [ "alloy-consensus", "alloy-eips", "alloy-json-rpc", "alloy-primitives", - "alloy-rpc-types", + "alloy-rpc-types-eth", + "alloy-serde", "alloy-signer", "alloy-sol-types", "async-trait", + "auto_impl", "futures-utils-wasm", "thiserror", ] @@ -237,12 +294,13 @@ dependencies = [ "cfg-if", "const-hex", "derive_more", + "getrandom 0.2.15", "hex-literal", "itoa", "k256", "keccak-asm", "proptest", - "rand", + "rand 0.8.5", "ruint", "serde", "tiny-keccak", @@ -250,16 +308,18 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d5af289798fe8783acd0c5f10644d9d26f54a12bc52a083e4f3b31718e9bf92" dependencies = [ + "alloy-chains", + "alloy-consensus", "alloy-eips", "alloy-json-rpc", "alloy-network", "alloy-primitives", "alloy-rpc-client", - "alloy-rpc-types", - "alloy-rpc-types-trace", + "alloy-rpc-types-eth", "alloy-transport", "alloy-transport-http", "async-stream", @@ -269,7 +329,9 @@ dependencies = [ "futures", "futures-utils-wasm", "lru", - "reqwest 0.12.4", + "pin-project", + "reqwest 0.12.5", + "serde", "serde_json", "tokio", "tracing", @@ -295,20 +357,21 @@ checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "alloy-rpc-client" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b40fcb53b2a9d0a78a4968b2eca8805a4b7011b9ee3fdfa2acaf137c5128f36b" dependencies = [ "alloy-json-rpc", "alloy-transport", "alloy-transport-http", "futures", "pin-project", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -320,17 +383,85 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f2fbe956a3e0f0975c798f488dc6be96b669544df3737e18f4a325b42f4c86" +dependencies = [ + "alloy-rpc-types-engine", + "alloy-rpc-types-eth", + "alloy-serde", +] + +[[package]] +name = "alloy-rpc-types-admin" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "334a8c00cde17a48e073031f1534e71a75b529dbf25552178c43c2337632e0ab" +dependencies = [ + "alloy-genesis", + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-rpc-types-anvil" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87f724e6170f558b809a520e37bdb34d99123092b78118bff31fb5b21dc2a2e" +dependencies = [ + "alloy-primitives", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-rpc-types-beacon" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb383cd3981cee0031aeacbd394c4e726e907f3a0180fe36d5fc76d37c41cd82" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "alloy-rpc-types-engine", + "serde", + "serde_with", + "thiserror", +] + +[[package]] +name = "alloy-rpc-types-engine" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd473d98ec552f8229cd6d566bd2b0bbfc5bb4efcefbb5288c834aa8fd832020" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-rpc-types-eth", + "alloy-serde", + "jsonrpsee-types", + "jsonwebtoken 9.3.0", + "rand 0.8.5", + "serde", + "thiserror", +] + +[[package]] +name = "alloy-rpc-types-eth" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "083f443a83b9313373817236a8f4bea09cca862618e9177d822aee579640a5d6" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-genesis", "alloy-primitives", "alloy-rlp", "alloy-serde", "alloy-sol-types", - "itertools 0.12.1", + "itertools 0.13.0", + "jsonrpsee-types", "serde", "serde_json", "thiserror", @@ -338,20 +469,35 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7a838f9a34aae7022c6cb53ecf21bc0a5a30c82f8d9eb0afed701ab5fd88de" dependencies = [ "alloy-primitives", - "alloy-rpc-types", + "alloy-rpc-types-eth", "alloy-serde", "serde", "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-rpc-types-txpool" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1572267dbc660843d87c02994029d1654c2c32867e186b266d1c03644b43af97" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", ] [[package]] name = "alloy-serde" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d94da1c0c4e27cc344b05626fe22a89dc6b8b531b9475f3b7691dbf6913e4109" dependencies = [ "alloy-primitives", "serde", @@ -360,8 +506,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58d876be3afd8b78979540084ff63995292a26aa527ad0d44276405780aa0ffd" dependencies = [ "alloy-primitives", "async-trait", @@ -372,9 +519,10 @@ dependencies = [ ] [[package]] -name = "alloy-signer-wallet" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +name = "alloy-signer-local" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40a37dc216c269b8a7244047cb1c18a9c69f7a0332ab2c4c2aa4cbb1a31468b" dependencies = [ "alloy-consensus", "alloy-network", @@ -382,7 +530,7 @@ dependencies = [ "alloy-signer", "async-trait", "k256", - "rand", + "rand 0.8.5", "thiserror", ] @@ -397,7 +545,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -413,7 +561,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "syn-solidity", "tiny-keccak", ] @@ -429,7 +577,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "syn-solidity", ] @@ -456,8 +604,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245af9541f0a0dbd5258669c80dfe3af118164cacec978a520041fc130550deb" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -469,22 +618,39 @@ dependencies = [ "tokio", "tower", "url", - "wasm-bindgen-futures", ] [[package]] name = "alloy-transport-http" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5619c017e1fdaa1db87f9182f4f0ed97c53d674957f4902fba655e972d359c6c" dependencies = [ "alloy-json-rpc", "alloy-transport", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde_json", "tower", + "tracing", "url", ] +[[package]] +name = "alloy-trie" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03704f265cbbb943b117ecb5055fd46e8f41e7dc8a58b1aed20bcd40ace38c15" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "derive_more", + "hashbrown 0.14.5", + "nybbles", + "serde", + "smallvec", + "tracing", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -794,7 +960,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", ] [[package]] @@ -804,7 +970,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", ] [[package]] @@ -869,7 +1035,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -880,7 +1046,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -929,7 +1095,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1012,21 +1178,21 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "backtrace" -version = "0.3.72" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line 0.22.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.35.0", + "object 0.36.0", "rustc-demangle", "serde", ] @@ -1077,6 +1243,15 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + [[package]] name = "bincode" version = "1.3.3" @@ -1092,7 +1267,7 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cexpr", "clang-sys", "itertools 0.12.1", @@ -1105,10 +1280,16 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.66", + "syn 2.0.68", "which", ] +[[package]] +name = "binout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b60b1af88a588fca5fe424ae7d735bc52814f80ff57614f57043cc4e2024f2ea" + [[package]] name = "bit-set" version = "0.5.3" @@ -1132,13 +1313,22 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] +[[package]] +name = "bitm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06e8e5bec3490b9f6f3adbb78aa4f53e8396fd9994e8a62a346b44ea7c15f35" +dependencies = [ + "dyn_size_of", +] + [[package]] name = "bitvec" version = "1.0.1" @@ -1201,6 +1391,15 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "bls12_381" version = "0.7.1" @@ -1210,7 +1409,7 @@ dependencies = [ "ff 0.12.1", "group 0.12.1", "pairing", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1295,9 +1494,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" dependencies = [ "bytemuck_derive", ] @@ -1310,7 +1509,7 @@ checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1330,22 +1529,8 @@ dependencies = [ [[package]] name = "c-kzg" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" -dependencies = [ - "blst", - "cc", - "glob", - "hex", - "libc", - "serde", -] - -[[package]] -name = "c-kzg-taiko" version = "1.0.0" -source = "git+https://github.com/smtmfft/c-kzg-4844?branch=for-alpha7#a2d3ae768eede8228920619c98c87584ad8afd09" +source = "git+https://github.com/brechtpd/c-kzg-4844?branch=for-alpha7#3bf0372e8c7a4ba908aff65da0508fcaaf9d38e6" dependencies = [ "blst", "cc", @@ -1421,9 +1606,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.99" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" dependencies = [ "jobserver", "libc", @@ -1453,11 +1638,22 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", "serde", + "wasm-bindgen", "windows-targets 0.52.5", ] +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "cipher" version = "0.4.4" @@ -1525,7 +1721,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1561,7 +1757,7 @@ dependencies = [ "hmac", "once_cell", "pbkdf2 0.12.2", - "rand", + "rand 0.8.5", "sha2", "thiserror", ] @@ -1592,6 +1788,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +[[package]] +name = "concat-kdf" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d72c1252426a83be2092dd5884a5f6e3b8e7180f6891b6263d2c21b92ec8816" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "console" version = "0.15.8" @@ -1636,6 +1841,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -1690,6 +1904,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" version = "1.4.2" @@ -1746,7 +1975,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -1763,38 +1992,70 @@ dependencies = [ [[package]] name = "ctr" -version = "0.9.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" dependencies = [ - "cipher", + "cipher 0.3.0", ] [[package]] -name = "curve25519-dalek" -version = "4.1.2" +name = "ctr" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "fiat-crypto", - "platforms", - "rustc_version 0.4.0", - "subtle", - "zeroize", + "cipher 0.3.0", ] [[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher 0.4.4", +] + +[[package]] +name = "cuckoofilter" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b810a8449931679f64cd7eef1bbd0fa315801b6d5d9cdc1ace2804d6529eee18" +dependencies = [ + "byteorder", + "fnv", + "rand 0.7.3", + "serde", + "serde_bytes", + "serde_derive", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version 0.4.0", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1864,7 +2125,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1875,7 +2136,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1894,7 +2155,7 @@ dependencies = [ "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core", + "parking_lot_core 0.9.10", ] [[package]] @@ -1903,6 +2164,16 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +[[package]] +name = "delay_map" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4355c25cbf99edcb6b4a0e906f6bdc6956eda149e84455bea49696429b2f8e8" +dependencies = [ + "futures", + "tokio-util", +] + [[package]] name = "der" version = "0.7.9" @@ -1936,15 +2207,15 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ - "convert_case", + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 1.0.109", + "syn 2.0.68", ] [[package]] @@ -2005,14 +2276,33 @@ dependencies = [ ] [[package]] -name = "displaydoc" -version = "0.2.4" +name = "discv5" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "cafb8ed8d460b7d1c8d4c970270d45ecb5e283179a3945143196624c55cda6ac" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", + "aes 0.7.5", + "aes-gcm", + "alloy-rlp", + "arrayvec", + "delay_map", + "enr 0.12.1", + "fnv", + "futures", + "hashlink", + "hex", + "hkdf", + "lazy_static", + "lru", + "more-asserts", + "parking_lot 0.11.2", + "rand 0.8.5", + "smallvec", + "socket2 0.4.10", + "tokio", + "tracing", + "uint", + "zeroize", ] [[package]] @@ -2035,7 +2325,7 @@ checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" dependencies = [ "digest 0.10.7", "futures", - "rand", + "rand 0.8.5", "reqwest 0.11.27", "thiserror", "tokio", @@ -2053,6 +2343,12 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +[[package]] +name = "dyn_size_of" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d4f78a40b1ec35bf8cafdaaf607ba2f773c366b0b3bda48937cacd7a8d5134" + [[package]] name = "ecdsa" version = "0.16.9" @@ -2067,6 +2363,31 @@ dependencies = [ "spki", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core 0.6.4", + "serde", + "sha2", + "subtle", + "zeroize", +] + [[package]] name = "either" version = "1.12.0" @@ -2092,7 +2413,7 @@ dependencies = [ "generic-array 0.14.7", "group 0.13.0", "pkcs8", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -2124,7 +2445,7 @@ dependencies = [ "hex", "k256", "log", - "rand", + "rand 0.8.5", "rlp", "serde", "sha3", @@ -2142,13 +2463,33 @@ dependencies = [ "hex", "k256", "log", - "rand", + "rand 0.8.5", "rlp", "serde", "sha3", "zeroize", ] +[[package]] +name = "enr" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "972070166c68827e64bd1ebc8159dd8e32d9bc2da7ebe8f20b61308f7974ad30" +dependencies = [ + "alloy-rlp", + "base64 0.21.7", + "bytes", + "ed25519-dalek", + "hex", + "k256", + "log", + "rand 0.8.5", + "secp256k1", + "serde", + "sha3", + "zeroize", +] + [[package]] name = "enumn" version = "0.1.13" @@ -2157,7 +2498,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2215,13 +2556,13 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ - "aes", - "ctr", + "aes 0.8.4", + "ctr 0.9.2", "digest 0.10.7", "hex", "hmac", "pbkdf2 0.11.0", - "rand", + "rand 0.8.5", "scrypt", "serde", "serde_json", @@ -2358,7 +2699,7 @@ dependencies = [ "regex", "serde", "serde_json", - "syn 2.0.66", + "syn 2.0.68", "toml 0.7.8", "walkdir", ] @@ -2380,7 +2721,7 @@ dependencies = [ "regex", "serde", "serde_json", - "syn 2.0.66", + "syn 2.0.68", "toml 0.8.14", "walkdir", ] @@ -2397,7 +2738,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2413,7 +2754,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2433,12 +2774,12 @@ dependencies = [ "num_enum 0.7.2", "once_cell", "open-fastrlp", - "rand", + "rand 0.8.5", "rlp", "serde", "serde_json", "strum 0.25.0", - "syn 2.0.66", + "syn 2.0.68", "tempfile", "thiserror", "tiny-keccak", @@ -2463,12 +2804,12 @@ dependencies = [ "num_enum 0.7.2", "once_cell", "open-fastrlp", - "rand", + "rand 0.8.5", "rlp", "serde", "serde_json", - "strum 0.26.2", - "syn 2.0.66", + "strum 0.26.3", + "syn 2.0.68", "tempfile", "thiserror", "tiny-keccak", @@ -2520,7 +2861,7 @@ dependencies = [ "hashers", "http 0.2.12", "instant", - "jsonwebtoken", + "jsonwebtoken 8.3.0", "once_cell", "pin-project", "reqwest 0.11.27", @@ -2557,7 +2898,7 @@ dependencies = [ "hashers", "http 0.2.12", "instant", - "jsonwebtoken", + "jsonwebtoken 8.3.0", "once_cell", "pin-project", "reqwest 0.11.27", @@ -2587,7 +2928,7 @@ dependencies = [ "elliptic-curve", "eth-keystore", "ethers-core 2.0.14", - "rand", + "rand 0.8.5", "sha2", "thiserror", "tracing", @@ -2633,7 +2974,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ "bitvec", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -2646,7 +2987,7 @@ dependencies = [ "bitvec", "byteorder", "ff_derive", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -2688,7 +3029,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -2742,7 +3083,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2838,7 +3179,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2923,6 +3264,17 @@ dependencies = [ "typenum", ] +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -2930,8 +3282,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "ghash" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" +dependencies = [ + "opaque-debug", + "polyval", ] [[package]] @@ -2956,7 +3320,7 @@ version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", "libgit2-sys", "log", @@ -2998,7 +3362,7 @@ checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ "ff 0.12.1", "memuse", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -3009,7 +3373,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff 0.13.0", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -3070,7 +3434,7 @@ dependencies = [ "ff 0.12.1", "group 0.12.1", "pasta_curves 0.4.1", - "rand_core", + "rand_core 0.6.4", "rayon", ] @@ -3128,6 +3492,15 @@ dependencies = [ "fxhash", ] +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.5", +] + [[package]] name = "hdrhistogram" version = "7.5.4" @@ -3189,6 +3562,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + [[package]] name = "hmac" version = "0.12.1" @@ -3271,9 +3653,9 @@ checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" [[package]] name = "httparse" -version = "1.9.2" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3935c160d00ac752e09787e6e6bfc26494c2183cc922f1bc678a60d4733bc2" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -3310,7 +3692,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -3354,19 +3736,20 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", "hyper 1.3.1", "hyper-util", - "rustls 0.22.4", + "rustls 0.23.10", "rustls-pki-types", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tower-service", + "webpki-roots 0.26.3", ] [[package]] @@ -3411,7 +3794,7 @@ dependencies = [ "http-body 1.0.0", "hyper 1.3.1", "pin-project-lite", - "socket2", + "socket2 0.5.7", "tokio", "tower", "tower-service", @@ -3441,124 +3824,6 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -3567,14 +3832,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -3662,6 +3925,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ + "block-padding", "generic-array 0.14.7", ] @@ -3720,6 +3984,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -3744,6 +4017,19 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpsee-types" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f511b714bca46f9a3e97c0e0eb21d2c112e83e444d2db535b5ec7093f5836d73" +dependencies = [ + "beef", + "http 1.1.0", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "jsonwebtoken" version = "8.3.0" @@ -3758,6 +4044,21 @@ dependencies = [ "simple_asn1", ] +[[package]] +name = "jsonwebtoken" +version = "9.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +dependencies = [ + "base64 0.21.7", + "js-sys", + "pem 3.0.4", + "ring 0.17.8", + "serde", + "serde_json", + "simple_asn1", +] + [[package]] name = "jubjub" version = "0.9.0" @@ -3768,7 +4069,7 @@ dependencies = [ "bls12_381", "ff 0.12.1", "group 0.12.1", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -3825,16 +4126,16 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] @@ -3887,9 +4188,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", "windows-targets 0.52.5", @@ -3907,7 +4208,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -3929,12 +4230,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "lock_api" version = "0.4.12" @@ -3966,6 +4261,12 @@ version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9106e1d747ffd48e6be5bb2d97fa706ed25b144fbee4d5c02eae110cd8d6badd" +[[package]] +name = "lz4_flex" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" + [[package]] name = "malloc_buf" version = "0.0.6" @@ -4002,9 +4303,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -4015,6 +4316,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" +dependencies = [ + "libc", +] + [[package]] name = "memuse" version = "0.2.1" @@ -4036,6 +4346,16 @@ dependencies = [ "paste", ] +[[package]] +name = "metrics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be3cbd384d4e955b231c895ce10685e3d8260c5ccffae898c96c723b0772835" +dependencies = [ + "ahash", + "portable-atomic", +] + [[package]] name = "mime" version = "0.3.17" @@ -4060,9 +4380,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -4080,19 +4400,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] [[package]] -name = "multimap" -version = "0.10.0" +name = "modular-bitfield" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] [[package]] -name = "native-tls" -version = "0.2.12" +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "more-asserts" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" + +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + +[[package]] +name = "native-tls" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ @@ -4137,6 +4484,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -4205,7 +4561,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -4298,7 +4654,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -4316,6 +4672,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "nybbles" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95f06be0417d97f81fe4e5c86d7d01b392655a9cac9c19a848aa033e18937b23" +dependencies = [ + "alloy-rlp", + "const-hex", + "proptest", + "serde", + "smallvec", +] + [[package]] name = "objc" version = "0.2.7" @@ -4348,9 +4717,9 @@ dependencies = [ [[package]] name = "object" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "memchr", ] @@ -4361,6 +4730,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + [[package]] name = "open-fastrlp" version = "0.1.4" @@ -4392,7 +4767,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types 0.3.2", "libc", @@ -4409,7 +4784,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -4445,7 +4820,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "p3-air" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "p3-field", "p3-matrix", @@ -4454,21 +4829,21 @@ dependencies = [ [[package]] name = "p3-baby-bear" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "num-bigint 0.4.5", "p3-field", "p3-mds", "p3-poseidon2", "p3-symmetric", - "rand", + "rand 0.8.5", "serde", ] [[package]] name = "p3-blake3" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "blake3", "p3-symmetric", @@ -4477,21 +4852,21 @@ dependencies = [ [[package]] name = "p3-bn254-fr" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "ff 0.13.0", "num-bigint 0.4.5", "p3-field", "p3-poseidon2", "p3-symmetric", - "rand", + "rand 0.8.5", "serde", ] [[package]] name = "p3-challenger" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "p3-field", "p3-maybe-rayon", @@ -4503,7 +4878,7 @@ dependencies = [ [[package]] name = "p3-commit" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "itertools 0.12.1", "p3-challenger", @@ -4516,7 +4891,7 @@ dependencies = [ [[package]] name = "p3-dft" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "p3-field", "p3-matrix", @@ -4528,20 +4903,20 @@ dependencies = [ [[package]] name = "p3-field" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "itertools 0.12.1", "num-bigint 0.4.5", "num-traits", "p3-util", - "rand", + "rand 0.8.5", "serde", ] [[package]] name = "p3-fri" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "itertools 0.12.1", "p3-challenger", @@ -4559,7 +4934,7 @@ dependencies = [ [[package]] name = "p3-interpolation" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "p3-field", "p3-matrix", @@ -4569,7 +4944,7 @@ dependencies = [ [[package]] name = "p3-keccak" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "p3-symmetric", "tiny-keccak", @@ -4578,7 +4953,7 @@ dependencies = [ [[package]] name = "p3-keccak-air" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "p3-air", "p3-field", @@ -4591,13 +4966,13 @@ dependencies = [ [[package]] name = "p3-matrix" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "itertools 0.12.1", "p3-field", "p3-maybe-rayon", "p3-util", - "rand", + "rand 0.8.5", "serde", "tracing", ] @@ -4605,7 +4980,7 @@ dependencies = [ [[package]] name = "p3-maybe-rayon" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "rayon", ] @@ -4613,7 +4988,7 @@ dependencies = [ [[package]] name = "p3-mds" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "itertools 0.12.1", "p3-dft", @@ -4621,13 +4996,13 @@ dependencies = [ "p3-matrix", "p3-symmetric", "p3-util", - "rand", + "rand 0.8.5", ] [[package]] name = "p3-merkle-tree" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "itertools 0.12.1", "p3-commit", @@ -4643,19 +5018,19 @@ dependencies = [ [[package]] name = "p3-poseidon2" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "gcd", "p3-field", "p3-mds", "p3-symmetric", - "rand", + "rand 0.8.5", ] [[package]] name = "p3-symmetric" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "itertools 0.12.1", "p3-field", @@ -4665,7 +5040,7 @@ dependencies = [ [[package]] name = "p3-uni-stark" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "itertools 0.12.1", "p3-air", @@ -4683,7 +5058,7 @@ dependencies = [ [[package]] name = "p3-util" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=3b5265f9d5af36534a46caebf0617595cfb42c5a#3b5265f9d5af36534a46caebf0617595cfb42c5a" +source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "serde", ] @@ -4706,6 +5081,7 @@ dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -4723,6 +5099,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.3" @@ -4730,7 +5117,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.10", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -4741,7 +5142,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.2", "smallvec", "windows-targets 0.52.5", ] @@ -4756,7 +5157,7 @@ dependencies = [ "ff 0.12.1", "group 0.12.1", "lazy_static", - "rand", + "rand 0.8.5", "static_assertions", "subtle", ] @@ -4771,7 +5172,7 @@ dependencies = [ "ff 0.13.0", "group 0.13.0", "lazy_static", - "rand", + "rand 0.8.5", "static_assertions", "subtle", ] @@ -4853,6 +5254,19 @@ dependencies = [ "indexmap 2.2.6", ] +[[package]] +name = "ph" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b7b74d575d7c11fb653fae69688be5206cafc1ead33c01ce61ac7f36eae45b" +dependencies = [ + "binout", + "bitm", + "dyn_size_of", + "rayon", + "wyhash", +] + [[package]] name = "pharos" version = "0.5.3" @@ -4880,7 +5294,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -4912,10 +5326,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] -name = "platforms" -version = "3.4.0" +name = "polyval" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] [[package]] name = "portable-atomic" @@ -4969,7 +5389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -5031,9 +5451,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -5044,7 +5464,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "hex", "lazy_static", "procfs-core", @@ -5057,7 +5477,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "hex", ] @@ -5072,7 +5492,7 @@ dependencies = [ "lazy_static", "libc", "memchr", - "parking_lot", + "parking_lot 0.12.3", "procfs", "protobuf", "thiserror", @@ -5080,17 +5500,17 @@ dependencies = [ [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "num-traits", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "rand_xorshift", "regex-syntax 0.8.4", "rusty-fork", @@ -5125,7 +5545,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.66", + "syn 2.0.68", "tempfile", ] @@ -5139,7 +5559,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -5172,6 +5592,53 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.23.10", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.17.8", + "rustc-hash", + "rustls 0.23.10", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +dependencies = [ + "libc", + "once_cell", + "socket2 0.5.7", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -5203,13 +5670,17 @@ dependencies = [ "alloy-transport-http", "anyhow", "assert_cmd", - "c-kzg-taiko", + "c-kzg", "clap 4.5.7", "ethers-core 2.0.10", "raiko-lib", "reqwest 0.11.27", - "reqwest 0.12.4", - "revm", + "reqwest 0.12.5", + "reth-evm", + "reth-evm-ethereum", + "reth-primitives", + "reth-provider", + "reth-revm", "risc0-driver", "rstest", "serde", @@ -5242,7 +5713,7 @@ dependencies = [ "axum", "bincode", "bytemuck", - "c-kzg-taiko", + "c-kzg", "cap", "cfg-if", "clap 4.5.7", @@ -5258,8 +5729,11 @@ dependencies = [ "raiko-core", "raiko-lib", "reqwest 0.11.27", - "reqwest 0.12.4", - "revm", + "reqwest 0.12.5", + "reth-evm", + "reth-evm-ethereum", + "reth-primitives", + "reth-provider", "risc0-driver", "rlp", "rstest", @@ -5288,7 +5762,6 @@ version = "0.1.0" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-network", "alloy-primitives", "alloy-rlp", "alloy-rlp-derive", @@ -5296,7 +5769,7 @@ dependencies = [ "alloy-sol-types", "anyhow", "bincode", - "c-kzg-taiko", + "c-kzg", "cfg-if", "chrono", "flate2", @@ -5306,8 +5779,10 @@ dependencies = [ "libflate", "log", "once_cell", - "revm", - "revm-primitives", + "reth-chainspec", + "reth-evm", + "reth-evm-ethereum", + "reth-primitives", "rlp", "serde", "serde_json", @@ -5370,8 +5845,7 @@ dependencies = [ "proptest", "raiko-lib", "reqwest 0.11.27", - "reqwest 0.12.4", - "revm", + "reqwest 0.12.5", "rlp", "rstest", "serde", @@ -5389,6 +5863,19 @@ dependencies = [ "url", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + [[package]] name = "rand" version = "0.8.5" @@ -5396,8 +5883,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", ] [[package]] @@ -5407,7 +5904,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", ] [[package]] @@ -5416,7 +5922,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", ] [[package]] @@ -5425,7 +5940,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -5465,11 +5980,20 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -5478,7 +6002,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom", + "getrandom 0.2.15", "libredox", "thiserror", ] @@ -5579,9 +6103,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64 0.22.1", "bytes", @@ -5593,7 +6117,7 @@ dependencies = [ "http-body 1.0.0", "http-body-util", "hyper 1.3.1", - "hyper-rustls 0.26.0", + "hyper-rustls 0.27.2", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -5604,17 +6128,18 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.4", + "quinn", + "rustls 0.23.10", "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.1", "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tokio-util", "tower-service", "url", @@ -5622,29 +6147,714 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.2", + "webpki-roots 0.26.3", "winreg 0.52.0", ] [[package]] -name = "reqwest-middleware" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a45d100244a467870f6cb763c4484d010a6bed6bd610b3676e3825d93fb4cfbd" +name = "reqwest-middleware" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a45d100244a467870f6cb763c4484d010a6bed6bd610b3676e3825d93fb4cfbd" +dependencies = [ + "anyhow", + "async-trait", + "http 1.1.0", + "reqwest 0.12.5", + "serde", + "thiserror", + "tower-service", +] + +[[package]] +name = "reth-blockchain-tree-api" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-consensus", + "reth-execution-errors", + "reth-primitives", + "reth-storage-errors", + "thiserror", +] + +[[package]] +name = "reth-chainspec" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-chains", + "alloy-eips", + "alloy-genesis", + "alloy-primitives", + "alloy-trie", + "derive_more", + "once_cell", + "reth-ethereum-forks", + "reth-primitives-traits", + "reth-trie-common", + "serde", + "serde_json", +] + +[[package]] +name = "reth-codecs" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-genesis", + "alloy-primitives", + "bytes", + "modular-bitfield", + "reth-codecs-derive", + "serde", +] + +[[package]] +name = "reth-codecs-derive" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "convert_case 0.6.0", + "proc-macro2", + "quote", + "syn 2.0.68", +] + +[[package]] +name = "reth-consensus" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "auto_impl", + "reth-primitives", + "thiserror-no-std", +] + +[[package]] +name = "reth-consensus-common" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-chainspec", + "reth-consensus", + "reth-primitives", +] + +[[package]] +name = "reth-db" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "bytes", + "derive_more", + "eyre", + "metrics", + "paste", + "reth-db-api", + "reth-fs-util", + "reth-metrics", + "reth-primitives", + "reth-prune-types", + "reth-stages-types", + "reth-storage-errors", + "reth-tracing", + "reth-trie-common", + "rustc-hash", + "serde", + "strum 0.26.3", + "sysinfo", + "thiserror", +] + +[[package]] +name = "reth-db-api" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "bytes", + "derive_more", + "metrics", + "modular-bitfield", + "parity-scale-codec", + "reth-codecs", + "reth-primitives", + "reth-prune-types", + "reth-stages-types", + "reth-storage-errors", + "reth-trie-common", + "serde", +] + +[[package]] +name = "reth-discv4" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "discv5", + "enr 0.12.1", + "generic-array 0.14.7", + "parking_lot 0.12.3", + "reth-ethereum-forks", + "reth-net-common", + "reth-net-nat", + "reth-network-peers", + "schnellru", + "secp256k1", + "serde", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "reth-ecies" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "aes 0.8.4", + "alloy-primitives", + "alloy-rlp", + "block-padding", + "byteorder", + "cipher 0.4.4", + "concat-kdf", + "ctr 0.9.2", + "digest 0.10.7", + "futures", + "generic-array 0.14.7", + "hmac", + "pin-project", + "rand 0.8.5", + "reth-network-peers", + "secp256k1", + "sha2", + "sha3", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "tracing", + "typenum", +] + +[[package]] +name = "reth-errors" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-blockchain-tree-api", + "reth-consensus", + "reth-execution-errors", + "reth-fs-util", + "reth-storage-errors", + "thiserror", +] + +[[package]] +name = "reth-eth-wire" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-rlp", + "bytes", + "derive_more", + "futures", + "pin-project", + "reth-chainspec", + "reth-codecs", + "reth-discv4", + "reth-ecies", + "reth-eth-wire-types", + "reth-metrics", + "reth-network-peers", + "reth-primitives", + "serde", + "snap", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "tracing", +] + +[[package]] +name = "reth-eth-wire-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-rlp", + "bytes", + "derive_more", + "reth-chainspec", + "reth-codecs-derive", + "reth-primitives", + "serde", + "thiserror", +] + +[[package]] +name = "reth-ethereum-consensus" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-chainspec", + "reth-consensus", + "reth-consensus-common", + "reth-primitives", + "tracing", +] + +[[package]] +name = "reth-ethereum-forks" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-chains", + "alloy-primitives", + "alloy-rlp", + "crc", + "serde", + "thiserror-no-std", +] + +[[package]] +name = "reth-evm" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "auto_impl", + "futures-util", + "reth-chainspec", + "reth-execution-errors", + "reth-execution-types", + "reth-primitives", + "reth-prune-types", + "reth-storage-errors", + "revm", + "revm-primitives", +] + +[[package]] +name = "reth-evm-ethereum" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-eips", + "alloy-sol-types", + "anyhow", + "lazy_static", + "reth-chainspec", + "reth-ethereum-consensus", + "reth-evm", + "reth-execution-types", + "reth-primitives", + "reth-prune-types", + "reth-revm", + "revm-primitives", +] + +[[package]] +name = "reth-execution-errors" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "reth-consensus", + "reth-prune-types", + "reth-storage-errors", + "revm-primitives", + "thiserror-no-std", +] + +[[package]] +name = "reth-execution-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-execution-errors", + "reth-primitives", + "reth-trie", + "revm", +] + +[[package]] +name = "reth-fs-util" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "serde_json", + "thiserror", +] + +[[package]] +name = "reth-metrics" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "metrics", + "reth-metrics-derive", +] + +[[package]] +name = "reth-metrics-derive" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.68", +] + +[[package]] +name = "reth-net-common" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "tokio", +] + +[[package]] +name = "reth-net-nat" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "futures-util", + "reqwest 0.12.5", + "serde_with", + "thiserror", + "tokio", +] + +[[package]] +name = "reth-network-api" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "enr 0.12.1", + "reth-eth-wire", + "reth-network-peers", + "reth-rpc-types", + "serde", + "thiserror", + "tokio", +] + +[[package]] +name = "reth-network-p2p" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "auto_impl", + "futures", + "reth-consensus", + "reth-eth-wire-types", + "reth-network-api", + "reth-network-peers", + "reth-primitives", + "reth-storage-errors", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "reth-network-peers" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "enr 0.12.1", + "secp256k1", + "serde_with", + "thiserror", + "tokio", + "url", +] + +[[package]] +name = "reth-nippy-jar" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "anyhow", + "bincode", + "cuckoofilter", + "derive_more", + "lz4_flex", + "memmap2 0.7.1", + "ph", + "reth-fs-util", + "serde", + "sucds", + "thiserror", + "tracing", + "zstd", +] + +[[package]] +name = "reth-primitives" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-genesis", + "alloy-primitives", + "alloy-rlp", + "alloy-rpc-types", + "byteorder", + "bytes", + "c-kzg", + "derive_more", + "modular-bitfield", + "once_cell", + "rayon", + "reth-chainspec", + "reth-codecs", + "reth-ethereum-forks", + "reth-primitives-traits", + "reth-static-file-types", + "reth-trie-common", + "revm", + "revm-primitives", + "roaring", + "secp256k1", + "serde", + "tempfile", + "thiserror-no-std", +] + +[[package]] +name = "reth-primitives-traits" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-genesis", + "alloy-primitives", + "alloy-rlp", + "alloy-rpc-types-eth", + "bytes", + "derive_more", + "modular-bitfield", + "reth-codecs", + "revm-primitives", + "serde", +] + +[[package]] +name = "reth-provider" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-rpc-types-engine", + "auto_impl", + "dashmap", + "itertools 0.12.1", + "metrics", + "parking_lot 0.12.3", + "pin-project", + "rayon", + "reth-blockchain-tree-api", + "reth-chainspec", + "reth-codecs", + "reth-db", + "reth-db-api", + "reth-errors", + "reth-evm", + "reth-execution-types", + "reth-fs-util", + "reth-metrics", + "reth-network-p2p", + "reth-nippy-jar", + "reth-primitives", + "reth-prune-types", + "reth-stages-types", + "reth-storage-api", + "reth-storage-errors", + "reth-trie", + "revm", + "strum 0.26.3", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "reth-prune-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "bytes", + "derive_more", + "modular-bitfield", + "reth-codecs", + "serde", + "thiserror", +] + +[[package]] +name = "reth-revm" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-eips", + "alloy-rlp", + "reth-chainspec", + "reth-consensus-common", + "reth-execution-errors", + "reth-primitives", + "reth-prune-types", + "reth-storage-api", + "reth-storage-errors", + "revm", + "tracing", +] + +[[package]] +name = "reth-rpc-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types", + "alloy-rpc-types-admin", + "alloy-rpc-types-anvil", + "alloy-rpc-types-beacon", + "alloy-rpc-types-engine", + "alloy-rpc-types-trace", + "alloy-rpc-types-txpool", + "alloy-serde", + "jsonrpsee-types", + "serde", + "serde_json", +] + +[[package]] +name = "reth-stages-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "bytes", + "modular-bitfield", + "reth-codecs", + "reth-trie-common", + "serde", +] + +[[package]] +name = "reth-static-file-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "derive_more", + "serde", + "strum 0.26.3", +] + +[[package]] +name = "reth-storage-api" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "auto_impl", + "reth-chainspec", + "reth-db-api", + "reth-execution-types", + "reth-primitives", + "reth-prune-types", + "reth-stages-types", + "reth-storage-errors", + "reth-trie", + "revm", +] + +[[package]] +name = "reth-storage-errors" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-fs-util", + "reth-primitives", + "thiserror-no-std", +] + +[[package]] +name = "reth-tracing" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "clap 4.5.7", + "eyre", + "rolling-file", + "tracing", + "tracing-appender", + "tracing-journald", + "tracing-logfmt", + "tracing-subscriber 0.3.18", +] + +[[package]] +name = "reth-trie" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" dependencies = [ - "anyhow", - "async-trait", - "http 1.1.0", - "reqwest 0.12.4", + "alloy-rlp", + "auto_impl", + "derive_more", + "metrics", + "rayon", + "reth-db", + "reth-db-api", + "reth-execution-errors", + "reth-metrics", + "reth-primitives", + "reth-stages-types", + "reth-trie-common", + "revm", + "tracing", +] + +[[package]] +name = "reth-trie-common" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus", + "alloy-genesis", + "alloy-primitives", + "alloy-rlp", + "alloy-trie", + "bytes", + "derive_more", + "itertools 0.12.1", + "nybbles", + "reth-codecs", + "reth-primitives-traits", + "revm-primitives", "serde", - "thiserror", - "tower-service", ] [[package]] name = "revm" -version = "8.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#7d23b1c557cf3d0e93f859b6794e580b9f0381c2" +version = "9.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "auto_impl", "cfg-if", @@ -5657,8 +6867,8 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "4.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#7d23b1c557cf3d0e93f859b6794e580b9f0381c2" +version = "5.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "revm-primitives", "serde", @@ -5666,31 +6876,31 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "6.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#7d23b1c557cf3d0e93f859b6794e580b9f0381c2" +version = "7.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "aurora-engine-modexp", - "c-kzg-taiko", - "cfg-if", + "blst", + "c-kzg", "k256", "once_cell", "revm-primitives", "ripemd", - "secp256k1 0.28.2", + "secp256k1", "sha2", "substrate-bn", ] [[package]] name = "revm-primitives" -version = "3.1.1" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#7d23b1c557cf3d0e93f859b6794e580b9f0381c2" +version = "4.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "alloy-primitives", "auto_impl", - "bitflags 2.5.0", + "bitflags 2.6.0", "bitvec", - "c-kzg-taiko", + "c-kzg", "cfg-if", "derive_more", "dyn-clone", @@ -5734,7 +6944,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -5796,7 +7006,7 @@ dependencies = [ "downloader", "hex", "metal", - "rand", + "rand 0.8.5", "rayon", "risc0-circuit-recursion-sys", "risc0-core", @@ -5826,7 +7036,7 @@ dependencies = [ "anyhow", "cust", "metal", - "rand", + "rand 0.8.5", "rayon", "risc0-circuit-rv32im-sys", "risc0-core", @@ -5853,7 +7063,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02e0cbd09d03c23b572b66cd96a56143adb22bf895aca89c1a153ccebedaa0b4" dependencies = [ "bytemuck", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -5944,8 +7154,8 @@ dependencies = [ "metal", "ndarray", "paste", - "rand", - "rand_core", + "rand 0.8.5", + "rand_core 0.6.4", "rayon", "risc0-core", "risc0-sys", @@ -5970,7 +7180,7 @@ dependencies = [ "cfg-if", "crypto-bigint", "elf", - "getrandom", + "getrandom 0.2.15", "hex", "human-repr", "lazy-regex", @@ -6004,7 +7214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03b6378c9e407be18a1560ed030fd87fb6056293c56263efac46c507ae97e0d7" dependencies = [ "bytemuck", - "getrandom", + "getrandom 0.2.15", "libm", ] @@ -6036,6 +7246,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "roaring" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7699249cc2c7d71939f30868f47e9d7add0bdc030d90ee10bfd16887ff8bb1c8" +dependencies = [ + "bytemuck", + "byteorder", +] + +[[package]] +name = "rolling-file" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8395b4f860856b740f20a296ea2cd4d823e81a2658cf05ef61be22916026a906" +dependencies = [ + "chrono", +] + [[package]] name = "rrs-lib" version = "0.1.0" @@ -6081,7 +7310,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.66", + "syn 2.0.68", "unicode-ident", ] @@ -6101,7 +7330,7 @@ dependencies = [ "parity-scale-codec", "primitive-types", "proptest", - "rand", + "rand 0.8.5", "rlp", "ruint-macro", "serde", @@ -6135,7 +7364,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.66", + "syn 2.0.68", "walkdir", ] @@ -6191,7 +7420,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -6212,11 +7441,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ - "log", + "once_cell", "ring 0.17.8", "rustls-pki-types", "rustls-webpki 0.102.4", @@ -6311,7 +7540,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" dependencies = [ - "cipher", + "cipher 0.4.4", ] [[package]] @@ -6365,6 +7594,17 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "schnellru" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +dependencies = [ + "ahash", + "cfg-if", + "hashbrown 0.13.2", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -6413,32 +7653,14 @@ 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 0.9.2", -] - [[package]] name = "secp256k1" version = "0.29.0" source = "git+https://github.com/CeciliaZ030/rust-secp256k1?branch=sp1-patch#09fe6ec0c0f0de848da5e295022029f46e0389e3" dependencies = [ - "rand", - "secp256k1-sys 0.10.0", -] - -[[package]] -name = "secp256k1-sys" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" -dependencies = [ - "cc", + "rand 0.8.5", + "secp256k1-sys", + "serde", ] [[package]] @@ -6455,7 +7677,7 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -6521,6 +7743,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bytes" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" version = "1.0.203" @@ -6529,7 +7760,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -6602,7 +7833,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -6614,7 +7845,7 @@ dependencies = [ "futures", "log", "once_cell", - "parking_lot", + "parking_lot 0.12.3", "scc", "serial_test_derive", ] @@ -6627,7 +7858,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -6642,9 +7873,9 @@ dependencies = [ "dirs", "hex", "raiko-lib", - "rand", - "rand_core", - "secp256k1 0.29.0", + "rand 0.8.5", + "rand_core 0.6.4", + "secp256k1", "serde", "serde_json", "sha3", @@ -6660,7 +7891,7 @@ dependencies = [ "alloy-provider", "alloy-rpc-client", "alloy-signer", - "alloy-signer-wallet", + "alloy-signer-local", "alloy-sol-types", "alloy-transport-http", "anyhow", @@ -6748,7 +7979,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -6783,6 +8014,15 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] + +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "snowbridge-amcl" @@ -6794,6 +8034,16 @@ dependencies = [ "scale-info", ] +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "socket2" version = "0.5.7" @@ -6814,19 +8064,20 @@ dependencies = [ [[package]] name = "sp1-core" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "anyhow", "arrayref", "bincode", "blake3", + "bytemuck", "cfg-if", "curve25519-dalek", "elf", "elliptic-curve", "generic-array 1.0.0", "hex", - "itertools 0.12.1", + "itertools 0.13.0", "k256", "log", "nohash-hasher", @@ -6850,6 +8101,7 @@ dependencies = [ "p3-symmetric", "p3-uni-stark", "p3-util", + "rand 0.8.5", "rayon-scan", "rrs-lib 0.1.0 (git+https://github.com/GregAC/rrs.git)", "serde", @@ -6858,7 +8110,7 @@ dependencies = [ "snowbridge-amcl", "sp1-derive", "sp1-primitives", - "strum 0.26.2", + "strum 0.26.3", "strum_macros 0.26.4", "tempfile", "thiserror", @@ -6872,7 +8124,7 @@ dependencies = [ [[package]] name = "sp1-derive" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "proc-macro2", "quote", @@ -6897,9 +8149,9 @@ dependencies = [ [[package]] name = "sp1-primitives" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ - "itertools 0.12.1", + "itertools 0.13.0", "lazy_static", "p3-baby-bear", "p3-field", @@ -6910,25 +8162,28 @@ dependencies = [ [[package]] name = "sp1-prover" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "anyhow", "backtrace", "bincode", + "bytemuck", "clap 4.5.7", "dirs", "futures", "hex", "indicatif", - "itertools 0.12.1", + "itertools 0.13.0", "num-bigint 0.4.5", "p3-baby-bear", "p3-bn254-fr", "p3-challenger", "p3-commit", "p3-field", + "p3-util", + "rand 0.8.5", "rayon", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde", "serde_json", "serial_test", @@ -6952,10 +8207,10 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "bincode", - "itertools 0.12.1", + "itertools 0.13.0", "p3-air", "p3-baby-bear", "p3-bn254-fr", @@ -6975,10 +8230,10 @@ dependencies = [ [[package]] name = "sp1-recursion-compiler" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "backtrace", - "itertools 0.12.1", + "itertools 0.13.0", "p3-air", "p3-baby-bear", "p3-bn254-fr", @@ -6999,13 +8254,13 @@ dependencies = [ [[package]] name = "sp1-recursion-core" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "arrayref", "backtrace", "ff 0.13.0", "hashbrown 0.14.5", - "itertools 0.12.1", + "itertools 0.13.0", "p3-air", "p3-baby-bear", "p3-bn254-fr", @@ -7019,6 +8274,7 @@ dependencies = [ "p3-merkle-tree", "p3-poseidon2", "p3-symmetric", + "p3-util", "serde", "serde_with", "sp1-core", @@ -7032,7 +8288,7 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "proc-macro2", "quote", @@ -7042,18 +8298,24 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-ffi" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ + "anyhow", + "bincode", "bindgen", "cc", "cfg-if", + "hex", "log", "num-bigint 0.4.5", "p3-baby-bear", "p3-field", - "rand", + "p3-symmetric", + "rand 0.8.5", "serde", "serde_json", + "sha2", + "sp1-core", "sp1-recursion-compiler", "tempfile", ] @@ -7061,9 +8323,9 @@ dependencies = [ [[package]] name = "sp1-recursion-program" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ - "itertools 0.12.1", + "itertools 0.13.0", "p3-air", "p3-baby-bear", "p3-challenger", @@ -7077,7 +8339,7 @@ dependencies = [ "p3-poseidon2", "p3-symmetric", "p3-util", - "rand", + "rand 0.8.5", "serde", "sp1-core", "sp1-recursion-compiler", @@ -7088,7 +8350,7 @@ dependencies = [ [[package]] name = "sp1-sdk" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#8c0f5010606f9c2306effe60412d421c23e88afa" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "alloy-sol-types", "anyhow", @@ -7107,16 +8369,17 @@ dependencies = [ "p3-field", "p3-matrix", "prost", - "reqwest 0.12.4", + "reqwest 0.12.5", "reqwest-middleware", "serde", "serde_json", "sha2", "sp1-core", "sp1-prover", - "strum 0.26.2", + "strum 0.26.3", "strum_macros 0.26.4", "tempfile", + "thiserror", "tokio", "tracing", "twirp", @@ -7204,9 +8467,9 @@ dependencies = [ [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros 0.26.4", ] @@ -7221,7 +8484,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7234,7 +8497,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7246,15 +8509,15 @@ dependencies = [ "byteorder", "crunchy", "lazy_static", - "rand", + "rand 0.8.5", "rustc-hex", ] [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-encoding" @@ -7265,6 +8528,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "sucds" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53d46182afe6ed822a94c54a532dc0d59691a8f49226bdc4596529ca864cdd6" +dependencies = [ + "anyhow", + "num-traits", +] + [[package]] name = "syn" version = "1.0.109" @@ -7278,9 +8551,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -7296,7 +8569,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7312,14 +8585,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] -name = "synstructure" -version = "0.13.1" +name = "sysinfo" +version = "0.30.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "windows", ] [[package]] @@ -7393,7 +8669,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7477,16 +8753,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -7513,10 +8779,10 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot", + "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] @@ -7529,7 +8795,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7554,11 +8820,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.4", + "rustls 0.23.10", "rustls-pki-types", "tokio", ] @@ -7600,6 +8866,7 @@ dependencies = [ "futures-core", "futures-sink", "pin-project-lite", + "slab", "tokio", ] @@ -7685,7 +8952,7 @@ dependencies = [ "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand", + "rand 0.8.5", "slab", "tokio", "tokio-util", @@ -7702,7 +8969,7 @@ checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ "async-compression", "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.6.0", "bytes", "futures-core", "futures-util", @@ -7722,7 +8989,7 @@ dependencies = [ "tower-layer", "tower-service", "tracing", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] @@ -7769,7 +9036,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7805,6 +9072,17 @@ dependencies = [ "tracing", ] +[[package]] +name = "tracing-journald" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba316a74e8fc3c3896a850dba2375928a9fa171b085ecddfc7c054d39970f3fd" +dependencies = [ + "libc", + "tracing-core", + "tracing-subscriber 0.3.18", +] + [[package]] name = "tracing-log" version = "0.2.0" @@ -7816,6 +9094,18 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-logfmt" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22b8e455f6caa5212a102ec530bf86b8dc5a4c536299bffd84b238fed9119be7" +dependencies = [ + "time", + "tracing", + "tracing-core", + "tracing-subscriber 0.3.18", +] + [[package]] name = "tracing-serde" version = "0.1.3" @@ -7874,7 +9164,7 @@ dependencies = [ "http 0.2.12", "httparse", "log", - "rand", + "rand 0.8.5", "rustls 0.21.12", "sha1", "thiserror", @@ -7895,7 +9185,7 @@ dependencies = [ "http-body-util", "hyper 1.3.1", "prost", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde", "serde_json", "thiserror", @@ -7947,7 +9237,7 @@ checksum = "ac73887f47b9312552aa90ef477927ff014d63d1920ca8037c6c1951eab64bb1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7983,12 +9273,27 @@ dependencies = [ "version_check", ] +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -8007,6 +9312,16 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "universal-hash" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + [[package]] name = "untrusted" version = "0.7.1" @@ -8021,9 +9336,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -8036,18 +9351,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "utf8parse" version = "0.2.2" @@ -8076,7 +9379,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8113,17 +9416,17 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom", + "getrandom 0.2.15", "serde", ] [[package]] name = "uuid" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -8203,6 +9506,12 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -8230,7 +9539,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "wasm-bindgen-shared", ] @@ -8264,7 +9573,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8316,9 +9625,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -8366,6 +9675,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core", + "windows-targets 0.52.5", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -8552,18 +9871,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -8584,36 +9891,21 @@ dependencies = [ ] [[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "yoke" -version = "0.7.4" +name = "wyhash" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "baf6e163c25e3fac820b4b453185ea2dea3b6a3e0a721d4d23d75bd33734c295" dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", + "rand_core 0.6.4", ] [[package]] -name = "yoke-derive" -version = "0.7.4" +name = "wyz" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", + "tap", ] [[package]] @@ -8633,28 +9925,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", + "syn 2.0.68", ] [[package]] @@ -8674,29 +9945,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8730,7 +9979,7 @@ dependencies = [ "jubjub", "lazy_static", "pasta_curves 0.5.1", - "rand", + "rand 0.8.5", "serde", "sha2", "sha3", @@ -8757,9 +10006,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.11+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index fde793c2..090ba25c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,14 +36,14 @@ opt-level = 3 raiko-lib = { path = "./lib", features = ["std"] } raiko-core = { path = "./core" } -# revm -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", - "c-kzg", - "taiko", -] } +# reth +reth-primitives = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko", default-features = false, features = ["alloy-compat", "taiko"] } +reth-evm-ethereum = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko" } +reth-evm = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko", default-features = false } +reth-rpc-types = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko" } +reth-revm = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko" } +reth-chainspec = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko" } +reth-provider = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko", default-features = false } # risc zero risc0-zkvm = { version = "0.21.0", features = ["prove", "getrandom"] } @@ -59,29 +59,29 @@ sp1-helper = { git = "https://github.com/succinctlabs/sp1.git", branch = "main" # alloy 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/ceciliaz030/alloy", branch = "175_4e22b9e-cycle" } -alloy-rpc-client = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle" } -alloy-consensus = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle", features = [ +alloy-core = { version = "0.7.2", default-features = false } +alloy-dyn-abi = { version = "0.7.2", default-features = false } +alloy-json-abi = { version = "0.7.2", default-features = false } +alloy-primitives = { version = "0.7.2", default-features = false } +alloy-sol-types = { version = "0.7.2", default-features = false } +reqwest_alloy = { package = "reqwest", version = "0.12.4", features = ["json"] } + +alloy-rpc-types = { version = "0.1" } +alloy-rpc-client = { version = "0.1" } +alloy-consensus = { version = "0.1", features = [ "serde", ] } -alloy-network = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle", features = [ +alloy-network = { version = "0.1", default-features = false, features = [ "k256", ] } -alloy-contract = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle" } -alloy-eips = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle", features = [ +alloy-contract = { version = "0.1" } +alloy-eips = { version = "0.1", default-features = false, features = [ "serde", ] } -alloy-provider = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle" } -alloy-transport-http = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle" } -alloy-signer = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle" } -alloy-signer-wallet = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle" } -reqwest_alloy = { package = "reqwest", version = "0.12.4", features = ["json"] } - +alloy-provider = { version = "0.1" } +alloy-transport-http = { version = "0.1" } +alloy-signer = { version = "0.1" } +alloy-signer-local = { version = "0.1" } # ethers (TODO: remove) ethers-contract = { git = "https://github.com/smtmfft/ethers-rs", branch = "ethers-core-2.0.10" } @@ -133,7 +133,7 @@ reqwest = { version = "0.11.22", features = ["json"] } url = "2.5.0" # crypto -c-kzg = { package = "c-kzg-taiko", git = "https://github.com/smtmfft/c-kzg-4844", branch = "for-alpha7", default-features = false, features = [ +c-kzg = { git = "https://github.com/brechtpd/c-kzg-4844", branch = "for-alpha7", default-features = false, features = [ "preload-kzg-settings", "no-threads", ] } @@ -174,3 +174,8 @@ rand_core = "0.6.4" dirs = "5.0.1" pathdiff = "0.2.1" +[patch.crates-io] +revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } +revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } +c-kzg = { git = "https://github.com/brechtpd/c-kzg-4844", branch = "for-alpha7" } +secp256k1 = { git = "https://github.com/CeciliaZ030/rust-secp256k1", branch = "sp1-patch" } \ No newline at end of file diff --git a/core/Cargo.toml b/core/Cargo.toml index 9a359519..5692839f 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -13,6 +13,13 @@ sgx-prover = { path = "../provers/sgx/prover", optional = true } # raiko raiko-lib = { workspace = true, features = ["c-kzg"] } +# reth +reth-primitives.workspace = true +reth-evm-ethereum.workspace = true +reth-evm.workspace = true +reth-revm.workspace = true +reth-provider.workspace = true + # alloy alloy-rlp = { workspace = true } alloy-rlp-derive = { workspace = true } @@ -24,7 +31,6 @@ alloy-transport-http = { workspace = true } alloy-consensus = { workspace = true } alloy-network = { workspace = true } alloy-rpc-client = { workspace = true } -revm = { workspace = true } # tracing and logging tracing = { workspace = true } diff --git a/core/src/lib.rs b/core/src/lib.rs index 716bf23d..26f3c63a 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -3,16 +3,14 @@ use crate::{ preflight::preflight, provider::BlockDataProvider, }; -use alloy_primitives::{Address, B256}; +use alloy_primitives::Address; use alloy_rpc_types::EIP1186AccountProofResponse; -use raiko_lib::{ - builder::{BlockBuilderStrategy, TaikoStrategy}, - consts::{ChainSpec, VerifierType}, - input::{GuestInput, GuestOutput, TaikoProverData}, - protocol_instance::ProtocolInstance, - prover::Proof, - utils::HeaderHasher, -}; +use raiko_lib::builder::{create_mem_db, RethBlockBuilder}; +use raiko_lib::consts::{ChainSpec, VerifierType}; +use raiko_lib::input::{GuestInput, GuestOutput, TaikoProverData}; +use raiko_lib::protocol_instance::ProtocolInstance; +use raiko_lib::prover::Proof; +use reth_primitives::Header; use serde_json::Value; use std::{collections::HashMap, hint::black_box}; use tracing::{debug, error, info, warn}; @@ -62,66 +60,28 @@ impl Raiko { } pub fn get_output(&self, input: &GuestInput) -> RaikoResult { - match TaikoStrategy::build_from(input) { - Ok((header, _mpt_node)) => { - info!("Verifying final state using provider data ..."); - info!("Final block hash derived successfully. {}", header.hash()); - debug!("Final block header derived successfully. {header:?}"); - let pi = ProtocolInstance::new(input, &header, VerifierType::None)?.instance_hash(); + let db = create_mem_db(&mut input.clone()).unwrap(); + let mut builder = RethBlockBuilder::new(input, db); + builder.prepare_header().expect("prepare"); + builder.execute_transactions(false).expect("execute"); + let result = builder.finalize(); - // 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", + match result { + Ok(header) => { + info!("Verifying final state using provider data ..."); + info!( + "Final block hash derived successfully. {}", + header.hash_slow() ); - check_eq(&exp.extra_data, &header.extra_data, "extra_data"); - - // Make sure the blockhash from the node matches the one from the builder - require_eq( - &B256::from(header.hash().0), - &input.block_hash_reference, - "block hash unexpected", - )?; - - let output = GuestOutput { header, hash: pi }; + debug!("Final block header derived successfully. {header:?}"); + // Check if the header is the expected one + check_header(&input.block.header, &header)?; - Ok(output) + Ok(GuestOutput { + header: header.clone(), + hash: ProtocolInstance::new(input, &header, VerifierType::None)? + .instance_hash(), + }) } Err(e) => { warn!("Proving bad block construction!"); @@ -141,6 +101,57 @@ impl Raiko { } } +fn check_header(exp: &Header, header: &Header) -> Result<(), RaikoError> { + // Check against the expected value of all fields for easy debugability + check_eq(&exp.parent_hash, &header.parent_hash, "parent_hash"); + 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, &header.extra_data, "extra_data"); + + // Make sure the blockhash from the node matches the one from the builder + require_eq( + &exp.hash_slow(), + &header.hash_slow(), + &format!("block hash unexpected for block {}", exp.number), + ) +} + fn check_eq(expected: &T, actual: &T, message: &str) { // printing out error, if any, but ignoring the result // making sure it's not optimized out diff --git a/core/src/preflight.rs b/core/src/preflight.rs index f2ff72ab..92aa964e 100644 --- a/core/src/preflight.rs +++ b/core/src/preflight.rs @@ -2,9 +2,7 @@ use crate::{ interfaces::{RaikoError, RaikoResult}, provider::{db::ProviderDb, rpc::RpcBlockDataProvider, BlockDataProvider}, }; -use alloy_consensus::{ - SignableTransaction, TxEip1559, TxEip2930, TxEip4844, TxEip4844Variant, TxEnvelope, TxLegacy, -}; +use alloy_consensus::TxEnvelope; pub use alloy_primitives::*; use alloy_provider::{Provider, ReqwestProvider}; use alloy_rpc_types::{Block, BlockTransactions, Filter, Transaction as AlloyRpcTransaction}; @@ -12,9 +10,7 @@ use alloy_sol_types::{SolCall, SolEvent}; use anyhow::{anyhow, bail, Result}; use c_kzg::{Blob, KzgCommitment}; use raiko_lib::{ - builder::{ - prepare::TaikoHeaderPrepStrategy, BlockBuilder, OptimisticDatabase, TkoTxExecStrategy, - }, + builder::{OptimisticDatabase, RethBlockBuilder}, clear_line, consts::ChainSpec, inplace_print, @@ -22,13 +18,12 @@ use raiko_lib::{ decode_anchor, proposeBlockCall, BlockProposed, GuestInput, TaikoGuestInput, TaikoProverData, }, - primitives::{ - eip4844::{kzg_to_versioned_hash, MAINNET_KZG_TRUSTED_SETUP}, - mpt::proofs_to_tries, - }, - utils::{generate_transactions, to_header, zlib_compress_data}, + primitives::{eip4844::MAINNET_KZG_TRUSTED_SETUP, mpt::proofs_to_tries}, + protocol_instance::kzg_to_versioned_hash, + utils::{generate_transactions, zlib_compress_data}, Measurement, }; +use reth_primitives::Block as RethBlock; use serde::{Deserialize, Serialize}; use std::{collections::HashSet, sync::Arc}; use tracing::{debug, info, warn}; @@ -55,13 +50,10 @@ pub async fn preflight( })?, ); - let hash = block.header.hash.ok_or_else(|| { - RaikoError::Preflight("No block hash for the requested block".to_string()) - })?; - info!( - "Processing block {:?} with block.hash: {:?}", - block.header.number, block.header.hash + "Processing block {:?} with hash: {:?}", + block.header.number, + block.header.hash.unwrap(), ); debug!("block.parent_hash: {:?}", block.header.parent_hash); debug!("block gas used: {:?}", block.header.gas_used); @@ -86,11 +78,12 @@ pub async fn preflight( }; measurement.stop(); + let reth_block = RethBlock::try_from(block.clone()).expect("block convert failed"); + let input = GuestInput { + block: reth_block.clone(), chain_spec: taiko_chain_spec.clone(), block_number, - block_hash_reference: hash, - block_header_reference: to_header(&block.header), beneficiary: block.header.miner, gas_limit: block.header.gas_limit.try_into().map_err(|_| { RaikoError::Conversion("Failed converting gas limit to u64".to_string()) @@ -108,7 +101,7 @@ pub async fn preflight( parent_state_trie: Default::default(), parent_storage: Default::default(), contracts: Default::default(), - parent_header: to_header(&parent_block.header), + parent_header: parent_block.header.clone().try_into().unwrap(), ancestor_headers: Default::default(), base_fee_per_gas: block.header.base_fee_per_gas.map_or_else( || { @@ -156,20 +149,22 @@ pub async fn preflight( ) .await?; - let mut builder = BlockBuilder::new(&input) - .with_db(provider_db) - .prepare_header::()?; + let mut builder = RethBlockBuilder::new(&input, provider_db); + builder.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 max_iterations = if is_local { 1 } else { 100 }; let mut done = false; let mut num_iterations = 0; while !done { inplace_print(&format!("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().await { + + let optimistic = num_iterations + 1 < max_iterations; + builder.db.as_mut().unwrap().optimistic = optimistic; + + builder.execute_transactions(optimistic).expect("execute"); + if builder.db.as_mut().unwrap().fetch_data().await { done = true; } num_iterations += 1; @@ -177,7 +172,7 @@ pub async fn preflight( clear_line(); println!("State data fetched in {num_iterations} iterations"); - let provider_db = builder.mut_db().unwrap(); + let provider_db = builder.db.as_mut().unwrap(); // Gather inclusion proofs for the initial and final state let measurement = Measurement::start("Fetching storage proofs...", true); @@ -205,19 +200,21 @@ pub async fn preflight( for account in initial_db.accounts.values() { let code = &account.info.code; if let Some(code) = code { - contracts.insert(code.bytecode.0.clone()); + contracts.insert(code.bytecode().0.clone()); } } measurement.stop(); - // Add the collected data to the input - Ok(GuestInput { + let input = GuestInput { parent_state_trie: state_trie, parent_storage: storage, contracts: contracts.into_iter().map(Bytes).collect(), ancestor_headers, ..input - }) + }; + + // Add the collected data to the input + Ok(input) } /// Prepare the input for a Taiko chain @@ -315,7 +312,7 @@ async fn prepare_taiko_chain_input( // Create the input struct without the block data set Ok(TaikoGuestInput { - l1_header: to_header(&l1_state_block.header), + l1_header: l1_state_block.header.clone().try_into().unwrap(), tx_data, anchor_tx: serde_json::to_string(&anchor_tx).map_err(RaikoError::Serde)?, tx_blob_hash, @@ -504,6 +501,7 @@ async fn get_block_proposed_event( let tx = provider .get_transaction_by_hash(log_tx_hash) .await + .expect("couldn't query the propose tx") .expect("Could not find the propose tx"); return Ok((tx, event.data)); } @@ -517,7 +515,7 @@ fn get_transactions_from_block(block: &Block) -> RaikoResult> { match &block.transactions { BlockTransactions::Full(txs) => { for tx in txs { - transactions.push(from_block_tx(tx)?); + transactions.push(TxEnvelope::try_from(tx.clone()).unwrap()); } }, _ => unreachable!("Block is too old, please connect to an archive node or use a block that is at most 128 blocks old."), @@ -530,95 +528,6 @@ fn get_transactions_from_block(block: &Block) -> RaikoResult> { Ok(transactions) } -fn from_block_tx(tx: &AlloyRpcTransaction) -> RaikoResult { - let Some(signature) = tx.signature else { - panic!("Transaction has no signature"); - }; - let signature = - Signature::from_rs_and_parity(signature.r, signature.s, signature.v.as_limbs()[0]) - .map_err(|_| RaikoError::Anyhow(anyhow!("Could not create signature")))?; - Ok(match tx.transaction_type.unwrap_or_default() { - 0 => TxEnvelope::Legacy( - TxLegacy { - chain_id: tx.chain_id, - nonce: tx.nonce, - gas_price: tx.gas_price.expect("No gas price for the transaction"), - gas_limit: tx.gas, - to: if let Some(to) = tx.to { - TxKind::Call(to) - } else { - TxKind::Create - }, - value: tx.value, - input: tx.input.0.clone().into(), - } - .into_signed(signature), - ), - 1 => TxEnvelope::Eip2930( - TxEip2930 { - chain_id: tx.chain_id.expect("No chain id for the transaction"), - nonce: tx.nonce, - gas_price: tx.gas_price.expect("No gas price for the transaction"), - gas_limit: tx.gas, - to: if let Some(to) = tx.to { - TxKind::Call(to) - } else { - TxKind::Create - }, - value: tx.value, - input: tx.input.clone(), - access_list: tx.access_list.clone().unwrap_or_default(), - } - .into_signed(signature), - ), - 2 => TxEnvelope::Eip1559( - TxEip1559 { - chain_id: tx.chain_id.expect("No chain id for the transaction"), - nonce: tx.nonce, - gas_limit: tx.gas, - max_fee_per_gas: tx - .max_fee_per_gas - .expect("No max fee per gas for the transaction"), - max_priority_fee_per_gas: tx - .max_priority_fee_per_gas - .expect("No max priority fee per gas for the transaction"), - to: if let Some(to) = tx.to { - TxKind::Call(to) - } else { - TxKind::Create - }, - value: tx.value, - access_list: tx.access_list.clone().unwrap_or_default(), - input: tx.input.clone(), - } - .into_signed(signature), - ), - 3 => TxEnvelope::Eip4844( - TxEip4844Variant::TxEip4844(TxEip4844 { - chain_id: tx.chain_id.expect("No chain id for the transaction"), - nonce: tx.nonce, - gas_limit: tx.gas, - max_fee_per_gas: tx - .max_fee_per_gas - .expect("No max fee per gas for the transaction"), - max_priority_fee_per_gas: tx - .max_priority_fee_per_gas - .expect("No max priority fee per gas for the transaction"), - to: tx.to.expect("No to address for the transaction"), - value: tx.value, - access_list: tx.access_list.clone().unwrap_or_default(), - input: tx.input.clone(), - blob_versioned_hashes: tx.blob_versioned_hashes.clone().unwrap_or_default(), - max_fee_per_blob_gas: tx - .max_fee_per_blob_gas - .expect("No max fee per blob gas for the transaction"), - }) - .into_signed(signature), - ), - _ => unimplemented!(), - }) -} - #[cfg(test)] mod test { use ethers_core::types::Transaction; diff --git a/core/src/provider/db.rs b/core/src/provider/db.rs index 0d6646c1..f75db707 100644 --- a/core/src/provider/db.rs +++ b/core/src/provider/db.rs @@ -1,31 +1,12 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -use std::{collections::HashSet, mem::take}; - -use alloy_consensus::Header as AlloyConsensusHeader; -use alloy_primitives::Bytes; -use raiko_lib::{ - builder::OptimisticDatabase, - consts::ChainSpec, - mem_db::MemDb, - primitives::{Address, B256, U256}, - utils::to_header, -}; -use revm::{ +use alloy_primitives::{Address, Bytes, U256}; +use raiko_lib::{builder::OptimisticDatabase, consts::ChainSpec, mem_db::MemDb}; +use reth_primitives::{Header, B256}; +use reth_provider::ProviderError; +use reth_revm::{ primitives::{Account, AccountInfo, Bytecode, HashMap}, Database, DatabaseCommit, }; +use std::{collections::HashSet, mem::take}; use tokio::runtime::Handle; use crate::{ @@ -38,7 +19,7 @@ pub struct ProviderDb { pub provider: BDP, pub block_number: u64, pub initial_db: MemDb, - pub initial_headers: HashMap, + pub initial_headers: HashMap, pub current_db: MemDb, async_executor: Handle, @@ -87,7 +68,7 @@ impl ProviderDb { .insert_block_hash(block_number, block_hash); provider_db .initial_headers - .insert(block_number, to_header(&block.header)); + .insert(block_number, block.header.try_into().unwrap()); } } Ok(provider_db) @@ -138,7 +119,7 @@ impl ProviderDb { Ok((initial_proofs, latest_proofs, num_storage_proofs)) } - pub async fn get_ancestor_headers(&mut self) -> RaikoResult> { + pub async fn get_ancestor_headers(&mut self) -> RaikoResult> { let earliest_block = self .initial_db .block_hashes @@ -155,7 +136,7 @@ impl ProviderDb { self.initial_headers.entry(block_number) { let block = &self.provider.get_blocks(&[(block_number, false)]).await?[0]; - e.insert(to_header(&block.header)); + e.insert(block.header.clone().try_into().unwrap()); } headers.push( self.initial_headers @@ -175,7 +156,7 @@ impl ProviderDb { } impl Database for ProviderDb { - type Error = RaikoError; + type Error = ProviderError; fn basic(&mut self, address: Address) -> Result, Self::Error> { // Check if the account is in the current database. @@ -211,10 +192,11 @@ impl Database for ProviderDb { let account = &tokio::task::block_in_place(|| { self.async_executor .block_on(self.provider.get_accounts(&[address])) - })? + }) + .map_err(|e| ProviderError::RPC(e.to_string()))? .first() .cloned() - .ok_or(RaikoError::RPC("No account".to_owned()))?; + .ok_or(ProviderError::RPC("No account".to_owned()))?; // Insert the account into the initial database. self.initial_db @@ -252,10 +234,11 @@ impl Database for ProviderDb { let value = tokio::task::block_in_place(|| { self.async_executor .block_on(self.provider.get_storage_values(&[(address, index)])) - })? + }) + .map_err(|e| ProviderError::RPC(e.to_string()))? .first() .copied() - .ok_or(RaikoError::RPC("No storage value".to_owned()))?; + .ok_or(ProviderError::RPC("No storage value".to_owned()))?; self.initial_db .insert_account_storage(&address, index, value); Ok(value) @@ -264,7 +247,7 @@ impl Database for ProviderDb { fn block_hash(&mut self, number: U256) -> Result { let block_number: u64 = number .try_into() - .map_err(|_| RaikoError::Conversion("Could not convert U256 to u64".to_owned()))?; + .map_err(|_| ProviderError::BlockNumberOverflow(number))?; // Check if the block hash is in the current database. if let Ok(block_hash) = self.initial_db.block_hash(number) { @@ -287,12 +270,13 @@ impl Database for ProviderDb { let block_hash = tokio::task::block_in_place(|| { self.async_executor .block_on(self.provider.get_blocks(&[(block_number, false)])) - })? + }) + .map_err(|e| ProviderError::RPC(e.to_string()))? .first() - .ok_or(RaikoError::RPC("No block".to_owned()))? + .ok_or(ProviderError::RPC("No block".to_owned()))? .header .hash - .ok_or_else(|| RaikoError::RPC("No block hash".to_owned()))? + .ok_or_else(|| ProviderError::RPC("No block hash".to_owned()))? .0 .into(); self.initial_db.insert_block_hash(block_number, block_hash); @@ -368,7 +352,7 @@ impl OptimisticDatabase for ProviderDb { self.staging_db .insert_block_hash(block_number, block.header.hash.unwrap()); self.initial_headers - .insert(block_number, to_header(&block.header)); + .insert(block_number, block.header.clone().try_into().unwrap()); } // If this wasn't a valid run, clear the post execution database diff --git a/core/src/provider/mod.rs b/core/src/provider/mod.rs index 7f9e974e..ee2849ad 100644 --- a/core/src/provider/mod.rs +++ b/core/src/provider/mod.rs @@ -1,6 +1,6 @@ use alloy_primitives::{Address, U256}; use alloy_rpc_types::Block; -use revm::primitives::AccountInfo; +use reth_primitives::revm_primitives::AccountInfo; use std::collections::HashMap; use crate::{interfaces::RaikoResult, MerkleProof}; diff --git a/core/src/provider/rpc.rs b/core/src/provider/rpc.rs index 623d7f5c..c0c3c447 100644 --- a/core/src/provider/rpc.rs +++ b/core/src/provider/rpc.rs @@ -5,7 +5,7 @@ use alloy_rpc_types::{Block, BlockId, BlockNumberOrTag, EIP1186AccountProofRespo use alloy_transport_http::Http; use raiko_lib::clear_line; use reqwest_alloy::Client; -use revm::primitives::{AccountInfo, Bytecode}; +use reth_primitives::revm_primitives::{AccountInfo, Bytecode}; use std::collections::HashMap; use tracing::trace; diff --git a/host/Cargo.toml b/host/Cargo.toml index 668c17a6..a4d4bea0 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -41,7 +41,6 @@ bincode = { workspace = true } bytemuck = { workspace = true } clap = { workspace = true } flate2 = { workspace = true } -revm = { workspace = true } serde = { workspace = true } serde_with = { workspace = true } serde_json = { workspace = true } @@ -66,6 +65,12 @@ url = { workspace = true } cfg-if = { workspace = true } cap = { workspace = true } +# reth +reth-primitives.workspace = true +reth-evm.workspace = true +reth-evm-ethereum.workspace = true +reth-provider.workspace = true + [dev-dependencies] assert_cmd = { workspace = true } rstest = { workspace = true } diff --git a/host/config/chain_spec_list_default.json b/host/config/chain_spec_list_default.json index 1988a0c2..37921d26 100644 --- a/host/config/chain_spec_list_default.json +++ b/host/config/chain_spec_list_default.json @@ -127,33 +127,5 @@ "genesis_time": 0, "seconds_per_slot": 1, "is_taiko": true - }, - { - "name": "taiko_mainnet", - "chain_id": 167000, - "max_spec_id": "SHANGHAI", - "hard_forks": { - "SHANGHAI": { - "Block": 0 - }, - "CANCUN": "TBD" - }, - "eip_1559_constants": { - "base_fee_change_denominator": "0x8", - "base_fee_max_increase_denominator": "0x8", - "base_fee_max_decrease_denominator": "0x8", - "elasticity_multiplier": "0x2" - }, - "l1_contract": "0x06a9Ab27c7e2255df1815E6CC0168d7755Feb19a", - "l2_contract": "0x1670000000000000000000000000000000010001", - "rpc": "https://rpc.mainnet.taiko.xyz", - "beacon_rpc": null, - "verifier_address": { - "SGX":"0x532efbf6d62720d0b2a2bb9d11066e8588cae6d9", - "SP1":null, - "RISC0":"0x0000000000000000000000000000000000000000" - }, "genesis_time": 0, - "seconds_per_slot": 1, - "is_taiko": true } ] \ No newline at end of file diff --git a/host/src/lib.rs b/host/src/lib.rs index 4208aec1..3cb6839d 100644 --- a/host/src/lib.rs +++ b/host/src/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - pub mod interfaces; pub mod metrics; pub mod server; @@ -53,8 +39,8 @@ fn default_log_level() -> String { #[derive(Default, Clone, Serialize, Deserialize, Debug, Parser)] #[command( - name = "raiko", - about = "The taiko prover host", + name = "raiko", + about = "The taiko prover host", long_about = None )] #[serde(default)] diff --git a/host/src/server/api/v1/proof.rs b/host/src/server/api/v1/proof.rs index 185f677c..91ef370c 100644 --- a/host/src/server/api/v1/proof.rs +++ b/host/src/server/api/v1/proof.rs @@ -8,7 +8,6 @@ use raiko_core::{ }; use raiko_lib::{ input::{get_input_path, GuestInput}, - utils::{to_header, HeaderHasher}, Measurement, }; use serde_json::Value; @@ -71,8 +70,8 @@ async fn validate_cache_input( .first() .ok_or_else(|| RaikoError::RPC("No block data for the requested block".to_owned()))?; - let cached_block_hash = cache_input.block_hash_reference; - let real_block_hash = block.header.hash.unwrap_or(to_header(&block.header).hash()); + let cached_block_hash = cache_input.block.header.hash_slow(); + let real_block_hash = block.header.hash.unwrap(); debug!( "cache_block_hash={:?}, real_block_hash={:?}", cached_block_hash, real_block_hash diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 9737d0b9..547eedb4 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -4,6 +4,13 @@ version = "0.1.0" edition = "2021" [dependencies] +# reth +reth-primitives.workspace = true +reth-evm-ethereum.workspace = true +reth-evm.workspace = true +reth-chainspec.workspace = true + +# alloy alloy-rlp = { workspace = true } alloy-eips = { workspace = true } alloy-rlp-derive = { workspace = true } @@ -11,7 +18,6 @@ alloy-sol-types = { workspace = true } alloy-primitives = { workspace = true } alloy-rpc-types = { workspace = true } alloy-consensus = { workspace = true } -alloy-network = { workspace = true } # errors anyhow = { workspace = true } @@ -23,10 +29,6 @@ serde = { workspace = true } serde_json = { workspace = true, optional = true } serde_with = { workspace = true, optional = true } -# revm -revm = { workspace = true } -revm-primitives = { workspace = true } - libflate = { workspace = true } once_cell = { workspace = true } url = { workspace = true } @@ -67,9 +69,8 @@ std = [ "dep:serde_with", # "dep:tokio", ] -tracer = ["revm/serde-json"] sgx = [] sp1 = [] risc0 = [] -c-kzg = ["revm-primitives/c-kzg", "dep:tempfile"] -sp1-cycle-tracker = [] \ No newline at end of file +c-kzg = ["dep:tempfile"] +sp1-cycle-tracker = [] diff --git a/lib/src/builder.rs b/lib/src/builder.rs new file mode 100644 index 00000000..334d0203 --- /dev/null +++ b/lib/src/builder.rs @@ -0,0 +1,580 @@ +use core::mem; +use std::sync::Arc; + +use crate::primitives::keccak::keccak; +use crate::primitives::mpt::StateAccount; +use crate::utils::generate_transactions; +use crate::{ + consts::{ChainSpec, MAX_BLOCK_HASH_AGE}, + guest_mem_forget, + input::GuestInput, + mem_db::{AccountState, DbAccount, MemDb}, + CycleTracker, +}; +use alloy_consensus::{Signed, Transaction, TxEnvelope}; +use alloy_rpc_types::{ConversionError, Parity, Transaction as AlloyTransaction}; +use anyhow::{bail, Context, Error, Result}; +use reth_chainspec::{ChainSpecBuilder, HOLESKY, MAINNET, TAIKO_A7, TAIKO_MAINNET}; +use reth_evm::execute::{BlockExecutionOutput, BlockValidationError, Executor, ProviderError}; +use reth_evm_ethereum::execute::{validate_block_post_execution, EthExecutorProvider}; +use reth_evm_ethereum::taiko::TaikoData; +use reth_primitives::revm_primitives::db::{Database, DatabaseCommit}; +use reth_primitives::revm_primitives::{ + Account, AccountInfo, AccountStatus, Bytecode, Bytes, HashMap, SpecId, +}; +use reth_primitives::transaction::Signature as RethSignature; +use reth_primitives::{Address, BlockBody, Header, TransactionSigned, B256, KECCAK_EMPTY, U256}; +use tracing::debug; + +pub fn calculate_block_header(input: &GuestInput) -> Header { + let cycle_tracker = CycleTracker::start("initialize_database"); + let db = create_mem_db(&mut input.clone()).unwrap(); + cycle_tracker.end(); + + let mut builder = RethBlockBuilder::new(input, db); + + let cycle_tracker = CycleTracker::start("prepare_header"); + builder.prepare_header().expect("prepare"); + cycle_tracker.end(); + + let cycle_tracker = CycleTracker::start("execute_transactions"); + builder.execute_transactions(false).expect("execute"); + cycle_tracker.end(); + + let cycle_tracker = CycleTracker::start("finalize"); + let header = builder.finalize().expect("execute"); + cycle_tracker.end(); + + header +} + +/// Optimistic database +#[allow(async_fn_in_trait)] +pub trait OptimisticDatabase { + /// Handle post execution work + async fn fetch_data(&mut self) -> bool; + + /// If the current database is optimistic + fn is_optimistic(&self) -> bool; +} +/// A generic builder for building a block. +#[derive(Clone, Debug)] +pub struct RethBlockBuilder { + pub chain_spec: ChainSpec, + pub input: GuestInput, + pub db: Option, + pub header: Option
, +} + +/// Minimum supported protocol version: SHANGHAI +const MIN_SPEC_ID: SpecId = SpecId::SHANGHAI; + +impl + DatabaseCommit + OptimisticDatabase> + RethBlockBuilder +{ + /// Creates a new block builder. + pub fn new(input: &GuestInput, db: DB) -> RethBlockBuilder { + RethBlockBuilder { + chain_spec: input.chain_spec.clone(), + db: Some(db), + header: None, + input: input.clone(), + } + } + + /// Initializes the header. This must be called before executing transactions. + pub fn prepare_header(&mut self) -> Result<()> { + /// Maximum size of extra data. + pub const MAX_EXTRA_DATA_BYTES: usize = 32; + + // Validate timestamp + let timestamp: u64 = self.input.timestamp; + if timestamp < self.input.parent_header.timestamp { + bail!( + "Invalid timestamp: expected >= {}, got {}", + self.input.parent_header.timestamp, + self.input.timestamp, + ); + } + // Validate extra data + let extra_data_bytes = self.input.extra_data.len(); + if extra_data_bytes > MAX_EXTRA_DATA_BYTES { + bail!("Invalid extra data: expected <= {MAX_EXTRA_DATA_BYTES}, got {extra_data_bytes}") + } + // Derive header + let number: u64 = self.input.parent_header.number; + self.header = Some(Header { + // Initialize fields that we can compute from the parent + parent_hash: self.input.parent_header.hash_slow(), + number: number + .checked_add(1) + .with_context(|| "Invalid block number: too large")?, + base_fee_per_gas: Some(self.input.base_fee_per_gas), + // Initialize metadata from input + beneficiary: self.input.beneficiary, + gas_limit: self.input.gas_limit, + timestamp: self.input.timestamp, + mix_hash: self.input.mix_hash, + extra_data: self.input.extra_data.clone(), + blob_gas_used: self.input.blob_gas_used, + excess_blob_gas: self.input.excess_blob_gas, + parent_beacon_block_root: self.input.parent_beacon_block_root, + // do not fill the remaining fields + ..Default::default() + }); + Ok(()) + } + + /// Executes all input transactions. + pub fn execute_transactions(&mut self, optimistic: bool) -> Result<()> { + let chain_spec = &self.input.chain_spec; + let is_taiko = chain_spec.is_taiko(); + + let total_difficulty = U256::ZERO; + let reth_chain_spec = match chain_spec.name.as_str() { + "taiko_a7" => TAIKO_A7.clone(), + "taiko_mainnet" => TAIKO_MAINNET.clone(), + "ethereum" => { + //MAINNET.clone() + // TODO(Brecht): for some reason using the spec directly doesn't work + Arc::new( + ChainSpecBuilder::default() + .chain(MAINNET.chain) + .genesis(MAINNET.genesis.clone()) + .cancun_activated() + .build(), + ) + } + "holesky" => HOLESKY.clone(), + _ => unimplemented!(), + }; + + let header = self.header.as_mut().expect("Header is not initialized"); + let spec_id = self + .input + .chain_spec + .active_fork(header.number, header.timestamp) + .unwrap(); + if !SpecId::enabled(spec_id, MIN_SPEC_ID) { + bail!("Invalid protocol version: expected >= {MIN_SPEC_ID:?}, got {spec_id:?}") + } + + // generate the transactions from the tx list + // For taiko blocks, insert the anchor tx as the first transaction + let anchor_tx = if is_taiko { + Some(serde_json::from_str(&self.input.taiko.anchor_tx.clone()).unwrap()) + } else { + None + }; + let transactions = generate_transactions( + &self.input.chain_spec, + self.input.taiko.block_proposed.meta.blobUsed, + &self.input.taiko.tx_data, + anchor_tx, + ); + let mut alloy_transactions = Vec::new(); + for tx in transactions { + let alloy_tx: AlloyTransaction = + to_alloy_transaction(&tx).expect("can't convert to alloy"); + alloy_transactions.push(alloy_tx); + } + + let mut block = self.input.block.clone(); + // Convert alloy transactions to reth transactions and set them on the block + block.body = alloy_transactions + .into_iter() + .map(|tx| { + let signature = tx + .signature + .ok_or(ConversionError::MissingSignature) + .expect("missing signature"); + TransactionSigned::from_transaction_and_signature( + tx.try_into().expect("tx conversion failed"), + RethSignature { + r: signature.r, + s: signature.s, + odd_y_parity: signature + .y_parity + .unwrap_or_else(|| alloy_rpc_types::Parity(!signature.v.bit(0))) + .0, + }, + ) + }) + .collect(); + + let block_with_senders = block + .clone() + .with_recovered_senders() + .ok_or(BlockValidationError::SenderRecoveryError)?; + + let executor = EthExecutorProvider::ethereum(reth_chain_spec.clone()) + .eth_executor(self.db.take().unwrap()) + .taiko_data(TaikoData { + l1_header: self.input.taiko.l1_header.clone(), + parent_header: self.input.parent_header.clone(), + l2_contract: self.input.chain_spec.l2_contract.unwrap_or_default(), + }) + .optimistic(optimistic); + let BlockExecutionOutput { + state, + receipts, + requests, + gas_used, + db: full_state, + } = executor.execute((&block_with_senders, total_difficulty).into())?; + + if !optimistic { + // Validates the gas used, the receipts root and the logs bloom + validate_block_post_execution( + &block_with_senders, + &reth_chain_spec.clone(), + &receipts, + &requests, + )?; + } + + self.db = Some(full_state.database); + + let changes: HashMap = state + .state + .into_iter() + .map(|(address, bundle_account)| { + let mut account = Account { + info: bundle_account.info.unwrap_or_default(), + storage: bundle_account.storage, + status: AccountStatus::default(), + }; + account.mark_touch(); + if bundle_account.status.was_destroyed() { + account.mark_selfdestruct(); + } + if bundle_account.original_info.is_none() { + account.mark_created(); + } + (address, account) + }) + .collect(); + self.db.as_mut().unwrap().commit(changes); + + // Set the values verified in validate_block_post_execution + let header = self.header.as_mut().unwrap(); + header.gas_used = gas_used; + header.receipts_root = self.input.block.header.receipts_root; + header.logs_bloom = self.input.block.header.logs_bloom; + + Ok(()) + } +} + +impl RethBlockBuilder { + /// Finalizes the block building and returns the header and the state trie. + pub fn finalize(&mut self) -> Result
{ + let mut header = self.header.take().expect("Header not initialized"); + let block_body = BlockBody::from(self.input.block.clone()); + + header.state_root = self.calculate_state_root()?; + header.transactions_root = block_body.calculate_tx_root(); + header.withdrawals_root = block_body.calculate_withdrawals_root(); + header.ommers_hash = block_body.calculate_ommers_root(); + + Ok(header) + } + + /// Finalizes the block building and returns the header and the state trie. + pub fn calculate_state_root(&mut self) -> Result { + let mut account_touched = 0; + let mut storage_touched = 0; + + // apply state updates + let mut state_trie = mem::take(&mut self.input.parent_state_trie); + for (address, account) in &self.db.as_ref().unwrap().accounts { + // if the account has not been touched, it can be ignored + if account.state == AccountState::None { + continue; + } + + // compute the index of the current account in the state trie + let state_trie_index = keccak(address); + + // remove deleted accounts from the state trie + if account.state == AccountState::Deleted { + state_trie.delete(&state_trie_index)?; + continue; + } + + account_touched += 1; + + // otherwise, compute the updated storage root for that account + let state_storage = &account.storage; + let storage_root = { + // getting a mutable reference is more efficient than calling remove + // every account must have an entry, even newly created accounts + let (storage_trie, _) = self + .input + .parent_storage + .get_mut(address) + .expect("Address not found in storage"); + // for cleared accounts always start from the empty trie + if account.state == AccountState::StorageCleared { + storage_trie.clear(); + } + + // apply all new storage entries for the current account (address) + for (key, value) in state_storage { + let storage_trie_index = keccak(key.to_be_bytes::<32>()); + if value.is_zero() { + storage_trie.delete(&storage_trie_index)?; + } else { + storage_trie.insert_rlp(&storage_trie_index, *value)?; + } + } + + storage_touched += 1; + + storage_trie.hash() + }; + + let state_account = StateAccount { + nonce: account.info.nonce, + balance: account.info.balance, + storage_root, + code_hash: account.info.code_hash, + }; + state_trie.insert_rlp(&state_trie_index, state_account)?; + } + + debug!("Accounts touched {:?}", account_touched); + debug!("Storages touched {:?}", storage_touched); + + Ok(state_trie.hash()) + } +} + +pub fn create_mem_db(input: &mut GuestInput) -> Result { + // Verify state trie root + if input.parent_state_trie.hash() != input.parent_header.state_root { + bail!( + "Invalid state trie: expected {}, got {}", + input.parent_header.state_root, + input.parent_state_trie.hash() + ); + } + + // hash all the contract code + let contracts: HashMap = mem::take(&mut input.contracts) + .into_iter() + .map(|bytes| (keccak(&bytes).into(), bytes)) + .collect(); + + let mut account_touched = 0; + let mut storage_touched = 0; + + // Load account data into db + let mut accounts = HashMap::with_capacity(input.parent_storage.len()); + for (address, (storage_trie, slots)) in &mut input.parent_storage { + // consume the slots, as they are no longer needed afterwards + let slots = mem::take(slots); + + account_touched += 1; + + // load the account from the state trie or empty if it does not exist + let state_account = input + .parent_state_trie + .get_rlp::(&keccak(address))? + .unwrap_or_default(); + // Verify storage trie root + if storage_trie.hash() != state_account.storage_root { + bail!( + "Invalid storage trie for {address:?}: expected {}, got {}", + state_account.storage_root, + storage_trie.hash() + ); + } + + // load the corresponding code + let code_hash = state_account.code_hash; + let bytecode = if code_hash.0 == KECCAK_EMPTY.0 { + Bytecode::new() + } else { + let bytes = contracts + .get(&code_hash) + .expect("Contract not found") + .clone(); + Bytecode::new_raw(bytes) + }; + + // load storage reads + let mut storage = HashMap::with_capacity(slots.len()); + for slot in slots { + let value: U256 = storage_trie + .get_rlp(&keccak(slot.to_be_bytes::<32>()))? + .unwrap_or_default(); + storage.insert(slot, value); + + storage_touched += 1; + } + + let mem_account = DbAccount { + info: AccountInfo { + balance: state_account.balance, + nonce: state_account.nonce, + code_hash: state_account.code_hash, + code: Some(bytecode), + }, + state: AccountState::None, + storage, + }; + + accounts.insert(*address, mem_account); + } + guest_mem_forget(contracts); + + debug!("Accounts touched: {account_touched:?}"); + debug!("Storages touched: {storage_touched:?}"); + + // prepare block hash history + let mut block_hashes = HashMap::with_capacity(input.ancestor_headers.len() + 1); + block_hashes.insert(input.parent_header.number, input.parent_header.hash_slow()); + let mut prev = &input.parent_header; + for current in &input.ancestor_headers { + let current_hash = current.hash_slow(); + if prev.parent_hash != current_hash { + bail!( + "Invalid chain: {} is not the parent of {}", + current.number, + prev.number + ); + } + if input.parent_header.number < current.number + || input.parent_header.number - current.number >= MAX_BLOCK_HASH_AGE + { + bail!( + "Invalid chain: {} is not one of the {MAX_BLOCK_HASH_AGE} most recent blocks", + current.number, + ); + } + block_hashes.insert(current.number, current_hash); + prev = current; + } + + // Store database + Ok(MemDb { + accounts, + block_hashes, + }) +} + +pub fn to_alloy_transaction(tx: &TxEnvelope) -> Result { + match tx { + TxEnvelope::Legacy(tx) => { + let alloy_tx = AlloyTransaction { + hash: *tx.hash(), + nonce: tx.tx().nonce(), + block_hash: None, + block_number: None, + transaction_index: None, + to: tx.tx().to().to().copied(), + value: tx.tx().value(), + gas_price: tx.tx().gas_price(), + gas: tx.tx().gas_limit(), + max_fee_per_gas: None, + max_priority_fee_per_gas: None, + max_fee_per_blob_gas: None, + input: tx.tx().input().to_owned().into(), + signature: Some(to_alloy_signature(get_sig(tx))), + chain_id: tx.tx().chain_id(), + blob_versioned_hashes: None, + access_list: None, + transaction_type: Some(0), + ..Default::default() + }; + Ok(alloy_tx) + } + TxEnvelope::Eip2930(tx) => { + let alloy_tx = AlloyTransaction { + hash: *tx.hash(), + nonce: tx.tx().nonce(), + block_hash: None, + block_number: None, + transaction_index: None, + to: tx.tx().to().to().copied(), + value: tx.tx().value(), + gas_price: tx.tx().gas_price(), + gas: tx.tx().gas_limit(), + max_fee_per_gas: None, + max_priority_fee_per_gas: None, + max_fee_per_blob_gas: None, + input: tx.tx().input().to_owned().into(), + signature: Some(to_alloy_signature(get_sig(tx))), + chain_id: tx.tx().chain_id(), + blob_versioned_hashes: None, + access_list: Some(tx.tx().access_list.clone()), + transaction_type: Some(1), + ..Default::default() + }; + Ok(alloy_tx) + } + TxEnvelope::Eip1559(tx) => { + let alloy_tx = AlloyTransaction { + hash: *tx.hash(), + nonce: tx.tx().nonce(), + block_hash: None, + block_number: None, + transaction_index: None, + to: tx.tx().to().to().copied(), + value: tx.tx().value(), + gas_price: tx.tx().gas_price(), + gas: tx.tx().gas_limit(), + max_fee_per_gas: Some(tx.tx().max_fee_per_gas), + max_priority_fee_per_gas: Some(tx.tx().max_priority_fee_per_gas), + max_fee_per_blob_gas: None, + input: tx.tx().input().to_owned().into(), + signature: Some(to_alloy_signature(get_sig(tx))), + chain_id: tx.tx().chain_id(), + blob_versioned_hashes: None, + access_list: Some(tx.tx().access_list.clone()), + transaction_type: Some(2), + ..Default::default() + }; + Ok(alloy_tx) + } + TxEnvelope::Eip4844(tx) => { + let alloy_tx = AlloyTransaction { + hash: *tx.hash(), + nonce: tx.tx().nonce(), + block_hash: None, + block_number: None, + transaction_index: None, + to: tx.tx().to().to().copied(), + value: tx.tx().value(), + gas_price: tx.tx().gas_price(), + gas: tx.tx().gas_limit(), + max_fee_per_gas: Some(tx.tx().tx().max_fee_per_gas), + max_priority_fee_per_gas: Some(tx.tx().tx().max_priority_fee_per_gas), + max_fee_per_blob_gas: Some(tx.tx().tx().max_fee_per_blob_gas), + input: tx.tx().input().to_owned().into(), + signature: Some(to_alloy_signature(get_sig(tx))), + chain_id: tx.tx().chain_id(), + blob_versioned_hashes: Some(tx.tx().tx().blob_versioned_hashes.clone()), + access_list: Some(tx.tx().tx().access_list.clone()), + transaction_type: Some(tx.tx().tx_type() as u8), + ..Default::default() + }; + Ok(alloy_tx) + } + _ => todo!(), + } +} + +pub fn get_sig(tx: &Signed) -> Sig { + tx.signature().clone() +} + +pub fn to_alloy_signature(sig: alloy_primitives::Signature) -> alloy_rpc_types::Signature { + alloy_rpc_types::Signature { + r: sig.r(), + s: sig.s(), + v: sig.v().to_u64().try_into().unwrap(), + y_parity: Some(Parity(sig.v().to_parity_bool().y_parity())), + } +} diff --git a/lib/src/builder/execute.rs b/lib/src/builder/execute.rs deleted file mode 100644 index ccf06367..00000000 --- a/lib/src/builder/execute.rs +++ /dev/null @@ -1,551 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use alloy_consensus::{constants::BEACON_ROOTS_ADDRESS, TxEnvelope}; -use alloy_primitives::{TxKind, U256}; -use anyhow::{anyhow, bail, ensure, Context, Error, Result}; -use core::{fmt::Debug, mem::take, str::from_utf8}; -#[cfg(feature = "std")] -use log::debug; -use revm::{ - interpreter::Host, - primitives::{ - Account, Address, EVMError, HandlerCfg, ResultAndState, SpecId, TransactTo, TxEnv, - MAX_BLOB_GAS_PER_BLOCK, - }, - taiko, Database, DatabaseCommit, Evm, JournaledState, -}; -use std::collections::HashSet; -use tracing::trace; -cfg_if::cfg_if! { - if #[cfg(feature = "tracer")] { - use std::{fs::{OpenOptions, File}, io::{BufWriter, Write}, sync::{Arc, Mutex}}; - use revm::{inspector_handle_register, inspectors::TracerEip3155}; - } -} - -use super::{OptimisticDatabase, TxExecStrategy}; -use crate::{ - builder::BlockBuilder, - clear_line, - consts::GWEI_TO_WEI, - guest_mem_forget, inplace_print, - primitives::{ - alloy_eips::eip4788::SYSTEM_ADDRESS, mpt::MptNode, receipt::Receipt, Bloom, Rlp2718Bytes, - RlpBytes, - }, - print_duration, - time::{AddAssign, Duration, Instant}, - utils::{check_anchor_tx, generate_transactions}, - CycleTracker, -}; - -/// Minimum supported protocol version: SHANGHAI -const MIN_SPEC_ID: SpecId = SpecId::SHANGHAI; - -pub struct TkoTxExecStrategy {} - -impl TxExecStrategy for TkoTxExecStrategy { - fn execute_transactions(mut block_builder: BlockBuilder) -> Result> - where - D: Database + DatabaseCommit + OptimisticDatabase, - ::Error: Debug, - { - let mut tx_transact_duration = Duration::default(); - let mut tx_misc_duration = Duration::default(); - - let is_optimistic = block_builder.db().unwrap().is_optimistic(); - - let header = block_builder - .header - .as_mut() - .expect("Header is not initialized"); - // Compute the spec id - let spec_id = block_builder - .chain_spec - .active_fork(header.number, header.timestamp) - .unwrap(); - if !SpecId::enabled(spec_id, MIN_SPEC_ID) { - bail!("Invalid protocol version: expected >= {MIN_SPEC_ID:?}, got {spec_id:?}") - } - - let chain_spec = &block_builder.input.chain_spec; - let chain_id = chain_spec.chain_id(); - let is_taiko = chain_spec.is_taiko(); - trace!("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 chain_spec.is_taiko() { - Some(serde_json::from_str(&block_builder.input.taiko.anchor_tx.clone()).unwrap()) - } else { - None - }; - let mut transactions = generate_transactions( - chain_spec, - block_builder.input.taiko.block_proposed.meta.blobUsed, - &block_builder.input.taiko.tx_data, - anchor_tx, - ); - - // Setup the EVM environment - let evm = Evm::builder().with_db(block_builder.db.take().unwrap()); - #[cfg(feature = "tracer")] - let evm = evm.with_external_context(TracerEip3155::new(Box::new(std::io::stdout()))); - let evm = evm - .with_handler_cfg(HandlerCfg::new_with_taiko(spec_id, is_taiko)) - .modify_cfg_env(|cfg_env| { - // set the EVM configuration - cfg_env.chain_id = chain_id; - }) - .modify_block_env(|blk_env| { - // set the EVM block environment - blk_env.number = U256::from(header.number); - blk_env.coinbase = block_builder.input.beneficiary; - blk_env.timestamp = header.timestamp.try_into().unwrap(); - blk_env.difficulty = U256::ZERO; - blk_env.prevrandao = Some(header.mix_hash); - 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.try_into().unwrap()); - } - }); - let evm = if is_taiko { - evm.append_handler_register(taiko::handler_register::taiko_handle_register) - } else { - evm - }; - #[cfg(feature = "tracer")] - let evm = evm.append_handler_register(inspector_handle_register); - let mut evm = evm.build(); - - // Set the beacon block root in the EVM - if spec_id >= SpecId::CANCUN { - let parent_beacon_block_root = header.parent_beacon_block_root.unwrap(); - - // From EIP-4788 Beacon block root in the EVM (Cancun): - // "Call BEACON_ROOTS_ADDRESS as SYSTEM_ADDRESS with the 32-byte input of - // header.parent_beacon_block_root, a gas limit of 30_000_000, and 0 value." - evm.env_mut().tx = TxEnv { - transact_to: TransactTo::Call(BEACON_ROOTS_ADDRESS), - caller: SYSTEM_ADDRESS, - data: parent_beacon_block_root.into(), - gas_limit: 30_000_000, - value: U256::ZERO, - ..Default::default() - }; - - let tmp = evm.env_mut().block.clone(); - - // disable block gas limit validation and base fee checks - evm.block_mut().gas_limit = U256::from(evm.tx().gas_limit); - evm.block_mut().basefee = U256::ZERO; - - let ResultAndState { mut state, .. } = - evm.transact().expect("beacon roots contract call failed"); - evm.env_mut().block = tmp; - - // commit only the changes to the beacon roots contract - state.remove(&SYSTEM_ADDRESS); - state.remove(&evm.block().coinbase); - evm.context.evm.db.commit(state); - } - - // bloom filter over all transaction logs - let mut logs_bloom = Bloom::default(); - // keep track of the gas used over all transactions - let mut cumulative_gas_used = 0u64; - let mut blob_gas_used = 0_u64; - - // process all the transactions - let mut tx_trie = MptNode::default(); - let mut receipt_trie = MptNode::default(); - // track the actual tx number to use in the tx/receipt trees as the key - let mut actual_tx_no = 0usize; - let num_transactions = transactions.len(); - for (tx_no, tx) in take(&mut transactions).into_iter().enumerate() { - if !is_optimistic { - cfg_if::cfg_if! { - if #[cfg(all(all(target_os = "zkvm", target_vendor = "succinct"), feature = "sp1-cycle-tracker"))]{ - println!( - "{:?}", - &format!("\rprocessing tx {tx_no}/{num_transactions}...") - ); - } else { - inplace_print(&format!("\rprocessing tx {tx_no}/{num_transactions}...")); - } - } - } else { - trace!("\rprocessing tx {tx_no}/{num_transactions}..."); - } - - #[cfg(feature = "tracer")] - let trace = set_trace_writer( - &mut evm.context.external, - chain_id, - block_builder.input.block_number, - actual_tx_no, - ); - - // anchor transaction always the first transaction - let is_anchor = is_taiko && tx_no == 0; - - // setup the EVM environment - let tx_env = &mut evm.env_mut().tx; - fill_eth_tx_env(tx_env, &tx)?; - // Set and check some taiko specific values - 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 = chain_spec.l2_contract.unwrap_or_default(); - - // Data blobs are not allowed on L2 - ensure!(tx_env.blob_hashes.len() == 0); - } - - // if the signature was not valid, the caller address will have been set to zero - if tx_env.caller == Address::ZERO { - if is_anchor { - bail!("Error recovering anchor signature"); - } - #[cfg(feature = "std")] - debug!("Error recovering address for transaction {tx_no}"); - if !is_taiko { - bail!("invalid signature"); - } - // If the signature is not valid, skip the transaction - continue; - } - - // verify the anchor tx - if is_anchor { - check_anchor_tx(&block_builder.input, &tx, &tx_env.caller) - .expect("invalid anchor tx"); - } - - // verify transaction gas - let block_available_gas = block_builder.input.gas_limit - cumulative_gas_used; - if block_available_gas < tx_env.gas_limit { - if is_optimistic { - continue; - } - if is_anchor { - bail!("Error at transaction {tx_no}: gas exceeds block limit"); - } - #[cfg(feature = "std")] - debug!("Error at transaction {tx_no}: gas exceeds block limit"); - if !is_taiko { - bail!("gas exceeds block limit"); - } - continue; - } - - // verify blob gas - if let TxEnvelope::Eip4844(blob_tx) = &tx { - let tx = blob_tx.tx().tx(); - blob_gas_used = blob_gas_used.checked_add(tx.blob_gas()).unwrap(); - ensure!( - blob_gas_used <= MAX_BLOB_GAS_PER_BLOCK, - "Error at transaction {tx_no}: total blob gas spent exceeds the limit", - ); - } - - // process the transaction - let start = Instant::now(); - let cycle_tracker = CycleTracker::start("evm.transact()"); - let ResultAndState { result, state } = match evm.transact() { - Ok(result) => result, - Err(err) => { - // Clear the state for the next tx - evm.context.evm.journaled_state = JournaledState::new(spec_id, HashSet::new()); - - if is_optimistic { - continue; - } - if !is_taiko { - bail!("tx failed to execute successfully: {err:?}"); - } - if is_anchor { - bail!("Anchor tx failed to execute successfully: {err:?}"); - } - // only continue for invalid tx errors, not db errors (because those can be - // manipulated by the prover) - match err { - EVMError::Transaction(invalid_transaction) => { - #[cfg(feature = "std")] - debug!("Invalid tx at {tx_no}: {invalid_transaction:?}"); - cycle_tracker.end(); - // skip the tx - continue; - } - _ => { - // any other error is not allowed - bail!("Error at tx {tx_no}: {err:?}"); - } - } - } - }; - cycle_tracker.end(); - #[cfg(feature = "std")] - trace!(" Ok: {result:?}"); - - #[cfg(feature = "tracer")] - // Flush the trace writer - trace.lock().unwrap().flush().expect("Error flushing trace"); - - tx_transact_duration.add_assign(start.elapsed()); - - let start = Instant::now(); - - // anchor tx needs to succeed - if is_anchor && !result.is_success() && !is_optimistic { - bail!( - "Error at transaction {tx_no}: execute anchor failed {result:?}, output {:?}", - result.output().map(|o| from_utf8(o).unwrap_or_default()) - ); - } - - // keep track of all the gas used in the block - let gas_used = result.gas_used(); - cumulative_gas_used = cumulative_gas_used.checked_add(gas_used).unwrap(); - - // create the receipt from the EVM result - let receipt = Receipt::new( - tx.tx_type() as u8, - result.is_success(), - cumulative_gas_used.try_into().unwrap(), - result.logs().iter().map(|log| log.clone().into()).collect(), - ); - - // update the state - evm.context.evm.db.commit(state); - - // accumulate logs to the block bloom filter - logs_bloom.accrue_bloom(&receipt.payload.logs_bloom); - - // Add receipt and tx to tries - let trie_key = alloy_rlp::encode(actual_tx_no); - // Add to tx trie - tx_trie.insert_rlp_encoded(&trie_key, tx.to_rlp_2718())?; - // Add to receipt trie - receipt_trie.insert_rlp(&trie_key, receipt)?; - - // If we got here it means the tx is not invalid - actual_tx_no += 1; - - tx_misc_duration.add_assign(start.elapsed()); - } - if !is_optimistic { - clear_line(); - print_duration("Tx transact time: ", tx_transact_duration); - print_duration("Tx misc time: ", tx_misc_duration); - } - clear_line(); - println!("actual Tx: {}", actual_tx_no); - - let mut db = &mut evm.context.evm.db; - - // process withdrawals unconditionally after any transactions - let mut withdrawals_trie = MptNode::default(); - for (i, withdrawal) in block_builder.input.withdrawals.iter().enumerate() { - // the withdrawal amount is given in Gwei - let amount_wei = GWEI_TO_WEI - .checked_mul(withdrawal.amount.try_into().unwrap()) - .unwrap(); - - // Credit withdrawal amount - increase_account_balance(&mut db, withdrawal.address, amount_wei)?; - // Add withdrawal to trie - withdrawals_trie - .insert_rlp(&i.to_rlp(), withdrawal) - .with_context(|| "failed to insert withdrawal")?; - } - - // Update result header with computed values - header.transactions_root = tx_trie.hash(); - header.receipts_root = receipt_trie.hash(); - header.logs_bloom = logs_bloom; - header.gas_used = cumulative_gas_used.into(); - 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.into()); - } - - // Leak memory, save cycles - guest_mem_forget([tx_trie, receipt_trie, withdrawals_trie]); - // Return block builder with updated database - Ok(block_builder.with_db(evm.context.evm.inner.db)) - } -} - -pub fn fill_eth_tx_env(tx_env: &mut TxEnv, tx: &TxEnvelope) -> Result<(), Error> { - // Clear values that may not be set - tx_env.access_list.clear(); - tx_env.blob_hashes.clear(); - tx_env.max_fee_per_blob_gas.take(); - // Get the data from the tx - // TODO(Brecht): use optimized recover - match tx { - TxEnvelope::Legacy(tx) => { - let cycle_tracker = CycleTracker::start("Legacy"); - tx_env.caller = tx.recover_signer().unwrap_or_default(); - cycle_tracker.end(); - let tx = tx.tx(); - 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 { - TransactTo::Call(to_addr) - } else { - TransactTo::create() - }; - tx_env.value = tx.value; - tx_env.data = tx.input.clone(); - tx_env.chain_id = tx.chain_id; - tx_env.nonce = Some(tx.nonce); - tx_env.access_list.clear(); - } - TxEnvelope::Eip2930(tx) => { - let cycle_tracker = CycleTracker::start("Eip2930"); - tx_env.caller = tx.recover_signer().unwrap_or_default(); - cycle_tracker.end(); - let tx = tx.tx(); - 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 { - TransactTo::Call(to_addr) - } else { - TransactTo::create() - }; - tx_env.value = tx.value; - tx_env.data = tx.input.clone(); - tx_env.chain_id = Some(tx.chain_id); - tx_env.nonce = Some(tx.nonce); - tx_env.access_list = tx.access_list.flattened(); - } - TxEnvelope::Eip1559(tx) => { - let cycle_tracker = CycleTracker::start("Eip1559"); - tx_env.caller = tx.recover_signer().unwrap_or_default(); - cycle_tracker.end(); - let tx = tx.tx(); - 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 { - TransactTo::Call(to_addr) - } else { - TransactTo::create() - }; - tx_env.value = tx.value; - tx_env.data = tx.input.clone(); - tx_env.chain_id = Some(tx.chain_id); - tx_env.nonce = Some(tx.nonce); - tx_env.access_list = tx.access_list.flattened(); - } - TxEnvelope::Eip4844(tx) => { - let cycle_tracker = CycleTracker::start("Eip1559"); - tx_env.caller = tx.recover_signer().unwrap_or_default(); - cycle_tracker.end(); - let tx = tx.tx().tx(); - 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); - tx_env.value = tx.value; - tx_env.data = tx.input.clone(); - tx_env.chain_id = Some(tx.chain_id); - tx_env.nonce = Some(tx.nonce); - tx_env.access_list = tx.access_list.flattened(); - 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(()) -} - -pub fn increase_account_balance( - db: &mut D, - address: Address, - amount_wei: U256, -) -> anyhow::Result<()> -where - D: Database + DatabaseCommit, - ::Error: Debug, -{ - // Read account from database - let mut account: Account = db - .basic(address) - .map_err(|db_err| anyhow!("Error increasing account balance for {address}: {db_err:?}"))? - .unwrap_or_default() - .into(); - // Credit withdrawal amount - account.info.balance = account.info.balance.checked_add(amount_wei).unwrap(); - account.mark_touch(); - // Commit changes to database - db.commit([(address, account)].into()); - - Ok(()) -} - -#[cfg(feature = "tracer")] -fn set_trace_writer( - tracer: &mut TracerEip3155, - chain_id: u64, - block_number: u64, - tx_no: usize, -) -> Arc>> { - struct FlushWriter { - writer: Arc>>, - } - impl FlushWriter { - fn new(writer: Arc>>) -> Self { - Self { writer } - } - } - impl Write for FlushWriter { - fn write(&mut self, buf: &[u8]) -> std::io::Result { - self.writer.lock().unwrap().write(buf) - } - - fn flush(&mut self) -> std::io::Result<()> { - self.writer.lock().unwrap().flush() - } - } - - // Create the traces directory if it doesn't exist - std::fs::create_dir_all("traces").expect("Failed to create traces directory"); - - // Construct the file writer to write the trace to - let file_name = format!("traces/{}_{}_{}.json", chain_id, block_number, tx_no); - let write = OpenOptions::new() - .write(true) - .create(true) - .truncate(true) - .open(file_name); - let trace = Arc::new(Mutex::new(BufWriter::new( - write.expect("Failed to open file"), - ))); - let writer = FlushWriter::new(Arc::clone(&trace)); - - // Set the writer inside the handler in revm - tracer.set_writer(Box::new(writer)); - - trace -} diff --git a/lib/src/builder/finalize.rs b/lib/src/builder/finalize.rs deleted file mode 100644 index c59c3ffc..00000000 --- a/lib/src/builder/finalize.rs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use core::mem; - -use alloy_consensus::Header as AlloyConsensusHeader; -use anyhow::Result; -use revm::{Database, DatabaseCommit}; - -use crate::{ - builder::BlockBuilder, - guest_mem_forget, - mem_db::{AccountState, MemDb}, - primitives::{ - keccak::keccak, - mpt::{MptNode, StateAccount}, - }, -}; - -pub trait BlockFinalizeStrategy -where - D: Database + DatabaseCommit, - ::Error: core::fmt::Debug, -{ - fn finalize(block_builder: BlockBuilder) -> Result<(AlloyConsensusHeader, MptNode)>; -} - -pub struct MemDbBlockFinalizeStrategy {} - -impl BlockFinalizeStrategy for MemDbBlockFinalizeStrategy { - fn finalize(mut block_builder: BlockBuilder) -> Result<(AlloyConsensusHeader, MptNode)> { - let db: MemDb = block_builder.db.take().expect("DB not initialized"); - - #[cfg(feature = "sp1-cycle-tracker")] - { - let mut account_touched = 0; - let mut storage_touched = 0; - } - - // apply state updates - let mut state_trie = mem::take(&mut block_builder.input.parent_state_trie); - for (address, account) in &db.accounts { - // if the account has not been touched, it can be ignored - if account.state == AccountState::None { - continue; - } - - // compute the index of the current account in the state trie - let state_trie_index = keccak(address); - - // remove deleted accounts from the state trie - if account.state == AccountState::Deleted { - state_trie.delete(&state_trie_index)?; - continue; - } - - #[cfg(feature = "sp1-cycle-tracker")] - { - account_touched += 1; - } - - // otherwise, compute the updated storage root for that account - let state_storage = &account.storage; - let storage_root = { - // getting a mutable reference is more efficient than calling remove - // every account must have an entry, even newly created accounts - let (storage_trie, _) = block_builder - .input - .parent_storage - .get_mut(address) - .expect("Address not found in storage"); - // for cleared accounts always start from the empty trie - if account.state == AccountState::StorageCleared { - storage_trie.clear(); - } - - // apply all new storage entries for the current account (address) - for (key, value) in state_storage { - let storage_trie_index = keccak(key.to_be_bytes::<32>()); - if value.is_zero() { - storage_trie.delete(&storage_trie_index)?; - } else { - storage_trie.insert_rlp(&storage_trie_index, *value)?; - } - - #[cfg(feature = "sp1-cycle-tracker")] - { - storage_touched += 1; - } - } - - storage_trie.hash() - }; - - let state_account = StateAccount { - nonce: account.info.nonce, - balance: account.info.balance, - storage_root, - code_hash: account.info.code_hash, - }; - state_trie.insert_rlp(&state_trie_index, state_account)?; - } - - #[cfg(feature = "sp1-cycle-tracker")] - { - println!("finalize Account touched {:?}", account_touched); - println!("finalize Storage touched {:?}", storage_touched); - } - - // update result header with the new state root - let mut header = block_builder.header.take().expect("Header not initialized"); - header.state_root = state_trie.hash(); - - // Leak memory, save cycles - guest_mem_forget(block_builder); - - Ok((header, state_trie)) - } -} diff --git a/lib/src/builder/initialize.rs b/lib/src/builder/initialize.rs deleted file mode 100644 index 11fbd1dd..00000000 --- a/lib/src/builder/initialize.rs +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use core::mem; - -use anyhow::{bail, Result}; -use revm::{ - primitives::{AccountInfo, Bytecode, HashMap, B256}, - Database, DatabaseCommit, -}; - -use crate::{ - builder::BlockBuilder, - consts::MAX_BLOCK_HASH_AGE, - guest_mem_forget, - mem_db::{AccountState, DbAccount, MemDb}, - primitives::{ - keccak::{keccak, KECCAK_EMPTY}, - mpt::StateAccount, - Bytes, - }, - utils::HeaderHasher, -}; - -pub trait DbInitStrategy -where - D: Database + DatabaseCommit, - ::Error: core::fmt::Debug, -{ - fn initialize_database(block_builder: BlockBuilder) -> Result>; -} - -pub struct MemDbInitStrategy {} - -impl DbInitStrategy for MemDbInitStrategy { - fn initialize_database(mut block_builder: BlockBuilder) -> Result> { - // Verify state trie root - if block_builder.input.parent_state_trie.hash() - != block_builder.input.parent_header.state_root - { - bail!( - "Invalid state trie: expected {}, got {}", - block_builder.input.parent_header.state_root, - block_builder.input.parent_state_trie.hash() - ); - } - - // hash all the contract code - let contracts: HashMap = mem::take(&mut block_builder.input.contracts) - .into_iter() - .map(|bytes| (keccak(&bytes).into(), bytes)) - .collect(); - - #[cfg(all( - all(target_os = "zkvm", target_vendor = "succinct"), - feature = "sp1-cycle-tracker" - ))] - { - let mut account_touched = 0; - let mut storage_touched = 0; - } - - // Load account data into db - let mut accounts = HashMap::with_capacity(block_builder.input.parent_storage.len()); - for (address, (storage_trie, slots)) in &mut block_builder.input.parent_storage { - // consume the slots, as they are no longer needed afterwards - let slots = mem::take(slots); - - // load the account from the state trie or empty if it does not exist - let state_account = block_builder - .input - .parent_state_trie - .get_rlp::(&keccak(address))? - .unwrap_or_default(); - // Verify storage trie root - if storage_trie.hash() != state_account.storage_root { - bail!( - "Invalid storage trie for {address:?}: expected {}, got {}", - state_account.storage_root, - storage_trie.hash() - ); - } - #[cfg(all( - all(target_os = "zkvm", target_vendor = "succinct"), - feature = "sp1-cycle-tracker" - ))] - { - account_touched += 1; - } - - // load the corresponding code - let code_hash = state_account.code_hash; - let bytecode = if code_hash.0 == KECCAK_EMPTY.0 { - Bytecode::new() - } else { - let bytes = contracts - .get(&code_hash) - .expect("Contract not found") - .clone(); - Bytecode::new_raw(bytes) - }; - - // load storage reads - let mut storage = HashMap::with_capacity(slots.len()); - for slot in slots { - let value: crate::primitives::U256 = storage_trie - .get_rlp(&keccak(slot.to_be_bytes::<32>()))? - .unwrap_or_default(); - storage.insert(slot, value); - #[cfg(all( - all(target_os = "zkvm", target_vendor = "succinct"), - feature = "sp1-cycle-tracker" - ))] - { - storage_touched += 1; - } - } - - let mem_account = DbAccount { - info: AccountInfo { - balance: state_account.balance, - nonce: state_account.nonce, - code_hash: state_account.code_hash, - code: Some(bytecode), - }, - state: AccountState::None, - storage, - }; - - accounts.insert(*address, mem_account); - } - guest_mem_forget(contracts); - - #[cfg(all( - all(target_os = "zkvm", target_vendor = "succinct"), - feature = "sp1-cycle-tracker" - ))] - { - println!("initialize_db Account touch {account_touched:?}"); - println!("initialize_db Storage touch {storage_touched:?}"); - } - - // prepare block hash history - let mut block_hashes = - HashMap::with_capacity(block_builder.input.ancestor_headers.len() + 1); - block_hashes.insert( - block_builder.input.parent_header.number, - block_builder.input.parent_header.hash(), - ); - let mut prev = &block_builder.input.parent_header; - for current in &block_builder.input.ancestor_headers { - let current_hash = current.hash(); - if prev.parent_hash != current_hash { - bail!( - "Invalid chain: {} is not the parent of {}", - current.number, - prev.number - ); - } - if block_builder.input.parent_header.number < current.number - || block_builder.input.parent_header.number - current.number >= MAX_BLOCK_HASH_AGE - { - bail!( - "Invalid chain: {} is not one of the {MAX_BLOCK_HASH_AGE} most recent blocks", - current.number, - ); - } - block_hashes.insert(current.number, current_hash); - prev = current; - } - - // Store database - Ok(block_builder.with_db(MemDb { - accounts, - block_hashes, - })) - } -} diff --git a/lib/src/builder/mod.rs b/lib/src/builder/mod.rs deleted file mode 100644 index be76fe72..00000000 --- a/lib/src/builder/mod.rs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use alloy_consensus::Header as AlloyConsensusHeader; -use anyhow::Result; -use revm::{Database, DatabaseCommit}; - -pub use self::execute::TkoTxExecStrategy; -use crate::{ - builder::{ - finalize::{BlockFinalizeStrategy, MemDbBlockFinalizeStrategy}, - initialize::{DbInitStrategy, MemDbInitStrategy}, - prepare::{HeaderPrepStrategy, TaikoHeaderPrepStrategy}, - }, - consts::ChainSpec, - input::GuestInput, - mem_db::MemDb, - primitives::mpt::MptNode, - CycleTracker, -}; - -pub mod execute; -mod finalize; -mod initialize; -pub mod prepare; - -/// Optimistic database -#[allow(async_fn_in_trait)] -pub trait OptimisticDatabase { - /// Handle post execution work - async fn fetch_data(&mut self) -> bool; - - /// If the current database is optimistic - fn is_optimistic(&self) -> bool; -} - -/// A generic builder for building a block. -#[derive(Clone, Debug)] -pub struct BlockBuilder { - pub(crate) chain_spec: ChainSpec, - pub(crate) input: GuestInput, - pub(crate) db: Option, - pub(crate) header: Option, -} - -impl BlockBuilder -where - D: Database + DatabaseCommit + OptimisticDatabase, - ::Error: core::fmt::Debug, -{ - /// Creates a new block builder. - pub fn new(input: &GuestInput) -> BlockBuilder { - BlockBuilder { - chain_spec: input.chain_spec.clone(), - db: None, - header: None, - input: input.clone(), - } - } - - /// Sets the database instead of initializing it from the input. - pub fn with_db(mut self, db: D) -> Self { - self.db = Some(db); - self - } - - /// Initializes the database from the input. - pub fn initialize_database>(self) -> Result { - let cycle_tracker = CycleTracker::start("initialize_database"); - let res = T::initialize_database(self); - cycle_tracker.end(); - res - } - - /// Initializes the header. This must be called before executing transactions. - pub fn prepare_header(self) -> Result { - let cycle_tracker = CycleTracker::start("prepare_header"); - let res = T::prepare_header(self); - cycle_tracker.end(); - res - } - - /// Executes all input transactions. - pub fn execute_transactions(self) -> Result { - let cycle_tracker = CycleTracker::start("execute_transactions"); - let res = T::execute_transactions(self); - cycle_tracker.end(); - res - } - - /// Finalizes the block building and returns the header and the state trie. - pub fn finalize>(self) -> Result<(AlloyConsensusHeader, MptNode)> { - let cycle_tracker = CycleTracker::start("finalize"); - let res = T::finalize(self); - cycle_tracker.end(); - res - } - - /// Returns a reference to the database. - pub fn db(&self) -> Option<&D> { - self.db.as_ref() - } - - /// Returns a mutable reference to the database. - pub fn mut_db(&mut self) -> Option<&mut D> { - self.db.as_mut() - } -} - -/// A bundle of strategies for building a block using [BlockBuilder]. -pub trait BlockBuilderStrategy { - type DbInitStrategy: DbInitStrategy; - type HeaderPrepStrategy: HeaderPrepStrategy; - type TxExecStrategy: TxExecStrategy; - type BlockFinalizeStrategy: BlockFinalizeStrategy; - - /// Builds a block from the given input. - fn build_from(input: &GuestInput) -> Result<(AlloyConsensusHeader, MptNode)> { - BlockBuilder::::new(input) - .initialize_database::()? - .prepare_header::()? - .execute_transactions::()? - .finalize::() - } -} - -/// The [BlockBuilderStrategy] for building a Taiko block. -pub struct TaikoStrategy {} -impl BlockBuilderStrategy for TaikoStrategy { - type DbInitStrategy = MemDbInitStrategy; - type HeaderPrepStrategy = TaikoHeaderPrepStrategy; - type TxExecStrategy = TkoTxExecStrategy; - type BlockFinalizeStrategy = MemDbBlockFinalizeStrategy; -} -pub trait TxExecStrategy { - fn execute_transactions(block_builder: BlockBuilder) -> Result> - where - D: Database + DatabaseCommit + OptimisticDatabase, - ::Error: core::fmt::Debug; -} diff --git a/lib/src/builder/prepare.rs b/lib/src/builder/prepare.rs deleted file mode 100644 index 9a8ab6ca..00000000 --- a/lib/src/builder/prepare.rs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use core::fmt::Debug; - -use alloy_consensus::Header as AlloyConsensusHeader; -use anyhow::{bail, Context, Result}; -use revm::{Database, DatabaseCommit}; - -use crate::{builder::BlockBuilder, consts::MAX_EXTRA_DATA_BYTES, utils::HeaderHasher}; - -pub trait HeaderPrepStrategy { - fn prepare_header(block_builder: BlockBuilder) -> Result> - where - D: Database + DatabaseCommit, - ::Error: core::fmt::Debug; -} - -pub struct TaikoHeaderPrepStrategy {} - -impl HeaderPrepStrategy for TaikoHeaderPrepStrategy { - fn prepare_header(mut block_builder: BlockBuilder) -> Result> - where - D: Database + DatabaseCommit, - ::Error: Debug, - { - // Validate timestamp - let timestamp: u64 = block_builder.input.timestamp; - if timestamp < block_builder.input.parent_header.timestamp { - bail!( - "Invalid timestamp: expected >= {}, got {}", - block_builder.input.parent_header.timestamp, - block_builder.input.timestamp, - ); - } - // Validate extra data - let extra_data_bytes = block_builder.input.extra_data.len(); - if extra_data_bytes > MAX_EXTRA_DATA_BYTES { - bail!("Invalid extra data: expected <= {MAX_EXTRA_DATA_BYTES}, got {extra_data_bytes}") - } - // Derive header - let number: u64 = block_builder.input.parent_header.number; - block_builder.header = Some(AlloyConsensusHeader { - // Initialize fields that we can compute from the parent - parent_hash: block_builder.input.parent_header.hash(), - number: number - .checked_add(1) - .with_context(|| "Invalid block number: too large")?, - 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.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.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() - }); - Ok(block_builder) - } -} diff --git a/lib/src/consts.rs b/lib/src/consts.rs index 7db4f634..bc941fd1 100644 --- a/lib/src/consts.rs +++ b/lib/src/consts.rs @@ -1,17 +1,3 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - //! Constants for the Ethereum protocol. extern crate alloc; @@ -19,7 +5,7 @@ use alloc::collections::BTreeMap; use alloy_primitives::Address; use anyhow::{anyhow, bail, Result}; -use revm::primitives::SpecId; +use reth_primitives::revm_primitives::SpecId; use serde::{Deserialize, Serialize}; use serde_json::Value; diff --git a/lib/src/input.rs b/lib/src/input.rs index d0b30e47..eeef9288 100644 --- a/lib/src/input.rs +++ b/lib/src/input.rs @@ -1,35 +1,19 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. use core::fmt::Debug; #[cfg(feature = "std")] use std::path::PathBuf; -use alloy_consensus::Header as AlloyConsensusHeader; use alloy_rpc_types::Withdrawal as AlloyWithdrawal; use alloy_sol_types::{sol, SolCall}; use anyhow::{anyhow, Result}; -use revm::primitives::HashMap; +use reth_primitives::revm_primitives::{Address, Bytes, HashMap, B256, U256}; use serde::{Deserialize, Serialize}; use serde_with::serde_as; +use reth_primitives::{Block as RethBlock, Header}; + #[cfg(not(feature = "std"))] use crate::no_std::*; -use crate::{ - consts::ChainSpec, - primitives::{mpt::MptNode, Address, Bytes, B256, U256}, - serde_with::{RlpBytes, RlpHexBytes}, -}; +use crate::{consts::ChainSpec, primitives::mpt::MptNode}; /// Represents the state of an account's storage. /// The storage trie together with the used storage slots allow us to reconstruct all the @@ -40,18 +24,14 @@ pub type StorageEntry = (MptNode, Vec); #[serde_as] #[derive(Debug, Clone, Default, Deserialize, Serialize)] pub struct GuestInput { + /// Reth block + pub block: RethBlock, /// The network to generate the proof for pub chain_spec: ChainSpec, /// Block number pub block_number: u64, - /// Block hash - for reference! - 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, + pub parent_header: Header, /// Address to which all priority fees in this block are transferred. pub beneficiary: Address, /// Scalar equal to the current limit of gas expenditure per block. @@ -71,8 +51,7 @@ pub struct GuestInput { /// The code of all unique contracts. pub contracts: Vec, /// List of at most 256 previous block headers - #[serde_as(as = "Vec")] - pub ancestor_headers: Vec, + pub ancestor_headers: Vec
, /// Base fee per gas pub base_fee_per_gas: u64, @@ -88,8 +67,7 @@ pub struct GuestInput { #[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct TaikoGuestInput { /// header - #[serde_as(as = "RlpBytes")] - pub l1_header: AlloyConsensusHeader, + pub l1_header: Header, pub tx_data: Vec, pub anchor_tx: String, pub block_proposed: BlockProposed, @@ -107,8 +85,7 @@ pub struct TaikoProverData { #[serde_as] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct GuestOutput { - #[serde_as(as = "RlpHexBytes")] - pub header: AlloyConsensusHeader, + pub header: Header, pub hash: B256, } diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 79925dc6..31b6f809 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -1,16 +1,3 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #![cfg_attr(any(not(feature = "std")), no_std)] #[cfg(feature = "std")] @@ -41,7 +28,6 @@ pub mod utils; #[cfg(not(target_os = "zkvm"))] mod time { - pub use core::ops::AddAssign; pub use std::time::{Duration, Instant}; } @@ -59,9 +45,9 @@ mod time { pub fn now() -> Instant { Instant::default() } - pub fn duration_since(&self, _instant: Instant) -> Duration { - Duration::default() - } + //pub fn duration_since(&self, _instant: Instant) -> Duration { + // Duration::default() + //} pub fn elapsed(&self) -> Duration { Duration::default() } @@ -165,7 +151,7 @@ pub fn inplace_print(title: &str) { if consts::IN_CONTAINER.is_some() { return; } - print!("\r\n{title}"); + print!("\r{title}"); #[cfg(all(feature = "std", debug_assertions))] io::stdout().flush().unwrap(); } @@ -174,7 +160,7 @@ pub fn clear_line() { if consts::IN_CONTAINER.is_some() { return; } - print!("\r\n\x1B[2K"); + print!("\r\x1B[2K"); } /// call forget only if running inside the guest @@ -182,90 +168,3 @@ pub fn guest_mem_forget(_t: T) { #[cfg(target_os = "zkvm")] // TODO: separate for risc0 core::mem::forget(_t) } - -pub trait RlpBytes: Sized { - /// Decodes the blob into the appropriate type. - /// The input must contain exactly one value and no trailing data. - fn decode_bytes(bytes: impl AsRef<[u8]>) -> Result; -} - -impl RlpBytes for T -where - T: alloy_rlp::Decodable, -{ - #[inline] - fn decode_bytes(bytes: impl AsRef<[u8]>) -> Result { - let mut buf = bytes.as_ref(); - let this = T::decode(&mut buf)?; - if buf.is_empty() { - Ok(this) - } else { - Err(alloy_rlp::Error::Custom("Trailing data")) - } - } -} - -pub mod serde_with { - use serde::{Deserialize, Deserializer, Serialize, Serializer}; - use serde_with::{DeserializeAs, SerializeAs}; - - use super::RlpBytes as _; - - pub struct RlpBytes {} - - impl SerializeAs for RlpBytes - where - T: alloy_rlp::Encodable, - { - fn serialize_as(source: &T, serializer: S) -> Result - where - S: Serializer, - { - let bytes = alloy_rlp::encode(source); - bytes.serialize(serializer) - } - } - - impl<'de, T> DeserializeAs<'de, T> for RlpBytes - where - T: alloy_rlp::Decodable, - { - fn deserialize_as(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let bytes = >::deserialize(deserializer)?; - T::decode_bytes(bytes).map_err(serde::de::Error::custom) - } - } - - pub struct RlpHexBytes {} - - impl SerializeAs for RlpHexBytes - where - T: alloy_rlp::Encodable, - { - fn serialize_as(source: &T, serializer: S) -> Result - where - S: Serializer, - { - let bytes = alloy_rlp::encode(source); - let hex_str = hex::encode(bytes); - hex_str.serialize(serializer) - } - } - - impl<'de, T> DeserializeAs<'de, T> for RlpHexBytes - where - T: alloy_rlp::Decodable, - { - fn deserialize_as(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let hex_str = ::deserialize(deserializer)?; - let bytes = hex::decode(hex_str).unwrap(); - T::decode_bytes(bytes).map_err(serde::de::Error::custom) - } - } -} diff --git a/lib/src/mem_db.rs b/lib/src/mem_db.rs index 50930945..dc003e78 100644 --- a/lib/src/mem_db.rs +++ b/lib/src/mem_db.rs @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. use anyhow::anyhow; -use revm::{ - primitives::{Account, AccountInfo, Bytecode}, - Database, DatabaseCommit, +use reth_evm::execute::ProviderError; +use reth_primitives::revm_primitives::{ + db::{Database, DatabaseCommit}, + Account, AccountInfo, Bytecode, }; use serde::{Deserialize, Serialize}; use std::collections::{hash_map::Entry, HashMap}; @@ -44,12 +45,6 @@ pub enum DbError { Unspecified(#[from] anyhow::Error), } -impl From for anyhow::Error { - fn from(error: DbError) -> Self { - anyhow!(error) - } -} - #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum AccountState { // Account can be cleared/removed from state. @@ -141,13 +136,13 @@ impl MemDb { } impl Database for MemDb { - type Error = DbError; + type Error = ProviderError; /// Get basic account information. fn basic(&mut self, address: Address) -> Result, Self::Error> { match self.accounts.get(&address) { Some(db_account) => Ok(db_account.info()), - None => Err(DbError::AccountNotFound(address)), + None => Err(ProviderError::BestBlockNotFound), } } @@ -169,26 +164,29 @@ impl Database for MemDb { // if the account has been deleted or cleared, we must return 0 AccountState::StorageCleared => Ok(U256::ZERO), // otherwise this is an uncached load - _ => Err(DbError::SlotNotFound(address, index)), + _ => Err(ProviderError::BestBlockNotFound), }, }, // otherwise this is an uncached load - None => Err(DbError::AccountNotFound(address)), + None => Err(ProviderError::BestBlockNotFound), } } fn block_hash(&mut self, number: U256) -> Result { - let block_no: u64 = number.try_into().map_err(|_| { - anyhow!( - "invalid block number: expected <= {}, got {}", - u64::MAX, - &number - ) - })?; + let block_no: u64 = number + .try_into() + .map_err(|_| { + anyhow!( + "invalid block number: expected <= {}, got {}", + u64::MAX, + &number + ) + }) + .expect("block hash not found"); self.block_hashes .get(&block_no) .copied() - .ok_or(DbError::BlockNotFound(block_no)) + .ok_or(ProviderError::BestBlockNotFound) } } diff --git a/lib/src/primitives/eip4844.rs b/lib/src/primitives/eip4844.rs index 0dfca5a2..e135261e 100644 --- a/lib/src/primitives/eip4844.rs +++ b/lib/src/primitives/eip4844.rs @@ -1,7 +1,9 @@ //! Helpers for working with EIP-4844 blob fee. // re-exports from revm for calculating blob fee -pub use revm_primitives::{calc_blob_gasprice, calc_excess_blob_gas as calculate_excess_blob_gas}; +pub use reth_primitives::revm_primitives::{ + calc_blob_gasprice, calc_excess_blob_gas as calculate_excess_blob_gas, +}; #[cfg(feature = "c-kzg")] use sha2::{Digest, Sha256}; @@ -34,7 +36,7 @@ mod trusted_setup { use std::{io::Write, sync::Arc}; use once_cell::sync::Lazy; - pub use revm_primitives::kzg::parse_kzg_trusted_setup; + pub use reth_primitives::revm_primitives::kzg::parse_kzg_trusted_setup; use crate::primitives::kzg::KzgSettings; @@ -42,8 +44,8 @@ mod trusted_setup { pub static MAINNET_KZG_TRUSTED_SETUP: Lazy> = Lazy::new(|| { Arc::new( c_kzg::KzgSettings::load_trusted_setup( - &revm_primitives::kzg::G1_POINTS.0, - &revm_primitives::kzg::G2_POINTS.0, + &reth_primitives::revm_primitives::kzg::G1_POINTS.0, + &reth_primitives::revm_primitives::kzg::G2_POINTS.0, ) .expect("failed to load trusted setup"), ) diff --git a/lib/src/primitives/mod.rs b/lib/src/primitives/mod.rs index 1ddf8115..5f3718bb 100644 --- a/lib/src/primitives/mod.rs +++ b/lib/src/primitives/mod.rs @@ -1,69 +1,11 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//#![cfg_attr(not(feature = "std"), no_std)] - extern crate alloc; extern crate core; pub use alloc::{vec, vec::Vec}; +pub use alloy_primitives::*; +#[cfg(feature = "c-kzg")] +pub use c_kzg as kzg; pub mod eip4844; pub mod keccak; pub mod mpt; -pub mod receipt; -pub mod signature; - -#[cfg(feature = "c-kzg")] -pub use c_kzg as kzg; - -pub mod revm; -pub use alloy_eips; -pub use alloy_primitives::*; -pub use alloy_rlp as rlp; - -pub trait RlpBytes { - /// Returns the RLP-encoding. - fn to_rlp(&self) -> Vec; -} - -impl RlpBytes for T -where - T: rlp::Encodable, -{ - #[inline] - fn to_rlp(&self) -> Vec { - let rlp_length = self.length(); - let mut out = Vec::with_capacity(rlp_length); - self.encode(&mut out); - debug_assert_eq!(out.len(), rlp_length); - out - } -} - -pub trait Rlp2718Bytes { - /// Returns the RLP-encoding. - fn to_rlp_2718(&self) -> Vec; -} - -impl Rlp2718Bytes for T -where - T: alloy_eips::eip2718::Encodable2718, -{ - #[inline] - fn to_rlp_2718(&self) -> Vec { - let mut out = Vec::new(); - self.encode_2718(&mut out); - out - } -} diff --git a/lib/src/primitives/mpt.rs b/lib/src/primitives/mpt.rs index 9680f7a4..c9bc2767 100644 --- a/lib/src/primitives/mpt.rs +++ b/lib/src/primitives/mpt.rs @@ -24,7 +24,7 @@ use alloy_rlp::Encodable; use alloy_rlp_derive::{RlpDecodable, RlpEncodable, RlpMaxEncodedLen}; use alloy_rpc_types::EIP1186AccountProofResponse; use anyhow::{Context, Result}; -use revm_primitives::{Address, HashMap}; +use reth_primitives::revm_primitives::{Address, HashMap}; use rlp::{Decodable, DecoderError, Prototype, Rlp}; use serde::{Deserialize, Serialize}; use thiserror::Error as ThisError; diff --git a/lib/src/primitives/receipt.rs b/lib/src/primitives/receipt.rs deleted file mode 100644 index 175de22d..00000000 --- a/lib/src/primitives/receipt.rs +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -extern crate alloc; -extern crate core; - -pub use alloc::{ - boxed::Box, - format, - string::{String, ToString}, - vec, - vec::Vec, -}; -pub use core::{ - convert::From, - default::Default, - option::{Option, Option::*}, - result::{Result, Result::*}, -}; - -use alloy_primitives::{Address, Bloom, BloomInput, Bytes, B256, U256}; -use alloy_rlp::Encodable; -use alloy_rlp_derive::RlpEncodable; -use serde::{Deserialize, Serialize}; - -/// Represents an Ethereum log entry. -#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, RlpEncodable)] -pub struct Log { - /// Contract that emitted this log. - pub address: Address, - /// Topics of the log. The number of logs depend on what `LOG` opcode is used. - pub topics: Vec, - /// Arbitrary length data. - pub data: Bytes, -} - -/// Payload of a [Receipt]. -#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, RlpEncodable)] -pub struct ReceiptPayload { - /// Indicates whether the transaction was executed successfully. - pub success: bool, - /// Total gas used by the transaction. - pub cumulative_gas_used: U256, - /// A bloom filter that contains indexed information of logs for quick searching. - pub logs_bloom: Bloom, - /// Logs generated during the execution of the transaction. - pub logs: Vec, -} - -/// Receipt containing result of transaction execution. -#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)] -pub struct Receipt { - /// Type of Receipt. - pub tx_type: u8, - /// Detailed payload of the receipt. - pub payload: ReceiptPayload, -} - -impl Encodable for Receipt { - /// Encodes the receipt into the `out` buffer. - #[inline] - fn encode(&self, out: &mut dyn alloy_rlp::BufMut) { - match self.tx_type { - // For legacy transactions - 0 => self.payload.encode(out), - // For EIP-2718 typed transactions - tx_type => { - // prepend the EIP-2718 transaction type - out.put_u8(tx_type); - // append the RLP-encoded payload - self.payload.encode(out); - } - } - } - - /// Returns the length of the encoded receipt in bytes. - #[inline] - fn length(&self) -> usize { - let mut payload_length = self.payload.length(); - if self.tx_type != 0 { - payload_length += 1; - } - payload_length - } -} - -impl Receipt { - /// Constructs a new [Receipt]. - /// - /// This function also computes the `logs_bloom` based on the provided logs. - pub fn new(tx_type: u8, success: bool, cumulative_gas_used: U256, logs: Vec) -> Receipt { - let mut logs_bloom = Bloom::default(); - for log in &logs { - logs_bloom.accrue(BloomInput::Raw(log.address.as_slice())); - for topic in &log.topics { - logs_bloom.accrue(BloomInput::Raw(topic.as_slice())); - } - } - - Receipt { - tx_type, - payload: ReceiptPayload { - success, - cumulative_gas_used, - logs_bloom, - logs, - }, - } - } -} - -// test vectors from https://github.com/ethereum/go-ethereum/blob/c40ab6af72ce282020d03c33e8273ea9b03d58f6/core/types/receipt_test.go -#[cfg(test)] -mod tests { - use hex_literal::hex; - use serde_json::json; - - use super::*; - - #[test] - fn legacy() { - let expected = hex!("f901c58001b9010000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000010000080000000000000000000004000000000000000000000000000040000000000000000000000000000800000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000f8bef85d940000000000000000000000000000000000000011f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100fff85d940000000000000000000000000000000000000111f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100ff"); - let receipt = Receipt::new( - 0, - false, - U256::from(1), - serde_json::from_value(json!([ - { - "address": "0x0000000000000000000000000000000000000011", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - }, - { - "address": "0x0000000000000000000000000000000000000111", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - } - ])) - .unwrap(), - ); - let mut data = vec![]; - receipt.encode(&mut data); - - assert_eq!(data, expected); - } - - #[test] - fn eip2930() { - let expected = hex!("01f901c58001b9010000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000010000080000000000000000000004000000000000000000000000000040000000000000000000000000000800000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000f8bef85d940000000000000000000000000000000000000011f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100fff85d940000000000000000000000000000000000000111f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100ff"); - let receipt = Receipt::new( - 1, - false, - U256::from(1), - serde_json::from_value(json!([ - { - "address": "0x0000000000000000000000000000000000000011", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - }, - { - "address": "0x0000000000000000000000000000000000000111", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - } - ])) - .unwrap(), - ); - let mut data = vec![]; - receipt.encode(&mut data); - - assert_eq!(data, expected); - } - - #[test] - fn eip1559() { - let expected = hex!("02f901c58001b9010000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000010000080000000000000000000004000000000000000000000000000040000000000000000000000000000800000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000f8bef85d940000000000000000000000000000000000000011f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100fff85d940000000000000000000000000000000000000111f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100ff"); - let receipt = Receipt::new( - 2, - false, - U256::from(1), - serde_json::from_value(json!([ - { - "address": "0x0000000000000000000000000000000000000011", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - }, - { - "address": "0x0000000000000000000000000000000000000111", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - } - ])) - .unwrap(), - ); - let mut data = vec![]; - receipt.encode(&mut data); - - assert_eq!(data, expected); - } -} diff --git a/lib/src/primitives/revm.rs b/lib/src/primitives/revm.rs deleted file mode 100644 index a680061f..00000000 --- a/lib/src/primitives/revm.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Convert to revm types. - -extern crate alloc; -extern crate core; - -pub use alloc::{ - boxed::Box, - format, - string::{String, ToString}, - vec, - vec::Vec, -}; -pub use core::{ - convert::From, - default::Default, - option::{Option, Option::*}, - result::{Result, Result::*}, -}; - -use revm_primitives::Log as RevmLog; - -use crate::primitives::receipt::Log; - -/// Provides a conversion from `RevmLog` to the local [Log]. -impl From for Log { - fn from(log: RevmLog) -> Self { - Log { - address: log.address, - topics: log.data.topics().to_vec(), - data: log.data.data, - } - } -} diff --git a/lib/src/primitives/signature.rs b/lib/src/primitives/signature.rs deleted file mode 100644 index 88d34e8b..00000000 --- a/lib/src/primitives/signature.rs +++ /dev/null @@ -1,82 +0,0 @@ -// use revm_primitives::U256; - -// The order of the secp256k1 curve, divided by two. Signatures that should be checked -// according to EIP-2 should have an S value less than or equal to this. -// -// `57896044618658097711785492504343953926418782139537452191302581570759080747168` -// const SECP256K1N_HALF: U256 = U256::from_be_bytes([ -// 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -// 0xFF, 0xFF, 0x5D, 0x57, 0x6E, 0x73, 0x57, 0xA4, 0x50, 0x1D, 0xDF, 0xE9, 0x2F, 0x46, -// 0x68, 0x1B, 0x20, 0xA0, ]); - -// Recovers the address of the sender using secp256k1 pubkey recovery. -// -// Converts the public key into an ethereum address by hashing the public key with -// keccak256. -// -// This does not ensure that the `s` value in the signature is low, and _just_ wraps the -// underlying secp256k1 library. -// pub fn recover_signer_unchecked_crypto(sig: &[u8; 65], msg: &[u8; 32]) -> -// Result { #[cfg(target_os = "zkvm")] -// { -// let pubkey = sp1_precompiles::secp256k1::ecrecover(sig, msg).unwrap(); -// return Ok(public_key_bytes_to_address(&pubkey)); -// } -// { -// let recid = RecoveryId::from_byte(sig[64]).expect("recovery ID is valid"); -// let sig = K256Signature::from_slice(&sig.as_slice()[..64])?; -// let recovered_key = VerifyingKey::recover_from_prehash(&msg[..], &sig, recid)?; -// let pubkey = PublicKey::from(&recovered_key); -// Ok(public_key_to_address(pubkey)) -// } -// } -// -// Recover signer from message hash, _without ensuring that the signature has a low `s` -// value_. -// -// Using this for signature validation will succeed, even if the signature is malleable or -// not compliant with EIP-2. This is provided for compatibility with old signatures which -// have large `s` values. -// pub fn recover_signer_unchecked(&self, hash: B256) -> Option
{ -// let mut sig: [u8; 65] = [0; 65]; -// -// sig[0..32].copy_from_slice(&self.r.to_be_bytes::<32>()); -// sig[32..64].copy_from_slice(&self.s.to_be_bytes::<32>()); -// sig[64] = self.odd_y_parity as u8; -// -// NOTE: we are removing error from underlying crypto library as it will restrain -// primitive errors and we care only if recovery is passing or not. -// recover_signer_unchecked_crypto(&sig, &hash.0).ok() -// } -// -// Recover signer address from message hash. This ensures that the signature S value is -// greater than `secp256k1n / 2`, as specified in -// [EIP-2](https://eips.ethereum.org/EIPS/eip-2). -// -// If the S value is too large, then this will return `None` -// pub fn recover_signer(&self, hash: B256) -> Option
{ -// if self.s > SECP256K1N_HALF { -// return None -// } -// -// self.recover_signer_unchecked(hash) -// } -// -// -// Converts a public key into an ethereum address by hashing the encoded public key with -// keccak256. -// pub fn public_key_to_address(public: PublicKey) -> Address { -// let pubkey_bytes = -// public.to_encoded_point(false).as_bytes().try_into().expect("The slice has 65 -// bytes"); public_key_bytes_to_address(&pubkey_bytes); -// // strip out the first byte because that should be the -// SECP256K1_TAG_PUBKEY_UNCOMPRESSED // tag returned by libsecp's uncompressed pubkey -// serialization let hash = keccak(&public.serialize_uncompressed()[1..]); -// Address::from_slice(&hash[12..]) -// } - -// fn public_key_bytes_to_address(public: &[u8; 65]) -> Address { -// // Strip out first byte of sec1 encoded pubkey -// let hash = keccak(&public[1..]); -// Address::from_slice(&hash[12..]) -// } diff --git a/lib/src/protocol_instance.rs b/lib/src/protocol_instance.rs index 94e21b3d..0d919da0 100644 --- a/lib/src/protocol_instance.rs +++ b/lib/src/protocol_instance.rs @@ -1,9 +1,8 @@ -use super::utils::ANCHOR_GAS_LIMIT; -use alloy_consensus::Header as AlloyConsensusHeader; use alloy_primitives::{Address, TxHash, B256}; use alloy_sol_types::SolValue; use anyhow::{ensure, Result}; use c_kzg::{Blob, KzgCommitment, KzgSettings}; +use reth_primitives::Header; use sha2::{Digest as _, Sha256}; use std::alloc::{alloc, Layout}; @@ -13,8 +12,8 @@ use crate::{ consts::{SupportedChainSpecs, VerifierType}, input::{BlockMetadata, EthDeposit, GuestInput, Transition}, primitives::keccak::keccak, - utils::HeaderHasher, }; +use reth_evm_ethereum::taiko::ANCHOR_GAS_LIMIT; const KZG_TRUST_SETUP_DATA: &[u8] = include_bytes!("../../kzg_settings_raw.bin"); @@ -29,11 +28,7 @@ pub struct ProtocolInstance { } impl ProtocolInstance { - pub fn new( - input: &GuestInput, - header: &AlloyConsensusHeader, - proof_type: VerifierType, - ) -> Result { + pub fn new(input: &GuestInput, header: &Header, proof_type: VerifierType) -> Result { let blob_used = input.taiko.block_proposed.meta.blobUsed; let tx_list_hash = if blob_used { if input.taiko.skip_verify_blob { @@ -121,7 +116,6 @@ impl ProtocolInstance { }) .collect::>(); - let gas_limit: u64 = header.gas_limit.try_into().unwrap(); let verifier_address = (*input .chain_spec .verifier_address @@ -132,19 +126,19 @@ impl ProtocolInstance { let pi = ProtocolInstance { transition: Transition { parentHash: header.parent_hash, - blockHash: header.hash(), + blockHash: header.hash_slow(), stateRoot: header.state_root, graffiti: input.taiko.prover_data.graffiti, }, block_metadata: BlockMetadata { - l1Hash: input.taiko.l1_header.hash(), + l1Hash: input.taiko.l1_header.hash_slow(), difficulty: input.taiko.block_proposed.meta.difficulty, blobHash: tx_list_hash, extraData: bytes_to_bytes32(&header.extra_data).into(), depositsHash: keccak(deposits.abi_encode()).into(), coinbase: header.beneficiary, id: header.number, - gasLimit: (gas_limit + gasLimit: (header.gas_limit - if input.chain_spec.is_taiko() { ANCHOR_GAS_LIMIT } else { diff --git a/lib/src/utils.rs b/lib/src/utils.rs index f4baff55..a1c9b854 100644 --- a/lib/src/utils.rs +++ b/lib/src/utils.rs @@ -1,41 +1,17 @@ -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}; -use alloy_rlp::{Decodable, Encodable}; -use alloy_rpc_types::{Header as AlloyHeader, Transaction as AlloyTransaction}; -use anyhow::{anyhow, bail, ensure, Context, Result}; -use lazy_static::lazy_static; +use alloy_consensus::{Signed, TxEip1559, TxEnvelope}; +use alloy_primitives::{Signature, TxKind}; +use alloy_rlp::Decodable; +use alloy_rpc_types::Transaction as AlloyTransaction; +use anyhow::Result; use libflate::zlib::Decoder as zlibDecoder; use libflate::zlib::Encoder as zlibEncoder; +use crate::consts::{ChainSpec, Network}; #[cfg(not(feature = "std"))] use crate::no_std::*; -use crate::{ - consts::{ChainSpec, Network}, - input::{decode_anchor, GuestInput}, - primitives::{keccak256, B256}, -}; - -pub const ANCHOR_GAS_LIMIT: u64 = 250_000; - -lazy_static! { - pub static ref GOLDEN_TOUCH_ACCOUNT: Address = { - Address::from_str("0x0000777735367b36bC9B61C50022d9D0700dB4Ec") - .expect("invalid golden touch account") - }; - static ref GX1: U256 = - uint!(0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798_U256); - static ref N: U256 = - uint!(0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141_U256); - static ref GX1_MUL_PRIVATEKEY: U256 = - uint!(0x4341adf5a780b4a87939938fd7a032f6e6664c7da553c121d3b4947429639122_U256); - static ref GX2: U256 = - uint!(0xc6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5_U256); -} pub fn decode_transactions(tx_list: &[u8]) -> Vec { Vec::::decode(&mut &tx_list.to_owned()[..]).unwrap_or_else(|e| { @@ -240,138 +216,3 @@ pub fn zlib_compress_data(data: &[u8]) -> Result> { 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(); - if sign.r() == *GX1 { - return Ok(()); - } - let msg_hash = anchor.signature_hash(); - let msg_hash: U256 = msg_hash.into(); - if sign.r() == *GX2 { - // when r == GX2 require s == 0 if k == 1 - // alias: when r == GX2 require N == msg_hash + *GX1_MUL_PRIVATEKEY - if *N != msg_hash + *GX1_MUL_PRIVATEKEY { - bail!( - "r == GX2, but N != msg_hash + *GX1_MUL_PRIVATEKEY, N: {}, msg_hash: {msg_hash}, *GX1_MUL_PRIVATEKEY: {}", - *N, *GX1_MUL_PRIVATEKEY - ); - } - return Ok(()); - } - Err(anyhow!( - "r != *GX1 && r != GX2, r: {}, *GX1: {}, GX2: {}", - sign.r(), - *GX1, - *GX2 - )) -} - -pub fn check_anchor_tx(input: &GuestInput, anchor: &TxEnvelope, from: &Address) -> Result<()> { - match anchor { - TxEnvelope::Eip1559(tx) => { - // Check the signature - check_anchor_signature(tx).context(anyhow!("failed to check anchor signature"))?; - - let tx = tx.tx(); - - // Extract the `to` address - let TxKind::Call(to) = tx.to else { - panic!("anchor tx not a smart contract call") - }; - // Check that it's from the golden touch address - ensure!( - *from == *GOLDEN_TOUCH_ACCOUNT, - "anchor transaction from mismatch" - ); - // Check that the L2 contract is being called - ensure!( - to == input.chain_spec.l2_contract.unwrap(), - "anchor transaction to mismatch" - ); - // Tx can't have any ETH attached - ensure!( - tx.value == U256::from(0), - "anchor transaction value mismatch" - ); - // Tx needs to have the expected gas limit - ensure!( - 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 - ensure!( - tx.max_fee_per_gas == input.base_fee_per_gas.into(), - "anchor transaction gas mismatch" - ); - - // Okay now let's decode the anchor tx to verify the inputs - let anchor_call = decode_anchor(&tx.input)?; - // The L1 blockhash needs to match the expected value - ensure!( - anchor_call.l1Hash == input.taiko.l1_header.hash(), - "L1 hash mismatch" - ); - if input.chain_spec.network() == Network::TaikoA7.to_string() { - ensure!( - anchor_call.l1StateRoot == input.taiko.l1_header.state_root, - "L1 state root mismatch" - ); - } - ensure!( - anchor_call.l1BlockId == input.taiko.l1_header.number, - "L1 block number mismatch" - ); - // The parent gas used input needs to match the gas used value of the parent block - ensure!( - anchor_call.parentGasUsed == input.parent_header.gas_used as u32, - "parentGasUsed mismatch" - ); - } - _ => { - panic!("invalid anchor tx type"); - } - } - - Ok(()) -} - -pub trait HeaderHasher { - fn hash(&self) -> B256; -} - -impl HeaderHasher for AlloyConsensusHeader { - fn hash(&self) -> B256 { - let mut out = Vec::::new(); - self.encode(&mut out); - keccak256(&out) - } -} - -/// Convert from an Alloy RPC header to an Alloy Consensus Header -/// which can be serialized and can be used to generate the block hash. -pub fn to_header(header: &AlloyHeader) -> AlloyConsensusHeader { - AlloyConsensusHeader { - parent_hash: header.parent_hash, - ommers_hash: header.uncles_hash, - beneficiary: header.miner, - state_root: header.state_root, - transactions_root: header.transactions_root, - receipts_root: header.receipts_root, - logs_bloom: header.logs_bloom, - difficulty: header.difficulty, - number: header.number.unwrap(), - gas_limit: header.gas_limit, - gas_used: header.gas_used, - timestamp: header.timestamp, - extra_data: header.extra_data.clone(), - mix_hash: header.mix_hash.unwrap(), - nonce: header.nonce.unwrap(), - base_fee_per_gas: header.base_fee_per_gas, - withdrawals_root: header.withdrawals_root, - blob_gas_used: header.blob_gas_used, - excess_blob_gas: header.excess_blob_gas, - parent_beacon_block_root: header.parent_beacon_block_root, - } -} diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml deleted file mode 100644 index 03092dca..00000000 --- a/primitives/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "raiko-primitives" -version = "0.1.0" -edition = "2021" - -[dependencies] -alloy-primitives = { workspace = true } -alloy-sol-types = { workspace = true } -alloy-dyn-abi = { workspace = true } -alloy-rlp = { workspace = true } -alloy-rlp-derive = { workspace = true } -alloy-rpc-types = { workspace = true } -alloy-eips = { workspace = true } -anyhow = { workspace = true } -sha2 = { workspace = true, optional = true } -tempfile = { workspace = true, optional = true } - -revm-primitives = { workspace = true } -rlp = { workspace = true, features = ["std"] } -serde = { workspace = true } -sha3 = { workspace = true } -thiserror = { workspace = true } - -once_cell = { workspace = true, features = ["critical-section"], optional = true } - -# for eip-4844 -c-kzg = { workspace = true, features = ["serde"], optional = true } - -[dev-dependencies] -bincode = { workspace = true } -hex-literal = { workspace = true } -serde_json = { version = "1.0", default-features = false } - -[features] -std = ["anyhow/std", "rlp/std"] -c-kzg = ["dep:c-kzg", "revm-primitives/c-kzg", "dep:sha2", "dep:tempfile", "dep:once_cell"] \ No newline at end of file diff --git a/primitives/src/eip4844.rs b/primitives/src/eip4844.rs deleted file mode 100644 index dcfc4a7b..00000000 --- a/primitives/src/eip4844.rs +++ /dev/null @@ -1,87 +0,0 @@ -//! Helpers for working with EIP-4844 blob fee. - -// re-exports from revm for calculating blob fee -pub use revm_primitives::{calc_blob_gasprice, calc_excess_blob_gas as calculate_excess_blob_gas}; -#[cfg(feature = "c-kzg")] -use sha2::{Digest, Sha256}; - -#[cfg(feature = "c-kzg")] -use crate::B256; - -/// Calculates the versioned hash for a KzgCommitment -/// -/// Specified in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844#header-extension) -#[cfg(feature = "c-kzg")] -pub fn kzg_to_versioned_hash(commitment: &c_kzg::KzgCommitment) -> B256 { - let mut res = Sha256::digest(commitment.as_slice()); - res[0] = VERSIONED_HASH_VERSION_KZG; - B256::new(res.into()) -} - -/// Constants for EIP-4844 -/// from https://github.com/paradigmxyz/reth/blob/79452eadaf4963f1e8d78a18b1f490d7c560aa54/crates/primitives/src/constants/eip4844.rs#L2 -pub use alloy_eips::eip4844::{ - BLOB_GASPRICE_UPDATE_FRACTION, BLOB_TX_MIN_BLOB_GASPRICE, DATA_GAS_PER_BLOB, - FIELD_ELEMENTS_PER_BLOB, FIELD_ELEMENT_BYTES, MAX_BLOBS_PER_BLOCK, MAX_DATA_GAS_PER_BLOCK, - TARGET_BLOBS_PER_BLOCK, TARGET_DATA_GAS_PER_BLOCK, VERSIONED_HASH_VERSION_KZG, -}; -/// [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844#parameters) protocol constants and utils for shard Blob Transactions. -#[cfg(feature = "c-kzg")] -pub use trusted_setup::*; - -#[cfg(feature = "c-kzg")] -mod trusted_setup { - use std::{io::Write, sync::Arc}; - - use once_cell::sync::Lazy; - pub use revm_primitives::kzg::parse_kzg_trusted_setup; - - use crate::kzg::KzgSettings; - - /// KZG trusted setup - pub static MAINNET_KZG_TRUSTED_SETUP: Lazy> = Lazy::new(|| { - Arc::new( - c_kzg::KzgSettings::load_trusted_setup( - &revm_primitives::kzg::G1_POINTS.0, - &revm_primitives::kzg::G2_POINTS.0, - ) - .expect("failed to load trusted setup"), - ) - }); - - /// Loads the trusted setup parameters from the given bytes and returns the - /// [KzgSettings]. - /// - /// This creates a temp file to store the bytes and then loads the [KzgSettings] from - /// the file via [KzgSettings::load_trusted_setup_file]. - pub fn load_trusted_setup_from_bytes( - bytes: &[u8], - ) -> Result { - let mut file = tempfile::NamedTempFile::new().map_err(LoadKzgSettingsError::TempFileErr)?; - file.write_all(bytes) - .map_err(LoadKzgSettingsError::TempFileErr)?; - KzgSettings::load_trusted_setup_file(file.path()).map_err(LoadKzgSettingsError::KzgError) - } - - /// Error type for loading the trusted setup. - #[derive(Debug, thiserror::Error)] - pub enum LoadKzgSettingsError { - /// Failed to create temp file to store bytes for loading [KzgSettings] via - /// [KzgSettings::load_trusted_setup_file]. - #[error("failed to setup temp file: {0}")] - TempFileErr(#[from] std::io::Error), - /// Kzg error - #[error("KZG error: {0:?}")] - KzgError(#[from] c_kzg::Error), - } - - #[cfg(test)] - mod tests { - use super::*; - - #[test] - fn ensure_load_kzg_settings() { - let _settings = Arc::clone(&MAINNET_KZG_TRUSTED_SETUP); - } - } -} diff --git a/primitives/src/keccak.rs b/primitives/src/keccak.rs deleted file mode 100644 index a7ae6f28..00000000 --- a/primitives/src/keccak.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use alloy_primitives::{b256, B256}; -use sha3::{Digest, Keccak256}; - -/// Represents the Keccak-256 hash of an empty byte slice. -/// -/// This is a constant value and can be used as a default or placeholder -/// in various cryptographic operations. -pub const KECCAK_EMPTY: B256 = - b256!("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"); - -/// Computes the Keccak-256 hash of the provided data. -/// -/// This function is a thin wrapper around the Keccak256 hashing algorithm -/// and is optimized for performance. -/// -/// # TODO -/// - Consider switching the return type to `B256` for consistency with other parts of the -/// codebase. -#[inline] -pub fn keccak(data: impl AsRef<[u8]>) -> [u8; 32] { - // TODO: Remove this benchmarking code once performance testing is complete. - // std::hint::black_box(sha2::Sha256::digest(&data)); - Keccak256::digest(data).into() -} diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs deleted file mode 100644 index 1ddf8115..00000000 --- a/primitives/src/lib.rs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//#![cfg_attr(not(feature = "std"), no_std)] - -extern crate alloc; -extern crate core; - -pub use alloc::{vec, vec::Vec}; - -pub mod eip4844; -pub mod keccak; -pub mod mpt; -pub mod receipt; -pub mod signature; - -#[cfg(feature = "c-kzg")] -pub use c_kzg as kzg; - -pub mod revm; -pub use alloy_eips; -pub use alloy_primitives::*; -pub use alloy_rlp as rlp; - -pub trait RlpBytes { - /// Returns the RLP-encoding. - fn to_rlp(&self) -> Vec; -} - -impl RlpBytes for T -where - T: rlp::Encodable, -{ - #[inline] - fn to_rlp(&self) -> Vec { - let rlp_length = self.length(); - let mut out = Vec::with_capacity(rlp_length); - self.encode(&mut out); - debug_assert_eq!(out.len(), rlp_length); - out - } -} - -pub trait Rlp2718Bytes { - /// Returns the RLP-encoding. - fn to_rlp_2718(&self) -> Vec; -} - -impl Rlp2718Bytes for T -where - T: alloy_eips::eip2718::Encodable2718, -{ - #[inline] - fn to_rlp_2718(&self) -> Vec { - let mut out = Vec::new(); - self.encode_2718(&mut out); - out - } -} diff --git a/primitives/src/mpt.rs b/primitives/src/mpt.rs deleted file mode 100644 index 9680f7a4..00000000 --- a/primitives/src/mpt.rs +++ /dev/null @@ -1,1407 +0,0 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use core::{ - cell::RefCell, - cmp, - fmt::{Debug, Write}, - iter, mem, -}; - -use alloy_primitives::{b256, TxNumber, B256, U256}; -use alloy_rlp::Encodable; -use alloy_rlp_derive::{RlpDecodable, RlpEncodable, RlpMaxEncodedLen}; -use alloy_rpc_types::EIP1186AccountProofResponse; -use anyhow::{Context, Result}; -use revm_primitives::{Address, HashMap}; -use rlp::{Decodable, DecoderError, Prototype, Rlp}; -use serde::{Deserialize, Serialize}; -use thiserror::Error as ThisError; - -pub type StorageEntry = (MptNode, Vec); - -/// Represents an Ethereum account within the state trie. -/// -/// The `StateAccount` struct encapsulates key details of an Ethereum account, including -/// its nonce, balance, storage root, and the hash of its associated bytecode. This -/// representation is used when interacting with or querying the Ethereum state trie. -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RlpEncodable, - RlpDecodable, - RlpMaxEncodedLen, -)] -pub struct StateAccount { - /// The number of transactions sent from this account's address. - pub nonce: TxNumber, - /// The current balance of the account in Wei. - pub balance: U256, - /// The root of the account's storage trie, representing all stored contract data. - pub storage_root: B256, - /// The Keccak-256 hash of the account's associated bytecode (if it's a contract). - pub code_hash: B256, -} - -impl Default for StateAccount { - /// Provides default values for a [StateAccount]. - /// - /// The default account has a nonce of 0, a balance of 0 Wei, an empty storage root, - /// and an empty bytecode hash. - fn default() -> Self { - Self { - nonce: 0, - balance: U256::ZERO, - storage_root: EMPTY_ROOT, - code_hash: KECCAK_EMPTY, - } - } -} - -pub trait RlpBytes { - /// Returns the RLP-encoding. - fn to_rlp(&self) -> Vec; -} - -impl RlpBytes for T -where - T: alloy_rlp::Encodable, -{ - #[inline] - fn to_rlp(&self) -> Vec { - let rlp_length = self.length(); - let mut out = Vec::with_capacity(rlp_length); - self.encode(&mut out); - debug_assert_eq!(out.len(), rlp_length); - out - } -} - -/// Root hash of an empty trie. -pub const EMPTY_ROOT: B256 = - b256!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"); - -extern crate alloc; - -/// Represents the Keccak-256 hash of an empty byte slice. -/// -/// This is a constant value and can be used as a default or placeholder -/// in various cryptographic operations. -pub const KECCAK_EMPTY: B256 = - b256!("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"); - -/// Computes the Keccak-256 hash of the provided data. -/// -/// This function is a thin wrapper around the Keccak256 hashing algorithm -/// and is optimized for performance. -/// -/// # TODO -/// - Consider switching the return type to `B256` for consistency with other parts of the -/// codebase. -#[inline] -pub fn keccak(data: impl AsRef<[u8]>) -> [u8; 32] { - // TODO: Remove this benchmarking code once performance testing is complete. - // std::hint::black_box(sha2::Sha256::digest(&data)); - *alloy_primitives::utils::keccak256(data) -} - -/// Represents the root node of a sparse Merkle Patricia Trie. -/// -/// The "sparse" nature of this trie allows for truncation of certain unneeded parts, -/// representing them by their node hash. This design choice is particularly useful for -/// optimizing storage. However, operations targeting a truncated part will fail and -/// return an error. Another distinction of this implementation is that branches cannot -/// store values, aligning with the construction of MPTs in Ethereum. -#[derive(Clone, Debug, Default, PartialEq, Eq, Ord, PartialOrd, Serialize, Deserialize)] -pub struct MptNode { - /// The type and data of the node. - data: MptNodeData, - /// Cache for a previously computed reference of this node. This is skipped during - /// serialization. - #[serde(skip)] - cached_reference: RefCell>, -} - -/// Represents custom error types for the sparse Merkle Patricia Trie (MPT). -/// -/// These errors cover various scenarios that can occur during trie operations, such as -/// encountering unresolved nodes, finding values in branches where they shouldn't be, and -/// issues related to RLP (Recursive Length Prefix) encoding and decoding. -#[derive(Debug, ThisError)] -pub enum Error { - /// Triggered when an operation reaches an unresolved node. The associated `B256` - /// value provides details about the unresolved node. - #[error("reached an unresolved node: {0:#}")] - NodeNotResolved(B256), - /// Occurs when a value is unexpectedly found in a branch node. - #[error("branch node with value")] - ValueInBranch, - /// Represents errors related to the RLP encoding and decoding using the `alloy_rlp` - /// library. - #[error("RLP error")] - Rlp(#[from] alloy_rlp::Error), - /// Represents errors related to the RLP encoding and decoding, specifically legacy - /// errors. - #[error("RLP error")] - LegacyRlp(#[from] DecoderError), -} - -/// Represents the various types of data that can be stored within a node in the sparse -/// Merkle Patricia Trie (MPT). -/// -/// Each node in the trie can be of one of several types, each with its own specific data -/// structure. This enum provides a clear and type-safe way to represent the data -/// associated with each node type. -#[derive(Clone, Debug, Default, PartialEq, Eq, Ord, PartialOrd, Serialize, Deserialize)] -pub enum MptNodeData { - /// Represents an empty trie node. - #[default] - Null, - /// A node that can have up to 16 children. Each child is an optional boxed [MptNode]. - Branch([Option>; 16]), - /// A leaf node that contains a key and a value, both represented as byte vectors. - Leaf(Vec, Vec), - /// A node that has exactly one child and is used to represent a shared prefix of - /// several keys. - Extension(Vec, Box), - /// Represents a sub-trie by its hash, allowing for efficient storage of large - /// sub-tries without storing their entire content. - Digest(B256), -} - -/// Represents the ways in which one node can reference another node inside the sparse -/// Merkle Patricia Trie (MPT). -/// -/// Nodes in the MPT can reference other nodes either directly through their byte -/// representation or indirectly through a hash of their encoding. This enum provides a -/// clear and type-safe way to represent these references. -#[derive(Clone, Debug, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] -pub enum MptNodeReference { - /// Represents a direct reference to another node using its byte encoding. Typically - /// used for short encodings that are less than 32 bytes in length. - Bytes(Vec), - /// Represents an indirect reference to another node using the Keccak hash of its long - /// encoding. Used for encodings that are not less than 32 bytes in length. - Digest(B256), -} - -/// Provides a conversion from [MptNodeData] to [MptNode]. -/// -/// This implementation allows for conversion from [MptNodeData] to [MptNode], -/// initializing the `data` field with the provided value and setting the -/// `cached_reference` field to `None`. -impl From for MptNode { - fn from(value: MptNodeData) -> Self { - Self { - data: value, - cached_reference: RefCell::new(None), - } - } -} - -/// Provides encoding functionalities for the `MptNode` type. -/// -/// This implementation allows for the serialization of an [MptNode] into its RLP-encoded -/// form. The encoding is done based on the type of node data ([MptNodeData]) it holds. -impl Encodable for MptNode { - /// Encodes the node into the provided `out` buffer. - /// - /// The encoding is done using the Recursive Length Prefix (RLP) encoding scheme. The - /// method handles different node data types and encodes them accordingly. - #[inline] - fn encode(&self, out: &mut dyn alloy_rlp::BufMut) { - match &self.data { - MptNodeData::Null => { - out.put_u8(alloy_rlp::EMPTY_STRING_CODE); - } - MptNodeData::Branch(nodes) => { - alloy_rlp::Header { - list: true, - payload_length: self.payload_length(), - } - .encode(out); - for child in nodes { - match child { - Some(node) => node.reference_encode(out), - None => out.put_u8(alloy_rlp::EMPTY_STRING_CODE), - } - } - // in the MPT reference, branches have values so always add empty value - out.put_u8(alloy_rlp::EMPTY_STRING_CODE); - } - MptNodeData::Leaf(prefix, value) => { - alloy_rlp::Header { - list: true, - payload_length: self.payload_length(), - } - .encode(out); - prefix.as_slice().encode(out); - value.as_slice().encode(out); - } - MptNodeData::Extension(prefix, node) => { - alloy_rlp::Header { - list: true, - payload_length: self.payload_length(), - } - .encode(out); - prefix.as_slice().encode(out); - node.reference_encode(out); - } - MptNodeData::Digest(digest) => { - digest.encode(out); - } - } - } - - /// Returns the length of the encoded node in bytes. - /// - /// This method calculates the length of the RLP-encoded node. It's useful for - /// determining the size requirements for storage or transmission. - #[inline] - fn length(&self) -> usize { - let payload_length = self.payload_length(); - payload_length + alloy_rlp::length_of_length(payload_length) - } -} - -/// Provides decoding functionalities for the [MptNode] type. -/// -/// This implementation allows for the deserialization of an RLP-encoded [MptNode] back -/// into its original form. The decoding is done based on the prototype of the RLP data, -/// ensuring that the node is reconstructed accurately. -/// -/// **Note**: This implementation is still using the older RLP library and needs to be -/// migrated to `alloy_rlp` in the future. -// TODO: migrate to alloy_rlp -impl Decodable for MptNode { - /// Decodes an RLP-encoded node from the provided `rlp` buffer. - /// - /// The method handles different RLP prototypes and reconstructs the `MptNode` based - /// on the encoded data. If the RLP data does not match any known prototype or if - /// there's an error during decoding, an error is returned. - fn decode(rlp: &Rlp) -> Result { - match rlp.prototype()? { - Prototype::Null | Prototype::Data(0) => Ok(MptNodeData::Null.into()), - Prototype::List(2) => { - let path: Vec = rlp.val_at(0)?; - let prefix = path[0]; - if (prefix & (2 << 4)) == 0 { - let node: MptNode = Decodable::decode(&rlp.at(1)?)?; - Ok(MptNodeData::Extension(path, Box::new(node)).into()) - } else { - Ok(MptNodeData::Leaf(path, rlp.val_at(1)?).into()) - } - } - Prototype::List(17) => { - let mut node_list = Vec::with_capacity(16); - for node_rlp in rlp.iter().take(16) { - match node_rlp.prototype()? { - Prototype::Null | Prototype::Data(0) => { - node_list.push(None); - } - _ => node_list.push(Some(Box::new(Decodable::decode(&node_rlp)?))), - } - } - let value: Vec = rlp.val_at(16)?; - if value.is_empty() { - Ok(MptNodeData::Branch(node_list.try_into().unwrap()).into()) - } else { - Err(DecoderError::Custom("branch node with value")) - } - } - Prototype::Data(32) => { - let bytes: Vec = rlp.as_val()?; - Ok(MptNodeData::Digest(B256::from_slice(&bytes)).into()) - } - _ => Err(DecoderError::RlpIncorrectListLen), - } - } -} - -/// Represents a node in the sparse Merkle Patricia Trie (MPT). -/// -/// The [MptNode] type encapsulates the data and functionalities associated with a node in -/// the MPT. It provides methods for manipulating the trie, such as inserting, deleting, -/// and retrieving values, as well as utility methods for encoding, decoding, and -/// debugging. -impl MptNode { - /// Clears the trie, replacing its data with an empty node, [MptNodeData::Null]. - /// - /// This method effectively removes all key-value pairs from the trie. - #[inline] - pub fn clear(&mut self) { - self.data = MptNodeData::Null; - self.invalidate_ref_cache(); - } - - /// Decodes an RLP-encoded [MptNode] from the provided byte slice. - /// - /// This method allows for the deserialization of a previously serialized [MptNode]. - #[inline] - pub fn decode(bytes: impl AsRef<[u8]>) -> Result { - rlp::decode(bytes.as_ref()).map_err(Error::from) - } - - /// Retrieves the underlying data of the node. - /// - /// This method provides a reference to the node's data, allowing for inspection and - /// manipulation. - #[inline] - pub fn as_data(&self) -> &MptNodeData { - &self.data - } - - /// Retrieves the [MptNodeReference] reference of the node when it's referenced inside - /// another node. - /// - /// This method provides a way to obtain a compact representation of the node for - /// storage or transmission purposes. - #[inline] - pub fn reference(&self) -> MptNodeReference { - self.cached_reference - .borrow_mut() - .get_or_insert_with(|| self.calc_reference()) - .clone() - } - - /// Computes and returns the 256-bit hash of the node. - /// - /// This method provides a unique identifier for the node based on its content. - #[inline] - pub fn hash(&self) -> B256 { - match self.data { - MptNodeData::Null => EMPTY_ROOT, - _ => match self.reference() { - MptNodeReference::Digest(digest) => digest, - MptNodeReference::Bytes(bytes) => keccak(bytes).into(), - }, - } - } - - /// Encodes the [MptNodeReference] of this node into the `out` buffer. - fn reference_encode(&self, out: &mut dyn alloy_rlp::BufMut) { - match self.reference() { - // if the reference is an RLP-encoded byte slice, copy it directly - MptNodeReference::Bytes(bytes) => out.put_slice(&bytes), - // if the reference is a digest, RLP-encode it with its fixed known length - MptNodeReference::Digest(digest) => { - out.put_u8(alloy_rlp::EMPTY_STRING_CODE + 32); - out.put_slice(digest.as_slice()); - } - } - } - - /// Returns the length of the encoded [MptNodeReference] of this node. - fn reference_length(&self) -> usize { - match self.reference() { - MptNodeReference::Bytes(bytes) => bytes.len(), - MptNodeReference::Digest(_) => 1 + 32, - } - } - - fn calc_reference(&self) -> MptNodeReference { - match &self.data { - MptNodeData::Null => MptNodeReference::Bytes(vec![alloy_rlp::EMPTY_STRING_CODE]), - MptNodeData::Digest(digest) => MptNodeReference::Digest(*digest), - _ => { - let encoded = alloy_rlp::encode(self); - if encoded.len() < 32 { - MptNodeReference::Bytes(encoded) - } else { - MptNodeReference::Digest(keccak(encoded).into()) - } - } - } - } - - /// Determines if the trie is empty. - /// - /// This method checks if the node represents an empty trie, i.e., it doesn't contain - /// any key-value pairs. - #[inline] - pub fn is_empty(&self) -> bool { - matches!(&self.data, MptNodeData::Null) - } - - /// Determines if the node represents a digest. - /// - /// A digest is a compact representation of a sub-trie, represented by its hash. - #[inline] - pub fn is_digest(&self) -> bool { - matches!(&self.data, MptNodeData::Digest(_)) - } - - /// Retrieves the nibbles corresponding to the node's prefix. - /// - /// Nibbles are half-bytes, and in the context of the MPT, they represent parts of - /// keys. - #[inline] - pub fn nibs(&self) -> Vec { - match &self.data { - MptNodeData::Null | MptNodeData::Branch(_) | MptNodeData::Digest(_) => vec![], - MptNodeData::Leaf(prefix, _) | MptNodeData::Extension(prefix, _) => prefix_nibs(prefix), - } - } - - /// Retrieves the value associated with a given key in the trie. - /// - /// If the key is not present in the trie, this method returns `None`. Otherwise, it - /// returns a reference to the associated value. If [None] is returned, the key is - /// provably not in the trie. - #[inline] - pub fn get(&self, key: &[u8]) -> Result, Error> { - self.get_internal(&to_nibs(key)) - } - - /// Retrieves the RLP-decoded value corresponding to the key. - /// - /// If the key is not present in the trie, this method returns `None`. Otherwise, it - /// returns the RLP-decoded value. - #[inline] - pub fn get_rlp(&self, key: &[u8]) -> Result, Error> { - match self.get(key)? { - Some(mut bytes) => Ok(Some(T::decode(&mut bytes)?)), - None => Ok(None), - } - } - - fn get_internal(&self, key_nibs: &[u8]) -> Result, Error> { - match &self.data { - MptNodeData::Null => Ok(None), - MptNodeData::Branch(nodes) => { - if let Some((i, tail)) = key_nibs.split_first() { - match nodes[*i as usize] { - Some(ref node) => node.get_internal(tail), - None => Ok(None), - } - } else { - Ok(None) - } - } - MptNodeData::Leaf(prefix, value) => { - if prefix_nibs(prefix) == key_nibs { - Ok(Some(value)) - } else { - Ok(None) - } - } - MptNodeData::Extension(prefix, node) => { - if let Some(tail) = key_nibs.strip_prefix(prefix_nibs(prefix).as_slice()) { - node.get_internal(tail) - } else { - Ok(None) - } - } - MptNodeData::Digest(digest) => Err(Error::NodeNotResolved(*digest)), - } - } - - /// Removes a key from the trie. - /// - /// This method attempts to remove a key-value pair from the trie. If the key is - /// present, it returns `true`. Otherwise, it returns `false`. - #[inline] - pub fn delete(&mut self, key: &[u8]) -> Result { - self.delete_internal(&to_nibs(key)) - } - - fn delete_internal(&mut self, key_nibs: &[u8]) -> Result { - match &mut self.data { - MptNodeData::Null => return Ok(false), - MptNodeData::Branch(children) => { - if let Some((i, tail)) = key_nibs.split_first() { - let child = &mut children[*i as usize]; - match child { - Some(node) => { - if !node.delete_internal(tail)? { - return Ok(false); - } - // if the node is now empty, remove it - if node.is_empty() { - *child = None; - } - } - None => return Ok(false), - } - } else { - return Err(Error::ValueInBranch); - } - - let mut remaining = children.iter_mut().enumerate().filter(|(_, n)| n.is_some()); - // there will always be at least one remaining node - let (index, node) = remaining.next().unwrap(); - // if there is only exactly one node left, we need to convert the branch - if remaining.next().is_none() { - let mut orphan = node.take().unwrap(); - match &mut orphan.data { - // if the orphan is a leaf, prepend the corresponding nib to it - MptNodeData::Leaf(prefix, orphan_value) => { - let new_nibs: Vec<_> = - iter::once(index as u8).chain(prefix_nibs(prefix)).collect(); - self.data = MptNodeData::Leaf( - to_encoded_path(&new_nibs, true), - mem::take(orphan_value), - ); - } - // if the orphan is an extension, prepend the corresponding nib to it - MptNodeData::Extension(prefix, orphan_child) => { - let new_nibs: Vec<_> = - iter::once(index as u8).chain(prefix_nibs(prefix)).collect(); - self.data = MptNodeData::Extension( - to_encoded_path(&new_nibs, false), - mem::take(orphan_child), - ); - } - // if the orphan is a branch or digest, convert to an extension - MptNodeData::Branch(_) | MptNodeData::Digest(_) => { - self.data = MptNodeData::Extension( - to_encoded_path(&[index as u8], false), - orphan, - ); - } - MptNodeData::Null => unreachable!(), - } - } - } - MptNodeData::Leaf(prefix, _) => { - if prefix_nibs(prefix) != key_nibs { - return Ok(false); - } - self.data = MptNodeData::Null; - } - MptNodeData::Extension(prefix, child) => { - let mut self_nibs = prefix_nibs(prefix); - if let Some(tail) = key_nibs.strip_prefix(self_nibs.as_slice()) { - if !child.delete_internal(tail)? { - return Ok(false); - } - } else { - return Ok(false); - } - - // an extension can only point to a branch or a digest; since it's sub trie was - // modified, we need to make sure that this property still holds - match &mut child.data { - // if the child is empty, remove the extension - MptNodeData::Null => { - self.data = MptNodeData::Null; - } - // for a leaf, replace the extension with the extended leaf - MptNodeData::Leaf(prefix, value) => { - self_nibs.extend(prefix_nibs(prefix)); - self.data = - MptNodeData::Leaf(to_encoded_path(&self_nibs, true), mem::take(value)); - } - // for an extension, replace the extension with the extended extension - MptNodeData::Extension(prefix, node) => { - self_nibs.extend(prefix_nibs(prefix)); - self.data = MptNodeData::Extension( - to_encoded_path(&self_nibs, false), - mem::take(node), - ); - } - // for a branch or digest, the extension is still correct - MptNodeData::Branch(_) | MptNodeData::Digest(_) => {} - } - } - MptNodeData::Digest(digest) => return Err(Error::NodeNotResolved(*digest)), - }; - - self.invalidate_ref_cache(); - Ok(true) - } - - /// Inserts a key-value pair into the trie. - /// - /// This method attempts to insert a new key-value pair into the trie. If the - /// insertion is successful, it returns `true`. If the key already exists, it updates - /// the value and returns `false`. - #[inline] - pub fn insert(&mut self, key: &[u8], value: Vec) -> Result { - assert!(!value.is_empty(), "value must not be empty"); - self.insert_internal(&to_nibs(key), value) - } - - /// Inserts an RLP-encoded value into the trie. - /// - /// This method inserts a value that's been encoded using RLP into the trie. - #[inline] - pub fn insert_rlp(&mut self, key: &[u8], value: impl Encodable) -> Result { - self.insert_internal(&to_nibs(key), value.to_rlp()) - } - - #[inline] - pub fn insert_rlp_encoded(&mut self, key: &[u8], value: Vec) -> Result { - self.insert_internal(&to_nibs(key), value) - } - - fn insert_internal(&mut self, key_nibs: &[u8], value: Vec) -> Result { - match &mut self.data { - MptNodeData::Null => { - self.data = MptNodeData::Leaf(to_encoded_path(key_nibs, true), value); - } - MptNodeData::Branch(children) => { - if let Some((i, tail)) = key_nibs.split_first() { - let child = &mut children[*i as usize]; - match child { - Some(node) => { - if !node.insert_internal(tail, value)? { - return Ok(false); - } - } - // if the corresponding child is empty, insert a new leaf - None => { - *child = Some(Box::new( - MptNodeData::Leaf(to_encoded_path(tail, true), value).into(), - )); - } - } - } else { - return Err(Error::ValueInBranch); - } - } - MptNodeData::Leaf(prefix, old_value) => { - let self_nibs = prefix_nibs(prefix); - let common_len = lcp(&self_nibs, key_nibs); - if common_len == self_nibs.len() && common_len == key_nibs.len() { - // if self_nibs == key_nibs, update the value if it is different - if old_value == &value { - return Ok(false); - } - *old_value = value; - } else if common_len == self_nibs.len() || common_len == key_nibs.len() { - return Err(Error::ValueInBranch); - } else { - let split_point = common_len + 1; - // otherwise, create a branch with two children - let mut children: [Option>; 16] = Default::default(); - - children[self_nibs[common_len] as usize] = Some(Box::new( - MptNodeData::Leaf( - to_encoded_path(&self_nibs[split_point..], true), - mem::take(old_value), - ) - .into(), - )); - children[key_nibs[common_len] as usize] = Some(Box::new( - MptNodeData::Leaf(to_encoded_path(&key_nibs[split_point..], true), value) - .into(), - )); - - let branch = MptNodeData::Branch(children); - if common_len > 0 { - // create parent extension for new branch - self.data = MptNodeData::Extension( - to_encoded_path(&self_nibs[..common_len], false), - Box::new(branch.into()), - ); - } else { - self.data = branch; - } - } - } - MptNodeData::Extension(prefix, existing_child) => { - let self_nibs = prefix_nibs(prefix); - let common_len = lcp(&self_nibs, key_nibs); - if common_len == self_nibs.len() { - // traverse down for update - if !existing_child.insert_internal(&key_nibs[common_len..], value)? { - return Ok(false); - } - } else if common_len == key_nibs.len() { - return Err(Error::ValueInBranch); - } else { - let split_point = common_len + 1; - // otherwise, create a branch with two children - let mut children: [Option>; 16] = Default::default(); - - children[self_nibs[common_len] as usize] = if split_point < self_nibs.len() { - Some(Box::new( - MptNodeData::Extension( - to_encoded_path(&self_nibs[split_point..], false), - mem::take(existing_child), - ) - .into(), - )) - } else { - Some(mem::take(existing_child)) - }; - children[key_nibs[common_len] as usize] = Some(Box::new( - MptNodeData::Leaf(to_encoded_path(&key_nibs[split_point..], true), value) - .into(), - )); - - let branch = MptNodeData::Branch(children); - if common_len > 0 { - // Create parent extension for new branch - self.data = MptNodeData::Extension( - to_encoded_path(&self_nibs[..common_len], false), - Box::new(branch.into()), - ); - } else { - self.data = branch; - } - } - } - MptNodeData::Digest(digest) => return Err(Error::NodeNotResolved(*digest)), - }; - - self.invalidate_ref_cache(); - Ok(true) - } - - fn invalidate_ref_cache(&mut self) { - self.cached_reference.borrow_mut().take(); - } - - /// Returns the number of traversable nodes in the trie. - /// - /// This method provides a count of all the nodes that can be traversed within the - /// trie. - pub fn size(&self) -> usize { - match self.as_data() { - MptNodeData::Null | MptNodeData::Digest(_) => 0, - MptNodeData::Branch(children) => { - children.iter().flatten().map(|n| n.size()).sum::() + 1 - } - MptNodeData::Leaf(_, _) => 1, - MptNodeData::Extension(_, child) => child.size() + 1, - } - } - - /// Formats the trie as a string list, where each line corresponds to a trie leaf. - /// - /// This method is primarily used for debugging purposes, providing a visual - /// representation of the trie's structure. - pub fn debug_rlp(&self) -> Vec { - // convert the nibs to hex - let nibs: String = self.nibs().iter().fold(String::new(), |mut output, n| { - let _ = write!(output, "{n:x}"); - output - }); - - match self.as_data() { - MptNodeData::Null => vec![format!("{:?}", MptNodeData::Null)], - MptNodeData::Branch(children) => children - .iter() - .enumerate() - .flat_map(|(i, child)| { - match child { - Some(node) => node.debug_rlp::(), - None => vec!["None".to_string()], - } - .into_iter() - .map(move |s| format!("{i:x} {s}")) - }) - .collect(), - MptNodeData::Leaf(_, data) => { - vec![format!( - "{nibs} -> {:?}", - T::decode(&mut &data[..]).unwrap() - )] - } - MptNodeData::Extension(_, node) => node - .debug_rlp::() - .into_iter() - .map(|s| format!("{nibs} {s}")) - .collect(), - MptNodeData::Digest(digest) => vec![format!("#{digest:#}")], - } - } - - /// Returns the length of the RLP payload of the node. - fn payload_length(&self) -> usize { - match &self.data { - MptNodeData::Null => 0, - MptNodeData::Branch(nodes) => { - 1 + nodes - .iter() - .map(|child| child.as_ref().map_or(1, |node| node.reference_length())) - .sum::() - } - MptNodeData::Leaf(prefix, value) => { - prefix.as_slice().length() + value.as_slice().length() - } - MptNodeData::Extension(prefix, node) => { - prefix.as_slice().length() + node.reference_length() - } - MptNodeData::Digest(_) => 32, - } - } -} - -/// Converts a byte slice into a vector of nibbles. -/// -/// A nibble is 4 bits or half of an 8-bit byte. This function takes each byte from the -/// input slice, splits it into two nibbles, and appends them to the resulting vector. -pub fn to_nibs(slice: &[u8]) -> Vec { - let mut result = Vec::with_capacity(2 * slice.len()); - for byte in slice { - result.push(byte >> 4); - result.push(byte & 0xf); - } - result -} - -/// Encodes a slice of nibbles into a vector of bytes, with an additional prefix to -/// indicate the type of node (leaf or extension). -/// -/// The function starts by determining the type of node based on the `is_leaf` parameter. -/// If the node is a leaf, the prefix is set to `0x20`. If the length of the nibbles is -/// odd, the prefix is adjusted and the first nibble is incorporated into it. -/// -/// The remaining nibbles are then combined into bytes, with each pair of nibbles forming -/// a single byte. The resulting vector starts with the prefix, followed by the encoded -/// bytes. -pub fn to_encoded_path(mut nibs: &[u8], is_leaf: bool) -> Vec { - let mut prefix = u8::from(is_leaf) * 0x20; - if nibs.len() % 2 != 0 { - prefix += 0x10 + nibs[0]; - nibs = &nibs[1..]; - } - iter::once(prefix) - .chain(nibs.chunks_exact(2).map(|byte| (byte[0] << 4) + byte[1])) - .collect() -} - -/// Returns the length of the common prefix. -fn lcp(a: &[u8], b: &[u8]) -> usize { - for (i, (a, b)) in iter::zip(a, b).enumerate() { - if a != b { - return i; - } - } - cmp::min(a.len(), b.len()) -} - -fn prefix_nibs(prefix: &[u8]) -> Vec { - let (extension, tail) = prefix.split_first().unwrap(); - // the first bit of the first nibble denotes the parity - let is_odd = extension & (1 << 4) != 0; - - let mut result = Vec::with_capacity(2 * tail.len() + usize::from(is_odd)); - // for odd lengths, the second nibble contains the first element - if is_odd { - result.push(extension & 0xf); - } - for nib in tail { - result.push(nib >> 4); - result.push(nib & 0xf); - } - result -} - -/// Parses proof bytes into a vector of MPT nodes. -pub fn parse_proof(proof: &[impl AsRef<[u8]>]) -> Result> { - Ok(proof - .iter() - .map(MptNode::decode) - .collect::, _>>()?) -} - -/// Creates a Merkle Patricia trie from an EIP-1186 proof. -/// For inclusion proofs the returned trie contains exactly one leaf with the value. -pub fn mpt_from_proof(proof_nodes: &[MptNode]) -> Result { - let mut next: Option = None; - for (i, node) in proof_nodes.iter().enumerate().rev() { - // there is nothing to replace for the last node - let Some(replacement) = next else { - next = Some(node.clone()); - continue; - }; - - // the next node must have a digest reference - let MptNodeReference::Digest(ref child_ref) = replacement.reference() else { - panic!("node {} in proof is not referenced by hash", i + 1); - }; - // find the child that references the next node - let resolved: MptNode = match node.as_data().clone() { - MptNodeData::Branch(mut children) => { - if let Some(child) = children.iter_mut().flatten().find( - |child| matches!(child.as_data(), MptNodeData::Digest(d) if d == child_ref), - ) { - *child = Box::new(replacement); - } else { - panic!("node {i} does not reference the successor"); - } - MptNodeData::Branch(children).into() - } - MptNodeData::Extension(prefix, child) => { - assert!( - matches!(child.as_data(), MptNodeData::Digest(d) if d == child_ref), - "node {i} does not reference the successor" - ); - MptNodeData::Extension(prefix, Box::new(replacement)).into() - } - MptNodeData::Null | MptNodeData::Leaf(_, _) | MptNodeData::Digest(_) => { - panic!("node {i} has no children to replace"); - } - }; - - next = Some(resolved); - } - - // the last node in the proof should be the root - Ok(next.unwrap_or_default()) -} - -/// Verifies that the given proof is a valid proof of exclusion for the given key. -pub fn is_not_included(key: &[u8], proof_nodes: &[MptNode]) -> Result { - let proof_trie = mpt_from_proof(proof_nodes).unwrap(); - // for valid proofs, the get must not fail - let value = proof_trie.get(key).unwrap(); - - Ok(value.is_none()) -} - -/// Creates a new MPT trie where all the digests contained in `node_store` are resolved. -pub fn resolve_nodes(root: &MptNode, node_store: &HashMap) -> MptNode { - let trie = match root.as_data() { - MptNodeData::Null | MptNodeData::Leaf(_, _) => root.clone(), - MptNodeData::Branch(children) => { - let children: Vec<_> = children - .iter() - .map(|child| { - child - .as_ref() - .map(|node| Box::new(resolve_nodes(node, node_store))) - }) - .collect(); - MptNodeData::Branch(children.try_into().unwrap()).into() - } - MptNodeData::Extension(prefix, target) => { - MptNodeData::Extension(prefix.clone(), Box::new(resolve_nodes(target, node_store))) - .into() - } - MptNodeData::Digest(digest) => { - if let Some(node) = node_store.get(&MptNodeReference::Digest(*digest)) { - resolve_nodes(node, node_store) - } else { - root.clone() - } - } - }; - // the root hash must not change - debug_assert_eq!(root.hash(), trie.hash()); - - trie -} - -/// Returns a list of all possible nodes that can be created by shortening the path of the -/// given node. -/// When nodes in an MPT are deleted, leaves or extensions may be extended. To still be -/// able to identify the original nodes, we create all shortened versions of the node. -pub fn shorten_node_path(node: &MptNode) -> Vec { - let mut res = Vec::new(); - let nibs = node.nibs(); - match node.as_data() { - MptNodeData::Null | MptNodeData::Branch(_) | MptNodeData::Digest(_) => {} - MptNodeData::Leaf(_, value) => { - for i in 0..=nibs.len() { - res.push( - MptNodeData::Leaf(to_encoded_path(&nibs[i..], true), value.clone()).into(), - ); - } - } - MptNodeData::Extension(_, child) => { - for i in 0..=nibs.len() { - res.push( - MptNodeData::Extension(to_encoded_path(&nibs[i..], false), child.clone()) - .into(), - ); - } - } - }; - res -} - -pub fn proofs_to_tries( - state_root: B256, - parent_proofs: HashMap, - proofs: HashMap, -) -> Result<(MptNode, HashMap)> { - // if no addresses are provided, return the trie only consisting of the state root - if parent_proofs.is_empty() { - return Ok((node_from_digest(state_root), HashMap::new())); - } - - let mut storage: HashMap = HashMap::with_capacity(parent_proofs.len()); - - let mut state_nodes = HashMap::new(); - let mut state_root_node = MptNode::default(); - for (address, proof) in parent_proofs { - let proof_nodes = parse_proof(&proof.account_proof).unwrap(); - mpt_from_proof(&proof_nodes).unwrap(); - - // the first node in the proof is the root - if let Some(node) = proof_nodes.first() { - state_root_node = node.clone(); - } - - for node in proof_nodes { - state_nodes.insert(node.reference(), node); - } - - let fini_proofs = proofs.get(&address).unwrap(); - - // assure that addresses can be deleted from the state trie - add_orphaned_leafs(address, &fini_proofs.account_proof, &mut state_nodes)?; - - // if no slots are provided, return the trie only consisting of the storage root - let storage_root = proof.storage_hash; - if proof.storage_proof.is_empty() { - let storage_root_node = node_from_digest(storage_root); - storage.insert(address, (storage_root_node, vec![])); - continue; - } - - let mut storage_nodes = HashMap::new(); - let mut storage_root_node = MptNode::default(); - for storage_proof in &proof.storage_proof { - let proof_nodes = parse_proof(&storage_proof.proof).unwrap(); - mpt_from_proof(&proof_nodes).unwrap(); - - // the first node in the proof is the root - if let Some(node) = proof_nodes.first() { - storage_root_node = node.clone(); - } - - for node in proof_nodes { - storage_nodes.insert(node.reference(), node); - } - } - - // assure that slots can be deleted from the storage trie - for storage_proof in &fini_proofs.storage_proof { - add_orphaned_leafs( - storage_proof.key.0 .0, - &storage_proof.proof, - &mut storage_nodes, - )?; - } - // create the storage trie, from all the relevant nodes - let storage_trie = resolve_nodes(&storage_root_node, &storage_nodes); - assert_eq!(storage_trie.hash(), storage_root); - - // convert the slots to a vector of U256 - let slots = proof - .storage_proof - .iter() - .map(|p| U256::from_be_bytes(p.key.0 .0)) - .collect(); - storage.insert(address, (storage_trie, slots)); - } - let state_trie = resolve_nodes(&state_root_node, &state_nodes); - assert_eq!(state_trie.hash(), state_root); - - Ok((state_trie, storage)) -} - -/// Adds all the leaf nodes of non-inclusion proofs to the nodes. -fn add_orphaned_leafs( - key: impl AsRef<[u8]>, - proof: &[impl AsRef<[u8]>], - nodes_by_reference: &mut HashMap, -) -> Result<()> { - if !proof.is_empty() { - let proof_nodes = parse_proof(proof).context("invalid proof encoding")?; - if is_not_included(&keccak(key), &proof_nodes)? { - // add the leaf node to the nodes - let leaf = proof_nodes.last().unwrap(); - for node in shorten_node_path(leaf) { - nodes_by_reference.insert(node.reference(), node); - } - } - } - - Ok(()) -} - -/// Creates a new MPT node from a digest. -fn node_from_digest(digest: B256) -> MptNode { - match digest { - EMPTY_ROOT | B256::ZERO => MptNode::default(), - _ => MptNodeData::Digest(digest).into(), - } -} - -#[cfg(test)] -mod tests { - use hex_literal::hex; - - use super::*; - - #[test] - pub fn test_trie_pointer_no_keccak() { - let cases = [ - ("do", "verb"), - ("dog", "puppy"), - ("doge", "coin"), - ("horse", "stallion"), - ]; - for (k, v) in cases { - let node: MptNode = - MptNodeData::Leaf(k.as_bytes().to_vec(), v.as_bytes().to_vec()).into(); - assert!( - matches!(node.reference(),MptNodeReference::Bytes(bytes) if bytes == node.to_rlp().to_vec()) - ); - } - } - - #[test] - pub fn test_to_encoded_path() { - // extension node with an even path length - let nibbles = vec![0x0a, 0x0b, 0x0c, 0x0d]; - assert_eq!(to_encoded_path(&nibbles, false), vec![0x00, 0xab, 0xcd]); - // extension node with an odd path length - let nibbles = vec![0x0a, 0x0b, 0x0c]; - assert_eq!(to_encoded_path(&nibbles, false), vec![0x1a, 0xbc]); - // leaf node with an even path length - let nibbles = vec![0x0a, 0x0b, 0x0c, 0x0d]; - assert_eq!(to_encoded_path(&nibbles, true), vec![0x20, 0xab, 0xcd]); - // leaf node with an odd path length - let nibbles = vec![0x0a, 0x0b, 0x0c]; - assert_eq!(to_encoded_path(&nibbles, true), vec![0x3a, 0xbc]); - } - - #[test] - pub fn test_lcp() { - let cases = [ - (vec![], vec![], 0), - (vec![0xa], vec![0xa], 1), - (vec![0xa, 0xb], vec![0xa, 0xc], 1), - (vec![0xa, 0xb], vec![0xa, 0xb], 2), - (vec![0xa, 0xb], vec![0xa, 0xb, 0xc], 2), - (vec![0xa, 0xb, 0xc], vec![0xa, 0xb, 0xc], 3), - (vec![0xa, 0xb, 0xc], vec![0xa, 0xb, 0xc, 0xd], 3), - (vec![0xa, 0xb, 0xc, 0xd], vec![0xa, 0xb, 0xc, 0xd], 4), - ]; - for (a, b, cpl) in cases { - assert_eq!(lcp(&a, &b), cpl) - } - } - - #[test] - pub fn test_empty() { - let trie = MptNode::default(); - - assert!(trie.is_empty()); - assert_eq!(trie.reference(), MptNodeReference::Bytes(vec![0x80])); - let expected = hex!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"); - assert_eq!(expected, trie.hash().0); - - // test RLP encoding - let mut out = Vec::new(); - trie.encode(&mut out); - assert_eq!(out, vec![0x80]); - assert_eq!(trie.length(), out.len()); - let decoded = MptNode::decode(out).unwrap(); - assert_eq!(trie.hash(), decoded.hash()); - } - - #[test] - pub fn test_empty_key() { - let mut trie = MptNode::default(); - - trie.insert(&[], b"empty".to_vec()).unwrap(); - assert_eq!(trie.get(&[]).unwrap(), Some(b"empty".as_ref())); - assert!(trie.delete(&[]).unwrap()); - } - - #[test] - pub fn test_clear() { - let mut trie = MptNode::default(); - trie.insert(b"dog", b"puppy".to_vec()).unwrap(); - assert!(!trie.is_empty()); - assert_ne!(trie.hash(), EMPTY_ROOT); - - trie.clear(); - assert!(trie.is_empty()); - assert_eq!(trie.hash(), EMPTY_ROOT); - } - - #[test] - pub fn test_tiny() { - // trie consisting of an extension, a branch and two leafs - let mut trie = MptNode::default(); - trie.insert_rlp(b"a", 0u8).unwrap(); - trie.insert_rlp(b"b", 1u8).unwrap(); - - assert!(!trie.is_empty()); - let exp_rlp = hex!("d816d680c3208180c220018080808080808080808080808080"); - assert_eq!(trie.reference(), MptNodeReference::Bytes(exp_rlp.to_vec())); - let exp_hash = hex!("6fbf23d6ec055dd143ff50d558559770005ff44ae1d41276f1bd83affab6dd3b"); - assert_eq!(trie.hash().0, exp_hash); - - // test RLP encoding - let mut out = Vec::new(); - trie.encode(&mut out); - assert_eq!(out, exp_rlp.to_vec()); - assert_eq!(trie.length(), out.len()); - let decoded = MptNode::decode(out).unwrap(); - assert_eq!(trie.hash(), decoded.hash()); - } - - #[test] - pub fn test_partial() { - let mut trie = MptNode::default(); - trie.insert_rlp(b"aa", 0u8).unwrap(); - trie.insert_rlp(b"ab", 1u8).unwrap(); - trie.insert_rlp(b"ba", 2u8).unwrap(); - - let exp_hash = trie.hash(); - - // replace one node with its digest - let MptNodeData::Extension(_, node) = &mut trie.data else { - panic!("extension expected") - }; - **node = MptNodeData::Digest(node.hash()).into(); - assert!(node.is_digest()); - - let trie = MptNode::decode(trie.to_rlp()).unwrap(); - assert_eq!(trie.hash(), exp_hash); - - // lookups should fail - trie.get(b"aa").unwrap_err(); - trie.get(b"a0").unwrap_err(); - } - - #[test] - pub fn test_branch_value() { - let mut trie = MptNode::default(); - trie.insert(b"do", b"verb".to_vec()).unwrap(); - // leads to a branch with value which is not supported - trie.insert(b"dog", b"puppy".to_vec()).unwrap_err(); - } - - #[test] - pub fn test_insert() { - let mut trie = MptNode::default(); - let vals = vec![ - ("painting", "place"), - ("guest", "ship"), - ("mud", "leave"), - ("paper", "call"), - ("gate", "boast"), - ("tongue", "gain"), - ("baseball", "wait"), - ("tale", "lie"), - ("mood", "cope"), - ("menu", "fear"), - ]; - for (key, val) in &vals { - assert!(trie - .insert(key.as_bytes(), val.as_bytes().to_vec()) - .unwrap()); - } - - let expected = hex!("2bab6cdf91a23ebf3af683728ea02403a98346f99ed668eec572d55c70a4b08f"); - assert_eq!(expected, trie.hash().0); - - for (key, value) in &vals { - assert_eq!(trie.get(key.as_bytes()).unwrap(), Some(value.as_bytes())); - } - - // check inserting duplicate keys - assert!(trie.insert(vals[0].0.as_bytes(), b"new".to_vec()).unwrap()); - assert!(!trie.insert(vals[0].0.as_bytes(), b"new".to_vec()).unwrap()); - - // try RLP roundtrip - let decoded = MptNode::decode(trie.to_rlp()).unwrap(); - assert_eq!(trie.hash(), decoded.hash()); - } - - #[test] - pub fn test_keccak_trie() { - const N: usize = 512; - - // insert - let mut trie = MptNode::default(); - for i in 0..N { - assert!(trie.insert_rlp(&keccak(i.to_be_bytes()), i).unwrap()); - - // check hash against trie build in reverse - let mut reference = MptNode::default(); - for j in (0..=i).rev() { - reference.insert_rlp(&keccak(j.to_be_bytes()), j).unwrap(); - } - assert_eq!(trie.hash(), reference.hash()); - } - - let expected = hex!("7310027edebdd1f7c950a7fb3413d551e85dff150d45aca4198c2f6315f9b4a7"); - assert_eq!(trie.hash().0, expected); - - // get - for i in 0..N { - assert_eq!(trie.get_rlp(&keccak(i.to_be_bytes())).unwrap(), Some(i)); - assert!(trie.get(&keccak((i + N).to_be_bytes())).unwrap().is_none()); - } - - // delete - for i in 0..N { - assert!(trie.delete(&keccak(i.to_be_bytes())).unwrap()); - - let mut reference = MptNode::default(); - for j in ((i + 1)..N).rev() { - reference.insert_rlp(&keccak(j.to_be_bytes()), j).unwrap(); - } - assert_eq!(trie.hash(), reference.hash()); - } - assert!(trie.is_empty()); - } - - #[test] - pub fn test_index_trie() { - const N: usize = 512; - - // insert - let mut trie = MptNode::default(); - for i in 0..N { - assert!(trie.insert_rlp(&i.to_rlp(), i).unwrap()); - - // check hash against trie build in reverse - let mut reference = MptNode::default(); - for j in (0..=i).rev() { - reference.insert_rlp(&j.to_rlp(), j).unwrap(); - } - assert_eq!(trie.hash(), reference.hash()); - - // try RLP roundtrip - let decoded = MptNode::decode(trie.to_rlp()).unwrap(); - assert_eq!(trie.hash(), decoded.hash()); - } - - // get - for i in 0..N { - assert_eq!(trie.get_rlp(&i.to_rlp()).unwrap(), Some(i)); - assert!(trie.get(&(i + N).to_rlp()).unwrap().is_none()); - } - - // delete - for i in 0..N { - assert!(trie.delete(&i.to_rlp()).unwrap()); - - let mut reference = MptNode::default(); - for j in ((i + 1)..N).rev() { - reference.insert_rlp(&j.to_rlp(), j).unwrap(); - } - assert_eq!(trie.hash(), reference.hash()); - } - assert!(trie.is_empty()); - } -} diff --git a/primitives/src/receipt.rs b/primitives/src/receipt.rs deleted file mode 100644 index 175de22d..00000000 --- a/primitives/src/receipt.rs +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -extern crate alloc; -extern crate core; - -pub use alloc::{ - boxed::Box, - format, - string::{String, ToString}, - vec, - vec::Vec, -}; -pub use core::{ - convert::From, - default::Default, - option::{Option, Option::*}, - result::{Result, Result::*}, -}; - -use alloy_primitives::{Address, Bloom, BloomInput, Bytes, B256, U256}; -use alloy_rlp::Encodable; -use alloy_rlp_derive::RlpEncodable; -use serde::{Deserialize, Serialize}; - -/// Represents an Ethereum log entry. -#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, RlpEncodable)] -pub struct Log { - /// Contract that emitted this log. - pub address: Address, - /// Topics of the log. The number of logs depend on what `LOG` opcode is used. - pub topics: Vec, - /// Arbitrary length data. - pub data: Bytes, -} - -/// Payload of a [Receipt]. -#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, RlpEncodable)] -pub struct ReceiptPayload { - /// Indicates whether the transaction was executed successfully. - pub success: bool, - /// Total gas used by the transaction. - pub cumulative_gas_used: U256, - /// A bloom filter that contains indexed information of logs for quick searching. - pub logs_bloom: Bloom, - /// Logs generated during the execution of the transaction. - pub logs: Vec, -} - -/// Receipt containing result of transaction execution. -#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)] -pub struct Receipt { - /// Type of Receipt. - pub tx_type: u8, - /// Detailed payload of the receipt. - pub payload: ReceiptPayload, -} - -impl Encodable for Receipt { - /// Encodes the receipt into the `out` buffer. - #[inline] - fn encode(&self, out: &mut dyn alloy_rlp::BufMut) { - match self.tx_type { - // For legacy transactions - 0 => self.payload.encode(out), - // For EIP-2718 typed transactions - tx_type => { - // prepend the EIP-2718 transaction type - out.put_u8(tx_type); - // append the RLP-encoded payload - self.payload.encode(out); - } - } - } - - /// Returns the length of the encoded receipt in bytes. - #[inline] - fn length(&self) -> usize { - let mut payload_length = self.payload.length(); - if self.tx_type != 0 { - payload_length += 1; - } - payload_length - } -} - -impl Receipt { - /// Constructs a new [Receipt]. - /// - /// This function also computes the `logs_bloom` based on the provided logs. - pub fn new(tx_type: u8, success: bool, cumulative_gas_used: U256, logs: Vec) -> Receipt { - let mut logs_bloom = Bloom::default(); - for log in &logs { - logs_bloom.accrue(BloomInput::Raw(log.address.as_slice())); - for topic in &log.topics { - logs_bloom.accrue(BloomInput::Raw(topic.as_slice())); - } - } - - Receipt { - tx_type, - payload: ReceiptPayload { - success, - cumulative_gas_used, - logs_bloom, - logs, - }, - } - } -} - -// test vectors from https://github.com/ethereum/go-ethereum/blob/c40ab6af72ce282020d03c33e8273ea9b03d58f6/core/types/receipt_test.go -#[cfg(test)] -mod tests { - use hex_literal::hex; - use serde_json::json; - - use super::*; - - #[test] - fn legacy() { - let expected = hex!("f901c58001b9010000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000010000080000000000000000000004000000000000000000000000000040000000000000000000000000000800000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000f8bef85d940000000000000000000000000000000000000011f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100fff85d940000000000000000000000000000000000000111f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100ff"); - let receipt = Receipt::new( - 0, - false, - U256::from(1), - serde_json::from_value(json!([ - { - "address": "0x0000000000000000000000000000000000000011", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - }, - { - "address": "0x0000000000000000000000000000000000000111", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - } - ])) - .unwrap(), - ); - let mut data = vec![]; - receipt.encode(&mut data); - - assert_eq!(data, expected); - } - - #[test] - fn eip2930() { - let expected = hex!("01f901c58001b9010000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000010000080000000000000000000004000000000000000000000000000040000000000000000000000000000800000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000f8bef85d940000000000000000000000000000000000000011f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100fff85d940000000000000000000000000000000000000111f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100ff"); - let receipt = Receipt::new( - 1, - false, - U256::from(1), - serde_json::from_value(json!([ - { - "address": "0x0000000000000000000000000000000000000011", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - }, - { - "address": "0x0000000000000000000000000000000000000111", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - } - ])) - .unwrap(), - ); - let mut data = vec![]; - receipt.encode(&mut data); - - assert_eq!(data, expected); - } - - #[test] - fn eip1559() { - let expected = hex!("02f901c58001b9010000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000010000080000000000000000000004000000000000000000000000000040000000000000000000000000000800000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000f8bef85d940000000000000000000000000000000000000011f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100fff85d940000000000000000000000000000000000000111f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100ff"); - let receipt = Receipt::new( - 2, - false, - U256::from(1), - serde_json::from_value(json!([ - { - "address": "0x0000000000000000000000000000000000000011", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - }, - { - "address": "0x0000000000000000000000000000000000000111", - "topics": [ - "0x000000000000000000000000000000000000000000000000000000000000dead", - "0x000000000000000000000000000000000000000000000000000000000000beef" - ], - "data": "0x0100ff" - } - ])) - .unwrap(), - ); - let mut data = vec![]; - receipt.encode(&mut data); - - assert_eq!(data, expected); - } -} diff --git a/primitives/src/revm.rs b/primitives/src/revm.rs deleted file mode 100644 index de85a64b..00000000 --- a/primitives/src/revm.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2024 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Convert to revm types. - -extern crate alloc; -extern crate core; - -pub use alloc::{ - boxed::Box, - format, - string::{String, ToString}, - vec, - vec::Vec, -}; -pub use core::{ - convert::From, - default::Default, - option::{Option, Option::*}, - result::{Result, Result::*}, -}; - -use revm_primitives::Log as RevmLog; - -use crate::receipt::Log; - -/// Provides a conversion from `RevmLog` to the local [Log]. -impl From for Log { - fn from(log: RevmLog) -> Self { - Log { - address: log.address, - topics: log.data.topics().to_vec(), - data: log.data.data, - } - } -} diff --git a/primitives/src/signature.rs b/primitives/src/signature.rs deleted file mode 100644 index 88d34e8b..00000000 --- a/primitives/src/signature.rs +++ /dev/null @@ -1,82 +0,0 @@ -// use revm_primitives::U256; - -// The order of the secp256k1 curve, divided by two. Signatures that should be checked -// according to EIP-2 should have an S value less than or equal to this. -// -// `57896044618658097711785492504343953926418782139537452191302581570759080747168` -// const SECP256K1N_HALF: U256 = U256::from_be_bytes([ -// 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -// 0xFF, 0xFF, 0x5D, 0x57, 0x6E, 0x73, 0x57, 0xA4, 0x50, 0x1D, 0xDF, 0xE9, 0x2F, 0x46, -// 0x68, 0x1B, 0x20, 0xA0, ]); - -// Recovers the address of the sender using secp256k1 pubkey recovery. -// -// Converts the public key into an ethereum address by hashing the public key with -// keccak256. -// -// This does not ensure that the `s` value in the signature is low, and _just_ wraps the -// underlying secp256k1 library. -// pub fn recover_signer_unchecked_crypto(sig: &[u8; 65], msg: &[u8; 32]) -> -// Result { #[cfg(target_os = "zkvm")] -// { -// let pubkey = sp1_precompiles::secp256k1::ecrecover(sig, msg).unwrap(); -// return Ok(public_key_bytes_to_address(&pubkey)); -// } -// { -// let recid = RecoveryId::from_byte(sig[64]).expect("recovery ID is valid"); -// let sig = K256Signature::from_slice(&sig.as_slice()[..64])?; -// let recovered_key = VerifyingKey::recover_from_prehash(&msg[..], &sig, recid)?; -// let pubkey = PublicKey::from(&recovered_key); -// Ok(public_key_to_address(pubkey)) -// } -// } -// -// Recover signer from message hash, _without ensuring that the signature has a low `s` -// value_. -// -// Using this for signature validation will succeed, even if the signature is malleable or -// not compliant with EIP-2. This is provided for compatibility with old signatures which -// have large `s` values. -// pub fn recover_signer_unchecked(&self, hash: B256) -> Option
{ -// let mut sig: [u8; 65] = [0; 65]; -// -// sig[0..32].copy_from_slice(&self.r.to_be_bytes::<32>()); -// sig[32..64].copy_from_slice(&self.s.to_be_bytes::<32>()); -// sig[64] = self.odd_y_parity as u8; -// -// NOTE: we are removing error from underlying crypto library as it will restrain -// primitive errors and we care only if recovery is passing or not. -// recover_signer_unchecked_crypto(&sig, &hash.0).ok() -// } -// -// Recover signer address from message hash. This ensures that the signature S value is -// greater than `secp256k1n / 2`, as specified in -// [EIP-2](https://eips.ethereum.org/EIPS/eip-2). -// -// If the S value is too large, then this will return `None` -// pub fn recover_signer(&self, hash: B256) -> Option
{ -// if self.s > SECP256K1N_HALF { -// return None -// } -// -// self.recover_signer_unchecked(hash) -// } -// -// -// Converts a public key into an ethereum address by hashing the encoded public key with -// keccak256. -// pub fn public_key_to_address(public: PublicKey) -> Address { -// let pubkey_bytes = -// public.to_encoded_point(false).as_bytes().try_into().expect("The slice has 65 -// bytes"); public_key_bytes_to_address(&pubkey_bytes); -// // strip out the first byte because that should be the -// SECP256K1_TAG_PUBKEY_UNCOMPRESSED // tag returned by libsecp's uncompressed pubkey -// serialization let hash = keccak(&public.serialize_uncompressed()[1..]); -// Address::from_slice(&hash[12..]) -// } - -// fn public_key_bytes_to_address(public: &[u8; 65]) -> Address { -// // Strip out first byte of sec1 encoded pubkey -// let hash = keccak(&public[1..]); -// Address::from_slice(&hash[12..]) -// } diff --git a/provers/risc0/guest/Cargo.lock b/provers/risc0/guest/Cargo.lock index 95737aa1..c4445324 100644 --- a/provers/risc0/guest/Cargo.lock +++ b/provers/risc0/guest/Cargo.lock @@ -26,16 +26,38 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + [[package]] name = "allocator-api2" version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "alloy-chains" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +dependencies = [ + "alloy-rlp", + "num_enum", + "serde", + "strum", +] + [[package]] name = "alloy-consensus" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a016bfa21193744d4c38b3f3ab845462284d129e5e23c7cc0fafca7e92d9db37" dependencies = [ "alloy-eips", "alloy-primitives", @@ -43,60 +65,33 @@ dependencies = [ "alloy-serde", "c-kzg", "serde", - "sha2 0.10.8", ] [[package]] name = "alloy-eips" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d6d8118b83b0489cfb7e6435106948add2b35217f4a5004ef895f613f60299" dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-serde", "c-kzg", + "derive_more", "once_cell", "serde", + "sha2 0.10.8", ] [[package]] name = "alloy-genesis" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "894f33a7822abb018db56b10ab90398e63273ce1b5a33282afd186c132d764a6" dependencies = [ "alloy-primitives", "alloy-serde", "serde", - "serde_json", -] - -[[package]] -name = "alloy-json-rpc" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" -dependencies = [ - "alloy-primitives", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "alloy-network" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-json-rpc", - "alloy-primitives", - "alloy-rpc-types", - "alloy-signer", - "alloy-sol-types", - "async-trait", - "futures-utils-wasm", - "thiserror", ] [[package]] @@ -110,6 +105,7 @@ dependencies = [ "cfg-if", "const-hex", "derive_more", + "getrandom", "hex-literal", "itoa", "k256 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -140,22 +136,32 @@ checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "alloy-rpc-types" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f2fbe956a3e0f0975c798f488dc6be96b669544df3737e18f4a325b42f4c86" +dependencies = [ + "alloy-rpc-types-eth", + "alloy-serde", +] + +[[package]] +name = "alloy-rpc-types-eth" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "083f443a83b9313373817236a8f4bea09cca862618e9177d822aee579640a5d6" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-genesis", "alloy-primitives", "alloy-rlp", "alloy-serde", "alloy-sol-types", - "itertools 0.12.1", + "itertools 0.13.0", "serde", "serde_json", "thiserror", @@ -163,27 +169,15 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d94da1c0c4e27cc344b05626fe22a89dc6b8b531b9475f3b7691dbf6913e4109" dependencies = [ "alloy-primitives", "serde", "serde_json", ] -[[package]] -name = "alloy-signer" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#6310be6f73bc998116a5f05713e49a324f4b7184" -dependencies = [ - "alloy-primitives", - "async-trait", - "auto_impl", - "elliptic-curve", - "k256 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror", -] - [[package]] name = "alloy-sol-macro" version = "0.7.6" @@ -195,7 +189,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -211,7 +205,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "syn-solidity", "tiny-keccak", ] @@ -227,7 +221,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "syn-solidity", ] @@ -240,6 +234,23 @@ dependencies = [ "alloy-primitives", "alloy-sol-macro", "const-hex", + "serde", +] + +[[package]] +name = "alloy-trie" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03704f265cbbb943b117ecb5055fd46e8f41e7dc8a58b1aed20bcd40ace38c15" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "derive_more", + "hashbrown 0.14.5", + "nybbles", + "serde", + "smallvec", + "tracing", ] [[package]] @@ -257,6 +268,55 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys", +] + [[package]] name = "anyhow" version = "1.0.86" @@ -429,7 +489,7 @@ dependencies = [ "ark-ff 0.4.2", "ark-std 0.4.0", "tracing", - "tracing-subscriber", + "tracing-subscriber 0.2.25", ] [[package]] @@ -503,17 +563,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "async-trait" -version = "0.1.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "aurora-engine-modexp" version = "1.1.0" @@ -532,7 +581,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -576,9 +625,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -640,9 +689,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" dependencies = [ "bytemuck_derive", ] @@ -655,7 +704,7 @@ checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -675,22 +724,8 @@ dependencies = [ [[package]] name = "c-kzg" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" -dependencies = [ - "blst", - "cc", - "glob", - "hex", - "libc", - "serde", -] - -[[package]] -name = "c-kzg-taiko" version = "1.0.0" -source = "git+https://github.com/smtmfft/c-kzg-4844?branch=for-alpha7#a2d3ae768eede8228920619c98c87584ad8afd09" +source = "git+https://github.com/brechtpd/c-kzg-4844?branch=for-alpha7#3bf0372e8c7a4ba908aff65da0508fcaaf9d38e6" dependencies = [ "blst", "cc", @@ -702,9 +737,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.99" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" [[package]] name = "cfg-if" @@ -720,11 +755,59 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", "serde", + "wasm-bindgen", "windows-targets", ] +[[package]] +name = "clap" +version = "4.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.68", +] + +[[package]] +name = "clap_lex" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" + +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + [[package]] name = "const-hex" version = "1.12.0" @@ -750,6 +833,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -774,6 +866,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" version = "1.4.2" @@ -783,6 +890,40 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + [[package]] name = "crunchy" version = "0.2.2" @@ -832,7 +973,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -843,7 +984,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -885,15 +1026,15 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ - "convert_case", + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 1.0.109", + "syn 2.0.68", ] [[package]] @@ -917,17 +1058,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "downcast-rs" version = "1.2.1" @@ -999,7 +1129,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1018,6 +1148,16 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + [[package]] name = "fastrand" version = "2.1.0" @@ -1089,10 +1229,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] -name = "futures-utils-wasm" -version = "0.1.0" +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] [[package]] name = "generic-array" @@ -1238,166 +1409,52 @@ dependencies = [ ] [[package]] -name = "icu_collections" -version = "1.5.0" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", + "unicode-bidi", + "unicode-normalization", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "impl-codec" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", + "parity-scale-codec", ] [[package]] -name = "icu_locid_transform" -version = "1.5.0" +name = "impl-trait-for-tuples" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "icu_locid_transform_data" -version = "1.5.0" +name = "indenter" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] -name = "icu_normalizer" -version = "1.5.0" +name = "indexmap" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" -dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -1415,6 +1472,12 @@ dependencies = [ "serde", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -1433,6 +1496,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -1495,9 +1567,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ "spin", ] @@ -1544,33 +1616,86 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "log" version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "metrics" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "2be3cbd384d4e955b231c895ce10685e3d8260c5ccffae898c96c723b0772835" +dependencies = [ + "ahash", + "portable-atomic", +] [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] +[[package]] +name = "modular-bitfield" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num" version = "0.4.3" @@ -1618,7 +1743,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1672,12 +1797,51 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + +[[package]] +name = "nybbles" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95f06be0417d97f81fe4e5c86d7d01b392655a9cac9c19a848aa033e18937b23" +dependencies = [ + "alloy-rlp", + "const-hex", + "proptest", + "serde", + "smallvec", +] + [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -1687,6 +1851,7 @@ dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -1733,6 +1898,12 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkcs8" version = "0.10.2" @@ -1743,6 +1914,12 @@ dependencies = [ "spki", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "powerfmt" version = "0.2.0" @@ -1801,18 +1978,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", @@ -1822,7 +1999,7 @@ dependencies = [ "rand", "rand_chacha", "rand_xorshift", - "regex-syntax", + "regex-syntax 0.8.4", "rusty-fork", "tempfile", "unarray", @@ -1855,14 +2032,13 @@ version = "0.1.0" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-network", "alloy-primitives", "alloy-rlp", "alloy-rlp-derive", "alloy-rpc-types", "alloy-sol-types", "anyhow", - "c-kzg-taiko", + "c-kzg", "cfg-if", "chrono", "flate2", @@ -1871,8 +2047,10 @@ dependencies = [ "libflate", "log", "once_cell", - "revm", - "revm-primitives", + "reth-chainspec", + "reth-evm", + "reth-evm-ethereum", + "reth-primitives", "rlp", "serde", "serde_json", @@ -1907,33 +2085,506 @@ dependencies = [ ] [[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "regex" +version = "1.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "reth-chainspec" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-chains", + "alloy-eips", + "alloy-genesis", + "alloy-primitives", + "alloy-trie", + "derive_more", + "once_cell", + "reth-ethereum-forks", + "reth-primitives-traits", + "reth-trie-common", + "serde", + "serde_json", +] + +[[package]] +name = "reth-codecs" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-genesis", + "alloy-primitives", + "bytes", + "modular-bitfield", + "reth-codecs-derive", + "serde", +] + +[[package]] +name = "reth-codecs-derive" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "convert_case 0.6.0", + "proc-macro2", + "quote", + "syn 2.0.68", +] + +[[package]] +name = "reth-consensus" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "auto_impl", + "reth-primitives", + "thiserror-no-std", +] + +[[package]] +name = "reth-consensus-common" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-chainspec", + "reth-consensus", + "reth-primitives", +] + +[[package]] +name = "reth-db" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "bytes", + "derive_more", + "eyre", + "metrics", + "paste", + "reth-db-api", + "reth-fs-util", + "reth-metrics", + "reth-primitives", + "reth-prune-types", + "reth-stages-types", + "reth-storage-errors", + "reth-tracing", + "reth-trie-common", + "rustc-hash", + "serde", + "strum", + "sysinfo", + "thiserror", +] + +[[package]] +name = "reth-db-api" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "bytes", + "derive_more", + "metrics", + "modular-bitfield", + "parity-scale-codec", + "reth-codecs", + "reth-primitives", + "reth-prune-types", + "reth-stages-types", + "reth-storage-errors", + "reth-trie-common", + "serde", +] + +[[package]] +name = "reth-ethereum-consensus" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-chainspec", + "reth-consensus", + "reth-consensus-common", + "reth-primitives", + "tracing", +] + +[[package]] +name = "reth-ethereum-forks" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-chains", + "alloy-primitives", + "alloy-rlp", + "crc", + "serde", + "thiserror-no-std", +] + +[[package]] +name = "reth-evm" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "auto_impl", + "futures-util", + "reth-chainspec", + "reth-execution-errors", + "reth-execution-types", + "reth-primitives", + "reth-prune-types", + "reth-storage-errors", + "revm", + "revm-primitives", +] + +[[package]] +name = "reth-evm-ethereum" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-eips", + "alloy-sol-types", + "anyhow", + "lazy_static", + "reth-chainspec", + "reth-ethereum-consensus", + "reth-evm", + "reth-execution-types", + "reth-primitives", + "reth-prune-types", + "reth-revm", + "revm-primitives", +] + +[[package]] +name = "reth-execution-errors" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "reth-consensus", + "reth-prune-types", + "reth-storage-errors", + "revm-primitives", + "thiserror-no-std", +] + +[[package]] +name = "reth-execution-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-execution-errors", + "reth-primitives", + "reth-trie", + "revm", +] + +[[package]] +name = "reth-fs-util" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "serde_json", + "thiserror", +] + +[[package]] +name = "reth-metrics" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "metrics", + "reth-metrics-derive", +] + +[[package]] +name = "reth-metrics-derive" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.68", +] + +[[package]] +name = "reth-primitives" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-genesis", + "alloy-primitives", + "alloy-rlp", + "alloy-rpc-types", + "byteorder", + "bytes", + "c-kzg", + "derive_more", + "modular-bitfield", + "once_cell", + "rayon", + "reth-chainspec", + "reth-codecs", + "reth-ethereum-forks", + "reth-primitives-traits", + "reth-static-file-types", + "reth-trie-common", + "revm", + "revm-primitives", + "roaring", + "secp256k1", + "serde", + "tempfile", + "thiserror-no-std", +] + +[[package]] +name = "reth-primitives-traits" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-genesis", + "alloy-primitives", + "alloy-rlp", + "alloy-rpc-types-eth", + "bytes", + "derive_more", + "modular-bitfield", + "reth-codecs", + "revm-primitives", + "serde", +] + +[[package]] +name = "reth-prune-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "bytes", + "derive_more", + "modular-bitfield", + "reth-codecs", + "serde", + "thiserror", +] + +[[package]] +name = "reth-revm" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-eips", + "alloy-rlp", + "reth-chainspec", + "reth-consensus-common", + "reth-execution-errors", + "reth-primitives", + "reth-prune-types", + "reth-storage-api", + "reth-storage-errors", + "revm", + "tracing", +] + +[[package]] +name = "reth-stages-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "bytes", + "modular-bitfield", + "reth-codecs", + "reth-trie-common", + "serde", +] + +[[package]] +name = "reth-static-file-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "derive_more", + "serde", + "strum", +] + +[[package]] +name = "reth-storage-api" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "auto_impl", + "reth-chainspec", + "reth-db-api", + "reth-execution-types", + "reth-primitives", + "reth-prune-types", + "reth-stages-types", + "reth-storage-errors", + "reth-trie", + "revm", +] + +[[package]] +name = "reth-storage-errors" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-fs-util", + "reth-primitives", + "thiserror-no-std", +] + +[[package]] +name = "reth-tracing" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" dependencies = [ - "getrandom", + "clap", + "eyre", + "rolling-file", + "tracing", + "tracing-appender", + "tracing-journald", + "tracing-logfmt", + "tracing-subscriber 0.3.18", ] [[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +name = "reth-trie" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" dependencies = [ - "rand_core", + "alloy-rlp", + "auto_impl", + "derive_more", + "rayon", + "reth-db", + "reth-db-api", + "reth-execution-errors", + "reth-primitives", + "reth-stages-types", + "reth-trie-common", + "revm", + "tracing", ] [[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +name = "reth-trie-common" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus", + "alloy-genesis", + "alloy-primitives", + "alloy-rlp", + "alloy-trie", + "bytes", + "derive_more", + "itertools 0.12.1", + "nybbles", + "reth-codecs", + "reth-primitives-traits", + "revm-primitives", + "serde", +] [[package]] name = "revm" -version = "8.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#7d23b1c557cf3d0e93f859b6794e580b9f0381c2" +version = "9.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "auto_impl", "cfg-if", @@ -1946,8 +2597,8 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "4.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#7d23b1c557cf3d0e93f859b6794e580b9f0381c2" +version = "5.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "revm-primitives", "serde", @@ -1955,12 +2606,12 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "6.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#7d23b1c557cf3d0e93f859b6794e580b9f0381c2" +version = "7.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "aurora-engine-modexp", - "c-kzg-taiko", - "cfg-if", + "blst", + "c-kzg", "k256 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell", "revm-primitives", @@ -1972,14 +2623,14 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "3.1.1" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#7d23b1c557cf3d0e93f859b6794e580b9f0381c2" +version = "4.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "alloy-primitives", "auto_impl", "bitflags", "bitvec", - "c-kzg-taiko", + "c-kzg", "cfg-if", "derive_more", "dyn-clone", @@ -2088,7 +2739,6 @@ dependencies = [ "k256 0.13.3 (git+https://github.com/risc0/RustCrypto-elliptic-curves?tag=k256/v0.13.3-risczero.0)", "raiko-lib", "revm-precompile", - "revm-primitives", "risc0-zkvm", "sha2 0.10.6", ] @@ -2167,6 +2817,25 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "roaring" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7699249cc2c7d71939f30868f47e9d7add0bdc030d90ee10bfd16887ff8bb1c8" +dependencies = [ + "bytemuck", + "byteorder", +] + +[[package]] +name = "rolling-file" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8395b4f860856b740f20a296ea2cd4d823e81a2658cf05ef61be22916026a906" +dependencies = [ + "chrono", +] + [[package]] name = "rrs-lib" version = "0.1.0" @@ -2207,6 +2876,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -2244,6 +2919,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + [[package]] name = "rusty-fork" version = "0.3.0" @@ -2278,9 +2959,8 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +version = "0.29.0" +source = "git+https://github.com/CeciliaZ030/rust-secp256k1?branch=sp1-patch#09fe6ec0c0f0de848da5e295022029f46e0389e3" dependencies = [ "rand", "secp256k1-sys", @@ -2288,9 +2968,8 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +version = "0.10.0" +source = "git+https://github.com/CeciliaZ030/rust-secp256k1?branch=sp1-patch#09fe6ec0c0f0de848da5e295022029f46e0389e3" dependencies = [ "cc", ] @@ -2336,7 +3015,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2378,7 +3057,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2422,6 +3101,15 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "signature" version = "2.2.0" @@ -2432,17 +3120,29 @@ dependencies = [ "rand_core", ] +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" @@ -2454,12 +3154,6 @@ dependencies = [ "der", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" @@ -2472,6 +3166,28 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.68", +] + [[package]] name = "substrate-bn" version = "0.6.0" @@ -2487,9 +3203,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2504,9 +3220,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -2522,18 +3238,21 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] -name = "synstructure" -version = "0.13.1" +name = "sysinfo" +version = "0.30.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "windows", ] [[package]] @@ -2571,7 +3290,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2594,6 +3313,16 @@ dependencies = [ "thiserror-impl-no-std", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "threadpool" version = "1.8.1" @@ -2644,15 +3373,20 @@ dependencies = [ ] [[package]] -name = "tinystr" -version = "0.7.6" +name = "tinyvec" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ - "displaydoc", - "zerovec", + "tinyvec_macros", ] +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "toml_datetime" version = "0.6.6" @@ -2682,6 +3416,18 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-appender" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" +dependencies = [ + "crossbeam-channel", + "thiserror", + "time", + "tracing-subscriber 0.3.18", +] + [[package]] name = "tracing-attributes" version = "0.1.27" @@ -2690,7 +3436,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2703,6 +3449,50 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-journald" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba316a74e8fc3c3896a850dba2375928a9fa171b085ecddfc7c054d39970f3fd" +dependencies = [ + "libc", + "tracing-core", + "tracing-subscriber 0.3.18", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-logfmt" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22b8e455f6caa5212a102ec530bf86b8dc5a4c536299bffd84b238fed9119be7" +dependencies = [ + "time", + "tracing", + "tracing-core", + "tracing-subscriber 0.3.18", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + [[package]] name = "tracing-subscriber" version = "0.2.25" @@ -2712,6 +3502,27 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2742,17 +3553,38 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -2760,16 +3592,10 @@ dependencies = [ ] [[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" +name = "utf8parse" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" @@ -2819,7 +3645,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "wasm-bindgen-shared", ] @@ -2841,7 +3667,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2852,6 +3678,38 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core", + "windows-targets", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -2943,18 +3801,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "wyz" version = "0.5.1" @@ -2964,30 +3810,6 @@ dependencies = [ "tap", ] -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", -] - [[package]] name = "zerocopy" version = "0.7.34" @@ -3005,28 +3827,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", + "syn 2.0.68", ] [[package]] @@ -3046,27 +3847,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", + "syn 2.0.68", ] diff --git a/provers/risc0/guest/Cargo.toml b/provers/risc0/guest/Cargo.toml index 49cb9f23..d0b14bf6 100644 --- a/provers/risc0/guest/Cargo.toml +++ b/provers/risc0/guest/Cargo.toml @@ -23,12 +23,11 @@ risc0-zkvm = { version = "0.21.0", default-features = false, features = [ 'std', "getrandom", ] } -revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v35-taiko", default-features = false, features = [ - "taiko", +revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko", default-features = false, features = [ "std", "c-kzg", -] } -revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v35-taiko", default-features = false } + "taiko", +]} k256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.0" } sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" } @@ -39,3 +38,7 @@ harness = { path = "../../../harness/macro", features = ["risc0"] } [patch.crates-io] # Can't use ZkOp since it's big int optimization used everywhere crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.2-risczero.0" } +revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } +revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } +c-kzg = { git = "https://github.com/brechtpd/c-kzg-4844", branch = "for-alpha7" } +secp256k1 = { git = "https://github.com/CeciliaZ030/rust-secp256k1", branch = "sp1-patch" } \ No newline at end of file diff --git a/provers/risc0/guest/src/main.rs b/provers/risc0/guest/src/main.rs index 070e8802..d728e420 100644 --- a/provers/risc0/guest/src/main.rs +++ b/provers/risc0/guest/src/main.rs @@ -4,8 +4,8 @@ use risc0_zkvm::guest::env; use raiko_lib::protocol_instance::ProtocolInstance; use raiko_lib::{ - builder::{BlockBuilderStrategy, TaikoStrategy}, consts::VerifierType, + builder::calculate_block_header, input::GuestInput, }; use revm_precompile::zk_op::ZkOperation; @@ -23,7 +23,7 @@ fn main() { .set(Box::new(vec![ZkOperation::Sha256, ZkOperation::Secp256k1])) .expect("Failed to set ZkvmOperations"); - let (header, _mpt_node) = TaikoStrategy::build_from(&input).unwrap(); + let header = calculate_block_header(&input); let pi = ProtocolInstance::new(&input, &header, VerifierType::RISC0) .unwrap() .instance_hash(); diff --git a/provers/risc0/guest/src/mem.rs b/provers/risc0/guest/src/mem.rs index 0a32268c..a151d19b 100644 --- a/provers/risc0/guest/src/mem.rs +++ b/provers/risc0/guest/src/mem.rs @@ -33,3 +33,8 @@ pub unsafe extern "C" fn calloc(nobj: usize, size: usize) -> *mut c_void { pub unsafe extern "C" fn free(_size: *const c_void) { // Intentionally a no-op, since the zkvm allocator is a bump allocator } + +#[no_mangle] +pub extern "C" fn __ctzsi2(x: u32) -> u32 { + x.trailing_zeros() +} diff --git a/provers/risc0/guest/src/zk_op.rs b/provers/risc0/guest/src/zk_op.rs index 88b98281..747540b6 100644 --- a/provers/risc0/guest/src/zk_op.rs +++ b/provers/risc0/guest/src/zk_op.rs @@ -1,4 +1,5 @@ use k256 as risc0_k256; +use raiko_lib::primitives::keccak256; use revm_precompile::{zk_op::ZkvmOperator, Error}; use sha2 as risc0_sha2; @@ -57,7 +58,7 @@ impl ZkvmOperator for Risc0Operator { let recovered_key = VerifyingKey::recover_from_prehash(&msg[..], &sig, recid) .map_err(|_| Error::ZkvmOperation("Patched k256 recover key failed".to_string()))?; // hash it - let mut hash = revm_primitives::keccak256( + let mut hash = keccak256( &recovered_key .to_encoded_point(/* compress = */ false) .as_bytes()[1..], diff --git a/provers/sgx/guest/src/one_shot.rs b/provers/sgx/guest/src/one_shot.rs index 8c734183..574a10a8 100644 --- a/provers/sgx/guest/src/one_shot.rs +++ b/provers/sgx/guest/src/one_shot.rs @@ -8,10 +8,7 @@ use std::{ use anyhow::{anyhow, bail, Context, Error, Result}; use base64_serde::base64_serde_type; use raiko_lib::{ - builder::{BlockBuilderStrategy, TaikoStrategy}, - consts::VerifierType, - input::GuestInput, - primitives::Address, + builder::calculate_block_header, consts::VerifierType, input::GuestInput, primitives::Address, protocol_instance::ProtocolInstance, }; use secp256k1::{Keypair, SecretKey}; @@ -133,9 +130,7 @@ pub async fn one_shot(global_opts: GlobalOpts, args: OneShotArgs) -> Result<()> assert!(!input.taiko.skip_verify_blob); // Process the block - let (header, _mpt_node) = - TaikoStrategy::build_from(&input).expect("Failed to build the resulting block"); - + let header = calculate_block_header(&input); // Calculate the public input hash let pi = ProtocolInstance::new(&input, &header, VerifierType::SGX)?.sgx_instance(new_instance); let pi_hash = pi.instance_hash(); diff --git a/provers/sgx/prover/Cargo.toml b/provers/sgx/prover/Cargo.toml index efe39e08..69c0c357 100644 --- a/provers/sgx/prover/Cargo.toml +++ b/provers/sgx/prover/Cargo.toml @@ -18,7 +18,7 @@ alloy-sol-types = { workspace = true } alloy-signer = { workspace = true } alloy-contract = { workspace = true } alloy-provider = { workspace = true } -alloy-signer-wallet = { workspace = true } +alloy-signer-local = { workspace = true } alloy-rpc-client = { workspace = true } alloy-transport-http = { workspace = true } pem = { version = "3.0.4", optional = true } diff --git a/provers/sgx/prover/src/sgx_register_utils.rs b/provers/sgx/prover/src/sgx_register_utils.rs index 51710421..ece2a755 100644 --- a/provers/sgx/prover/src/sgx_register_utils.rs +++ b/provers/sgx/prover/src/sgx_register_utils.rs @@ -1,14 +1,12 @@ -use alloy_provider::{network::EthereumSigner, Provider, ProviderBuilder, RootProvider}; +use alloy_provider::{Provider, ProviderBuilder, RootProvider}; use alloy_rpc_client::RpcClient; use alloy_signer::Signer; +use alloy_signer_local::PrivateKeySigner; use alloy_sol_types::sol; use alloy_transport_http::Http; use anyhow::Result; use pem::parse_many; -use raiko_lib::primitives::{ - alloy_eips::{BlockId, BlockNumberOrTag}, - hex, Address, Bytes, FixedBytes, U256, -}; +use raiko_lib::primitives::{hex, Address, Bytes, FixedBytes, U256}; use std::{env, fs, io, path::Path}; use url::Url; @@ -276,7 +274,7 @@ pub async fn register_sgx_instance( ) -> Result> { // prepare wallet let sender_priv_key = env::var("SENDER_PRIV_KEY").expect("SENDER_PRIV_KEY is not set"); - let mut wallet: alloy_signer_wallet::LocalWallet = sender_priv_key.as_str().parse().unwrap(); + let mut wallet: PrivateKeySigner = sender_priv_key.as_str().parse().unwrap(); wallet.set_chain_id(Some(chain_id)); println!("wallet: {:?}", wallet); @@ -284,16 +282,12 @@ pub async fn register_sgx_instance( 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())) .on_provider(RootProvider::new(RpcClient::new(http, false))); let sgx_verifier_contract = SgxVerifier::new(sgx_verifier_addr, &provider); // init account - let tag = BlockId::Number(BlockNumberOrTag::Latest); - let balance = provider.get_balance(wallet.address(), tag).await?; - let nonce = provider - .get_transaction_count(wallet.address(), tag) - .await?; + let balance = provider.get_balance(wallet.address()).await?; + let nonce = provider.get_transaction_count(wallet.address()).await?; let gas_price = provider.get_gas_price().await?; let gas_limit = 4000000u128; assert!( diff --git a/provers/sgx/setup/Cargo.toml b/provers/sgx/setup/Cargo.toml index 7c040da6..16ab6883 100644 --- a/provers/sgx/setup/Cargo.toml +++ b/provers/sgx/setup/Cargo.toml @@ -29,7 +29,6 @@ bytemuck = { workspace = true } clap = { workspace = true } structopt = { workspace = true } flate2 = { workspace = true } -revm = { workspace = true } serde = { workspace = true } serde_with = { workspace = true } serde_json = { workspace = true } diff --git a/provers/sp1/guest/Cargo.lock b/provers/sp1/guest/Cargo.lock index da4e3f3c..0d40bf56 100644 --- a/provers/sp1/guest/Cargo.lock +++ b/provers/sp1/guest/Cargo.lock @@ -26,77 +26,99 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + [[package]] name = "allocator-api2" version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "alloy-chains" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +dependencies = [ + "alloy-rlp", + "num_enum", + "serde", + "strum", +] + [[package]] name = "alloy-consensus" version = "0.1.0" source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#e589f8f2e856d83ec7cfa4d297d59f2e2f121857" dependencies = [ - "alloy-eips", + "alloy-eips 0.1.0", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.1.0", "c-kzg", "serde", "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "alloy-eips" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#e589f8f2e856d83ec7cfa4d297d59f2e2f121857" +name = "alloy-consensus" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a016bfa21193744d4c38b3f3ab845462284d129e5e23c7cc0fafca7e92d9db37" dependencies = [ + "alloy-eips 0.1.2", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.1.2", "c-kzg", - "once_cell", "serde", ] [[package]] -name = "alloy-genesis" +name = "alloy-eips" version = "0.1.0" source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#e589f8f2e856d83ec7cfa4d297d59f2e2f121857" dependencies = [ "alloy-primitives", - "alloy-serde", + "alloy-rlp", + "alloy-serde 0.1.0", + "c-kzg", + "once_cell", "serde", - "serde_json", ] [[package]] -name = "alloy-json-rpc" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#e589f8f2e856d83ec7cfa4d297d59f2e2f121857" +name = "alloy-eips" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d6d8118b83b0489cfb7e6435106948add2b35217f4a5004ef895f613f60299" dependencies = [ "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.2", + "c-kzg", + "derive_more", + "once_cell", "serde", - "serde_json", - "thiserror", - "tracing", + "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "alloy-network" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#e589f8f2e856d83ec7cfa4d297d59f2e2f121857" +name = "alloy-genesis" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "894f33a7822abb018db56b10ab90398e63273ce1b5a33282afd186c132d764a6" dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-json-rpc", "alloy-primitives", - "alloy-rpc-types", - "alloy-signer", - "alloy-sol-types", - "async-trait", - "futures-utils-wasm", - "thiserror", + "alloy-serde 0.1.2", + "serde", ] [[package]] @@ -110,6 +132,7 @@ dependencies = [ "cfg-if", "const-hex", "derive_more", + "getrandom", "hex-literal", "itoa", "k256", @@ -140,22 +163,32 @@ checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "alloy-rpc-types" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#e589f8f2e856d83ec7cfa4d297d59f2e2f121857" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f2fbe956a3e0f0975c798f488dc6be96b669544df3737e18f4a325b42f4c86" dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-genesis", + "alloy-rpc-types-eth", + "alloy-serde 0.1.2", +] + +[[package]] +name = "alloy-rpc-types-eth" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "083f443a83b9313373817236a8f4bea09cca862618e9177d822aee579640a5d6" +dependencies = [ + "alloy-consensus 0.1.2", + "alloy-eips 0.1.2", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.1.2", "alloy-sol-types", - "itertools 0.12.1", + "itertools 0.13.0", "serde", "serde_json", "thiserror", @@ -172,16 +205,14 @@ dependencies = [ ] [[package]] -name = "alloy-signer" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#e589f8f2e856d83ec7cfa4d297d59f2e2f121857" +name = "alloy-serde" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d94da1c0c4e27cc344b05626fe22a89dc6b8b531b9475f3b7691dbf6913e4109" dependencies = [ "alloy-primitives", - "async-trait", - "auto_impl", - "elliptic-curve", - "k256", - "thiserror", + "serde", + "serde_json", ] [[package]] @@ -195,7 +226,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -211,7 +242,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "syn-solidity", "tiny-keccak", ] @@ -227,7 +258,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "syn-solidity", ] @@ -240,6 +271,23 @@ dependencies = [ "alloy-primitives", "alloy-sol-macro", "const-hex", + "serde", +] + +[[package]] +name = "alloy-trie" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03704f265cbbb943b117ecb5055fd46e8f41e7dc8a58b1aed20bcd40ace38c15" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "derive_more", + "hashbrown 0.14.5", + "nybbles", + "serde", + "smallvec", + "tracing", ] [[package]] @@ -257,6 +305,55 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys", +] + [[package]] name = "anyhow" version = "1.0.86" @@ -393,17 +490,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "async-trait" -version = "0.1.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "aurora-engine-modexp" version = "1.1.0" @@ -422,7 +508,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -475,9 +561,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -528,6 +614,12 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +[[package]] +name = "bytemuck" +version = "1.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" + [[package]] name = "byteorder" version = "1.5.0" @@ -545,22 +637,8 @@ dependencies = [ [[package]] name = "c-kzg" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" -dependencies = [ - "blst", - "cc", - "glob", - "hex", - "libc", - "serde", -] - -[[package]] -name = "c-kzg-taiko" version = "1.0.0" -source = "git+https://github.com/smtmfft/c-kzg-4844?branch=for-alpha7#a2d3ae768eede8228920619c98c87584ad8afd09" +source = "git+https://github.com/brechtpd/c-kzg-4844?branch=for-alpha7#3bf0372e8c7a4ba908aff65da0508fcaaf9d38e6" dependencies = [ "blst", "cc", @@ -572,9 +650,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.99" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" [[package]] name = "cfg-if" @@ -590,11 +668,59 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", "serde", + "wasm-bindgen", "windows-targets", ] +[[package]] +name = "clap" +version = "4.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.68", +] + +[[package]] +name = "clap_lex" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" + +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + [[package]] name = "const-hex" version = "1.12.0" @@ -620,6 +746,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -644,6 +779,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" version = "1.4.2" @@ -653,6 +803,40 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + [[package]] name = "crunchy" version = "0.2.2" @@ -702,7 +886,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -713,7 +897,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -759,11 +943,11 @@ version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ - "convert_case", + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -847,7 +1031,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -866,6 +1050,16 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + [[package]] name = "fastrand" version = "2.1.0" @@ -938,10 +1132,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] -name = "futures-utils-wasm" -version = "0.1.0" +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] [[package]] name = "generic-array" @@ -1113,6 +1338,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + [[package]] name = "indexmap" version = "1.9.3" @@ -1135,6 +1366,12 @@ dependencies = [ "serde", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -1153,6 +1390,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -1203,9 +1449,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ "spin", ] @@ -1258,12 +1504,31 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "metrics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be3cbd384d4e955b231c895ce10685e3d8260c5ccffae898c96c723b0772835" +dependencies = [ + "ahash", + "portable-atomic", +] + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -1274,17 +1539,57 @@ dependencies = [ ] [[package]] -name = "num" -version = "0.4.3" +name = "modular-bitfield" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", ] [[package]] @@ -1363,12 +1668,51 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + +[[package]] +name = "nybbles" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95f06be0417d97f81fe4e5c86d7d01b392655a9cac9c19a848aa033e18937b23" +dependencies = [ + "alloy-rlp", + "const-hex", + "proptest", + "serde", + "smallvec", +] + [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -1378,6 +1722,7 @@ dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -1424,6 +1769,12 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkcs8" version = "0.10.2" @@ -1434,6 +1785,12 @@ dependencies = [ "spki", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "powerfmt" version = "0.2.0" @@ -1492,18 +1849,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", @@ -1513,7 +1870,7 @@ dependencies = [ "rand", "rand_chacha", "rand_xorshift", - "regex-syntax", + "regex-syntax 0.8.4", "rusty-fork", "tempfile", "unarray", @@ -1544,16 +1901,15 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" name = "raiko-lib" version = "0.1.0" dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-network", + "alloy-consensus 0.1.2", + "alloy-eips 0.1.2", "alloy-primitives", "alloy-rlp", "alloy-rlp-derive", "alloy-rpc-types", "alloy-sol-types", "anyhow", - "c-kzg-taiko", + "c-kzg", "cfg-if", "chrono", "flate2", @@ -1562,8 +1918,10 @@ dependencies = [ "libflate", "log", "once_cell", - "revm", - "revm-primitives", + "reth-chainspec", + "reth-evm", + "reth-evm-ethereum", + "reth-primitives", "rlp", "serde", "serde_json", @@ -1624,16 +1982,489 @@ dependencies = [ "rand_core", ] +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "regex" +version = "1.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "reth-chainspec" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-chains", + "alloy-eips 0.1.2", + "alloy-genesis", + "alloy-primitives", + "alloy-trie", + "derive_more", + "once_cell", + "reth-ethereum-forks", + "reth-primitives-traits", + "reth-trie-common", + "serde", + "serde_json", +] + +[[package]] +name = "reth-codecs" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus 0.1.2", + "alloy-eips 0.1.2", + "alloy-genesis", + "alloy-primitives", + "bytes", + "modular-bitfield", + "reth-codecs-derive", + "serde", +] + +[[package]] +name = "reth-codecs-derive" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "convert_case 0.6.0", + "proc-macro2", + "quote", + "syn 2.0.68", +] + +[[package]] +name = "reth-consensus" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "auto_impl", + "reth-primitives", + "thiserror-no-std", +] + +[[package]] +name = "reth-consensus-common" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-chainspec", + "reth-consensus", + "reth-primitives", +] + +[[package]] +name = "reth-db" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "bytes", + "derive_more", + "eyre", + "metrics", + "paste", + "reth-db-api", + "reth-fs-util", + "reth-metrics", + "reth-primitives", + "reth-prune-types", + "reth-stages-types", + "reth-storage-errors", + "reth-tracing", + "reth-trie-common", + "rustc-hash", + "serde", + "strum", + "sysinfo", + "thiserror", +] + +[[package]] +name = "reth-db-api" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "bytes", + "derive_more", + "metrics", + "modular-bitfield", + "parity-scale-codec", + "reth-codecs", + "reth-primitives", + "reth-prune-types", + "reth-stages-types", + "reth-storage-errors", + "reth-trie-common", + "serde", +] + +[[package]] +name = "reth-ethereum-consensus" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-chainspec", + "reth-consensus", + "reth-consensus-common", + "reth-primitives", + "tracing", +] + +[[package]] +name = "reth-ethereum-forks" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-chains", + "alloy-primitives", + "alloy-rlp", + "crc", + "serde", + "thiserror-no-std", +] + +[[package]] +name = "reth-evm" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "auto_impl", + "futures-util", + "reth-chainspec", + "reth-execution-errors", + "reth-execution-types", + "reth-primitives", + "reth-prune-types", + "reth-storage-errors", + "revm", + "revm-primitives", +] + +[[package]] +name = "reth-evm-ethereum" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-eips 0.1.2", + "alloy-sol-types", + "anyhow", + "lazy_static", + "reth-chainspec", + "reth-ethereum-consensus", + "reth-evm", + "reth-execution-types", + "reth-primitives", + "reth-prune-types", + "reth-revm", + "revm-primitives", +] + +[[package]] +name = "reth-execution-errors" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-eips 0.1.2", + "alloy-primitives", + "reth-consensus", + "reth-prune-types", + "reth-storage-errors", + "revm-primitives", + "thiserror-no-std", +] + +[[package]] +name = "reth-execution-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-execution-errors", + "reth-primitives", + "reth-trie", + "revm", +] + +[[package]] +name = "reth-fs-util" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "serde_json", + "thiserror", +] + +[[package]] +name = "reth-metrics" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "metrics", + "reth-metrics-derive", +] + +[[package]] +name = "reth-metrics-derive" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.68", +] + +[[package]] +name = "reth-primitives" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus 0.1.2", + "alloy-eips 0.1.2", + "alloy-genesis", + "alloy-primitives", + "alloy-rlp", + "alloy-rpc-types", + "byteorder", + "bytes", + "c-kzg", + "derive_more", + "modular-bitfield", + "once_cell", + "rayon", + "reth-chainspec", + "reth-codecs", + "reth-ethereum-forks", + "reth-primitives-traits", + "reth-static-file-types", + "reth-trie-common", + "revm", + "revm-primitives", + "roaring", + "secp256k1", + "serde", + "tempfile", + "thiserror-no-std", +] + +[[package]] +name = "reth-primitives-traits" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus 0.1.2", + "alloy-eips 0.1.2", + "alloy-genesis", + "alloy-primitives", + "alloy-rlp", + "alloy-rpc-types-eth", + "bytes", + "derive_more", + "modular-bitfield", + "reth-codecs", + "revm-primitives", + "serde", +] + +[[package]] +name = "reth-prune-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "bytes", + "derive_more", + "modular-bitfield", + "reth-codecs", + "serde", + "thiserror", +] + +[[package]] +name = "reth-revm" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-eips 0.1.2", + "alloy-rlp", + "reth-chainspec", + "reth-consensus-common", + "reth-execution-errors", + "reth-primitives", + "reth-prune-types", + "reth-storage-api", + "reth-storage-errors", + "revm", + "tracing", +] + +[[package]] +name = "reth-stages-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "bytes", + "modular-bitfield", + "reth-codecs", + "reth-trie-common", + "serde", +] + +[[package]] +name = "reth-static-file-types" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-primitives", + "derive_more", + "serde", + "strum", +] + +[[package]] +name = "reth-storage-api" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "auto_impl", + "reth-chainspec", + "reth-db-api", + "reth-execution-types", + "reth-primitives", + "reth-prune-types", + "reth-stages-types", + "reth-storage-errors", + "reth-trie", + "revm", +] + +[[package]] +name = "reth-storage-errors" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "reth-fs-util", + "reth-primitives", + "thiserror-no-std", +] + +[[package]] +name = "reth-tracing" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "clap", + "eyre", + "rolling-file", + "tracing", + "tracing-appender", + "tracing-journald", + "tracing-logfmt", + "tracing-subscriber", +] + +[[package]] +name = "reth-trie" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-rlp", + "auto_impl", + "derive_more", + "rayon", + "reth-db", + "reth-db-api", + "reth-execution-errors", + "reth-primitives", + "reth-stages-types", + "reth-trie-common", + "revm", + "tracing", +] + +[[package]] +name = "reth-trie-common" +version = "1.0.0-rc.2" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#d20c700ca296f7e4227b4c8c254a8d0f948bbd36" +dependencies = [ + "alloy-consensus 0.1.2", + "alloy-genesis", + "alloy-primitives", + "alloy-rlp", + "alloy-trie", + "bytes", + "derive_more", + "itertools 0.12.1", + "nybbles", + "reth-codecs", + "reth-primitives-traits", + "revm-primitives", + "serde", +] + [[package]] name = "revm" -version = "8.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#9a1e6db4b84c35e05308ec2d7dbb50a48aea6fed" +version = "9.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "auto_impl", "cfg-if", @@ -1646,8 +2477,8 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "4.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#9a1e6db4b84c35e05308ec2d7dbb50a48aea6fed" +version = "5.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "revm-primitives", "serde", @@ -1655,12 +2486,12 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "6.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#9a1e6db4b84c35e05308ec2d7dbb50a48aea6fed" +version = "7.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "aurora-engine-modexp", - "c-kzg-taiko", - "cfg-if", + "blst", + "c-kzg", "k256", "once_cell", "revm-primitives", @@ -1672,14 +2503,14 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "3.1.1" -source = "git+https://github.com/taikoxyz/revm.git?branch=v35-taiko#9a1e6db4b84c35e05308ec2d7dbb50a48aea6fed" +version = "4.0.0" +source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35c1b41d62a9119110a281c5dbe1c8" dependencies = [ "alloy-primitives", "auto_impl", "bitflags", "bitvec", - "c-kzg-taiko", + "c-kzg", "cfg-if", "derive_more", "dyn-clone", @@ -1724,6 +2555,25 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "roaring" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7699249cc2c7d71939f30868f47e9d7add0bdc030d90ee10bfd16887ff8bb1c8" +dependencies = [ + "bytemuck", + "byteorder", +] + +[[package]] +name = "rolling-file" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8395b4f860856b740f20a296ea2cd4d823e81a2658cf05ef61be22916026a906" +dependencies = [ + "chrono", +] + [[package]] name = "ruint" version = "1.12.3" @@ -1754,6 +2604,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -1791,6 +2647,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + [[package]] name = "rusty-fork" version = "0.3.0" @@ -1905,7 +2767,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1947,7 +2809,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1991,6 +2853,15 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "signature" version = "2.2.0" @@ -2001,6 +2872,24 @@ dependencies = [ "rand_core", ] +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] + [[package]] name = "snowbridge-amcl" version = "1.0.2" @@ -2015,12 +2904,11 @@ dependencies = [ name = "sp1-guest" version = "0.1.0" dependencies = [ - "alloy-consensus", + "alloy-consensus 0.1.0", "harness", "harness-core", "raiko-lib", "revm-precompile", - "revm-primitives", "sha2 0.10.8 (git+https://github.com/sp1-patches/RustCrypto-hashes?branch=patch-v0.10.8)", "sp1-precompiles", "sp1-zkvm", @@ -2030,7 +2918,7 @@ dependencies = [ [[package]] name = "sp1-precompiles" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#b35be4200e7369bd987d8ba101f70dd7dec3df1a" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "anyhow", "bincode", @@ -2047,7 +2935,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#b35be4200e7369bd987d8ba101f70dd7dec3df1a" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "bincode", "cfg-if", @@ -2064,9 +2952,9 @@ dependencies = [ [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" @@ -2090,6 +2978,28 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.68", +] + [[package]] name = "substrate-bn" version = "0.6.0" @@ -2105,9 +3015,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2122,9 +3032,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -2140,7 +3050,21 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", +] + +[[package]] +name = "sysinfo" +version = "0.30.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "windows", ] [[package]] @@ -2178,7 +3102,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2201,6 +3125,16 @@ dependencies = [ "thiserror-impl-no-std", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "threadpool" version = "1.8.1" @@ -2293,6 +3227,18 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-appender" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" +dependencies = [ + "crossbeam-channel", + "thiserror", + "time", + "tracing-subscriber", +] + [[package]] name = "tracing-attributes" version = "0.1.27" @@ -2301,7 +3247,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2311,6 +3257,72 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-journald" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba316a74e8fc3c3896a850dba2375928a9fa171b085ecddfc7c054d39970f3fd" +dependencies = [ + "libc", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-logfmt" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22b8e455f6caa5212a102ec530bf86b8dc5a4c536299bffd84b238fed9119be7" +dependencies = [ + "time", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", ] [[package]] @@ -2364,6 +3376,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "url" version = "2.5.2" @@ -2375,6 +3393,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "valuable" version = "0.1.0" @@ -2423,7 +3447,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "wasm-bindgen-shared", ] @@ -2445,7 +3469,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2456,6 +3480,38 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core", + "windows-targets", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -2573,7 +3629,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2593,5 +3649,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] diff --git a/provers/sp1/guest/Cargo.toml b/provers/sp1/guest/Cargo.toml index 4f0e2d3c..bd3797b9 100644 --- a/provers/sp1/guest/Cargo.toml +++ b/provers/sp1/guest/Cargo.toml @@ -5,13 +5,10 @@ name = "sp1-guest" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] name = "zk_op" path = "src/zk_op.rs" - [[bin]] name = "sha256" path = "src/benchmark/sha256.rs" @@ -37,12 +34,12 @@ path = "src/benchmark/bn254_mul.rs" [dependencies] raiko-lib = { path = "../../../lib", features = ["std", "sp1"] } sp1-zkvm ={ git = "https://github.com/succinctlabs/sp1.git", branch = "main" } -revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v35-taiko", default-features = false, features = [ - "taiko", +revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko", default-features = false, features = [ "std", "c-kzg", -] } -revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v35-taiko", default-features = false } + "taiko", +]} + sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", branch = "patch-v0.10.8" } sp1-precompiles = { git = "https://github.com/succinctlabs/sp1.git", branch = "main"} harness-core = { path = "../../../harness/core" } @@ -51,15 +48,18 @@ substrate-bn = "0.6.0" alloy-consensus = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle", optional = true, features = [ "serde", ] } + [patch.crates-io] # Cant's use ZkOp for keccak since it's not precompile -ecdsa = { git = "https://github.com/taikoxyz/signatures.git", branch = "0.16.9", package = "ecdsa", default-features = false, features = ["der"] } +ecdsa = { git = "https://github.com/taikoxyz/signatures.git", branch = "0.16.9", package = "ecdsa" } tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", branch = "patch-v2.0.2" } -secp256k1 = { git = "https://github.com/CeciliaZ030/rust-secp256k1", branch = "sp1-patch", features = ["recovery", "sp1"]} +revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } +revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } +c-kzg = { git = "https://github.com/brechtpd/c-kzg-4844", branch = "for-alpha7" } +secp256k1 = { git = "https://github.com/CeciliaZ030/rust-secp256k1", branch = "sp1-patch" } [features] sp1-cycle-tracker = [ - "alloy-consensus/sp1-cycle-tracker", - "raiko-lib/sp1-cycle-tracker", + "raiko-lib/sp1-cycle-tracker", "revm-precompile/sp1-cycle-tracker" - ] +] diff --git a/provers/sp1/guest/elf/sp1-guest b/provers/sp1/guest/elf/sp1-guest index 56006c0a..74320365 100755 Binary files a/provers/sp1/guest/elf/sp1-guest and b/provers/sp1/guest/elf/sp1-guest differ diff --git a/provers/sp1/guest/src/main.rs b/provers/sp1/guest/src/main.rs index d3cbe38e..df819a5f 100644 --- a/provers/sp1/guest/src/main.rs +++ b/provers/sp1/guest/src/main.rs @@ -3,9 +3,9 @@ harness::entrypoint!(main, tests, zk_op::tests); // harness::entrypoint!(main, tests); use raiko_lib::{ - builder::{BlockBuilderStrategy, TaikoStrategy}, consts::VerifierType, - input::{GuestInput}, + builder::calculate_block_header, + input::GuestInput, protocol_instance::ProtocolInstance, }; use revm_precompile::zk_op::ZkOperation; @@ -26,7 +26,7 @@ pub fn main() { ])) .expect("Failed to set ZkvmOperations"); - let (header, _mpt_node) = TaikoStrategy::build_from(&input).unwrap(); + let header = calculate_block_header(&input); let pi = ProtocolInstance::new(&input, &header, VerifierType::SP1) .unwrap() .instance_hash(); diff --git a/provers/sp1/guest/src/mem.rs b/provers/sp1/guest/src/mem.rs index 0a32268c..a151d19b 100644 --- a/provers/sp1/guest/src/mem.rs +++ b/provers/sp1/guest/src/mem.rs @@ -33,3 +33,8 @@ pub unsafe extern "C" fn calloc(nobj: usize, size: usize) -> *mut c_void { pub unsafe extern "C" fn free(_size: *const c_void) { // Intentionally a no-op, since the zkvm allocator is a bump allocator } + +#[no_mangle] +pub extern "C" fn __ctzsi2(x: u32) -> u32 { + x.trailing_zeros() +} diff --git a/provers/sp1/guest/src/zk_op.rs b/provers/sp1/guest/src/zk_op.rs index 749f0997..c32bab35 100644 --- a/provers/sp1/guest/src/zk_op.rs +++ b/provers/sp1/guest/src/zk_op.rs @@ -1,4 +1,5 @@ use revm_precompile::{bn128::ADD_INPUT_LEN, utilities::right_pad, zk_op::ZkvmOperator, Error}; +use raiko_lib::primitives::keccak256; use sha2_v0_10_8 as sp1_sha2; use sp1_zkvm::precompiles::{bn254::Bn254, utils::AffinePoint}; @@ -67,7 +68,7 @@ impl ZkvmOperator for Sp1Operator { let recovered_key = sp1_precompiles::secp256k1::ecrecover(&sig_id, msg) .map_err(|e| Error::ZkvmOperation(e.to_string()))?; - let mut hash = revm_primitives::keccak256(&recovered_key[1..]); + let mut hash = keccak256(&recovered_key[1..]); // truncate to 20 bytes hash[..12].fill(0); @@ -102,7 +103,6 @@ fn point_to_be_bytes(p: AffinePoint) -> [u8; 64] { harness::zk_suits!( pub mod tests { use revm_precompile::bn128; - use revm_primitives::hex; use sp1_zkvm::precompiles::{bn254::Bn254, utils::AffinePoint}; use substrate_bn::Group;