diff --git a/Cargo.lock b/Cargo.lock index e9adb8e6b..07e996b24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,9 +151,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +checksum = "1752d7d62e2665da650a36d84abbf239f812534475d51f072a49a533513b7cdd" dependencies = [ "alloy-rlp", "num_enum 0.7.2", @@ -163,23 +163,23 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a016bfa21193744d4c38b3f3ab845462284d129e5e23c7cc0fafca7e92d9db37" +checksum = "3f63a6c9eb45684a5468536bc55379a2af0f45ffa5d756e4e4964532737e1836" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", "alloy-serde", - "c-kzg", + "c-kzg 1.0.2", "serde", ] [[package]] name = "alloy-contract" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47b2a620fd588d463ccf0f5931b41357664b293a8d31592768845a2a101bb9e" +checksum = "0c26b7d34cb76f826558e9409a010e25257f7bfb5aa5e3dd0042c564664ae159" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -213,14 +213,14 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d6d8118b83b0489cfb7e6435106948add2b35217f4a5004ef895f613f60299" +checksum = "aa4b0fc6a572ef2eebda0a31a5e393d451abda703fec917c75d9615d8c978cf2" dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-serde", - "c-kzg", + "c-kzg 1.0.2", "derive_more", "once_cell", "serde", @@ -229,9 +229,9 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894f33a7822abb018db56b10ab90398e63273ce1b5a33282afd186c132d764a6" +checksum = "48450f9c6f0821c1eee00ed912942492ed4f11dd69532825833de23ecc7a2256" dependencies = [ "alloy-primitives", "alloy-serde", @@ -252,9 +252,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f0ae6e93b885cc70fe8dae449e7fd629751dbee8f59767eaaa7285333c5727" +checksum = "d484c2a934d0a4d86f8ad4db8113cb1d607707a6c54f6e78f4f1b4451b47aa70" dependencies = [ "alloy-primitives", "serde", @@ -265,9 +265,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc122cbee2b8523854cc11d87bcd5773741602c553d2d2d106d82eeb9c16924a" +checksum = "7a20eba9bc551037f0626d6d29e191888638d979943fa4e842e9e6fc72bf0565" dependencies = [ "alloy-consensus", "alloy-eips", @@ -308,9 +308,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d5af289798fe8783acd0c5f10644d9d26f54a12bc52a083e4f3b31718e9bf92" +checksum = "ad5d89acb7339fad13bc69e7b925232f242835bfd91c82fcb9326b36481bd0f0" dependencies = [ "alloy-chains", "alloy-consensus", @@ -362,9 +362,9 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40fcb53b2a9d0a78a4968b2eca8805a4b7011b9ee3fdfa2acaf137c5128f36b" +checksum = "479ce003e8c74bbbc7d4235131c1d6b7eaf14a533ae850295b90d240340989cb" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -383,9 +383,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f2fbe956a3e0f0975c798f488dc6be96b669544df3737e18f4a325b42f4c86" +checksum = "0dfa1dd3e0bc3a3d89744fba8d1511216e83257160da2cd028a18b7d9c026030" dependencies = [ "alloy-rpc-types-engine", "alloy-rpc-types-eth", @@ -394,9 +394,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-admin" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "334a8c00cde17a48e073031f1534e71a75b529dbf25552178c43c2337632e0ab" +checksum = "bae99de76a362c4311f0892e286eb752cf2a3a6ef6555dff6d93f51de2c24648" dependencies = [ "alloy-genesis", "alloy-primitives", @@ -406,9 +406,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-anvil" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87f724e6170f558b809a520e37bdb34d99123092b78118bff31fb5b21dc2a2e" +checksum = "f67aec11f9f3bc5e96c2b7f342dba6e9541a8a48d2cfbe27b6b195136aa18eee" dependencies = [ "alloy-primitives", "alloy-serde", @@ -417,23 +417,23 @@ dependencies = [ [[package]] name = "alloy-rpc-types-beacon" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb383cd3981cee0031aeacbd394c4e726e907f3a0180fe36d5fc76d37c41cd82" +checksum = "dd2c363d49f460538899aaeb3325918f55fa01841fd7f3f11f58d438343ea083" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", "serde", - "serde_with", + "serde_with 3.8.1", "thiserror", ] [[package]] name = "alloy-rpc-types-engine" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd473d98ec552f8229cd6d566bd2b0bbfc5bb4efcefbb5288c834aa8fd832020" +checksum = "cc40df2dda7561d1406d0bee1d19c8787483a2cf2ee8011c05909475e7bc102d" dependencies = [ "alloy-consensus", "alloy-eips", @@ -450,9 +450,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083f443a83b9313373817236a8f4bea09cca862618e9177d822aee579640a5d6" +checksum = "13bd7aa9ff9e67f1ba7ee0dd8cebfc95831d1649b0e4eeefae940dc3681079fa" dependencies = [ "alloy-consensus", "alloy-eips", @@ -469,9 +469,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7a838f9a34aae7022c6cb53ecf21bc0a5a30c82f8d9eb0afed701ab5fd88de" +checksum = "535d26db98ac320a0d1637faf3e210328c3df3b1998abd7e72343d3857058efe" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -483,9 +483,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-txpool" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1572267dbc660843d87c02994029d1654c2c32867e186b266d1c03644b43af97" +checksum = "5971c92989c6a5588d3f6d1e99e5328fba6e68694efbe969d6ec96ae5b9d1037" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -495,9 +495,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94da1c0c4e27cc344b05626fe22a89dc6b8b531b9475f3b7691dbf6913e4109" +checksum = "8913f9e825068d77c516188c221c44f78fd814fce8effe550a783295a2757d19" dependencies = [ "alloy-primitives", "serde", @@ -506,9 +506,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d876be3afd8b78979540084ff63995292a26aa527ad0d44276405780aa0ffd" +checksum = "f740e13eb4c6a0e4d0e49738f1e86f31ad2d7ef93be499539f492805000f7237" dependencies = [ "alloy-primitives", "async-trait", @@ -520,9 +520,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40a37dc216c269b8a7244047cb1c18a9c69f7a0332ab2c4c2aa4cbb1a31468b" +checksum = "87db68d926887393a1d0f9c43833b44446ea29d603291e7b20e5d115f31aa4e3" dependencies = [ "alloy-consensus", "alloy-network", @@ -604,9 +604,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245af9541f0a0dbd5258669c80dfe3af118164cacec978a520041fc130550deb" +checksum = "dd9773e4ec6832346171605c776315544bd06e40f803e7b5b7824b325d5442ca" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -622,9 +622,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5619c017e1fdaa1db87f9182f4f0ed97c53d674957f4902fba655e972d359c6c" +checksum = "ff8ef947b901c0d4e97370f9fa25844cf8b63b1a58fd4011ee82342dc8a9fc6b" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -796,7 +796,7 @@ dependencies = [ "ark-serialize 0.3.0", "ark-std 0.3.0", "derivative", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.3.3", @@ -816,7 +816,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools 0.10.5", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.4.0", @@ -849,7 +849,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "quote", "syn 1.0.109", @@ -861,7 +861,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "proc-macro2", "quote", @@ -927,7 +927,7 @@ dependencies = [ "ark-serialize-derive", "ark-std 0.4.0", "digest 0.10.7", - "num-bigint 0.4.5", + "num-bigint 0.4.6", ] [[package]] @@ -1408,19 +1408,32 @@ checksum = "a3c196a77437e7cc2fb515ce413a6401291578b5afc8ecb29a3c7ab957f05941" dependencies = [ "ff 0.12.1", "group 0.12.1", - "pairing", + "pairing 0.22.0", "rand_core 0.6.4", "subtle", ] +[[package]] +name = "bls12_381" +version = "0.8.0" +source = "git+https://github.com/brechtpd/rust-kzg.git?branch=sp1-patch#cbbfafdd1fa9ae4133e04d5edf6eaabf86acac3a" +dependencies = [ + "ff 0.13.0", + "group 0.13.0", + "pairing 0.23.0", + "rand_core 0.6.4", + "serde", + "subtle", +] + [[package]] name = "blst" version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" +source = "git+https://github.com/CeciliaZ030/blst.git?branch=v0.3.12-serialize#063b5206470c6ea4204d3f520a9d7c5490947fa8" dependencies = [ "cc", "glob", + "serde", "threadpool", "zeroize", ] @@ -1540,6 +1553,20 @@ dependencies = [ "serde", ] +[[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 = "camino" version = "1.1.7" @@ -1606,9 +1633,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.100" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" +checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" dependencies = [ "jobserver", "libc", @@ -2390,9 +2417,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elf" @@ -4019,9 +4046,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f511b714bca46f9a3e97c0e0eb21d2c112e83e444d2db535b5ec7093f5836d73" +checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" dependencies = [ "beef", "http 1.1.0", @@ -4066,7 +4093,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a575df5f985fe1cd5b2b05664ff6accfc46559032b954529fd225a2168d27b0f" dependencies = [ "bitvec", - "bls12_381", + "bls12_381 0.7.1", "ff 0.12.1", "group 0.12.1", "rand_core 0.6.4", @@ -4106,6 +4133,18 @@ dependencies = [ "sha3-asm", ] +[[package]] +name = "kzg" +version = "0.1.0" +source = "git+https://github.com/brechtpd/rust-kzg.git?branch=sp1-patch#cbbfafdd1fa9ae4133e04d5edf6eaabf86acac3a" +dependencies = [ + "bincode", + "blst", + "serde", + "sha2", + "siphasher", +] + [[package]] name = "lazy-regex" version = "3.1.0" @@ -4242,9 +4281,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" @@ -4509,7 +4548,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-complex", "num-integer", "num-iter", @@ -4530,9 +4569,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -4590,7 +4629,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-integer", "num-traits", ] @@ -4831,7 +4870,7 @@ name = "p3-baby-bear" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.6", "p3-field", "p3-mds", "p3-poseidon2", @@ -4855,7 +4894,7 @@ version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "ff 0.13.0", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "p3-field", "p3-poseidon2", "p3-symmetric", @@ -4906,7 +4945,7 @@ version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "itertools 0.12.1", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "p3-util", "rand 0.8.5", @@ -5072,6 +5111,15 @@ dependencies = [ "group 0.12.1", ] +[[package]] +name = "pairing" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" +dependencies = [ + "group 0.13.0", +] + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -5670,9 +5718,10 @@ dependencies = [ "alloy-transport-http", "anyhow", "assert_cmd", - "c-kzg", + "bincode", "clap 4.5.7", "ethers-core 2.0.10", + "kzg", "raiko-lib", "reqwest 0.11.27", "reqwest 0.12.5", @@ -5683,9 +5732,10 @@ dependencies = [ "reth-revm", "risc0-driver", "rstest", + "rust-kzg-zkcrypto", "serde", "serde_json", - "serde_with", + "serde_with 3.8.1", "sgx-prover", "sp1-driver", "thiserror", @@ -5713,7 +5763,6 @@ dependencies = [ "axum", "bincode", "bytemuck", - "c-kzg", "cap", "cfg-if", "clap 4.5.7", @@ -5721,6 +5770,7 @@ dependencies = [ "ethers-core 2.0.10", "flate2", "hyper 0.14.29", + "kzg", "lazy_static", "lru_time_cache", "once_cell", @@ -5737,9 +5787,10 @@ dependencies = [ "risc0-driver", "rlp", "rstest", + "rust-kzg-zkcrypto", "serde", "serde_json", - "serde_with", + "serde_with 3.8.1", "sgx-prover", "sha2", "sp1-driver", @@ -5769,12 +5820,12 @@ dependencies = [ "alloy-sol-types", "anyhow", "bincode", - "c-kzg", "cfg-if", "chrono", "flate2", "hex", "hex-literal", + "kzg", "lazy_static", "libflate", "log", @@ -5784,12 +5835,12 @@ dependencies = [ "reth-evm-ethereum", "reth-primitives", "rlp", + "rust-kzg-zkcrypto", "serde", "serde_json", - "serde_with", + "serde_with 3.8.1", "sha2", "sha3", - "tempfile", "thiserror", "thiserror-no-std", "tokio", @@ -5850,7 +5901,7 @@ dependencies = [ "rstest", "serde", "serde_json", - "serde_with", + "serde_with 3.8.1", "sgx-prover", "sha2", "structopt", @@ -6169,7 +6220,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-consensus", "reth-execution-errors", @@ -6181,7 +6232,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-chains", "alloy-eips", @@ -6200,7 +6251,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6215,7 +6266,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "convert_case 0.6.0", "proc-macro2", @@ -6226,7 +6277,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "auto_impl", "reth-primitives", @@ -6236,7 +6287,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-chainspec", "reth-consensus", @@ -6246,7 +6297,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "bytes", "derive_more", @@ -6272,7 +6323,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "bytes", "derive_more", @@ -6291,7 +6342,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -6315,7 +6366,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "aes 0.8.4", "alloy-primitives", @@ -6346,7 +6397,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-blockchain-tree-api", "reth-consensus", @@ -6359,7 +6410,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-rlp", "bytes", @@ -6386,7 +6437,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-rlp", "bytes", @@ -6401,7 +6452,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-chainspec", "reth-consensus", @@ -6413,7 +6464,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-chains", "alloy-primitives", @@ -6426,7 +6477,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "auto_impl", "futures-util", @@ -6443,13 +6494,14 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-eips", "alloy-sol-types", "anyhow", "lazy_static", "reth-chainspec", + "reth-consensus", "reth-ethereum-consensus", "reth-evm", "reth-execution-types", @@ -6462,7 +6514,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-eips", "alloy-primitives", @@ -6476,7 +6528,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-execution-errors", "reth-primitives", @@ -6487,7 +6539,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "serde_json", "thiserror", @@ -6496,7 +6548,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "metrics", "reth-metrics-derive", @@ -6505,7 +6557,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "once_cell", "proc-macro2", @@ -6517,7 +6569,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "tokio", @@ -6526,11 +6578,11 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "futures-util", "reqwest 0.12.5", - "serde_with", + "serde_with 3.8.1", "thiserror", "tokio", ] @@ -6538,7 +6590,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "enr 0.12.1", @@ -6553,7 +6605,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "auto_impl", "futures", @@ -6571,13 +6623,13 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "alloy-rlp", "enr 0.12.1", "secp256k1", - "serde_with", + "serde_with 3.8.1", "thiserror", "tokio", "url", @@ -6586,7 +6638,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "anyhow", "bincode", @@ -6606,7 +6658,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6616,7 +6668,7 @@ dependencies = [ "alloy-rpc-types", "byteorder", "bytes", - "c-kzg", + "c-kzg 1.0.2", "derive_more", "modular-bitfield", "once_cell", @@ -6628,6 +6680,7 @@ dependencies = [ "reth-static-file-types", "reth-trie-common", "revm", + "revm-precompile", "revm-primitives", "roaring", "secp256k1", @@ -6639,7 +6692,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6658,7 +6711,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-rpc-types-engine", "auto_impl", @@ -6696,7 +6749,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "bytes", @@ -6710,7 +6763,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-eips", "alloy-rlp", @@ -6728,7 +6781,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "alloy-rpc-types", @@ -6747,7 +6800,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "bytes", @@ -6760,7 +6813,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "derive_more", @@ -6771,7 +6824,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "auto_impl", "reth-chainspec", @@ -6788,7 +6841,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-fs-util", "reth-primitives", @@ -6798,7 +6851,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "clap 4.5.7", "eyre", @@ -6813,7 +6866,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-rlp", "auto_impl", @@ -6834,7 +6887,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-consensus", "alloy-genesis", @@ -6881,7 +6934,7 @@ source = "git+https://github.com/taikoxyz/revm.git?branch=v36-taiko#787302e80d35 dependencies = [ "aurora-engine-modexp", "blst", - "c-kzg", + "c-kzg 1.0.0", "k256", "once_cell", "revm-primitives", @@ -6900,7 +6953,7 @@ dependencies = [ "auto_impl", "bitflags 2.6.0", "bitvec", - "c-kzg", + "c-kzg 1.0.0", "cfg-if", "derive_more", "dyn-clone", @@ -7087,7 +7140,7 @@ dependencies = [ "risc0-zkvm", "serde", "serde_json", - "serde_with", + "serde_with 3.8.1", "tracing", "typetag", ] @@ -7104,7 +7157,7 @@ dependencies = [ "ark-serialize 0.4.2", "bytemuck", "hex", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-derive", "num-traits", "risc0-core", @@ -7325,7 +7378,7 @@ dependencies = [ "ark-ff 0.4.2", "bytes", "fastrlp", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "parity-scale-codec", "primitive-types", @@ -7378,6 +7431,23 @@ dependencies = [ "walkdir", ] +[[package]] +name = "rust-kzg-zkcrypto" +version = "0.1.0" +source = "git+https://github.com/brechtpd/rust-kzg.git?branch=sp1-patch#cbbfafdd1fa9ae4133e04d5edf6eaabf86acac3a" +dependencies = [ + "bls12_381 0.8.0", + "blst", + "byteorder", + "ff 0.13.0", + "hex", + "kzg", + "libc", + "serde", + "serde_with 2.3.3", + "subtle", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -7745,9 +7815,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] @@ -7765,9 +7835,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "indexmap 2.2.6", "itoa", @@ -7806,6 +7876,22 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +dependencies = [ + "base64 0.13.1", + "chrono", + "hex", + "indexmap 1.9.3", + "serde", + "serde_json", + "serde_with_macros 2.3.3", + "time", +] + [[package]] name = "serde_with" version = "3.8.1" @@ -7820,10 +7906,22 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_with_macros", + "serde_with_macros 3.8.1", "time", ] +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "serde_with_macros" version = "3.8.1" @@ -7901,7 +7999,7 @@ dependencies = [ "raiko-lib", "serde", "serde_json", - "serde_with", + "serde_with 3.8.1", "tokio", "url", ] @@ -7988,12 +8086,18 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "thiserror", "time", ] +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "size" version = "0.4.1" @@ -8082,7 +8186,7 @@ dependencies = [ "log", "nohash-hasher", "num", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num_cpus", "p3-air", "p3-baby-bear", @@ -8105,7 +8209,7 @@ dependencies = [ "rayon-scan", "rrs-lib 0.1.0 (git+https://github.com/GregAC/rrs.git)", "serde", - "serde_with", + "serde_with 3.8.1", "size", "snowbridge-amcl", "sp1-derive", @@ -8174,7 +8278,7 @@ dependencies = [ "hex", "indicatif", "itertools 0.13.0", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "p3-baby-bear", "p3-bn254-fr", "p3-challenger", @@ -8276,7 +8380,7 @@ dependencies = [ "p3-symmetric", "p3-util", "serde", - "serde_with", + "serde_with 3.8.1", "sp1-core", "sp1-derive", "sp1-primitives", @@ -8307,7 +8411,7 @@ dependencies = [ "cfg-if", "hex", "log", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "p3-baby-bear", "p3-field", "p3-symmetric", @@ -8364,7 +8468,7 @@ dependencies = [ "hex", "indicatif", "log", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "p3-commit", "p3-field", "p3-matrix", @@ -8755,9 +8859,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] @@ -9969,7 +10073,7 @@ dependencies = [ "ark-std 0.4.0", "bitvec", "blake2", - "bls12_381", + "bls12_381 0.7.1", "byteorder", "cfg-if", "group 0.12.1", diff --git a/Cargo.toml b/Cargo.toml index 090ba25cb..8c9cec791 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,11 +38,11 @@ raiko-core = { path = "./core" } # 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-ethereum = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko", default-features = false } 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-rpc-types = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko", default-features = false } +reth-revm = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko", default-features = false } +reth-chainspec = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko", default-features = false } reth-provider = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko", default-features = false } # risc zero @@ -66,22 +66,26 @@ 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 = [ +alloy-rpc-types = { version = "0.1", default-features = false } +alloy-rpc-client = { version = "0.1", default-features = false } +alloy-consensus = { version = "0.1", default-features = false, features = [ "serde", ] } alloy-network = { version = "0.1", default-features = false, features = [ "k256", ] } -alloy-contract = { version = "0.1" } +alloy-contract = { version = "0.1", default-features = false } alloy-eips = { version = "0.1", default-features = false, features = [ "serde", ] } -alloy-provider = { version = "0.1" } -alloy-transport-http = { version = "0.1" } -alloy-signer = { version = "0.1" } -alloy-signer-local = { version = "0.1" } +alloy-provider = { version = "0.1", default-features = false, features = [ + "reqwest", +] } +alloy-transport-http = { version = "0.1",default-features = false, features = [ + "reqwest", +] } +alloy-signer = { version = "0.1", default-features = false} +alloy-signer-local = { version = "0.1", default-features = false } # ethers (TODO: remove) ethers-contract = { git = "https://github.com/smtmfft/ethers-rs", branch = "ethers-core-2.0.10" } @@ -133,15 +137,12 @@ reqwest = { version = "0.11.22", features = ["json"] } url = "2.5.0" # crypto -c-kzg = { git = "https://github.com/brechtpd/c-kzg-4844", branch = "for-alpha7", default-features = false, features = [ - "preload-kzg-settings", - "no-threads", -] } +kzg = { package = "rust-kzg-zkcrypto", git = "https://github.com/brechtpd/rust-kzg.git", branch = "sp1-patch", default-features = false } +kzg_traits = { package = "kzg", git = "https://github.com/brechtpd/rust-kzg.git", branch = "sp1-patch", default-features = false } sha3 = { version = "0.10", default-features = false } sha2 = "0.10.8" -secp256k1 = { git = "https://github.com/CeciliaZ030/rust-secp256k1", branch = "sp1-patch", features = [ - 'global-context', - "rand", +secp256k1 = { version = "0.29", default-features = false, features = [ + "global-context", "recovery", ] } @@ -177,5 +178,6 @@ 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 +revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } +secp256k1 = { git = "https://github.com/CeciliaZ030/rust-secp256k1", branch = "sp1-patch" } +blst = { git = "https://github.com/CeciliaZ030/blst.git", branch = "v0.3.12-serialize" } \ No newline at end of file diff --git a/core/Cargo.toml b/core/Cargo.toml index 5692839fa..3f2380ea7 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -11,7 +11,7 @@ risc0-driver = { path = "../provers/risc0/driver", optional = true } sgx-prover = { path = "../provers/sgx/prover", optional = true } # raiko -raiko-lib = { workspace = true, features = ["c-kzg"] } +raiko-lib = { workspace = true } # reth reth-primitives.workspace = true @@ -34,6 +34,7 @@ alloy-rpc-client = { workspace = true } # tracing and logging tracing = { workspace = true } +bincode = { workspace = true } # errors anyhow = { workspace = true } @@ -45,7 +46,8 @@ serde_json = { workspace = true } serde_with = { workspace = true } # c-kzg -c-kzg = { workspace = true } +kzg = { workspace = true } +kzg_traits = { workspace = true } # async tokio = { workspace = true } diff --git a/core/src/interfaces.rs b/core/src/interfaces.rs index 466f61b4f..e68d5ce58 100644 --- a/core/src/interfaces.rs +++ b/core/src/interfaces.rs @@ -2,9 +2,11 @@ use crate::{merge, prover::NativeProver}; use alloy_primitives::{Address, B256}; use clap::{Args, ValueEnum}; use raiko_lib::{ - input::{GuestInput, GuestOutput}, + input::{BlobProofType, GuestInput, GuestOutput}, + primitives::eip4844::{calc_kzg_proof, commitment_to_version_hash, kzg_proof_to_bytes}, prover::{Proof, Prover, ProverError}, }; +use reth_primitives::hex; use serde::{Deserialize, Serialize}; use serde_json::Value; use serde_with::{serde_as, DisplayFromStr}; @@ -17,6 +19,10 @@ pub enum RaikoError { #[error("Unknown proof type: {0}")] InvalidProofType(String), + /// For invalid proof type generation request. + #[error("Unknown proof type: {0}")] + InvalidBlobOption(String), + /// For invalid proof request configuration. #[error("Invalid proof request: {0}")] InvalidRequestConfig(String), @@ -128,13 +134,13 @@ impl ProofType { output: &GuestOutput, config: &Value, ) -> RaikoResult { - match self { - ProofType::Native => NativeProver::run(input, output, config) + let mut proof = match self { + ProofType::Native => NativeProver::run(input.clone(), output, config) .await .map_err(|e| e.into()), ProofType::Sp1 => { #[cfg(feature = "sp1")] - return sp1_driver::Sp1Prover::run(input, output, config) + return sp1_driver::Sp1Prover::run(input.clone(), output, config) .await .map_err(|e| e.into()); #[cfg(not(feature = "sp1"))] @@ -142,7 +148,7 @@ impl ProofType { } ProofType::Risc0 => { #[cfg(feature = "risc0")] - return risc0_driver::Risc0Prover::run(input, output, config) + return risc0_driver::Risc0Prover::run(input.clone(), output, config) .await .map_err(|e| e.into()); #[cfg(not(feature = "risc0"))] @@ -150,13 +156,29 @@ impl ProofType { } ProofType::Sgx => { #[cfg(feature = "sgx")] - return sgx_prover::SgxProver::run(input, output, config) + return sgx_prover::SgxProver::run(input.clone(), output, config) .await .map_err(|e| e.into()); #[cfg(not(feature = "sgx"))] Err(RaikoError::FeatureNotSupportedError(self.clone())) } + }?; + + // Add the kzg proof to the proof if needed + if let Some(blob_commitment) = input.taiko.blob_commitment.clone() { + let kzg_proof = calc_kzg_proof( + &input.taiko.tx_data, + &commitment_to_version_hash(&blob_commitment.try_into().unwrap()), + ) + .unwrap(); + let kzg_proof_hex = hex::encode(kzg_proof_to_bytes(&kzg_proof)); + proof + .as_object_mut() + .unwrap() + .insert("kzg_proof".to_string(), Value::String(kzg_proof_hex)); } + + Ok(proof) } } @@ -168,7 +190,7 @@ pub struct ProofRequest { pub block_number: u64, /// The network to generate the proof for. pub network: String, - /// The L1 network to grnerate the proof for. + /// The L1 network to generate the proof for. pub l1_network: String, /// Graffiti. pub graffiti: B256, @@ -177,6 +199,8 @@ pub struct ProofRequest { pub prover: Address, /// The proof type. pub proof_type: ProofType, + /// Blob proof type. + pub blob_proof_type: BlobProofType, #[serde(flatten)] /// Additional prover params. pub prover_args: HashMap, @@ -204,6 +228,8 @@ pub struct ProofRequestOpt { #[arg(long, require_equals = true)] /// The proof type. pub proof_type: Option, + /// Blob proof type. + pub blob_proof_type: Option, #[command(flatten)] #[serde(flatten)] /// Any additional prover params in JSON format. @@ -294,6 +320,13 @@ impl TryFrom for ProofRequest { ))? .parse() .map_err(|_| RaikoError::InvalidRequestConfig("Invalid proof_type".to_string()))?, + blob_proof_type: value + .blob_proof_type + .unwrap_or("ProofOfCommitment".to_string()) + .parse() + .map_err(|_| { + RaikoError::InvalidRequestConfig("Invalid blob_proof_type".to_string()) + })?, prover_args: value.prover_args.into(), }) } diff --git a/core/src/lib.rs b/core/src/lib.rs index 26f3c63a5..e71983b8a 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -54,6 +54,7 @@ impl Raiko { graffiti: self.request.graffiti, prover: self.request.prover, }, + self.request.blob_proof_type.clone(), ) .await .map_err(Into::::into) @@ -197,6 +198,7 @@ mod tests { use clap::ValueEnum; use raiko_lib::{ consts::{Network, SupportedChainSpecs}, + input::BlobProofType, primitives::B256, }; use serde_json::{json, Value}; @@ -255,15 +257,11 @@ mod tests { let provider = RpcBlockDataProvider::new(&taiko_chain_spec.rpc, proof_request.block_number - 1) .expect("Could not create RpcBlockDataProvider"); - let proof_type = proof_request.proof_type.to_owned(); - let raiko = Raiko::new(l1_chain_spec, taiko_chain_spec, proof_request); - let mut input = raiko + let raiko = Raiko::new(l1_chain_spec, taiko_chain_spec, proof_request.clone()); + let input = raiko .generate_input(provider) .await .expect("input generation failed"); - if is_ci() && proof_type == ProofType::Sp1 { - input.taiko.skip_verify_blob = true; - } let output = raiko.get_output(&input).expect("output generation failed"); let _proof = raiko .prove(input, &output) @@ -293,6 +291,7 @@ mod tests { prover: Address::ZERO, l1_network, proof_type, + blob_proof_type: BlobProofType::ProofOfEquivalence, prover_args: test_proof_params(), }; prove_block(l1_chain_spec, taiko_chain_spec, proof_request).await; @@ -319,6 +318,35 @@ mod tests { prover: Address::ZERO, l1_network, proof_type, + blob_proof_type: BlobProofType::ProofOfEquivalence, + prover_args: test_proof_params(), + }; + prove_block(l1_chain_spec, taiko_chain_spec, proof_request).await; + } + } + + #[tokio::test(flavor = "multi_thread")] + async fn test_prove_block_taiko_mainnet() { + let proof_type = get_proof_type_from_env(); + // Skip test on SP1 for now because it's too slow on CI + if !(is_ci() && proof_type == ProofType::Sp1) { + let network = Network::TaikoMainnet.to_string(); + let l1_network = Network::Ethereum.to_string(); + let block_number = 88970; + let taiko_chain_spec = SupportedChainSpecs::default() + .get_chain_spec(&network) + .unwrap(); + let l1_chain_spec = SupportedChainSpecs::default() + .get_chain_spec(&l1_network) + .unwrap(); + let proof_request = ProofRequest { + block_number, + network, + graffiti: B256::ZERO, + prover: Address::ZERO, + l1_network, + proof_type, + blob_proof_type: BlobProofType::ProofOfEquivalence, prover_args: test_proof_params(), }; prove_block(l1_chain_spec, taiko_chain_spec, proof_request).await; diff --git a/core/src/preflight.rs b/core/src/preflight.rs index 92aa964e9..e1e633724 100644 --- a/core/src/preflight.rs +++ b/core/src/preflight.rs @@ -8,24 +8,29 @@ use alloy_provider::{Provider, ReqwestProvider}; use alloy_rpc_types::{Block, BlockTransactions, Filter, Transaction as AlloyRpcTransaction}; use alloy_sol_types::{SolCall, SolEvent}; use anyhow::{anyhow, bail, Result}; -use c_kzg::{Blob, KzgCommitment}; +use kzg_traits::{ + eip_4844::{blob_to_kzg_commitment_rust, Blob}, + G1, +}; use raiko_lib::{ builder::{OptimisticDatabase, RethBlockBuilder}, clear_line, consts::ChainSpec, inplace_print, input::{ - decode_anchor, proposeBlockCall, BlockProposed, GuestInput, TaikoGuestInput, + decode_anchor, proposeBlockCall, BlobProofType, BlockProposed, GuestInput, TaikoGuestInput, TaikoProverData, }, - primitives::{eip4844::MAINNET_KZG_TRUSTED_SETUP, mpt::proofs_to_tries}, - protocol_instance::kzg_to_versioned_hash, + primitives::{ + eip4844::{self, commitment_to_version_hash, KZG_SETTINGS}, + mpt::proofs_to_tries, + }, utils::{generate_transactions, zlib_compress_data}, Measurement, }; use reth_primitives::Block as RethBlock; use serde::{Deserialize, Serialize}; -use std::{collections::HashSet, sync::Arc}; +use std::collections::HashSet; use tracing::{debug, info, warn}; pub async fn preflight( @@ -34,6 +39,7 @@ pub async fn preflight( l1_chain_spec: ChainSpec, taiko_chain_spec: ChainSpec, prover_data: TaikoProverData, + blob_proof_type: BlobProofType, ) -> RaikoResult { let measurement = Measurement::start("Fetching block data...", false); @@ -66,6 +72,7 @@ pub async fn preflight( block_number, block, prover_data, + blob_proof_type, ) .await? } else { @@ -224,6 +231,7 @@ async fn prepare_taiko_chain_input( block_number: u64, block: &Block, prover_data: TaikoProverData, + blob_proof_type: BlobProofType, ) -> RaikoResult { let provider_l1 = RpcBlockDataProvider::new(&l1_chain_spec.rpc, block_number)?; @@ -272,7 +280,7 @@ async fn prepare_taiko_chain_input( .await?; // Fetch the tx data from either calldata or blobdata - let (tx_data, tx_blob_hash) = if proposal_event.meta.blobUsed { + let (tx_data, blob_commitment) = if proposal_event.meta.blobUsed { debug!("blob active"); // Get the blob hashes attached to the propose tx let blob_hashes = proposal_tx.blob_versioned_hashes.unwrap_or_default(); @@ -289,7 +297,9 @@ async fn prepare_taiko_chain_input( RaikoError::Preflight("Beacon RPC URL is required for Taiko chains".to_owned()) })?; let blob = get_blob_data(&beacon_rpc_url, slot_id, blob_hash).await?; - (blob, Some(blob_hash)) + let commitment = eip4844::calc_kzg_proof_commitment(&blob).map_err(|e| anyhow!(e))?; + + (blob, Some(commitment.to_vec())) } else { // Get the tx list data directly from the propose transaction data let proposal_call = proposeBlockCall::abi_decode(&proposal_tx.input, false) @@ -315,10 +325,10 @@ async fn prepare_taiko_chain_input( 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, + blob_commitment, block_proposed: proposal_event, prover_data, - skip_verify_blob: false, + blob_proof_type, }) } @@ -351,11 +361,13 @@ fn blob_to_bytes(blob_str: &str) -> Vec { fn calc_blob_versioned_hash(blob_str: &str) -> [u8; 32] { let blob_bytes: Vec = hex::decode(blob_str.to_lowercase().trim_start_matches("0x")) .expect("Could not decode blob"); - let kzg_settings = Arc::clone(&*MAINNET_KZG_TRUSTED_SETUP); let blob = Blob::from_bytes(&blob_bytes).expect("Could not create blob"); - let kzg_commit = KzgCommitment::blob_to_kzg_commitment(&blob, &kzg_settings) - .expect("Could not create kzg commitment from blob"); - let version_hash: [u8; 32] = kzg_to_versioned_hash(&kzg_commit).0; + let commitment = blob_to_kzg_commitment_rust( + &eip4844::deserialize_blob_rust(&blob).expect("Could not deserialize blob"), + &KZG_SETTINGS.clone(), + ) + .expect("Could not create kzg commitment from blob"); + let version_hash: [u8; 32] = commitment_to_version_hash(&commitment.to_bytes()).0; version_hash } @@ -533,63 +545,11 @@ mod test { use ethers_core::types::Transaction; use raiko_lib::{ consts::{Network, SupportedChainSpecs}, - primitives::{eip4844::parse_kzg_trusted_setup, kzg::KzgSettings}, utils::decode_transactions, }; use super::*; - #[allow(dead_code)] - fn calc_commit_versioned_hash(commitment: &str) -> [u8; 32] { - let commit_bytes = hex::decode(commitment.to_lowercase().trim_start_matches("0x")).unwrap(); - let kzg_commit = c_kzg::KzgCommitment::from_bytes(&commit_bytes).unwrap(); - let version_hash: [u8; 32] = kzg_to_versioned_hash(&kzg_commit).0; - version_hash - } - - // TODO(Cecilia): "../kzg_parsed_trust_setup" does not exist - #[ignore] - #[test] - fn test_parse_kzg_trusted_setup() { - // check if file exists - let b_file_exists = std::path::Path::new("../kzg_parsed_trust_setup").exists(); - assert!(b_file_exists); - // open file as lines of strings - let kzg_trust_setup_str = std::fs::read_to_string("../kzg_parsed_trust_setup").unwrap(); - let (g1, g2) = parse_kzg_trusted_setup(&kzg_trust_setup_str) - .map_err(|e| { - println!("error: {e:?}"); - e - }) - .unwrap(); - println!("g1: {:?}", g1.0.len()); - println!("g2: {:?}", g2.0.len()); - } - - // TODO(Cecilia): "../kzg_parsed_trust_setup" does not exist - #[ignore] - #[test] - fn test_blob_to_kzg_commitment() { - // check if file exists - let b_file_exists = std::path::Path::new("../kzg_parsed_trust_setup").exists(); - assert!(b_file_exists); - // open file as lines of strings - let kzg_trust_setup_str = std::fs::read_to_string("../kzg_parsed_trust_setup").unwrap(); - let (g1, g2) = parse_kzg_trusted_setup(&kzg_trust_setup_str) - .map_err(|e| { - println!("error: {e:?}"); - e - }) - .unwrap(); - let kzg_settings = KzgSettings::load_trusted_setup(&g1.0, &g2.0).unwrap(); - let blob = [0u8; 131072].into(); - let kzg_commit = KzgCommitment::blob_to_kzg_commitment(&blob, &kzg_settings).unwrap(); - assert_eq!( - kzg_to_versioned_hash(&kzg_commit).to_string(), - "0x010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c444014" - ); - } - #[test] fn test_new_blob_decode() { let valid_blob_str = "\ @@ -637,139 +597,13 @@ mod test { 0000000000000000000000000000000000000000000000000000000000000000\ 0000000000000000000000000000000000000000000000000000000000000000\ 00000000000000000000000000000000"; - // println!("valid blob: {:?}", valid_blob_str); let blob_str = format!("{:0<262144}", valid_blob_str); let dec_blob = blob_to_bytes(&blob_str); println!("dec blob tx len: {:?}", dec_blob.len()); let txs = decode_transactions(&dec_blob); println!("dec blob tx: {txs:?}"); - // assert_eq!(hex::encode(dec_blob), expected_dec_blob); - } - - #[test] - fn test_c_kzg_lib_commitment() { - // check c-kzg mainnet trusted setup is ok - let kzg_settings = Arc::clone(&*MAINNET_KZG_TRUSTED_SETUP); - let blob = [0u8; 131072].into(); - let kzg_commit = KzgCommitment::blob_to_kzg_commitment(&blob, &kzg_settings).unwrap(); - assert_eq!( - kzg_to_versioned_hash(&kzg_commit).to_string(), - "0x010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c444014" - ); } - // #[ignore] - // #[tokio::test] - // async fn test_propose_block() { - // tokio::task::spawn_blocking(|| { - // let l2_chain_spec = get_taiko_chain_spec("internal_devnet_a"); - // let mut l1_provider = new_provider( - // None, - // Some("https://localhost:8545".to_owned()), - // Some("https://localhost:3500/".to_owned()), - // ) - // .expect("bad provider"); - // let (propose_tx, block_metadata) = l1_provider - // .get_propose(&ProposeQuery { - // l1_contract: H160::from_slice(l2_chain_spec.l1_contract.unwrap().as_slice()), - // l1_block_no: 6093, - // l2_block_no: 1000, - // }) - // .expect("bad get_propose"); - // println!("propose_tx: {:?}", propose_tx); - // println!("block_metadata: {:?}", block_metadata); - // }) - // .await - // .unwrap(); - // } - // - // #[ignore] - // #[tokio::test] - // async fn test_fetch_blob_data_and_hash() { - // tokio::task::spawn_blocking(|| { - // let mut provider = new_provider( - // None, - // Some("https://l1rpc.internal.taiko.xyz/".to_owned()), - // Some("https://l1beacon.internal.taiko.xyz/".to_owned()), - // ) - // .expect("bad provider"); - // let blob_data = fetch_blob_data("http://localhost:3500".to_string(), 5).unwrap(); - // let blob_data = provider.get_blob_data(17138).unwrap(); - // println!("blob len: {:?}", blob_data.data[0].blob.len()); - // let dec_blob = decode_blob_data(&blob_data.data[0].blob); - // println!("dec blob tx: {:?}", dec_blob.len()); - // - // println!("blob commitment: {:?}", blob_data.data[0].kzg_commitment); - // let blob_hash = calc_commit_versioned_hash(&blob_data.data[0].kzg_commitment); - // println!("blob hash {:?}", hex::encode(blob_hash)); - // }) - // .await - // .unwrap(); - // } - // - // #[ignore] - // #[tokio::test] - // async fn test_fetch_and_verify_blob_data() { - // tokio::task::spawn_blocking(|| { - // let mut provider = new_provider( - // None, - // Some("https://l1rpc.internal.taiko.xyz".to_owned()), - // Some("https://l1beacon.internal.taiko.xyz".to_owned()), - // ) - // .expect("bad provider"); - // let blob_data = provider.get_blob_data(168).unwrap(); - // let blob_bytes: [u8; 4096 * 32] = hex::decode( - // blob_data.data[0] - // .blob - // .to_lowercase() - // .trim_start_matches("0x"), - // ) - // .unwrap() - // .try_into() - // .unwrap(); - // let blob: Blob = blob_bytes.into(); - // let kzg_settings = Arc::clone(&*MAINNET_KZG_TRUSTED_SETUP); - // let kzg_commit: KzgCommitment = - // KzgCommitment::blob_to_kzg_commitment(&blob, &kzg_settings).unwrap(); - // assert_eq!( - // "0x".to_owned() + &kzg_commit.as_hex_string(), - // blob_data.data[0].kzg_commitment - // ); - // println!("blob commitment: {:?}", blob_data.data[0].kzg_commitment); - // let calc_versioned_hash = - // calc_commit_versioned_hash(&blob_data.data[0].kzg_commitment); println!("blob hash - // {:?}", hex::encode(calc_versioned_hash)); }) - // .await - // .unwrap(); - // } - // - // #[ignore] - // #[tokio::test] - // async fn test_fetch_and_decode_blob_tx() { - // let block_num = std::env::var("TAIKO_L2_BLOCK_NO") - // .unwrap_or("94".to_owned()) - // .parse::() - // .unwrap(); - // tokio::task::spawn_blocking(move || { - // let mut provider = new_provider( - // None, - // Some("http://35.202.137.144:8545".to_owned()), - // Some("http://35.202.137.144:3500".to_owned()), - // ) - // .expect("bad provider"); - // let blob_data = provider.get_blob_data(block_num).unwrap(); - // println!("blob str len: {:?}", blob_data.data[0].blob.len()); - // let blob_bytes = decode_blob_data(&blob_data.data[0].blob); - // println!("blob byte len: {:?}", blob_bytes.len()); - // println!("blob bytes {:?}", blob_bytes); - // rlp decode blob tx - // let txs: Vec = rlp_decode_list(&blob_bytes).unwrap(); - // println!("blob tx: {:?}", txs); - // }) - // .await - // .unwrap(); - // } - #[ignore] #[test] fn test_slot_block_num_mapping() { diff --git a/host/Cargo.toml b/host/Cargo.toml index a4d4bea01..3926be2f5 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -12,7 +12,7 @@ risc0-driver = { path = "../provers/risc0/driver", optional = true } sgx-prover = { path = "../provers/sgx/prover", optional = true } # raiko -raiko-lib = { workspace = true, features = ["c-kzg"] } +raiko-lib = { workspace = true } raiko-core = { workspace = true } # alloy @@ -27,6 +27,10 @@ alloy-consensus = { workspace = true } alloy-network = { workspace = true } alloy-rpc-client = { workspace = true } +# crypto +kzg = { workspace = true } +kzg_traits = { workspace = true } + # server axum = { workspace = true } tower-http = { workspace = true } @@ -59,7 +63,6 @@ reqwest = { workspace = true } reqwest_alloy = { workspace = true } sha2 = { workspace = true } proptest = { workspace = true } -c-kzg = { workspace = true } rlp = { workspace = true } url = { workspace = true } cfg-if = { workspace = true } @@ -77,7 +80,7 @@ rstest = { workspace = true } ethers-core = { workspace = true } [features] -# powdr = ["dep:powdr"] +default = [] sp1 = ["raiko-core/sp1"] risc0 = ["raiko-core/risc0"] sgx = ["raiko-core/sgx"] @@ -89,3 +92,7 @@ path = "src/bin/main.rs" [[bin]] name = "docs" path = "src/bin/docs.rs" + +[[bin]] +name = "gen-kzg-settings" +path = "src/bin/gen_kzg_settings.rs" diff --git a/host/config/config.json b/host/config/config.json index 8abe5daab..4f293e4e4 100644 --- a/host/config/config.json +++ b/host/config/config.json @@ -4,6 +4,7 @@ "prover": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", "graffiti": "8008500000000000000000000000000000000000000000000000000000000000", "proof_type": "risc0", + "blob_option": "proof_of_equivalence", "sgx": { "instance_id": 456, "setup": true, diff --git a/host/src/bin/gen_kzg_settings.rs b/host/src/bin/gen_kzg_settings.rs new file mode 100644 index 000000000..624a63019 --- /dev/null +++ b/host/src/bin/gen_kzg_settings.rs @@ -0,0 +1,22 @@ +#![feature(slice_flatten)] +use std::{fs, path::PathBuf}; + +use kzg::kzg_proofs::KZGSettings; +use reth_primitives::revm_primitives::kzg::{G1Points, G2Points, G1_POINTS, G2_POINTS}; +static FILE_NAME: &str = "zkcrypto_kzg_settings.bin"; + +fn main() { + let kzg_setting: KZGSettings = kzg_traits::eip_4844::load_trusted_setup_rust( + G1Points::as_ref(G1_POINTS).flatten(), + G2Points::as_ref(G2_POINTS).flatten(), + ) + .expect("failed to load trusted setup"); + + let path = PathBuf::from("./lib/kzg_settings"); + if !path.exists() { + fs::create_dir_all(&path).expect("Couldn't create destination directories"); + } + let file = fs::File::create(path.join(FILE_NAME)).expect("Couldn't create file"); + + bincode::serialize_into(file, &kzg_setting).expect("failed to serialize kzg settings"); +} diff --git a/host/src/server/api/v1/proof.rs b/host/src/server/api/v1/proof.rs index 91ef370c1..3bc1dee0f 100644 --- a/host/src/server/api/v1/proof.rs +++ b/host/src/server/api/v1/proof.rs @@ -243,6 +243,7 @@ mod test { use alloy_primitives::{Address, B256}; use raiko_core::interfaces::ProofType; use raiko_lib::consts::{Network, SupportedChainSpecs}; + use raiko_lib::input::BlobProofType; async fn create_cache_input( l1_network: &String, @@ -262,6 +263,7 @@ mod test { graffiti: B256::ZERO, prover: Address::ZERO, proof_type: ProofType::Native, + blob_proof_type: BlobProofType::ProofOfCommitment, prover_args: Default::default(), }; let raiko = Raiko::new( diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 547eedb43..0da2f7cc6 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -33,26 +33,25 @@ libflate = { workspace = true } once_cell = { workspace = true } url = { workspace = true } hex = { workspace = true } -c-kzg = { workspace = true } +kzg = { workspace = true } +kzg_traits = { workspace = true } sha2 = { workspace = true } sha3 = { workspace = true } rlp = { workspace = true, features = ["std"] } + +# misc cfg-if = { workspace = true } tracing = { workspace = true } +bincode = { workspace = true } # [target.'cfg(feature = "std")'.dependencies] flate2 = { workspace = true, optional = true } log = { workspace = true, optional = true } - tokio = { workspace = true, optional = true } chrono = { workspace = true, optional = true } - lazy_static = { workspace = true } -tempfile = { workspace = true, optional = true } - [dev-dependencies] -bincode = "1.3" hex-literal = { workspace = true } [features] @@ -72,5 +71,4 @@ std = [ sgx = [] sp1 = [] risc0 = [] -c-kzg = ["dep:tempfile"] -sp1-cycle-tracker = [] +sp1-cycle-tracker = [] \ No newline at end of file diff --git a/lib/kzg_settings/zkcrypto_kzg_settings.bin b/lib/kzg_settings/zkcrypto_kzg_settings.bin new file mode 100644 index 000000000..1fa153cba Binary files /dev/null and b/lib/kzg_settings/zkcrypto_kzg_settings.bin differ diff --git a/lib/src/input.rs b/lib/src/input.rs index eeef92884..bb8cf9dd6 100644 --- a/lib/src/input.rs +++ b/lib/src/input.rs @@ -1,10 +1,10 @@ -use core::fmt::Debug; +use core::{fmt::Debug, str::FromStr}; #[cfg(feature = "std")] use std::path::PathBuf; use alloy_rpc_types::Withdrawal as AlloyWithdrawal; use alloy_sol_types::{sol, SolCall}; -use anyhow::{anyhow, Result}; +use anyhow::{anyhow, Error, Result}; use reth_primitives::revm_primitives::{Address, Bytes, HashMap, B256, U256}; use serde::{Deserialize, Serialize}; use serde_with::serde_as; @@ -72,8 +72,36 @@ pub struct TaikoGuestInput { pub anchor_tx: String, pub block_proposed: BlockProposed, pub prover_data: TaikoProverData, - pub tx_blob_hash: Option, - pub skip_verify_blob: bool, + pub blob_commitment: Option>, + pub blob_proof_type: BlobProofType, +} + +#[derive(Clone, Debug, Serialize, Deserialize, Default)] +pub enum BlobProofType { + /// Simplified Proof of Equivalence with fiat input in non-aligned field + /// Referencing https://notes.ethereum.org/@dankrad/kzg_commitments_in_proofs + /// with impl details in https://github.com/taikoxyz/raiko/issues/292 + /// Guest proves the KZG evaluation of the a fiat-shamir input x and output result y + /// x = sha256(sha256(blob), kzg_commit(blob)) + /// y = f(x) + /// where f is the KZG polynomial + #[default] + ProofOfEquivalence, + /// Guest runs through the entire computation from blob to Kzg commitment + /// then to version hash + ProofOfCommitment, +} + +impl FromStr for BlobProofType { + type Err = Error; + + fn from_str(s: &str) -> Result { + match s.trim() { + "ProofOfEquivalence" => Ok(BlobProofType::ProofOfEquivalence), + "ProofOfCommitment" => Ok(BlobProofType::ProofOfCommitment), + _ => Err(anyhow!("invalid blob proof type")), + } + } } #[derive(Clone, Default, Debug, Serialize, Deserialize)] diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 31b6f8099..abe289a81 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -1,5 +1,6 @@ #![cfg_attr(any(not(feature = "std")), no_std)] - +#![feature(slice_flatten)] +#![feature(result_flattening)] #[cfg(feature = "std")] use std::io::{self, Write}; @@ -96,6 +97,14 @@ impl CycleTracker { ))] println!("cycle-tracker-end: {self.title}"); } + + pub fn println(_inner: impl Fn()) { + #[cfg(all( + all(target_os = "zkvm", target_vendor = "succinct"), + feature = "sp1-cycle-tracker" + ))] + _inner() + } } pub struct Measurement { diff --git a/lib/src/primitives/eip4844.rs b/lib/src/primitives/eip4844.rs index e135261ed..9dd31ae9d 100644 --- a/lib/src/primitives/eip4844.rs +++ b/lib/src/primitives/eip4844.rs @@ -1,89 +1,215 @@ -//! Helpers for working with EIP-4844 blob fee. - -// re-exports from revm for calculating blob fee -pub use reth_primitives::revm_primitives::{ - calc_blob_gasprice, calc_excess_blob_gas as calculate_excess_blob_gas, +use kzg::kzg_types::{ZFr, ZG1}; +use kzg_traits::{ + eip_4844::{ + blob_to_kzg_commitment_rust, blob_to_polynomial, compute_kzg_proof_rust, + evaluate_polynomial_in_evaluation_form, hash_to_bls_field, Blob, + }, + Fr, G1, }; -#[cfg(feature = "c-kzg")] -use sha2::{Digest, Sha256}; - -#[cfg(feature = "c-kzg")] -use crate::primitives::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()) +use once_cell::sync::Lazy; +use reth_primitives::B256; +use sha2::{Digest as _, Sha256}; + +pub use kzg::{eip_4844::deserialize_blob_rust, kzg_proofs::KZGSettings}; +pub static KZG_SETTINGS_BIN: &[u8] = include_bytes!("../../kzg_settings/zkcrypto_kzg_settings.bin"); + +// The KZG settings under the concrete type of kzg backend +// We directly include the serialzed struct to avoid conversion cost in guest +// To generate the bytes, run: +// +// cargo run --bin gen_kzg_settings +pub static KZG_SETTINGS: Lazy = Lazy::new(|| { + bincode::deserialize(KZG_SETTINGS_BIN) + .expect("failed to load trusted setup, please run `cargo run --bin gen_kzg_settings`") +}); + +pub const VERSIONED_HASH_VERSION_KZG: u8 = 0x01; + +pub type KzgGroup = [u8; 48]; +pub type KzgField = [u8; 32]; +pub type KzgCommitment = KzgGroup; + +#[derive(Debug, thiserror::Error)] +pub enum Eip4844Error { + #[error("Failed to deserialize blob to field elements")] + DeserializeBlob, + #[error("Failed to evaluate polynomial at hashed point: {0}")] + EvaluatePolynomial(String), + #[error("Failed to compute KZG proof")] + ComputeKzgProof(String), + #[error("Failed set commitment proof")] + KzgDataPoison(String), } -/// 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 reth_primitives::revm_primitives::kzg::parse_kzg_trusted_setup; - - use crate::primitives::kzg::KzgSettings; - - /// KZG trusted setup - pub static MAINNET_KZG_TRUSTED_SETUP: Lazy> = Lazy::new(|| { - Arc::new( - c_kzg::KzgSettings::load_trusted_setup( - &reth_primitives::revm_primitives::kzg::G1_POINTS.0, - &reth_primitives::revm_primitives::kzg::G2_POINTS.0, - ) - .expect("failed to load trusted setup"), +pub fn get_evaluation_point(blob: &[u8], versioned_hash: &B256) -> ZFr { + let blob_hash = Sha256::digest(blob); + let x = Sha256::digest([blob_hash.to_vec(), versioned_hash.to_vec()].concat()).into(); + hash_to_bls_field(&x) +} + +pub fn proof_of_equivalence( + blob: &[u8], + versioned_hash: &B256, +) -> Result<(KzgField, KzgField), Eip4844Error> { + let blob_fields = Blob::from_bytes(blob) + .and_then(|b| deserialize_blob_rust(&b)) + .map_err(|_| Eip4844Error::DeserializeBlob)?; + + let poly = blob_to_polynomial(&blob_fields).unwrap(); + let x = get_evaluation_point(blob, versioned_hash); + let y = evaluate_polynomial_in_evaluation_form(&poly, &x, &KZG_SETTINGS.clone()) + .map(|fr| fr.to_bytes()) + .map_err(|e| Eip4844Error::EvaluatePolynomial(e.to_string()))?; + + Ok((x.to_bytes(), y)) +} + +pub fn calc_kzg_proof(blob: &[u8], versioned_hash: &B256) -> Result { + calc_kzg_proof_with_point(blob, get_evaluation_point(blob, versioned_hash)) +} + +pub fn calc_kzg_proof_with_point(blob: &[u8], z: ZFr) -> Result { + let blob_fields = Blob::from_bytes(blob) + .and_then(|b| deserialize_blob_rust(&b)) + .map_err(|_| Eip4844Error::DeserializeBlob)?; + let (proof, _) = compute_kzg_proof_rust(&blob_fields, &z, &KZG_SETTINGS.clone()) + .map_err(Eip4844Error::ComputeKzgProof)?; + Ok(proof) +} + +pub fn calc_kzg_proof_commitment(blob: &[u8]) -> Result { + let blob_fields = Blob::from_bytes(blob) + .and_then(|b| deserialize_blob_rust(&b)) + .map_err(|_| Eip4844Error::DeserializeBlob)?; + Ok( + blob_to_kzg_commitment_rust(&blob_fields, &KZG_SETTINGS.clone()) + .map_err(Eip4844Error::ComputeKzgProof)? + .to_bytes(), + ) +} + +pub fn commitment_to_version_hash(commitment: &[u8; 48]) -> B256 { + let mut hash = Sha256::digest(commitment); + hash[0] = VERSIONED_HASH_VERSION_KZG; + B256::new(hash.into()) +} + +pub fn kzg_proof_to_bytes(proof: &ZG1) -> KzgGroup { + proof.to_bytes() +} + +#[cfg(test)] +mod test { + use super::*; + use kzg_traits::{ + eip_4844::{verify_kzg_proof_rust, BYTES_PER_FIELD_ELEMENT}, + G1, + }; + use reth_primitives::revm_primitives::kzg::{G1Points, G2Points, G1_POINTS, G2_POINTS}; + use reth_primitives::revm_primitives::Bytes; + + pub fn verify_kzg_proof_evm( + commitment: &KzgCommitment, + z: &ZFr, + y: &ZFr, + proof: &ZG1, + ) -> Result { + // The input is encoded as follows: + // | versioned_hash | z | y | commitment | proof | + // | 32 | 32 | 32 | 48 | 48 | + let version_hash = commitment_to_version_hash(&commitment); + let mut input = [0u8; 192]; + input[..32].copy_from_slice(&(*version_hash)); + input[32..64].copy_from_slice(&z.to_bytes()); + input[64..96].copy_from_slice(&y.to_bytes()); + input[96..144].copy_from_slice(commitment); + input[144..192].copy_from_slice(&kzg_proof_to_bytes(&proof)); + + Ok(reth_primitives::revm_precompile::kzg_point_evaluation::run( + &Bytes::copy_from_slice(&input), + u64::MAX, + &reth_primitives::revm_primitives::env::Env::default(), ) - }); - - /// 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) + .is_ok()) } - /// 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), + #[test] + fn test_kzg_settings_equivalence() { + let kzg_settings: KZGSettings = kzg_traits::eip_4844::load_trusted_setup_rust( + G1Points::as_ref(G1_POINTS).flatten(), + G2Points::as_ref(G2_POINTS).flatten(), + ) + .expect("failed to load trusted setup"); + assert_eq!(KZG_SETTINGS.clone().secret_g1, kzg_settings.secret_g1); + assert_eq!(KZG_SETTINGS.clone().secret_g2, kzg_settings.secret_g2); + } + + #[test] + fn test_blob_to_kzg_commitment() { + let blob = Blob::from_bytes(&[0u8; 131072]).unwrap(); + let commitment = blob_to_kzg_commitment_rust( + &deserialize_blob_rust(&blob).unwrap(), + &KZG_SETTINGS.clone(), + ) + .map(|c| c.to_bytes()) + .unwrap(); + assert_eq!( + commitment_to_version_hash(&commitment).to_string(), + "0x010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c444014" + ); } - #[cfg(test)] - mod tests { - use super::*; + #[test] + fn test_verify_kzg_proof() { + let kzg_settings = KZG_SETTINGS.clone(); + let data = (0u64..131072).map(|v| (v % 64) as u8).collect::>(); + let blob = Blob::from_bytes(&data).unwrap(); + let blob_fields = deserialize_blob_rust(&blob).unwrap(); + let commitment = calc_kzg_proof_commitment(&blob.bytes).unwrap(); + let poly = blob_to_polynomial(&blob_fields).unwrap(); + + // Random number hash to field + let x = hash_to_bls_field(&[5; BYTES_PER_FIELD_ELEMENT]); + let y = evaluate_polynomial_in_evaluation_form(&poly, &x, &kzg_settings).unwrap(); + let proof = calc_kzg_proof_with_point(&blob.bytes, x).unwrap(); + + assert!(verify_kzg_proof_rust( + &ZG1::from_bytes(&commitment).unwrap(), + &x, + &y, + &proof, + &kzg_settings, + ) + .unwrap()); + } + + #[test] + fn test_verify_kzg_proof_in_precompile() { + let data = (0u64..131072).map(|v| (v % 64) as u8).collect::>(); + let blob = Blob::from_bytes(&data).unwrap(); + let blob_fields = deserialize_blob_rust(&blob).unwrap(); + let commitment = calc_kzg_proof_commitment(&blob.bytes).unwrap(); + let poly = blob_to_polynomial(&blob_fields).unwrap(); + + // Random number hash to field + let x = hash_to_bls_field(&[5; BYTES_PER_FIELD_ELEMENT]); + let y = evaluate_polynomial_in_evaluation_form(&poly, &x, &KZG_SETTINGS.clone()).unwrap(); + let proof = calc_kzg_proof_with_point(&blob.bytes, x).unwrap(); + + // Verify a correct proof + assert!(verify_kzg_proof_evm(&commitment, &x, &y, &proof,).unwrap()); + + // Create a proof for a different point + { + let x = hash_to_bls_field(&[6; BYTES_PER_FIELD_ELEMENT]); + let proof = calc_kzg_proof_with_point(&blob.bytes, x).unwrap(); + assert!(!verify_kzg_proof_evm(&commitment, &x, &y, &proof,).unwrap()); + } - #[test] - fn ensure_load_kzg_settings() { - let _settings = Arc::clone(&MAINNET_KZG_TRUSTED_SETUP); + // Try to prove a different evaluated point + { + let y = y.add(&ZFr::one()); + assert!(!verify_kzg_proof_evm(&commitment, &x, &y, &proof,).unwrap()); } } } diff --git a/lib/src/primitives/mod.rs b/lib/src/primitives/mod.rs index 5f3718bbd..785fe1998 100644 --- a/lib/src/primitives/mod.rs +++ b/lib/src/primitives/mod.rs @@ -3,8 +3,6 @@ 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; diff --git a/lib/src/protocol_instance.rs b/lib/src/protocol_instance.rs index 0d919da0e..cd642be97 100644 --- a/lib/src/protocol_instance.rs +++ b/lib/src/protocol_instance.rs @@ -1,22 +1,20 @@ 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}; +use reth_primitives::{Header, U256}; #[cfg(not(feature = "std"))] use crate::no_std::*; use crate::{ consts::{SupportedChainSpecs, VerifierType}, - input::{BlockMetadata, EthDeposit, GuestInput, Transition}, - primitives::keccak::keccak, + input::{BlobProofType, BlockMetadata, EthDeposit, GuestInput, Transition}, + primitives::{ + eip4844::{self, commitment_to_version_hash}, + keccak::keccak, + }, }; use reth_evm_ethereum::taiko::ANCHOR_GAS_LIMIT; -const KZG_TRUST_SETUP_DATA: &[u8] = include_bytes!("../../kzg_settings_raw.bin"); - #[derive(Debug, Clone)] pub struct ProtocolInstance { pub transition: Transition, @@ -25,47 +23,39 @@ pub struct ProtocolInstance { pub sgx_instance: Address, // only used for SGX pub chain_id: u64, pub verifier_address: Address, + pub proof_of_equivalence: (U256, U256), } impl ProtocolInstance { pub fn new(input: &GuestInput, header: &Header, proof_type: VerifierType) -> Result { let blob_used = input.taiko.block_proposed.meta.blobUsed; + // If blob is used, tx_list_hash is the commitment to the blob + // and we need to verify the blob hash matches the blob data. + // If we need to compute the proof of equivalence this data will be set. + // Otherwise the proof_of_equivalence is 0 + let mut proof_of_equivalence = (U256::ZERO, U256::ZERO); let tx_list_hash = if blob_used { - if input.taiko.skip_verify_blob { - println!("kzg check disabled!"); - input.taiko.tx_blob_hash.unwrap() - } else { - println!("kzg check enabled!"); - let data_size = KZG_TRUST_SETUP_DATA.len(); - let aligned_data_size = (data_size + 3) / 4 * 4; - let layout = Layout::from_size_align(aligned_data_size, 4).unwrap(); - // Allocate aligned memory - let raw_ptr = unsafe { alloc(layout) }; - if raw_ptr.is_null() { - panic!("Failed to allocate memory with aligned pointer"); + let commitment = input + .taiko + .blob_commitment + .as_ref() + .expect("no blob commitment"); + let versioned_hash = + commitment_to_version_hash(&commitment.clone().try_into().unwrap()); + match get_blob_proof_type(proof_type, input.taiko.blob_proof_type.clone()) { + crate::input::BlobProofType::ProofOfEquivalence => { + let points = + eip4844::proof_of_equivalence(&input.taiko.tx_data, &versioned_hash)?; + proof_of_equivalence = + (U256::from_le_bytes(points.0), U256::from_le_bytes(points.1)); } - // Convert to a Vec (unsafe because we are managing raw memory) - let mut aligned_vec = - unsafe { Vec::from_raw_parts(raw_ptr, data_size, aligned_data_size) }; - // Copy data into aligned_vec - aligned_vec.copy_from_slice(KZG_TRUST_SETUP_DATA); - - let kzg_settings = KzgSettings::from_u8_slice(&mut aligned_vec); - let kzg_commit = KzgCommitment::blob_to_kzg_commitment( - &Blob::from_bytes(input.taiko.tx_data.as_slice()) - .expect("Fail to form blob from tx bytes"), - &kzg_settings, - ) - .expect("Fail to calculate KZG commitment"); - let versioned_hash = kzg_to_versioned_hash(&kzg_commit); - assert_eq!( - versioned_hash, - input.taiko.tx_blob_hash.unwrap(), - "Blob version hash not matching" - ); - drop(aligned_vec); - versioned_hash - } + crate::input::BlobProofType::ProofOfCommitment => { + ensure!( + commitment == &eip4844::calc_kzg_proof_commitment(&input.taiko.tx_data)? + ); + } + }; + versioned_hash } else { TxHash::from(keccak(input.taiko.tx_data.as_slice())) }; @@ -155,6 +145,7 @@ impl ProtocolInstance { prover: input.taiko.prover_data.prover, chain_id: input.chain_spec.chain_id, verifier_address, + proof_of_equivalence, }; // Sanity check @@ -192,6 +183,7 @@ impl ProtocolInstance { self.sgx_instance, self.prover, self.meta_hash(), + self.proof_of_equivalence, ) .abi_encode(); if self.sgx_instance != Address::default() { @@ -201,11 +193,17 @@ impl ProtocolInstance { } } -pub const VERSIONED_HASH_VERSION_KZG: u8 = 0x01; -pub fn kzg_to_versioned_hash(commitment: &KzgCommitment) -> B256 { - let mut res = Sha256::digest(commitment.as_slice()); - res[0] = VERSIONED_HASH_VERSION_KZG; - B256::new(res.into()) +// Make sure the verifier supports the blob proof type +fn get_blob_proof_type( + proof_type: VerifierType, + blob_proof_type_hint: BlobProofType, +) -> BlobProofType { + match proof_type { + VerifierType::None => blob_proof_type_hint, + VerifierType::SGX => BlobProofType::ProofOfCommitment, + VerifierType::SP1 => BlobProofType::ProofOfEquivalence, + VerifierType::RISC0 => BlobProofType::ProofOfEquivalence, + } } fn bytes_to_bytes32(input: &[u8]) -> [u8; 32] { @@ -248,6 +246,8 @@ mod tests { graffiti: b256!("0000000000000000000000000000000000000000000000000000000000000000"), }; let meta_hash = b256!("9608088f69e586867154a693565b4f3234f26f82d44ef43fb99fd774e7266024"); + let proof_of_equivalence = ([0u8; 32], [0u8; 32]); + let pi_hash = keccak::keccak( ( "VERIFY_PROOF", @@ -257,6 +257,7 @@ mod tests { address!("741E45D08C70c1C232802711bBFe1B7C0E1acc55"), address!("70997970C51812dc3A010C7d01b50e0d17dc79C8"), meta_hash, + proof_of_equivalence, ) .abi_encode() .iter() @@ -266,10 +267,11 @@ mod tests { ); assert_eq!( hex::encode(pi_hash), - "4a7ba84010036277836eaf99acbbc10dc5d8ee9063e2e3c5be5e8be39ceba8ae" + "dc1696a5289616fa5eaa9b6ce97d53765b79db948caedb6887f21a26e4c29511" ); } + // TODO: update proof_of_equivalence #[test] fn test_eip712_pi_hash() { let input = "10d008bd000000000000000000000000000000000000000000000000000000000000004900000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000340689c98d83627e8749504eb6effbc2b08408183f11211bbf8bd281727b16255e6b3f8ee61d80cd7d30cdde9aa49acac0b82264a6b0f992139398e95636e501fd80189249f72753bd6c715511cc61facdec4781d4ecb1d028dafdff4a0827d7d53302e31382e302d64657600000000000000000000000000000000000000000000569e75fc77c1a856f6daaf9e69d8a9566ca34aa47f9133711ce065a571af0cfd00000000000000000000000016700100000000000000000000000000000100010000000000000000000000000000000000000000000000000000000000000049000000000000000000000000000000000000000000000000000000000e4e1c000000000000000000000000000000000000000000000000000000000065f94010000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001fdbdc45da60168ddf29b246eb9e0a2e612a670f671c6d3aafdfdac21f86b4bca0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bcaf73b06ee94a454236314610c55e053df3af4402081df52c9ff2692349a6b497bc17a6706bc1cf4c363e800d2133d0d143363871d9c17b8fc5cf6d3cfd585bc80730a40cf8d8186241d45e19785c117956de919999d50e473aaa794b8fd4097000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000"; @@ -279,6 +281,8 @@ mod tests { let (meta, trans, _proof) = <(BlockMetadata, Transition, TierProof)>::abi_decode_params(&input, false).unwrap(); let meta_hash: B256 = keccak::keccak(meta.abi_encode()).into(); + let proof_of_equivalence = ([0u8; 32], [0u8; 32]); + let pi_hash = keccak::keccak( ( "VERIFY_PROOF", @@ -288,6 +292,7 @@ mod tests { address!("4F3F0D5B22338f1f991a1a9686C7171389C97Ff7"), address!("4F3F0D5B22338f1f991a1a9686C7171389C97Ff7"), meta_hash, + proof_of_equivalence, ) .abi_encode() .iter() @@ -297,7 +302,7 @@ mod tests { ); assert_eq!( hex::encode(pi_hash), - "e9a8ebed81fb2da780c79aef3739c64c485373250b6167719517157936a1501b" + "8b0e2833f7bae47f6886e5f172d90b12e330485bfe366d8ed4d53b2114d47e68" ); } } diff --git a/provers/risc0/driver/src/methods/risc0_guest.rs b/provers/risc0/driver/src/methods/risc0_guest.rs index 639c7760f..e0f43b74d 100644 --- a/provers/risc0/driver/src/methods/risc0_guest.rs +++ b/provers/risc0/driver/src/methods/risc0_guest.rs @@ -1,7 +1,7 @@ pub const RISC0_GUEST_ELF: &[u8] = include_bytes!("../../../guest/target/riscv32im-risc0-zkvm-elf/release/risc0-guest"); pub const RISC0_GUEST_ID: [u32; 8] = [ - 1444642754, 3434511061, 2910616417, 2829025913, 3284452016, 1678600137, 1001540409, 1336920303, + 1106284168, 2121988569, 4030233466, 422073515, 2026351144, 1404012643, 690639581, 3252900346, ]; pub const RISC0_GUEST_PATH: &str = r#"/home/ubuntu/raiko/provers/risc0/guest/target/riscv32im-risc0-zkvm-elf/release/risc0-guest"#; diff --git a/provers/risc0/guest/Cargo.lock b/provers/risc0/guest/Cargo.lock index c4445324e..d0eace428 100644 --- a/provers/risc0/guest/Cargo.lock +++ b/provers/risc0/guest/Cargo.lock @@ -2,6 +2,17 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addchain" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + [[package]] name = "adler" version = "1.0.2" @@ -43,9 +54,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +checksum = "1752d7d62e2665da650a36d84abbf239f812534475d51f072a49a533513b7cdd" dependencies = [ "alloy-rlp", "num_enum", @@ -55,9 +66,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a016bfa21193744d4c38b3f3ab845462284d129e5e23c7cc0fafca7e92d9db37" +checksum = "3f63a6c9eb45684a5468536bc55379a2af0f45ffa5d756e4e4964532737e1836" dependencies = [ "alloy-eips", "alloy-primitives", @@ -69,9 +80,9 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d6d8118b83b0489cfb7e6435106948add2b35217f4a5004ef895f613f60299" +checksum = "aa4b0fc6a572ef2eebda0a31a5e393d451abda703fec917c75d9615d8c978cf2" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -80,14 +91,14 @@ dependencies = [ "derive_more", "once_cell", "serde", - "sha2 0.10.8", + "sha2 0.10.6", ] [[package]] name = "alloy-genesis" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894f33a7822abb018db56b10ab90398e63273ce1b5a33282afd186c132d764a6" +checksum = "48450f9c6f0821c1eee00ed912942492ed4f11dd69532825833de23ecc7a2256" dependencies = [ "alloy-primitives", "alloy-serde", @@ -108,7 +119,7 @@ dependencies = [ "getrandom", "hex-literal", "itoa", - "k256 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "k256", "keccak-asm", "proptest", "rand", @@ -119,9 +130,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" +checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -130,9 +141,9 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" +checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" dependencies = [ "proc-macro2", "quote", @@ -141,9 +152,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f2fbe956a3e0f0975c798f488dc6be96b669544df3737e18f4a325b42f4c86" +checksum = "0dfa1dd3e0bc3a3d89744fba8d1511216e83257160da2cd028a18b7d9c026030" dependencies = [ "alloy-rpc-types-eth", "alloy-serde", @@ -151,9 +162,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083f443a83b9313373817236a8f4bea09cca862618e9177d822aee579640a5d6" +checksum = "13bd7aa9ff9e67f1ba7ee0dd8cebfc95831d1649b0e4eeefae940dc3681079fa" dependencies = [ "alloy-consensus", "alloy-eips", @@ -169,9 +180,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94da1c0c4e27cc344b05626fe22a89dc6b8b531b9475f3b7691dbf6913e4109" +checksum = "8913f9e825068d77c516188c221c44f78fd814fce8effe550a783295a2757d19" dependencies = [ "alloy-primitives", "serde", @@ -349,7 +360,7 @@ dependencies = [ "blake2", "derivative", "digest 0.10.7", - "sha2 0.10.8", + "sha2 0.10.6", ] [[package]] @@ -380,7 +391,7 @@ dependencies = [ "ark-serialize 0.3.0", "ark-std 0.3.0", "derivative", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.3.3", @@ -400,7 +411,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools 0.10.5", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.4.0", @@ -433,7 +444,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "quote", "syn 1.0.109", @@ -445,7 +456,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "proc-macro2", "quote", @@ -511,7 +522,7 @@ dependencies = [ "ark-serialize-derive", "ark-std 0.4.0", "digest 0.10.7", - "num-bigint", + "num-bigint 0.4.6", ] [[package]] @@ -596,6 +607,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.22.1" @@ -608,6 +625,15 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -663,14 +689,27 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bls12_381" +version = "0.8.0" +source = "git+https://github.com/brechtpd/rust-kzg.git?branch=sp1-patch#cbbfafdd1fa9ae4133e04d5edf6eaabf86acac3a" +dependencies = [ + "ff", + "group", + "pairing", + "rand_core", + "serde", + "subtle", +] + [[package]] name = "blst" version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" +source = "git+https://github.com/CeciliaZ030/blst.git?branch=v0.3.12-serialize#063b5206470c6ea4204d3f520a9d7c5490947fa8" dependencies = [ "cc", "glob", + "serde", "threadpool", "zeroize", ] @@ -737,9 +776,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.100" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" +checksum = "779e6b7d17797c0b42023d417228c02889300190e700cb074c3438d9c541d332" [[package]] name = "cfg-if" @@ -764,9 +803,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" dependencies = [ "clap_builder", "clap_derive", @@ -774,9 +813,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" dependencies = [ "anstream", "anstyle", @@ -786,9 +825,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ "heck", "proc-macro2", @@ -1092,9 +1131,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elf" @@ -1181,10 +1220,29 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ + "bitvec", + "byteorder", + "ff_derive", "rand_core", "subtle", ] +[[package]] +name = "ff_derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" +dependencies = [ + "addchain", + "cfg-if", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1520,19 +1578,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "k256" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "once_cell", - "sha2 0.10.8", -] - [[package]] name = "k256" version = "0.13.3" @@ -1542,7 +1587,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", - "sha2 0.10.8", + "sha2 0.10.6", "signature", ] @@ -1565,6 +1610,18 @@ dependencies = [ "sha3-asm", ] +[[package]] +name = "kzg" +version = "0.1.0" +source = "git+https://github.com/brechtpd/rust-kzg.git?branch=sp1-patch#cbbfafdd1fa9ae4133e04d5edf6eaabf86acac3a" +dependencies = [ + "bincode", + "blst", + "serde", + "sha2 0.10.6", + "siphasher", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -1618,9 +1675,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "matchers" @@ -1702,7 +1759,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-complex", "num-integer", "num-iter", @@ -1712,9 +1769,20 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -1772,7 +1840,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-integer", "num-traits", ] @@ -1842,6 +1910,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "pairing" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" +dependencies = [ + "group", +] + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -2038,11 +2115,12 @@ dependencies = [ "alloy-rpc-types", "alloy-sol-types", "anyhow", - "c-kzg", + "bincode", "cfg-if", "chrono", "flate2", "hex", + "kzg", "lazy_static", "libflate", "log", @@ -2052,9 +2130,10 @@ dependencies = [ "reth-evm-ethereum", "reth-primitives", "rlp", + "rust-kzg-zkcrypto", "serde", "serde_json", - "serde_with", + "serde_with 3.8.1", "sha2 0.10.8", "sha3", "thiserror", @@ -2169,7 +2248,7 @@ 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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-chains", "alloy-eips", @@ -2188,7 +2267,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2203,7 +2282,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "convert_case 0.6.0", "proc-macro2", @@ -2214,7 +2293,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "auto_impl", "reth-primitives", @@ -2224,7 +2303,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-chainspec", "reth-consensus", @@ -2234,7 +2313,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "bytes", "derive_more", @@ -2260,7 +2339,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "bytes", "derive_more", @@ -2279,7 +2358,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-chainspec", "reth-consensus", @@ -2291,7 +2370,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-chains", "alloy-primitives", @@ -2304,7 +2383,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "auto_impl", "futures-util", @@ -2321,13 +2400,14 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-eips", "alloy-sol-types", "anyhow", "lazy_static", "reth-chainspec", + "reth-consensus", "reth-ethereum-consensus", "reth-evm", "reth-execution-types", @@ -2340,7 +2420,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-eips", "alloy-primitives", @@ -2354,7 +2434,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-execution-errors", "reth-primitives", @@ -2365,7 +2445,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "serde_json", "thiserror", @@ -2374,7 +2454,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "metrics", "reth-metrics-derive", @@ -2383,7 +2463,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "once_cell", "proc-macro2", @@ -2395,7 +2475,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2417,6 +2497,7 @@ dependencies = [ "reth-static-file-types", "reth-trie-common", "revm", + "revm-precompile", "revm-primitives", "roaring", "secp256k1", @@ -2428,7 +2509,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2447,7 +2528,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "bytes", @@ -2461,7 +2542,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-eips", "alloy-rlp", @@ -2479,7 +2560,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "bytes", @@ -2492,7 +2573,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "derive_more", @@ -2503,7 +2584,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "auto_impl", "reth-chainspec", @@ -2520,7 +2601,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-fs-util", "reth-primitives", @@ -2530,7 +2611,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "clap", "eyre", @@ -2545,7 +2626,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-rlp", "auto_impl", @@ -2564,7 +2645,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-consensus", "alloy-genesis", @@ -2612,12 +2693,12 @@ dependencies = [ "aurora-engine-modexp", "blst", "c-kzg", - "k256 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "k256", "once_cell", "revm-primitives", "ripemd", "secp256k1", - "sha2 0.10.8", + "sha2 0.10.6", "substrate-bn", ] @@ -2722,7 +2803,7 @@ dependencies = [ "ark-groth16", "ark-serialize 0.4.2", "hex", - "num-bigint", + "num-bigint 0.4.6", "num-derive", "num-traits", "risc0-zkp", @@ -2733,12 +2814,12 @@ dependencies = [ name = "risc0-guest" version = "0.1.0" dependencies = [ - "crypto-bigint", "harness", "harness-core", - "k256 0.13.3 (git+https://github.com/risc0/RustCrypto-elliptic-curves?tag=k256/v0.13.3-risczero.0)", + "k256", "raiko-lib", "revm-precompile", + "revm-primitives", "risc0-zkvm", "sha2 0.10.6", ] @@ -2759,7 +2840,7 @@ dependencies = [ "risc0-core", "risc0-zkvm-platform", "serde", - "sha2 0.10.8", + "sha2 0.10.6", "tracing", ] @@ -2786,7 +2867,7 @@ dependencies = [ "rrs-lib", "semver 1.0.23", "serde", - "sha2 0.10.8", + "sha2 0.10.6", "tracing", ] @@ -2857,7 +2938,7 @@ dependencies = [ "ark-ff 0.4.2", "bytes", "fastrlp", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "parity-scale-codec", "primitive-types", @@ -2876,6 +2957,23 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rust-kzg-zkcrypto" +version = "0.1.0" +source = "git+https://github.com/brechtpd/rust-kzg.git?branch=sp1-patch#cbbfafdd1fa9ae4133e04d5edf6eaabf86acac3a" +dependencies = [ + "bls12_381", + "blst", + "byteorder", + "ff", + "hex", + "kzg", + "libc", + "serde", + "serde_with 2.3.3", + "subtle", +] + [[package]] name = "rustc-hash" version = "1.1.0" @@ -2960,7 +3058,8 @@ dependencies = [ [[package]] name = "secp256k1" version = "0.29.0" -source = "git+https://github.com/CeciliaZ030/rust-secp256k1?branch=sp1-patch#09fe6ec0c0f0de848da5e295022029f46e0389e3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" dependencies = [ "rand", "secp256k1-sys", @@ -2969,7 +3068,8 @@ dependencies = [ [[package]] name = "secp256k1-sys" version = "0.10.0" -source = "git+https://github.com/CeciliaZ030/rust-secp256k1?branch=sp1-patch#09fe6ec0c0f0de848da5e295022029f46e0389e3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1433bd67156263443f14d603720b082dd3121779323fce20cba2aa07b874bc1b" dependencies = [ "cc", ] @@ -3020,9 +3120,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "indexmap 2.2.6", "itoa", @@ -3030,13 +3130,29 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +dependencies = [ + "base64 0.13.1", + "chrono", + "hex", + "indexmap 1.9.3", + "serde", + "serde_json", + "serde_with_macros 2.3.3", + "time", +] + [[package]] name = "serde_with" version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", @@ -3044,10 +3160,22 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_with_macros", + "serde_with_macros 3.8.1", "time", ] +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "serde_with_macros" version = "3.8.1" @@ -3120,6 +3248,12 @@ dependencies = [ "rand_core", ] +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "slab" version = "0.4.9" @@ -3374,9 +3508,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] diff --git a/provers/risc0/guest/Cargo.toml b/provers/risc0/guest/Cargo.toml index d0b14bf6e..80853b59b 100644 --- a/provers/risc0/guest/Cargo.toml +++ b/provers/risc0/guest/Cargo.toml @@ -23,22 +23,23 @@ risc0-zkvm = { version = "0.21.0", default-features = false, features = [ 'std', "getrandom", ] } -revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko", default-features = false, features = [ - "std", - "c-kzg", - "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" } -crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.2-risczero.0" } harness-core = { path = "../../../harness/core" } harness = { path = "../../../harness/macro", features = ["risc0"] } +revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko", default-features = false } +revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko", default-features = false, features = [ + "taiko", + "std", + "c-kzg", +] } [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" } +revm-precompile = { 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 +blst = { git = "https://github.com/CeciliaZ030/blst.git", branch = "v0.3.12-serialize" } +crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.2-risczero.0" } +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" } \ No newline at end of file diff --git a/provers/sgx/guest/src/one_shot.rs b/provers/sgx/guest/src/one_shot.rs index 574a10a8b..ab4f78ded 100644 --- a/provers/sgx/guest/src/one_shot.rs +++ b/provers/sgx/guest/src/one_shot.rs @@ -127,7 +127,6 @@ pub async fn one_shot(global_opts: GlobalOpts, args: OneShotArgs) -> Result<()> let input: GuestInput = bincode::deserialize_from(std::io::stdin()).expect("unable to deserialize input"); - assert!(!input.taiko.skip_verify_blob); // Process the block let header = calculate_block_header(&input); diff --git a/provers/sgx/setup/Cargo.toml b/provers/sgx/setup/Cargo.toml index 16ab6883c..2f1a94af4 100644 --- a/provers/sgx/setup/Cargo.toml +++ b/provers/sgx/setup/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" sgx-prover = { path = "../prover", features = ["enable"] } # raiko -raiko-lib = { workspace = true, features = ["c-kzg"] } +raiko-lib = { workspace = true } # alloy alloy-rlp = { workspace = true } diff --git a/provers/sp1/guest/Cargo.lock b/provers/sp1/guest/Cargo.lock index 0d40bf563..49592c66b 100644 --- a/provers/sp1/guest/Cargo.lock +++ b/provers/sp1/guest/Cargo.lock @@ -2,6 +2,17 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addchain" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + [[package]] name = "adler" version = "1.0.2" @@ -43,9 +54,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +checksum = "1752d7d62e2665da650a36d84abbf239f812534475d51f072a49a533513b7cdd" dependencies = [ "alloy-rlp", "num_enum", @@ -55,54 +66,27 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#e589f8f2e856d83ec7cfa4d297d59f2e2f121857" -dependencies = [ - "alloy-eips 0.1.0", - "alloy-primitives", - "alloy-rlp", - "alloy-serde 0.1.0", - "c-kzg", - "serde", - "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "alloy-consensus" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a016bfa21193744d4c38b3f3ab845462284d129e5e23c7cc0fafca7e92d9db37" +checksum = "3f63a6c9eb45684a5468536bc55379a2af0f45ffa5d756e4e4964532737e1836" dependencies = [ - "alloy-eips 0.1.2", + "alloy-eips", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.2", + "alloy-serde", "c-kzg", "serde", ] [[package]] name = "alloy-eips" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#e589f8f2e856d83ec7cfa4d297d59f2e2f121857" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "alloy-serde 0.1.0", - "c-kzg", - "once_cell", - "serde", -] - -[[package]] -name = "alloy-eips" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d6d8118b83b0489cfb7e6435106948add2b35217f4a5004ef895f613f60299" +checksum = "aa4b0fc6a572ef2eebda0a31a5e393d451abda703fec917c75d9615d8c978cf2" dependencies = [ "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.2", + "alloy-serde", "c-kzg", "derive_more", "once_cell", @@ -112,12 +96,12 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894f33a7822abb018db56b10ab90398e63273ce1b5a33282afd186c132d764a6" +checksum = "48450f9c6f0821c1eee00ed912942492ed4f11dd69532825833de23ecc7a2256" dependencies = [ "alloy-primitives", - "alloy-serde 0.1.2", + "alloy-serde", "serde", ] @@ -146,9 +130,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" +checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -157,9 +141,9 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" +checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" dependencies = [ "proc-macro2", "quote", @@ -168,25 +152,25 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f2fbe956a3e0f0975c798f488dc6be96b669544df3737e18f4a325b42f4c86" +checksum = "0dfa1dd3e0bc3a3d89744fba8d1511216e83257160da2cd028a18b7d9c026030" dependencies = [ "alloy-rpc-types-eth", - "alloy-serde 0.1.2", + "alloy-serde", ] [[package]] name = "alloy-rpc-types-eth" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083f443a83b9313373817236a8f4bea09cca862618e9177d822aee579640a5d6" +checksum = "13bd7aa9ff9e67f1ba7ee0dd8cebfc95831d1649b0e4eeefae940dc3681079fa" dependencies = [ - "alloy-consensus 0.1.2", - "alloy-eips 0.1.2", + "alloy-consensus", + "alloy-eips", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.2", + "alloy-serde", "alloy-sol-types", "itertools 0.13.0", "serde", @@ -196,19 +180,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.1.0" -source = "git+https://github.com/ceciliaz030/alloy?branch=175_4e22b9e-cycle#e589f8f2e856d83ec7cfa4d297d59f2e2f121857" -dependencies = [ - "alloy-primitives", - "serde", - "serde_json", -] - -[[package]] -name = "alloy-serde" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94da1c0c4e27cc344b05626fe22a89dc6b8b531b9475f3b7691dbf6913e4109" +checksum = "8913f9e825068d77c516188c221c44f78fd814fce8effe550a783295a2757d19" dependencies = [ "alloy-primitives", "serde", @@ -371,7 +345,7 @@ dependencies = [ "ark-serialize 0.3.0", "ark-std 0.3.0", "derivative", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.3.3", @@ -391,7 +365,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools 0.10.5", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.4.0", @@ -424,7 +398,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "quote", "syn 1.0.109", @@ -436,7 +410,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "proc-macro2", "quote", @@ -461,7 +435,7 @@ checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ "ark-std 0.4.0", "digest 0.10.7", - "num-bigint", + "num-bigint 0.4.6", ] [[package]] @@ -523,6 +497,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.22.1" @@ -590,14 +570,27 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bls12_381" +version = "0.8.0" +source = "git+https://github.com/brechtpd/rust-kzg.git?branch=sp1-patch#cbbfafdd1fa9ae4133e04d5edf6eaabf86acac3a" +dependencies = [ + "ff", + "group", + "pairing", + "rand_core", + "serde", + "subtle", +] + [[package]] name = "blst" version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" +source = "git+https://github.com/CeciliaZ030/blst.git?branch=v0.3.12-serialize#063b5206470c6ea4204d3f520a9d7c5490947fa8" dependencies = [ "cc", "glob", + "serde", "threadpool", "zeroize", ] @@ -650,9 +643,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.100" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" +checksum = "779e6b7d17797c0b42023d417228c02889300190e700cb074c3438d9c541d332" [[package]] name = "cfg-if" @@ -677,9 +670,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" dependencies = [ "clap_builder", "clap_derive", @@ -687,9 +680,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" dependencies = [ "anstream", "anstyle", @@ -699,9 +692,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ "heck", "proc-macro2", @@ -999,9 +992,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -1084,10 +1077,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "bitvec", + "byteorder", + "ff_derive", "rand_core", "subtle", ] +[[package]] +name = "ff_derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" +dependencies = [ + "addchain", + "cfg-if", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1447,6 +1458,18 @@ dependencies = [ "sha3-asm", ] +[[package]] +name = "kzg" +version = "0.1.0" +source = "git+https://github.com/brechtpd/rust-kzg.git?branch=sp1-patch#cbbfafdd1fa9ae4133e04d5edf6eaabf86acac3a" +dependencies = [ + "bincode", + "blst", + "serde", + "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", + "siphasher", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -1500,9 +1523,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "matchers" @@ -1584,7 +1607,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-complex", "num-integer", "num-iter", @@ -1594,9 +1617,20 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -1643,7 +1677,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-integer", "num-traits", ] @@ -1713,6 +1747,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "pairing" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" +dependencies = [ + "group", +] + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -1901,19 +1944,20 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" name = "raiko-lib" version = "0.1.0" dependencies = [ - "alloy-consensus 0.1.2", - "alloy-eips 0.1.2", + "alloy-consensus", + "alloy-eips", "alloy-primitives", "alloy-rlp", "alloy-rlp-derive", "alloy-rpc-types", "alloy-sol-types", "anyhow", - "c-kzg", + "bincode", "cfg-if", "chrono", "flate2", "hex", + "kzg", "lazy_static", "libflate", "log", @@ -1923,9 +1967,10 @@ dependencies = [ "reth-evm-ethereum", "reth-primitives", "rlp", + "rust-kzg-zkcrypto", "serde", "serde_json", - "serde_with", + "serde_with 3.8.1", "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", "sha3", "thiserror", @@ -2049,10 +2094,10 @@ 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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-chains", - "alloy-eips 0.1.2", + "alloy-eips", "alloy-genesis", "alloy-primitives", "alloy-trie", @@ -2068,10 +2113,10 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ - "alloy-consensus 0.1.2", - "alloy-eips 0.1.2", + "alloy-consensus", + "alloy-eips", "alloy-genesis", "alloy-primitives", "bytes", @@ -2083,7 +2128,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "convert_case 0.6.0", "proc-macro2", @@ -2094,7 +2139,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "auto_impl", "reth-primitives", @@ -2104,7 +2149,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-chainspec", "reth-consensus", @@ -2114,7 +2159,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "bytes", "derive_more", @@ -2140,7 +2185,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "bytes", "derive_more", @@ -2159,7 +2204,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-chainspec", "reth-consensus", @@ -2171,7 +2216,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-chains", "alloy-primitives", @@ -2184,7 +2229,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "auto_impl", "futures-util", @@ -2201,13 +2246,14 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ - "alloy-eips 0.1.2", + "alloy-eips", "alloy-sol-types", "anyhow", "lazy_static", "reth-chainspec", + "reth-consensus", "reth-ethereum-consensus", "reth-evm", "reth-execution-types", @@ -2220,9 +2266,9 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ - "alloy-eips 0.1.2", + "alloy-eips", "alloy-primitives", "reth-consensus", "reth-prune-types", @@ -2234,7 +2280,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-execution-errors", "reth-primitives", @@ -2245,7 +2291,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "serde_json", "thiserror", @@ -2254,7 +2300,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "metrics", "reth-metrics-derive", @@ -2263,7 +2309,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "once_cell", "proc-macro2", @@ -2275,10 +2321,10 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ - "alloy-consensus 0.1.2", - "alloy-eips 0.1.2", + "alloy-consensus", + "alloy-eips", "alloy-genesis", "alloy-primitives", "alloy-rlp", @@ -2297,6 +2343,7 @@ dependencies = [ "reth-static-file-types", "reth-trie-common", "revm", + "revm-precompile", "revm-primitives", "roaring", "secp256k1", @@ -2308,10 +2355,10 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ - "alloy-consensus 0.1.2", - "alloy-eips 0.1.2", + "alloy-consensus", + "alloy-eips", "alloy-genesis", "alloy-primitives", "alloy-rlp", @@ -2327,7 +2374,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "bytes", @@ -2341,9 +2388,9 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ - "alloy-eips 0.1.2", + "alloy-eips", "alloy-rlp", "reth-chainspec", "reth-consensus-common", @@ -2359,7 +2406,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "bytes", @@ -2372,7 +2419,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-primitives", "derive_more", @@ -2383,7 +2430,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "auto_impl", "reth-chainspec", @@ -2400,7 +2447,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "reth-fs-util", "reth-primitives", @@ -2410,7 +2457,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "clap", "eyre", @@ -2425,7 +2472,7 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ "alloy-rlp", "auto_impl", @@ -2444,9 +2491,9 @@ dependencies = [ [[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" +source = "git+https://github.com/taikoxyz/taiko-reth.git?branch=v1.0.0-rc.2-taiko#c73555d1d94dcbb602370415291d1f4e577ce006" dependencies = [ - "alloy-consensus 0.1.2", + "alloy-consensus", "alloy-genesis", "alloy-primitives", "alloy-rlp", @@ -2585,7 +2632,7 @@ dependencies = [ "ark-ff 0.4.2", "bytes", "fastrlp", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "parity-scale-codec", "primitive-types", @@ -2604,6 +2651,23 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rust-kzg-zkcrypto" +version = "0.1.0" +source = "git+https://github.com/brechtpd/rust-kzg.git?branch=sp1-patch#cbbfafdd1fa9ae4133e04d5edf6eaabf86acac3a" +dependencies = [ + "bls12_381", + "blst", + "byteorder", + "ff", + "hex", + "kzg", + "libc", + "serde", + "serde_with 2.3.3", + "subtle", +] + [[package]] name = "rustc-hash" version = "1.1.0" @@ -2772,9 +2836,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "indexmap 2.2.6", "itoa", @@ -2782,13 +2846,29 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +dependencies = [ + "base64 0.13.1", + "chrono", + "hex", + "indexmap 1.9.3", + "serde", + "serde_json", + "serde_with_macros 2.3.3", + "time", +] + [[package]] name = "serde_with" version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", @@ -2796,10 +2876,22 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_with_macros", + "serde_with_macros 3.8.1", "time", ] +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "serde_with_macros" version = "3.8.1" @@ -2872,6 +2964,12 @@ dependencies = [ "rand_core", ] +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "slab" version = "0.4.9" @@ -2904,7 +3002,6 @@ dependencies = [ name = "sp1-guest" version = "0.1.0" dependencies = [ - "alloy-consensus 0.1.0", "harness", "harness-core", "raiko-lib", @@ -3186,9 +3283,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] diff --git a/provers/sp1/guest/Cargo.toml b/provers/sp1/guest/Cargo.toml index bd3797b9d..b2471175f 100644 --- a/provers/sp1/guest/Cargo.toml +++ b/provers/sp1/guest/Cargo.toml @@ -34,28 +34,25 @@ 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 = "v36-taiko", default-features = false, features = [ - "std", - "c-kzg", - "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" } harness = { path = "../../../harness/macro", features = ["sp1"]} substrate-bn = "0.6.0" -alloy-consensus = { git = "https://github.com/ceciliaz030/alloy", branch = "175_4e22b9e-cycle", optional = true, features = [ - "serde", +revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko", default-features = false, features = [ + "taiko", + "std", + "c-kzg", ] } [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" } -tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", branch = "patch-v2.0.2" } revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } +revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } c-kzg = { git = "https://github.com/brechtpd/c-kzg-4844", branch = "for-alpha7" } +blst = { git = "https://github.com/CeciliaZ030/blst.git", branch = "v0.3.12-serialize" } +ecdsa = { git = "https://github.com/taikoxyz/signatures.git", branch = "0.16.9" } +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] diff --git a/provers/sp1/guest/elf/sp1-guest b/provers/sp1/guest/elf/sp1-guest index 743203652..7aac97bb6 100755 Binary files a/provers/sp1/guest/elf/sp1-guest and b/provers/sp1/guest/elf/sp1-guest differ