diff --git a/Cargo.lock b/Cargo.lock index 4f2d56f7dd8..1bcf61c35ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,7 +140,48 @@ dependencies = [ [[package]] name = "alloy-consensus" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#4ecb7d86882ece8a9a7a5a892b71a3c198030731" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "c-kzg", + "serde", +] + +[[package]] +name = "alloy-consensus" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=cb95183#cb95183d477024b57b27336035d10403e8ba55b8" +dependencies = [ + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cb95183)", + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cb95183)", + "serde", + "sha2 0.10.8", +] + +[[package]] +name = "alloy-consensus" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "c-kzg", + "serde", + "sha2 0.10.8", + "thiserror", +] + +[[package]] +name = "alloy-consensus" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy#cc68b93605f4521c2b0bce1a7efaeff2046cf07c" dependencies = [ "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy)", "alloy-primitives", @@ -152,9 +193,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8425a283510106b1a6ad25dd4bb648ecde7da3fd2baeb9400a85ad62f51ec90b" +checksum = "efd2404399cb1b50572758e66e9b4bf088e5a3df9007be7126456c7e50af935f" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -165,7 +206,7 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.9", + "winnow 0.6.11", ] [[package]] @@ -189,7 +230,47 @@ dependencies = [ [[package]] name = "alloy-eips" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#4ecb7d86882ece8a9a7a5a892b71a3c198030731" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "c-kzg", + "once_cell", + "serde", + "sha2 0.10.8", +] + +[[package]] +name = "alloy-eips" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=cb95183#cb95183d477024b57b27336035d10403e8ba55b8" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cb95183)", + "c-kzg", + "serde", +] + +[[package]] +name = "alloy-eips" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "c-kzg", + "derive_more", + "once_cell", + "serde", +] + +[[package]] +name = "alloy-eips" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy#cc68b93605f4521c2b0bce1a7efaeff2046cf07c" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -214,7 +295,28 @@ dependencies = [ [[package]] name = "alloy-genesis" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#4ecb7d86882ece8a9a7a5a892b71a3c198030731" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-primitives", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-genesis" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-primitives", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "serde", +] + +[[package]] +name = "alloy-genesis" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy#cc68b93605f4521c2b0bce1a7efaeff2046cf07c" dependencies = [ "alloy-primitives", "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy)", @@ -224,9 +326,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30946aa6173020259055a44971f5cf40a7d76c931d209caeb51b333263df4f" +checksum = "7c3abf6446a292e19853aaca43590eeb48bf435dfd2c74200259e8f4872f6ce3" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -246,6 +348,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "alloy-json-rpc" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "alloy-json-rpc" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "alloy-network" version = "0.1.0" @@ -253,10 +378,28 @@ source = "git+https://github.com/alloy-rs/alloy?rev=5796024#57960245a0e17ec3ba6c dependencies = [ "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", - "alloy-json-rpc", + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "alloy-primitives", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", - "alloy-signer", + "alloy-signer 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "alloy-sol-types", + "async-trait", + "auto_impl", + "futures-utils-wasm", + "thiserror", +] + +[[package]] +name = "alloy-network" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-primitives", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-signer 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", "alloy-sol-types", "async-trait", "auto_impl", @@ -264,6 +407,22 @@ dependencies = [ "thiserror", ] +[[package]] +name = "alloy-network" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-primitives", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-signer 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "async-trait", + "futures-utils-wasm", + "thiserror", +] + [[package]] name = "alloy-node-bindings" version = "0.1.0" @@ -281,9 +440,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8aa973e647ec336810a9356af8aea787249c9d00b1525359f3db29a68d231b" +checksum = "5277af0cbcc483ee6ad2c1e818090b5928d27f04fd6580680f31c1cf8068bcc2" dependencies = [ "alloy-rlp", "arbitrary", @@ -314,14 +473,46 @@ dependencies = [ "alloy-chains", "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", - "alloy-json-rpc", - "alloy-network", + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "alloy-network 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "alloy-primitives", - "alloy-rpc-client", + "alloy-rpc-client 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", - "alloy-rpc-types-trace", - "alloy-transport", - "alloy-transport-http", + "alloy-rpc-types-trace 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "alloy-transport-http 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "async-stream", + "async-trait", + "auto_impl", + "dashmap", + "futures", + "futures-utils-wasm", + "lru", + "pin-project", + "reqwest 0.12.4", + "serde", + "serde_json", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "alloy-provider" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-chains", + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-network 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-primitives", + "alloy-rpc-client 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-rpc-types-trace 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-transport-http 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", "async-stream", "async-trait", "auto_impl", @@ -338,6 +529,32 @@ dependencies = [ "url", ] +[[package]] +name = "alloy-provider" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-network 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-primitives", + "alloy-rpc-client 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-rpc-types-trace 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-transport-http 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "async-stream", + "async-trait", + "auto_impl", + "dashmap", + "futures", + "lru", + "reqwest 0.12.4", + "serde_json", + "tokio", + "tracing", + "url", +] + [[package]] name = "alloy-rlp" version = "0.3.5" @@ -365,9 +582,49 @@ name = "alloy-rpc-client" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=5796024#57960245a0e17ec3ba6c0d996d47279ee674088a" dependencies = [ - "alloy-json-rpc", - "alloy-transport", - "alloy-transport-http", + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "alloy-transport-http 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "futures", + "pin-project", + "reqwest 0.12.4", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-rpc-client" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-transport-http 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "futures", + "pin-project", + "reqwest 0.12.4", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-rpc-client" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-transport-http 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", "futures", "pin-project", "reqwest 0.12.4", @@ -405,7 +662,43 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#4ecb7d86882ece8a9a7a5a892b71a3c198030731" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-sol-types", + "itertools 0.12.1", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-rpc-types" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-sol-types", + "itertools 0.12.1", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-rpc-types" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy#cc68b93605f4521c2b0bce1a7efaeff2046cf07c" dependencies = [ "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy)", "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy)", @@ -464,39 +757,119 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=5796024#57960245a0e17ec3ba6c0d996d47279ee674088a" +source = "git+https://github.com/alloy-rs/alloy?rev=5796024#57960245a0e17ec3ba6c0d996d47279ee674088a" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-rpc-types-trace" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-rpc-types-trace" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=5796024#57960245a0e17ec3ba6c0d996d47279ee674088a" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=cb95183#cb95183d477024b57b27336035d10403e8ba55b8" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy#cc68b93605f4521c2b0bce1a7efaeff2046cf07c" dependencies = [ "alloy-primitives", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", - "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "serde", "serde_json", ] [[package]] -name = "alloy-serde" +name = "alloy-signer" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=5796024#57960245a0e17ec3ba6c0d996d47279ee674088a" dependencies = [ "alloy-primitives", - "serde", - "serde_json", + "async-trait", + "auto_impl", + "elliptic-curve", + "k256", + "thiserror", ] [[package]] -name = "alloy-serde" +name = "alloy-signer" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#4ecb7d86882ece8a9a7a5a892b71a3c198030731" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" dependencies = [ "alloy-primitives", - "serde", - "serde_json", + "async-trait", + "auto_impl", + "elliptic-curve", + "k256", + "thiserror", ] [[package]] name = "alloy-signer" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=5796024#57960245a0e17ec3ba6c0d996d47279ee674088a" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" dependencies = [ "alloy-primitives", "async-trait", @@ -512,9 +885,9 @@ version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=5796024#57960245a0e17ec3ba6c0d996d47279ee674088a" dependencies = [ "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", - "alloy-network", + "alloy-network 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "alloy-primitives", - "alloy-signer", + "alloy-signer 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "async-trait", "coins-bip32", "coins-bip39", @@ -525,9 +898,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dbd17d67f3e89478c8a634416358e539e577899666c927bc3d2b1328ee9b6ca" +checksum = "30708a79919b082f2692423c8cc72fc250477e4a2ecb0d4a7244cd3cdb299965" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -539,14 +912,14 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6da95adcf4760bb4b108fefa51d50096c5e5fdd29ee72fed3e86ee414f2e34" +checksum = "1c7a679ac01774ab7e00a567a918d4231ae692c5c8cedaf4e16956c3116d7896" dependencies = [ "alloy-json-abi", "alloy-sol-macro-input", "const-hex", - "heck 0.4.1", + "heck 0.5.0", "indexmap 2.2.6", "proc-macro-error", "proc-macro2", @@ -558,9 +931,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32c8da04c1343871fb6ce5a489218f9c85323c8340a36e9106b5fc98d4dd59d5" +checksum = "356da0c2228aa6675a5faaa08a3e4061b967f924753983d72b9a18d9a3fad44e" dependencies = [ "alloy-json-abi", "const-hex", @@ -575,18 +948,18 @@ dependencies = [ [[package]] name = "alloy-sol-type-parser" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368cae4dc052cad1d8f72eb2ae0c38027116933eeb49213c200a9e9875f208d7" +checksum = "81fd4783b0a5840479013e9ce960d2eb7b3be381f722e0fe3d1f7c3bb6bd4ebd" dependencies = [ - "winnow 0.6.9", + "winnow 0.6.11", ] [[package]] name = "alloy-sol-types" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a64d2d2395c1ac636b62419a7b17ec39031d6b2367e66e9acbf566e6055e9c" +checksum = "6eb5e6234c0b62514992589fe1578f64d418dbc8ef5cd1ab2d7f2f568f599698" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -600,7 +973,43 @@ name = "alloy-transport" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=5796024#57960245a0e17ec3ba6c0d996d47279ee674088a" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "base64 0.22.1", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "url", + "wasm-bindgen-futures", +] + +[[package]] +name = "alloy-transport" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "base64 0.22.1", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "url", + "wasm-bindgen-futures", +] + +[[package]] +name = "alloy-transport" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", "base64 0.22.1", "futures-util", "futures-utils-wasm", @@ -618,8 +1027,22 @@ name = "alloy-transport-http" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=5796024#57960245a0e17ec3ba6c0d996d47279ee674088a" dependencies = [ - "alloy-json-rpc", - "alloy-transport", + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", + "reqwest 0.12.4", + "serde_json", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-transport-http" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bd39117#bd391179fb4ebf64fe13484e44f2e432baf9b6c2" +dependencies = [ + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", "reqwest 0.12.4", "serde_json", "tower", @@ -627,6 +1050,19 @@ dependencies = [ "url", ] +[[package]] +name = "alloy-transport-http" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d" +dependencies = [ + "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "reqwest 0.12.4", + "serde_json", + "tower", + "url", +] + [[package]] name = "alloy-trie" version = "0.4.1" @@ -700,9 +1136,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -2977,6 +3413,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -2989,7 +3440,7 @@ dependencies = [ [[package]] name = "foundry-blob-explorers" version = "0.1.0" -source = "git+https://github.com/foundry-rs/block-explorers#1b024125d8327595f67f18a60ac29c49056c3a6d" +source = "git+https://github.com/foundry-rs/block-explorers#d5fdf79cd62f378448907663fc4ba9d085393b35" dependencies = [ "alloy-chains", "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy)", @@ -3554,9 +4005,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", @@ -3603,7 +4054,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.29", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -3628,6 +4079,22 @@ dependencies = [ "tower-service", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.5" @@ -4154,7 +4621,7 @@ dependencies = [ "beef", "futures-timer", "futures-util", - "hyper 0.14.28", + "hyper 0.14.29", "jsonrpsee-types", "parking_lot 0.12.3", "pin-project", @@ -4176,7 +4643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ccf93fc4a0bfe05d851d37d7c32b7f370fe94336b52a2f0efc5f1981895c2e5" dependencies = [ "async-trait", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-rustls 0.24.2", "jsonrpsee-core", "jsonrpsee-types", @@ -4210,7 +4677,7 @@ checksum = "12d8b6a9674422a8572e0b0abb12feeb3f2aeda86528c80d0350c2bd0923ab41" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.29", "jsonrpsee-core", "jsonrpsee-types", "pin-project", @@ -4325,6 +4792,88 @@ dependencies = [ "sha3-asm", ] +[[package]] +name = "kona-derive" +version = "0.0.1" +source = "git+https://github.com/ethereum-optimism/kona?branch=main#8cf870276eacff4b4bc55b7e35cff0f2b1d11292" +dependencies = [ + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-primitives", + "alloy-provider 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-rlp", + "alloy-sol-types", + "alloy-transport-http 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "anyhow", + "async-trait", + "c-kzg", + "hashbrown 0.14.5", + "kona-primitives", + "lru", + "miniz_oxide", + "op-alloy-consensus", + "reqwest 0.12.4", + "revm-primitives 3.1.1", + "serde", + "sha2 0.10.8", + "spin 0.9.8", + "tracing", + "unsigned-varint 0.8.0", +] + +[[package]] +name = "kona-exex" +version = "0.0.0" +dependencies = [ + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-provider 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-rlp", + "alloy-rpc-client 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "alloy-transport-http 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=bd39117)", + "anyhow", + "async-trait", + "eyre", + "kona-derive", + "kona-primitives", + "reqwest 0.12.4", + "reth", + "reth-basic-payload-builder", + "reth-evm", + "reth-execution-errors", + "reth-exex", + "reth-node-api", + "reth-node-ethereum", + "reth-node-optimism", + "reth-payload-builder", + "reth-primitives", + "reth-provider", + "reth-revm", + "reth-rpc-types", + "reth-testing-utils", + "reth-tracing", + "reth-transaction-pool", + "secp256k1 0.28.2", + "serde_json", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "kona-primitives" +version = "0.0.1" +source = "git+https://github.com/ethereum-optimism/kona?branch=main#8cf870276eacff4b4bc55b7e35cff0f2b1d11292" +dependencies = [ + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=e3f2f07)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cb95183)", + "alloy-primitives", + "alloy-rlp", + "alloy-sol-types", + "anyhow", + "op-alloy-consensus", + "serde", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -4948,6 +5497,23 @@ dependencies = [ "unsigned-varint 0.7.2", ] +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "network" version = "0.0.0" @@ -5205,18 +5771,69 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +[[package]] +name = "op-alloy-consensus" +version = "0.1.0" +source = "git+https://github.com/clabby/op-alloy?branch=refcell/consensus-port#74ed6337b600a7f77fa10568be0f054042f70400" +dependencies = [ + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cb95183)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cb95183)", + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=cb95183)", + "serde", +] + [[package]] name = "opaque-debug" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-sys" +version = "0.9.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -5716,9 +6333,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.84" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -6070,7 +6687,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "ipnet", "js-sys", "log", @@ -6109,11 +6726,13 @@ dependencies = [ "http-body-util", "hyper 1.3.1", "hyper-rustls 0.26.0", + "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -6126,6 +6745,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper", "tokio", + "tokio-native-tls", "tokio-rustls 0.25.0", "tower-service", "url", @@ -6624,9 +7244,9 @@ name = "reth-e2e-test-utils" version = "0.2.0-beta.8" dependencies = [ "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", - "alloy-network", + "alloy-network 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", - "alloy-signer", + "alloy-signer 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "alloy-signer-wallet", "eyre", "futures-util", @@ -6775,7 +7395,7 @@ dependencies = [ "reth-primitives", "reth-rpc-types", "reth-rpc-types-compat", - "revm-primitives", + "revm-primitives 4.0.0", "serde", "serde_json", "sha2 0.10.8", @@ -6834,7 +7454,7 @@ dependencies = [ "reth-primitives", "reth-storage-errors", "revm", - "revm-primitives", + "revm-primitives 4.0.0", ] [[package]] @@ -6848,7 +7468,7 @@ dependencies = [ "reth-primitives", "reth-revm", "reth-testing-utils", - "revm-primitives", + "revm-primitives 4.0.0", "secp256k1 0.28.2", "serde_json", ] @@ -6865,7 +7485,7 @@ dependencies = [ "reth-provider", "reth-revm", "revm", - "revm-primitives", + "revm-primitives 4.0.0", "thiserror", "tracing", ] @@ -7023,7 +7643,7 @@ name = "reth-network" version = "0.2.0-beta.8" dependencies = [ "alloy-node-bindings", - "alloy-provider", + "alloy-provider 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "alloy-rlp", "aquamarine", "auto_impl", @@ -7212,7 +7832,7 @@ dependencies = [ "eyre", "futures", "humantime", - "hyper 0.14.28", + "hyper 0.14.29", "metrics", "metrics-exporter-prometheus", "metrics-process", @@ -7316,7 +7936,7 @@ dependencies = [ "async-trait", "clap", "eyre", - "hyper 0.14.28", + "hyper 0.14.29", "jsonrpsee", "parking_lot 0.12.3", "reqwest 0.12.4", @@ -7340,7 +7960,7 @@ dependencies = [ "reth-rpc-types-compat", "reth-tracing", "reth-transaction-pool", - "revm-primitives", + "revm-primitives 4.0.0", "serde", "serde_json", "thiserror", @@ -7449,7 +8069,7 @@ dependencies = [ "reth-network-types", "reth-static-file-types", "revm", - "revm-primitives", + "revm-primitives 4.0.0", "roaring", "secp256k1 0.28.2", "serde", @@ -7557,7 +8177,7 @@ dependencies = [ "futures", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "jsonrpsee", "jsonwebtoken 8.3.0", "metrics", @@ -7585,7 +8205,7 @@ dependencies = [ "reth-transaction-pool", "revm", "revm-inspectors", - "revm-primitives", + "revm-primitives 4.0.0", "schnellru", "secp256k1 0.28.2", "serde", @@ -7630,7 +8250,7 @@ dependencies = [ name = "reth-rpc-builder" version = "0.2.0-beta.8" dependencies = [ - "hyper 0.14.28", + "hyper 0.14.29", "jsonrpsee", "metrics", "pin-project", @@ -7705,7 +8325,7 @@ dependencies = [ "assert_matches", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "jsonrpsee", "pin-project", "tempfile", @@ -7730,7 +8350,7 @@ dependencies = [ "alloy-rpc-types-anvil", "alloy-rpc-types-beacon", "alloy-rpc-types-engine", - "alloy-rpc-types-trace", + "alloy-rpc-types-trace 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "arbitrary", "bytes", "jsonrpsee-types", @@ -8035,7 +8655,7 @@ source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=421f9e4#421f9e46 dependencies = [ "alloy-primitives", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", - "alloy-rpc-types-trace", + "alloy-rpc-types-trace 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=5796024)", "alloy-sol-types", "anstyle", "boa_engine", @@ -8051,7 +8671,7 @@ name = "revm-interpreter" version = "5.0.0" source = "git+https://github.com/bluealloy/revm?rev=a28a543#a28a5439b9cfb7494cbd670da10cbedcfe6c5854" dependencies = [ - "revm-primitives", + "revm-primitives 4.0.0", "serde", ] @@ -8066,13 +8686,34 @@ dependencies = [ "k256", "once_cell", "p256", - "revm-primitives", + "revm-primitives 4.0.0", "ripemd", "secp256k1 0.29.0", "sha2 0.10.8", "substrate-bn", ] +[[package]] +name = "revm-primitives" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbbc9640790cebcb731289afb7a7d96d16ad94afeb64b5d0b66443bd151e79d6" +dependencies = [ + "alloy-primitives", + "auto_impl", + "bitflags 2.5.0", + "bitvec", + "c-kzg", + "cfg-if", + "derive_more", + "dyn-clone", + "enumn", + "hashbrown 0.14.5", + "hex", + "once_cell", + "serde", +] + [[package]] name = "revm-primitives" version = "4.0.0" @@ -8211,9 +8852,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f308135fef9fc398342da5472ce7c484529df23743fb7c734e0f3d472971e62" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" dependencies = [ "alloy-rlp", "arbitrary", @@ -8236,9 +8877,9 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rusqlite" @@ -8986,6 +9627,9 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] [[package]] name = "spinning" @@ -9099,9 +9743,9 @@ dependencies = [ [[package]] name = "symbolic-common" -version = "12.8.0" +version = "12.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cccfffbc6bb3bb2d3a26cd2077f4d055f6808d266f9d4d158797a4c60510dfe" +checksum = "89d2aef0f60f62e38c472334148758afbd570ed78d20be622692e5ebfec3734f" dependencies = [ "debugid", "memmap2 0.9.4", @@ -9111,9 +9755,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.8.0" +version = "12.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a99812da4020a67e76c4eb41f08c87364c14170495ff780f30dd519c221a68" +checksum = "1719d1292eac816cdd3fdad12b22315624b7ce6a7bacb267a3a27fccfd286b48" dependencies = [ "cpp_demangle", "rustc-demangle", @@ -9144,9 +9788,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8db114c44cf843a8bacd37a146e37987a0b823a0e8bc4fdc610c9c72ab397a5" +checksum = "e6fe08d08d84f2c0a77f1e7c46518789d745c2e87a2721791ed7c3c9bc78df28" dependencies = [ "paste", "proc-macro2", @@ -9481,6 +10125,16 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.24.1" @@ -9531,14 +10185,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.13", + "toml_edit 0.22.14", ] [[package]] @@ -9563,15 +10217,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.9", + "winnow 0.6.11", ] [[package]] @@ -9922,9 +10576,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "universal-hash" @@ -10174,9 +10828,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" dependencies = [ "rustls-pki-types", ] @@ -10452,9 +11106,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" +checksum = "56c52728401e1dc672a56e81e593e912aa54c78f40246869f78359a2bf24d29d" dependencies = [ "memchr", ] diff --git a/examples/exex/kona/Cargo.toml b/examples/exex/kona/Cargo.toml new file mode 100644 index 00000000000..0b7c23a11cf --- /dev/null +++ b/examples/exex/kona/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "kona-exex" +version = "0.0.0" +publish = false +edition.workspace = true +license.workspace = true + +[dependencies] +# reth +reth.workspace = true +reth-exex.workspace = true +reth-node-api.workspace = true +reth-node-ethereum.workspace = true +reth-primitives.workspace = true +reth-execution-errors.workspace = true +reth-provider.workspace = true +reth-revm.workspace = true +reth-tracing.workspace = true +reth-transaction-pool.workspace = true +reth-basic-payload-builder.workspace = true +reth-evm.workspace = true +reth-payload-builder.workspace = true +reth-rpc-types.workspace = true +reth-node-optimism = { workspace = true, features = [ "optimism" ] } + +# workspace deps +tracing.workspace = true +async-trait.workspace = true +url.workspace = true +reqwest.workspace = true +eyre.workspace = true +tokio.workspace = true +serde_json.workspace = true + +# kona +anyhow = { version = "1.0.79", default-features = false } +kona-derive = { git = "https://github.com/ethereum-optimism/kona", branch = "main", features = ["online", "serde", "k256"] } +kona-primitives = { git = "https://github.com/ethereum-optimism/kona", branch = "main" } + +# alloy +alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" } +alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" } +alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" } +alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "e3f2f07", default-features = false, features = ["kzg"] } +# alloy-consensus = { workspace = true, features = ["kzg"] } +alloy-rlp.workspace = true + +[dev-dependencies] +reth-testing-utils.workspace = true +secp256k1.workspace = true diff --git a/examples/exex/kona/src/blobs.rs b/examples/exex/kona/src/blobs.rs new file mode 100644 index 00000000000..b2e004fea2a --- /dev/null +++ b/examples/exex/kona/src/blobs.rs @@ -0,0 +1,66 @@ +//! Blob Provider + +use anyhow::Result; +use std::boxed::Box; +use std::sync::{Arc, Mutex}; +use std::collections::HashMap; +use reth_primitives::alloy_primitives::{FixedBytes, B256}; +use kona_derive::types::{BlockInfo, Blob, BlobProviderError, IndexedBlobHash}; +use async_trait::async_trait; +use kona_derive::traits::BlobProvider; + +/// A blob provider that hold blobs in memory. +#[derive(Default, Debug, Clone)] +pub struct InMemoryBlobProvider { + /// Maps block hashes to blobs. + blocks_to_blob: HashMap>, +} + +impl InMemoryBlobProvider { + /// Creates a new [InMemoryBlobProvider]. + pub fn new() -> Self { + Self { blocks_to_blob: HashMap::new() } + } + + /// Inserts multiple blobs into the provider. + pub fn insert_blobs(&mut self, block_hash: B256, blobs: Vec) { + self.blocks_to_blob.entry(block_hash).or_default().extend(blobs); + } +} + +/// [BlobProvider] for the [kona_derive::DerivationPipeline]. +#[derive(Debug, Clone)] +pub struct ExExBlobProvider(Arc>); + +impl ExExBlobProvider { + /// Creates a new [ExExBlobProvider]. + pub fn new(inner: Arc>) -> Self { + Self(inner) + } +} + +#[async_trait] +impl BlobProvider for ExExBlobProvider { + /// Fetches blobs for a given block ref and the blob hashes. + async fn get_blobs( + &mut self, + block_ref: &BlockInfo, + blob_hashes: &[IndexedBlobHash], + ) -> Result, BlobProviderError> { + let err = |block_ref: &BlockInfo| BlobProviderError::Custom(anyhow::anyhow!("Blob not found for block ref: {:?}", block_ref)); + let locked = self.0.lock().map_err(|_| err(block_ref))?; + let blobs_for_block = locked.blocks_to_blob.get(&block_ref.hash).ok_or_else(|| err(block_ref))?; + let mut blobs = Vec::new(); + for _blob_hash in blob_hashes { + for blob in blobs_for_block { + // TODO: update kona-derive to use the alloy_eips Blob type + // if blob_hash.hash == blob.hash { + // blobs.push(*blob.clone()); + // break; + // } + blobs.push(FixedBytes(**blob)); + } + } + Ok(blobs) + } +} diff --git a/examples/exex/kona/src/execution.rs b/examples/exex/kona/src/execution.rs new file mode 100644 index 00000000000..f6b95504277 --- /dev/null +++ b/examples/exex/kona/src/execution.rs @@ -0,0 +1,60 @@ +//! Module for executing [kona_derive::types::L2ExecutionPayload]s against [reth_revm::Evm]. + +use std::sync::Arc; +use reth_evm::ConfigureEvm; +use reth_payload_builder::database::CachedReads; +use reth_basic_payload_builder::*; +use reth_node_optimism::{OptimismPayloadBuilderAttributes, OptimismPayloadBuilder}; +use reth_revm::InMemoryDB; +use reth_primitives::{Bytes, SealedBlockWithSenders, ChainSpec, B256}; +use reth_transaction_pool::TransactionPool; +use tracing::debug; +use kona_derive::types::L2AttributesWithParent; + +/// Executes an [L2ExecutionPayload] against the EVM. +pub async fn exec_payload( + db: &mut InMemoryDB, + attributes: L2AttributesWithParent, + pool: impl TransactionPool, + evm_config: impl ConfigureEvm, + chain_spec: Arc, +) -> eyre::Result { + let builder = OptimismPayloadBuilder::new(chain_spec, evm_config); + let blockchain_db = db; + let payload_config = PayloadConfig::new( + /* Best Payload */, + Bytes::default(), + OptimismPayloadBuilderAttributes::try_new( + /* Best Payload .hash() */, + reth_rpc_types::engine::OptimismPayloadAttributes::try_new( + payload_attributes: attributes, + transactions: None, + no_tx_pool: None, + gas_limit: None, + ), + )?, + chain + ); + let args = BuildArguments::new( + blockchain_db, + pool, + CachedReads::default(), + payload_config, + Cancelled::default(), + None, + ); + let hash: B256 = match builder.try_build(args)? { + BuildOutcome::Better { payload, .. } => { + let block = payload.block(); + debug!(target: "exex::kona", ?block, "Built new payload"); + + let senders = block.senders().expect("sender recovery failed"); + let block_with_senders = + SealedBlockWithSenders::new(block.clone(), senders).unwrap(); + + block_with_senders.hash_slow() + }, + _ => unreachable!("other outcomes are unreachable"), + }; + Ok(hash) +} diff --git a/examples/exex/kona/src/main.rs b/examples/exex/kona/src/main.rs new file mode 100644 index 00000000000..89370cf5a6e --- /dev/null +++ b/examples/exex/kona/src/main.rs @@ -0,0 +1,270 @@ +//! A minimal consensus client that derives L2 blocks using [kona-derive][1]. +//! +//! [1]: https://gituhb.com/ethereum-optimism/kona + +use std::sync::Arc; +use std::sync::Mutex; + +use reth_transaction_pool::TransactionPool; +use reth_provider::Chain; +use reth_revm::InMemoryDB; +use reth_node_ethereum::EthereumNode; +use reth_node_api::FullNodeComponents; +use reth_exex::{ExExContext, ExExEvent}; +use reth_tracing::tracing::{error, info}; +use reth_primitives::{Receipt, TxHash, B256, BlobTransactionSidecar, SealedBlockWithSenders}; + +use kona_derive::types::Blob; +use kona_derive::DerivationPipeline; +use kona_derive::sources::EthereumDataSource; +use kona_derive::stages::{L1Traversal, StatefulAttributesBuilder, L1Retrieval, FrameQueue, ChannelBank, ChannelReader, BatchQueue, AttributesQueue}; +use kona_primitives::{BlockInfo, L2BlockInfo, RollupConfig, SystemConfig}; + +mod execution; + +mod blobs; +use blobs::{ExExBlobProvider, InMemoryBlobProvider}; + +mod reset; +use reset::{TipState, ExExResetProvider}; + +mod providers; +use providers::{InMemoryChainProvider, InMemoryL2ChainProvider, ExExChainProvider, ExExL2ChainProvider}; + +/* Custom ExEx Kona Derivation Types */ +type ExExDerivationPipeline = DerivationPipeline; +type ExExAttributesBuilder = StatefulAttributesBuilder; +type ExExAttributesQueue = AttributesQueue; +type ExExBatchQueue = BatchQueue; +type ExExChannelReader = ChannelReader; +type ExExChannelBank = ChannelBank; +type ExExFrameQueue = FrameQueue; +type ExExL1Retrieval = L1Retrieval, ExExL1Traversal>; +type ExExL1Traversal = L1Traversal; + +const DEFAULT_ATTRIBUTE_CHANNEL_SIZE: usize = 100; + +fn main() -> eyre::Result<()> { + reth::cli::Cli::parse_args().run(|builder, _| async move { + let handle = builder + .node(EthereumNode::default()) + .install_exex("Kona", move |ctx| async { + Ok(Deriver::new(ctx).start()) + }) + .launch() + .await?; + handle.wait_for_node_exit().await + }) +} + +struct Deriver { + ctx: ExExContext, + db: InMemoryDB, + chain_provider: Arc>, + tip_state: Arc>, + l2_chain_provider: Arc>, + blob_provider: Arc>, +} + +impl Deriver { + fn new(ctx: ExExContext) -> Self { + Self { + ctx, + db: InMemoryDB::new(reth_revm::db::EmptyDB::default()), + chain_provider: Arc::new(Mutex::new(InMemoryChainProvider::new())), + tip_state: Arc::new(Mutex::new(TipState::new(BlockInfo::default(), SystemConfig::default()))), + l2_chain_provider: Arc::new(Mutex::new(InMemoryL2ChainProvider::new())), + blob_provider: Arc::new(Mutex::new(InMemoryBlobProvider::new())), + } + } + + async fn start(mut self) -> eyre::Result<()> { + // Build the kona derivation pipeline + info!("Kona ExEx Deriver starting"); + + // Create a channel for the derivation pipeline to send back prepared + // L2AttributesWithParent. + let (sender, mut receiver) = tokio::sync::mpsc::channel(DEFAULT_ATTRIBUTE_CHANNEL_SIZE); + + // Create a channel for the deriver to reset the pipeline. + let (reset_sender, mut reset_receiver) = tokio::sync::mpsc::channel(1); + + // Continuously attempt to step on the derivation pipeline. + let mut pipeline = self.new_pipeline(); + tokio::spawn(async move { + loop { + // Reset the pipeline if needed + if (reset_receiver.recv().await).is_some() { + pipeline.reset(); + } + // Step the pipeline. + if let Err(e) = pipeline.step().await { + error!("Error stepping derivation pipeline: {:?}", e); + } + // Try to pop an item off the prepared attributes. + if let Some(attributes) = pipeline.prepared.pop_front() { + if let Err(e) = sender.send(attributes).await { + error!("Error sending prepared attributes: {:?}", e); + } + } + } + }); + + // TODO: get rollup config from superchain-registry + configured chain id + // get genesis from rollup config + // derive ChainSpec from genesis + let chain_spec = Arc::new(reth_primitives::ChainSpec::default()); + + // Process all new chain state notifications + loop { + tokio::select! { + Some(attributes) = receiver.recv() => { + let block_hash = execution::exec_payload( + &mut self.db, + attributes, + self.ctx.pool().clone(), + self.ctx.evm_config().clone(), + Arc::clone(&chain_spec), + ).await?; + info!("Executed block with hash: {}", block_hash); + // TODO: fetch block from sequencer and verify block hash matches + } + Some(notification) = self.ctx.notifications.recv() => { + if let Some(reverted_chain) = notification.reverted_chain() { + reset_sender.send(()).await?; + self.revert(&reverted_chain)?; + } + + if let Some(committed_chain) = notification.committed_chain() { + self.commit(&committed_chain).await?; + self.ctx.events.send(ExExEvent::FinishedHeight(committed_chain.tip().number))?; + } + } + } + if receiver.is_closed() { break; } + } + + Ok(()) + } + + /// Creates a new derivation pipeline. + fn new_pipeline(&self) -> ExExDerivationPipeline { + // Place the cursor at the origin. + let cursor = L2BlockInfo::default(); + + // Create the base rollup config. + // TODO: get this from superchain-registry? + let rollup_config = Arc::new(RollupConfig::default()); + + // Create a stateful attributes provider. + let builder = StatefulAttributesBuilder::new( + Arc::clone(&rollup_config), + ExExL2ChainProvider::new(Arc::clone(&self.l2_chain_provider)), + ExExChainProvider::new(Arc::clone(&self.chain_provider)), + ); + + // Other Providers + let reset = ExExResetProvider::new(Arc::clone(&self.tip_state)); + let l2_chain_provider = ExExL2ChainProvider::new(Arc::clone(&self.l2_chain_provider)); + + // Build the ethereum data source + let chain_provider = ExExChainProvider::new(Arc::clone(&self.chain_provider)); + let blob_provider = ExExBlobProvider::new(Arc::clone(&self.blob_provider)); + let dap_source = EthereumDataSource::new(chain_provider, blob_provider, &rollup_config); + + // Instantiates and link all the stages. + let chain_provider = ExExChainProvider::new(Arc::clone(&self.chain_provider)); + let l1_traversal = L1Traversal::new(chain_provider, Arc::clone(&rollup_config)); + let l1_retrieval = L1Retrieval::new(l1_traversal, dap_source); + let frame_queue = FrameQueue::new(l1_retrieval); + let channel_bank = ChannelBank::new(Arc::clone(&rollup_config), frame_queue); + let channel_reader = ChannelReader::new(channel_bank, Arc::clone(&rollup_config)); + let batch_queue = BatchQueue::new(rollup_config.clone(), channel_reader, l2_chain_provider); + let queue = AttributesQueue::new(*rollup_config, batch_queue, builder); + + // Assemble and return the pipeline. + DerivationPipeline::new(queue, reset, cursor) + } + + /// Process a new chain commit. + /// + /// This function decodes all transactions to the rollup contract into events, executes the + /// corresponding actions and inserts the results into the database. + async fn commit(&mut self, chain: &Chain) -> eyre::Result<()> { + // Insert blocks and receipts into the provider for the derivation pipeline. + let mut blocks = chain.blocks_iter().cloned().collect::>(); + blocks.sort_by(|a, b| b.number.cmp(&a.number)); + let highest_block = blocks.first().cloned(); + let block_with_receipts: Vec<(&SealedBlockWithSenders, &Vec>)> = chain.blocks_and_receipts().collect(); + let receipts: Vec<(B256, Vec>)> = block_with_receipts.into_iter().map(|(block, receipts)| (block.hash(), receipts.clone().into_iter().map(to_consensus).collect())).collect(); + { + let mut locked_chain_provider = self.chain_provider.lock().map_err(|_| eyre::eyre!("Failed to lock chain provider"))?; + locked_chain_provider.insert_blocks(blocks); + locked_chain_provider.insert_receipts(receipts); + } + + // Fetch all blobs for all transactions. + let blocks = chain.blocks_iter().collect::>(); + for block in blocks { + let tx_hashes = block.transactions().map(|tx| tx.hash).collect::>(); + let blobs = self.ctx.pool().get_all_blobs(tx_hashes)?; + let blobs = blobs.into_iter().map(|b| b.1).collect::>(); + let mut locked_blob_provider = self.blob_provider.lock().map_err(|_| eyre::eyre!("Failed to lock blob provider"))?; + // Flatten blob sidecar blobs. + let blobs = blobs.into_iter().flat_map(|b| b.blobs).collect::>(); + locked_blob_provider.insert_blobs(block.hash(), blobs); + } + + // Update the reset provider with the latest origin. + self.update_tip_state(highest_block)?; + + Ok(()) + } + + /// Process a chain revert. + fn revert(&mut self, chain: &Chain) -> eyre::Result<()> { + // Get the highest block after the chain revert. + let mut blocks = chain.blocks_iter().collect::>(); + blocks.sort_by(|a, b| b.number.cmp(&a.number)); + let highest_block = blocks.first().cloned().cloned(); + let highest_block_number = highest_block.as_ref().map(|b| b.number).unwrap_or(0); + + // Prune the Chain Provider. + self.chain_provider.lock().map_err(|_| eyre::eyre!("Failed to lock chain provider"))?.prune( + highest_block_number + ); + + // Prune the L2 Chain Provider. + self.l2_chain_provider.lock().map_err(|_| eyre::eyre!("Failed to lock L2 chain provider"))?.prune( + highest_block_number + ); + + // Update the tip state. + self.update_tip_state(highest_block)?; + + Ok(()) + } + + fn update_tip_state(&mut self, highest_block: Option) -> eyre::Result<()> { + if let Some(origin) = highest_block.map(|b| BlockInfo { + hash: b.hash(), + number: b.number, + parent_hash: b.parent_hash, + timestamp: b.timestamp + }) { + let mut locked = self.tip_state.lock().map_err(|_| eyre::eyre!("Failed to lock tip state"))?; + locked.set_origin(origin); + } + Ok(()) + } +} + +fn to_consensus(receipt: Option) -> Option { + let receipt = receipt?; + Some(alloy_consensus::Receipt { + status: receipt.success, + cumulative_gas_used: receipt.cumulative_gas_used, + logs: receipt.logs, + }) +} + diff --git a/examples/exex/kona/src/providers.rs b/examples/exex/kona/src/providers.rs new file mode 100644 index 00000000000..2d1e645e798 --- /dev/null +++ b/examples/exex/kona/src/providers.rs @@ -0,0 +1,195 @@ +//! Provider adapters for kona. + +use anyhow::Result; +use std::boxed::Box; +use std::sync::{Arc, Mutex}; +use async_trait::async_trait; +use std::collections::HashMap; +use kona_derive::types::BlockInfo; +use kona_derive::traits::ChainProvider; +use kona_derive::traits::L2ChainProvider; +use reth::primitives::SealedBlockWithSenders; +use reth_primitives::alloy_primitives::B256; +use alloy_consensus::{Receipt, TxEnvelope, Header}; +use kona_primitives::{SystemConfig, L2BlockInfo, RollupConfig, L2ExecutionPayloadEnvelope}; + +/// Stores and serves locally-derived L2 Chain data in memory. +#[derive(Debug, Clone)] +pub struct InMemoryL2ChainProvider { + /// L2 Safe Blocks. + blocks_by_number: HashMap, + /// Payload Attributes by number. + payloads_by_number: HashMap, + /// Maps block numbers to a [SystemConfig] at that point in time. + configs_by_number: HashMap, +} + +impl InMemoryL2ChainProvider { + /// Instantiates a new [InMemoryL2ChainProvider]. + pub fn new() -> Self { + Self { + blocks_by_number: HashMap::new(), + payloads_by_number: HashMap::new(), + configs_by_number: HashMap::new(), + } + } + + /// Prunes all [L2BlockInfo] and [L2ExecutionPayloadEnvelope]s that + /// have L1 Origins greater than the given number. + /// Also prunes [SystemConfig]s that were set after the given number. + pub fn prune(&mut self, number: u64) { + // Get all l2 block numbers that have an l1 origin greater than the given number. + let block_numbers_to_prune: Vec = self.blocks_by_number.iter() + .filter(|(_, v)| v.l1_origin.number > number) + .map(|(k, _)| *k) + .collect(); + // Prune all l2 blocks with numbers in the block_numbers_to_prune list. + for number in block_numbers_to_prune { + self.blocks_by_number.remove(&number); + self.payloads_by_number.remove(&number); + self.configs_by_number.remove(&number); + } + } +} + +/// [L2ChainProvider] for the execution extension. +#[derive(Debug, Clone)] +pub struct ExExL2ChainProvider(Arc>); + +impl ExExL2ChainProvider { + /// Creates a new [ExExL2ChainProvider]. + pub fn new(inner: Arc>) -> Self { + Self(inner) + } +} + +#[async_trait] +impl L2ChainProvider for ExExL2ChainProvider { + /// Returns the L2 block info given a block number. + /// Errors if the block does not exist. + async fn l2_block_info_by_number(&mut self, number: u64) -> Result { + let err = |number: u64| anyhow::anyhow!("Failed to find L2 block info for block number {}", number); + let locked = self.0.lock().map_err(|_| err(number))?; + locked.blocks_by_number.get(&number).ok_or_else(|| err(number)).cloned() + } + + /// Returns an execution payload for a given number. + /// Errors if the execution payload does not exist. + async fn payload_by_number(&mut self, number: u64) -> Result { + let err = |number: u64| anyhow::anyhow!("Failed to find payload for block number {}", number); + let locked = self.0.lock().map_err(|_| err(number))?; + locked.payloads_by_number.get(&number).ok_or_else(|| err(number)).cloned() + } + + /// Returns the [SystemConfig] by L2 number. + async fn system_config_by_number(&mut self,number: u64, _: Arc) -> Result { + let err = |number: u64| anyhow::anyhow!("Failed to find system config for block number {}", number); + let locked = self.0.lock().map_err(|_| err(number))?; + locked.configs_by_number.get(&number).ok_or_else(|| err(number)).cloned() + } +} + +/// InMemoryChainProvider +/// +/// Implements the [ChainProvider] trait with in memory maps. +#[derive(Debug, Clone, PartialEq)] +pub struct InMemoryChainProvider { + /// Maps block numbers to their respective [SealedBlockWithSenders]. + pub blocks: HashMap, + /// Maps block hashes to their respective [Vec]. + pub receipts: HashMap>>, +} + +impl InMemoryChainProvider { + /// Creates a new [InMemoryChainProvider] with empty maps. + pub fn new() -> Self { + Self { + blocks: HashMap::new(), + receipts: HashMap::new(), + } + } + + /// Removes all blocks and receipts from the provider after the given block number. + pub fn prune(&mut self, number: u64) { + self.blocks.retain(|k, b| { + if *k <= number { return true; } + self.receipts.remove(&b.hash()); + false + }); + } + + /// Inserts a list of blocks into the provider. + pub fn insert_blocks(&mut self, blocks: Vec) { + for block in blocks { + self.blocks.insert(block.number, block); + } + } + + /// Inserts a list of receipts into the provider. + pub fn insert_receipts(&mut self, receipts: Vec<(B256, Vec>)>) { + for (hash, receipt) in receipts { + if self.receipts.contains_key(&hash) { + self.receipts.get_mut(&hash).expect( + "Receipts not found" + ).extend(receipt.clone()); + continue; + } + self.receipts.insert(hash, receipt.clone()); + } + } +} + +fn simplify_block(block: &SealedBlockWithSenders) -> BlockInfo { + BlockInfo { + hash: block.hash(), + number: block.number, + parent_hash: block.parent_hash, + timestamp: block.timestamp, + } +} + +/// [ChainProvider] for the execution extension. +#[derive(Debug, Clone)] +pub struct ExExChainProvider(Arc>); + +impl ExExChainProvider { + /// Creates a new [ExExL2ChainProvider]. + pub fn new(inner: Arc>) -> Self { + Self(inner) + } +} + +#[async_trait] +impl ChainProvider for ExExChainProvider { + async fn block_info_by_number(&mut self, number: u64) -> Result { + let err = |number: u64| anyhow::anyhow!("Failed to find block info for block number {}", number); + let locked = self.0.lock().map_err(|_| err(number))?; + locked.blocks.get(&number).map(simplify_block).ok_or_else(|| err(number)) + } + + async fn receipts_by_hash(&mut self, hash: B256) -> Result> { + let err = |hash: B256| anyhow::anyhow!("Failed to find receipts for block {}", hash); + let locked = self.0.lock().map_err(|_| err(hash))?; + let receipts = locked.receipts.get(&hash).ok_or_else(|| err(hash))?; + Ok(receipts.iter().flatten().cloned().collect::>()) + } + + /// `header_by_hash` is not used by the [L1Traversal][1] stage of the + /// derivation pipeline. + /// + /// [1]: kona_derive::stages::L1Traversal + async fn header_by_hash(&mut self, _: B256) -> Result
{ + unimplemented!() + } + + /// `block_info_and_transactions_by_hash` is unused for the [L1Traversal][1] + /// stage of the derivation pipeline. + /// + /// [1]: kona_derive::stages::L1Traversal + async fn block_info_and_transactions_by_hash( + &mut self, + _: B256, + ) -> Result<(BlockInfo, Vec)> { + unimplemented!() + } +} diff --git a/examples/exex/kona/src/reset.rs b/examples/exex/kona/src/reset.rs new file mode 100644 index 00000000000..f860259d662 --- /dev/null +++ b/examples/exex/kona/src/reset.rs @@ -0,0 +1,70 @@ +//! Reset Provider for Kona's Derivation Pipeline + +use std::sync::Mutex; +use std::sync::Arc; +use async_trait::async_trait; +use kona_derive::builder::ResetProvider; +use kona_primitives::{BlockInfo, SystemConfig}; + +/// TipState stores the tip information for the derivation pipeline. +#[derive(Debug, Clone, PartialEq)] +pub struct TipState { + /// The origin [BlockInfo]. + /// This is used downstream by [kona_derive] to reset the origin + /// of the [kona_derive::stages::BatchQueue] and l1 block list. + origin: BlockInfo, + /// The [SystemConfig] is used in two places. + /// + system_config: SystemConfig, +} + +impl TipState { + /// Creates a new [TipState]. + pub fn new(origin: BlockInfo, system_config: SystemConfig) -> Self { + Self { origin, system_config } + } + + /// Retrieves a copy of the [BlockInfo]. + pub fn origin(&self) -> BlockInfo { + self.origin + } + + /// Retrieves a copy of the [SystemConfig]. + pub fn system_config(&self) -> SystemConfig { + self.system_config + } + + /// Sets the block info. + pub fn set_origin(&mut self, new_bi: BlockInfo) { + self.origin = new_bi; + } + + // /// Sets the system config. + // pub fn set_system_config(&mut self, new_config: SystemConfig) { + // self.system_config = new_config; + // } +} + +/// The ExExResetProvider implements the [ResetProvider] trait. +#[derive(Debug, Clone)] +pub struct ExExResetProvider(Arc>); + +impl ExExResetProvider { + /// Creates a new [ExExResetProvider]. + pub fn new(ts: Arc>) -> Self { + Self(ts) + } +} + +#[async_trait] +impl ResetProvider for ExExResetProvider { + /// Returns the current [BlockInfo] for the pipeline to reset. + async fn block_info(&self) -> BlockInfo { + self.0.lock().map(|ts| ts.origin()).unwrap_or_default() + } + + /// Returns the current [SystemConfig] for the pipeline to reset. + async fn system_config(&self) -> SystemConfig { + self.0.lock().map(|ts| ts.system_config()).unwrap_or_default() + } +}