diff --git a/Cargo.lock b/Cargo.lock index ef3cc19fb051..896a480e14f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -117,12 +117,12 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c309895995eaa4bfcc345f5515a39c7df9447798645cc8bf462b6c5bf1dc96" +checksum = "7198a527b4c4762cb88d54bcaeb0428f4298b72552c9c8ec4af614b4a4990c59" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "alloy-serde", "arbitrary", @@ -132,12 +132,12 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413902aa18a97569e60f679c23f46a18db1656d87ab4d4e49d0e1e52042f66df" +checksum = "ba5b68572f5dfa99ede0a491d658c9842626c956b840d0b97d0bbc9637742504" dependencies = [ "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-sol-type-parser", "alloy-sol-types", "const-hex", @@ -148,43 +148,70 @@ dependencies = [ "winnow", ] +[[package]] +name = "alloy-eip2930" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" +dependencies = [ + "alloy-primitives 0.8.0", + "alloy-rlp", + "arbitrary", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "alloy-eip7702" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d319bb544ca6caeab58c39cea8921c55d924d4f68f2c60f24f914673f9a74a" +dependencies = [ + "alloy-primitives 0.8.0", + "alloy-rlp", + "arbitrary", + "k256", + "rand 0.8.5", + "serde", +] + [[package]] name = "alloy-eips" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" +checksum = "159eab0e4e15b88571f55673af37314f4b8f17630dc1b393c3d70f2128a1d494" dependencies = [ - "alloy-primitives", + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives 0.8.0", "alloy-rlp", "alloy-serde", "arbitrary", "c-kzg", - "derive_more 0.99.18", - "k256", + "derive_more 1.0.0", "once_cell", - "rand 0.8.5", "serde", "sha2 0.10.8", ] [[package]] name = "alloy-genesis" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79614dfe86144328da11098edcc7bc1a3f25ad8d3134a9eb9e857e06f0d9840d" +checksum = "210f4b358d724f85df8adaec753c583defb58169ad3cad3d48c80d1a25a6ff0e" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-serde", "serde", ] [[package]] name = "alloy-json-abi" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc05b04ac331a9f07e3a4036ef7926e49a8bf84a99a1ccfc7e2ab55a5fcbb372" +checksum = "299d2a937b6c60968df3dad2a988b0f0e03277b344639a4f7a31bd68e6285e59" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-sol-type-parser", "serde", "serde_json", @@ -192,11 +219,11 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e2865c4c3bb4cdad3f0d9ec1ab5c0c657ba69a375651bd35e32fb6c180ccc2" +checksum = "f7733446dd531f8eb877331fea02f6c40bdbb47444a17dc3464bf75319cc073a" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-sol-types", "serde", "serde_json", @@ -206,15 +233,15 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e701fc87ef9a3139154b0b4ccb935b565d27ffd9de020fe541bf2dec5ae4ede" +checksum = "b80851d1697fc4fa2827998e3ee010a3d1fc59c7d25e87070840169fcf465832" dependencies = [ "alloy-consensus", "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", @@ -227,23 +254,23 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec9d5a0f9170b10988b6774498a022845e13eda94318440d17709d50687f67f9" +checksum = "d76a2336889f3d0624b18213239d27f4f34eb476eb35bef22f6a8cc24e0c0078" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-serde", "serde", ] [[package]] name = "alloy-node-bindings" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16faebb9ea31a244fd6ce3288d47df4be96797d9c3c020144b8f2c31543a4512" +checksum = "2657dae91ae61ed6cdd4c58b7e09330de934eea4e14d2f54f72f2a6720b23437" dependencies = [ "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.0", "k256", "serde_json", "tempfile", @@ -257,6 +284,28 @@ name = "alloy-primitives" version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 0.99.18", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand 0.8.5", + "ruint", + "serde", + "tiny-keccak", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a767e59c86900dd7c3ce3ecef04f3ace5ac9631ee150beb8b7d22f7fa3bbb2d7" dependencies = [ "alloy-rlp", "arbitrary", @@ -265,14 +314,13 @@ dependencies = [ "const-hex", "derive_arbitrary", "derive_more 0.99.18", - "ethereum_ssz", "getrandom 0.2.15", "hex-literal", "itoa", "k256", "keccak-asm", "proptest", - "proptest-derive 0.4.0", + "proptest-derive", "rand 0.8.5", "ruint", "serde", @@ -281,9 +329,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9c0ab10b93de601a6396fc7ff2ea10d3b28c46f079338fa562107ebf9857c8" +checksum = "f2d2a195caa6707f5ce13905794865765afc6d9ea92c3a56e3a973c168d703bc" dependencies = [ "alloy-chains", "alloy-consensus", @@ -291,7 +339,7 @@ dependencies = [ "alloy-json-rpc", "alloy-network", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types-admin", @@ -303,7 +351,7 @@ dependencies = [ "async-stream", "async-trait", "auto_impl", - "dashmap 5.5.3", + "dashmap 6.0.1", "futures", "futures-utils-wasm", "lru", @@ -311,6 +359,7 @@ dependencies = [ "reqwest", "serde", "serde_json", + "thiserror", "tokio", "tracing", "url", @@ -318,12 +367,12 @@ dependencies = [ [[package]] name = "alloy-pubsub" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f5da2c55cbaf229bad3c5f8b00b5ab66c74ef093e5f3a753d874cfecf7d2281" +checksum = "b4c59e13200322138fe4279b4676b0d78c4f55502de127f5a448495d3ddfaa43" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-transport", "bimap", "futures", @@ -359,12 +408,12 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b38e3ffdb285df5d9f60cb988d336d9b8e3505acb78750c3bc60336a7af41d3" +checksum = "ed31cdba2b23d71c555505b06674f8e7459496abfd7f4875d268434ef5a99ee6" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -383,9 +432,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c31a3750b8f5a350d17354e46a52b0f2f19ec5f2006d816935af599dedc521" +checksum = "e2d758f65aa648491c6358335c578de45cd7de6fdf2877c3cef61f2c9bebea21" dependencies = [ "alloy-rpc-types-engine", "alloy-rpc-types-eth", @@ -396,35 +445,35 @@ dependencies = [ [[package]] name = "alloy-rpc-types-admin" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbfb8b2c2eea8acd5580c9804a1ee58038938b16efb24eec09c3005f65b0e4ad" +checksum = "7e41c33bbddaec71ca1bd7a4df38f95f408ef4fa3b3c29a7e9cc8d0e43be5fbe" dependencies = [ "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.0", "serde", "serde_json", ] [[package]] name = "alloy-rpc-types-anvil" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ab6509cd38b2e8c8da726e0f61c1e314a81df06a38d37ddec8bced3f8d25ed" +checksum = "fa5ee4ffe3e687a6372dd02e998f4f65e512ffdfe0d2c248db822649814c36cd" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-serde", "serde", ] [[package]] name = "alloy-rpc-types-beacon" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8a24bcff4f9691d7a4971b43e5da46aa7b4ce22ed7789796612dc1eed220983" +checksum = "3173bf0239a59d3616f4f4ab1682de25dd30b13fb8f52bf7ee7503729354f3c4" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rpc-types-engine", "serde", "serde_with", @@ -433,13 +482,13 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff63f51b2fb2f547df5218527fd0653afb1947bf7fead5b3ce58c75d170b30f7" +checksum = "24e800d959606fa19b36b31d7c24d68ef75b970c654b7aa581dce23de82db0a5" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "alloy-rpc-types-eth", "alloy-serde", @@ -452,14 +501,14 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81e18424d962d7700a882fe423714bd5b9dde74c7a7589d4255ea64068773aef" +checksum = "c0ba05d6ee4db0d89113294a614137940f79abfc2c40a9a3bee2995660358776" dependencies = [ "alloy-consensus", "alloy-eips", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "alloy-serde", "alloy-sol-types", @@ -473,12 +522,12 @@ dependencies = [ [[package]] name = "alloy-rpc-types-mev" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a0593a17b4b009598eb3e8380e298c53bd5581f3f37d85a38e6a34881c90ea1" +checksum = "9a0b28949d1077826684b5912fe9ab1c752a863af0419b1ba9abff19006d61b1" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-serde", "serde", "serde_json", @@ -486,11 +535,11 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a86eeb49ea0cc79f249faa1d35c20541bb1c317a59b5962cb07b1890355b0064" +checksum = "cd2af822ed58f2b6dd7cfccf88bf69f42c9a8cbf4663316227646a8a3e5a591f" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rpc-types-eth", "alloy-serde", "serde", @@ -500,11 +549,11 @@ dependencies = [ [[package]] name = "alloy-rpc-types-txpool" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2342fed8175642b15a37a51f8729b05b2469281fbeb816f0ccbb0087e2dd74a" +checksum = "1a8fbdf39e93a9b213df39541be51671e93e6e8b142c3602ddb4ff6219a1bc85" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rpc-types-eth", "alloy-serde", "serde", @@ -512,11 +561,11 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33feda6a53e6079895aed1d08dcb98a1377b000d80d16370fbbdb8155d547ef" +checksum = "bfd260ede54f0b53761fdd04133acc10ae70427f66a69aa9590529bbd066cd58" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "arbitrary", "serde", "serde_json", @@ -524,11 +573,11 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740a25b92e849ed7b0fa013951fe2f64be9af1ad5abe805037b44fb7770c5c47" +checksum = "7b5193ee6b370b89db154d7dc40c6a8e6ce11213865baaf2b418a9f2006be762" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "async-trait", "auto_impl", "elliptic-curve", @@ -538,13 +587,13 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0707d4f63e4356a110b30ef3add8732ab6d181dd7be4607bf79b8777105cee" +checksum = "bf6b19bbb231c7f941af07f363d4c74d356dfcdfcd7dfa85a41a504ae856a6d5" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-signer", "async-trait", "coins-bip32", @@ -556,9 +605,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" +checksum = "183bcfc0f3291d9c41a3774172ee582fb2ce6eb6569085471d8f225de7bb86fc" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -570,9 +619,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" +checksum = "71c4d842beb7a6686d04125603bc57614d5ed78bf95e4753274db3db4ba95214" dependencies = [ "alloy-sol-macro-input", "const-hex", @@ -588,9 +637,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" +checksum = "1306e8d3c9e6e6ecf7a39ffaf7291e73a5f655a2defd366ee92c2efebcdf7fee" dependencies = [ "const-hex", "dunce", @@ -603,9 +652,9 @@ dependencies = [ [[package]] name = "alloy-sol-type-parser" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" +checksum = "f4691da83dce9c9b4c775dd701c87759f173bd3021cbf2e60cde00c5fe6d7241" dependencies = [ "serde", "winnow", @@ -613,11 +662,12 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" +checksum = "577e262966e92112edbd15b1b2c0947cc434d6e8311df96d3329793fe8047da9" dependencies = [ - "alloy-primitives", + "alloy-json-abi", + "alloy-primitives 0.8.0", "alloy-sol-macro", "const-hex", "serde", @@ -625,9 +675,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0590afbdacf2f8cca49d025a2466f3b6584a016a8b28f532f29f8da1007bae" +checksum = "454220c714857cf68af87d788d1f0638ad8766268b94f6a49fed96cbc2ab382c" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -644,9 +694,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2437d145d80ea1aecde8574d2058cceb8b3c9cba05f6aea8e67907c660d46698" +checksum = "377f2353d7fea03a2dba6b9ffbb7d610402c040dd5700d1fae8b9ec2673eed9b" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -659,9 +709,9 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804494366e20468776db4e18f9eb5db7db0fe14f1271eb6dbf155d867233405c" +checksum = "8653c47dcc30326fb09a34140e8800fa21987fc52453de6cfcdd5c7b8b6e9886" dependencies = [ "alloy-json-rpc", "alloy-pubsub", @@ -678,9 +728,9 @@ dependencies = [ [[package]] name = "alloy-transport-ws" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af855163e7df008799941aa6dd324a43ef2bf264b08ba4b22d44aad6ced65300" +checksum = "26d43ba8e9a3a7fef626d5fd93cc87ff2d6d2c81acfb866f068b3dce31dda060" dependencies = [ "alloy-pubsub", "alloy-transport", @@ -696,19 +746,19 @@ dependencies = [ [[package]] name = "alloy-trie" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03704f265cbbb943b117ecb5055fd46e8f41e7dc8a58b1aed20bcd40ace38c15" +checksum = "cd491aade72a82d51db430379f48a44a1d388ff03711a2023f1faa302c5b675d" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "arbitrary", "derive_arbitrary", - "derive_more 0.99.18", + "derive_more 1.0.0", "hashbrown 0.14.5", "nybbles", "proptest", - "proptest-derive 0.4.0", + "proptest-derive", "serde", "smallvec", "tracing", @@ -1269,19 +1319,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bls12_381" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc6d6292be3a19e6379786dac800f551e5865a5bb51ebbe3064ab80433f403" -dependencies = [ - "ff", - "group", - "pairing", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "blst" version = "0.3.13" @@ -1735,9 +1772,9 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "coins-bip32" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c43ff7fd9ff522219058808a259e61423335767b1071d5b346de60d9219657" +checksum = "2073678591747aed4000dd468b97b14d7007f7936851d3f2f01846899f5ebf08" dependencies = [ "bs58", "coins-core", @@ -1751,9 +1788,9 @@ dependencies = [ [[package]] name = "coins-bip39" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4587c0b4064da887ed39a6522f577267d57e58bdd583178cd877d721b56a2e" +checksum = "74b169b26623ff17e9db37a539fe4f15342080df39f129ef7631df7683d6d9d4" dependencies = [ "bitvec", "coins-bip32", @@ -1767,9 +1804,9 @@ dependencies = [ [[package]] name = "coins-core" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3aeeec621f4daec552e9d28befd58020a78cfc364827d06a753e8bc13c6c4b" +checksum = "62b962ad8545e43a28e14e87377812ba9ae748dd4fd963f4c10e9fcc6d13475b" dependencies = [ "base64 0.21.7", "bech32", @@ -2665,44 +2702,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "ethbloom" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-rlp", - "impl-serde", - "tiny-keccak", -] - -[[package]] -name = "ethereum-types" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-rlp", - "impl-serde", - "primitive-types", - "uint", -] - -[[package]] -name = "ethereum_ssz" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" -dependencies = [ - "ethereum-types", - "itertools 0.10.5", - "smallvec", -] - [[package]] name = "event-listener" version = "2.5.3" @@ -3058,7 +3057,6 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "bitvec", "rand_core 0.6.4", "subtle", ] @@ -3087,7 +3085,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ - "arbitrary", "byteorder", "rand 0.8.5", "rustc-hex", @@ -3894,24 +3891,6 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "impl-rlp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" -dependencies = [ - "rlp", -] - -[[package]] -name = "impl-serde" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", -] - [[package]] name = "impl-trait-for-tuples" version = "0.2.2" @@ -4387,21 +4366,6 @@ version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" -[[package]] -name = "kzg-rs" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9920cd4460ce3cbca19c62f3bb9a9611562478a4dc9d2c556f4a7d049c5b6b" -dependencies = [ - "bls12_381", - "glob", - "hex", - "once_cell", - "serde", - "serde_derive", - "serde_yaml", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -4706,7 +4670,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e00cdd87dab765e7dac55c21eb680bfd10655b6c2530f6fe578acdfbb66c757c" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "async-sse", "bytes", "futures-util", @@ -5095,28 +5059,29 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "op-alloy-consensus" -version = "0.1.5" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e41c4537e76555df708c8372ec2c4254da9631eb129c2530f2baea00d645b422" +checksum = "54fbd540222e2ce1e89461441ac6afa939c81d6d800b64daa29256e516dd91c6" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "alloy-serde", - "derive_more 0.99.18", + "derive_more 1.0.0", "serde", ] [[package]] name = "op-alloy-network" -version = "0.1.5" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45aa09913f11e914fbd60535133d079529e726ad4605edd3d3047678d37b548" +checksum = "01cd89afee0c49d76496ed4f80c2f006145b61731aae4ee229f1756e179f9f93" dependencies = [ "alloy-consensus", + "alloy-eips", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rpc-types-eth", "op-alloy-consensus", "op-alloy-rpc-types", @@ -5124,12 +5089,12 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types" -version = "0.1.5" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48bf0c126082234c15b6051c1f06d2d666adf68e7de305a5352022f06a84be78" +checksum = "fcdf8c645f51571f84e9b8dcd1128efc79a9e65a57fcfdd28f1ecb940aed6686" dependencies = [ "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rpc-types-eth", "alloy-serde", "op-alloy-consensus", @@ -5137,6 +5102,18 @@ dependencies = [ "serde_json", ] +[[package]] +name = "op-alloy-rpc-types-engine" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39bfbf5b445266023e365613420b132c1788cf5b8518292b4b70563d7f012b87" +dependencies = [ + "alloy-primitives 0.8.0", + "alloy-rpc-types-engine", + "alloy-serde", + "serde", +] + [[package]] name = "opaque-debug" version = "0.3.1" @@ -5192,15 +5169,6 @@ dependencies = [ "winapi", ] -[[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" @@ -5589,8 +5557,6 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", - "impl-rlp", - "impl-serde", "uint", ] @@ -5692,17 +5658,6 @@ dependencies = [ "proptest", ] -[[package]] -name = "proptest-derive" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf16337405ca084e9c78985114633b6827711d22b9e6ef6c6c0d665eb3f0b6e" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proptest-derive" version = "0.5.0" @@ -6399,7 +6354,7 @@ dependencies = [ "alloy-chains", "alloy-eips", "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "alloy-trie", "auto_impl", @@ -6494,7 +6449,7 @@ name = "reth-cli-util" version = "1.0.5" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.0", "eyre", "libc", "rand 0.8.5", @@ -6510,7 +6465,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-trie", "arbitrary", "bytes", @@ -6705,7 +6660,7 @@ dependencies = [ name = "reth-discv4" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "assert_matches", "discv5", @@ -6731,7 +6686,7 @@ dependencies = [ name = "reth-discv5" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "derive_more 1.0.0", "discv5", @@ -6756,7 +6711,7 @@ name = "reth-dns-discovery" version = "1.0.5" dependencies = [ "alloy-chains", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "data-encoding", "enr", @@ -6854,7 +6809,7 @@ name = "reth-ecies" version = "1.0.5" dependencies = [ "aes", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "block-padding", "byteorder", @@ -7104,7 +7059,7 @@ name = "reth-ethereum-forks" version = "1.0.5" dependencies = [ "alloy-chains", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "arbitrary", "auto_impl", @@ -7112,7 +7067,7 @@ dependencies = [ "dyn-clone", "once_cell", "proptest", - "proptest-derive 0.5.0", + "proptest-derive", "rustc-hash 2.0.0", "serde", "thiserror-no-std", @@ -7140,7 +7095,7 @@ dependencies = [ name = "reth-etl" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "rayon", "reth-db-api", "tempfile", @@ -7209,7 +7164,7 @@ name = "reth-execution-errors" version = "1.0.5" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "derive_more 1.0.0", "nybbles", @@ -7224,7 +7179,7 @@ name = "reth-execution-types" version = "1.0.5" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.0", "reth-chainspec", "reth-execution-errors", "reth-primitives", @@ -7300,7 +7255,7 @@ dependencies = [ name = "reth-exex-types" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "reth-provider", "serde", ] @@ -7392,7 +7347,7 @@ dependencies = [ name = "reth-net-banlist" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", ] [[package]] @@ -7468,7 +7423,7 @@ dependencies = [ name = "reth-network-api" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rpc-types-admin", "auto_impl", "derive_more 1.0.0", @@ -7508,7 +7463,7 @@ dependencies = [ name = "reth-network-peers" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "enr", "rand 0.8.5", @@ -7687,7 +7642,7 @@ name = "reth-node-ethereum" version = "1.0.5" dependencies = [ "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.0", "eyre", "futures", "futures-util", @@ -7770,7 +7725,7 @@ name = "reth-node-optimism" version = "1.0.5" dependencies = [ "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.0", "async-trait", "clap", "eyre", @@ -7820,7 +7775,7 @@ version = "1.0.5" dependencies = [ "alloy-chains", "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.0", "derive_more 1.0.0", "once_cell", "op-alloy-rpc-types", @@ -7834,7 +7789,7 @@ dependencies = [ name = "reth-optimism-cli" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "clap", "eyre", @@ -7914,7 +7869,7 @@ version = "1.0.5" name = "reth-optimism-rpc" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "jsonrpsee-types", "op-alloy-network", "parking_lot 0.12.3", @@ -7995,9 +7950,10 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "alloy-rpc-types", + "alloy-serde", "arbitrary", "assert_matches", "bytes", @@ -8007,6 +7963,7 @@ dependencies = [ "k256", "modular-bitfield", "once_cell", + "op-alloy-rpc-types", "pprof", "proptest", "proptest-arbitrary-interop", @@ -8036,7 +7993,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "alloy-rpc-types-eth", "arbitrary", @@ -8102,7 +8059,7 @@ dependencies = [ name = "reth-prune" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "assert_matches", "itertools 0.13.0", "metrics", @@ -8131,7 +8088,7 @@ dependencies = [ name = "reth-prune-types" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "arbitrary", "assert_matches", "bytes", @@ -8170,7 +8127,7 @@ dependencies = [ "alloy-dyn-abi", "alloy-genesis", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "async-trait", "derive_more 1.0.0", @@ -8422,7 +8379,7 @@ dependencies = [ name = "reth-rpc-server-types" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "jsonrpsee-core", "jsonrpsee-types", "reth-errors", @@ -8437,7 +8394,7 @@ dependencies = [ name = "reth-rpc-types" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rpc-types", "alloy-rpc-types-admin", "alloy-rpc-types-anvil", @@ -8449,6 +8406,8 @@ dependencies = [ "alloy-serde", "arbitrary", "jsonrpsee-types", + "op-alloy-rpc-types", + "op-alloy-rpc-types-engine", "rand 0.8.5", ] @@ -8516,7 +8475,7 @@ dependencies = [ name = "reth-stages-api" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "aquamarine", "assert_matches", "auto_impl", @@ -8545,7 +8504,7 @@ dependencies = [ name = "reth-stages-types" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "arbitrary", "bytes", "modular-bitfield", @@ -8562,7 +8521,7 @@ dependencies = [ name = "reth-static-file" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "assert_matches", "parking_lot 0.12.3", "rayon", @@ -8585,7 +8544,7 @@ dependencies = [ name = "reth-static-file-types" version = "1.0.5" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "clap", "derive_more 1.0.0", "serde", @@ -8748,7 +8707,7 @@ version = "1.0.5" dependencies = [ "alloy-consensus", "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "alloy-trie", "arbitrary", @@ -8831,9 +8790,9 @@ dependencies = [ [[package]] name = "revm" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b2f635bbbf4002b1b5c0219f841ec1a317723883ed7662c0d138617539a6087" +checksum = "69eae90188e48c81588fe1987b4bd35cd90d69b3602cb0c3a9ab12b882f18d91" dependencies = [ "auto_impl", "cfg-if", @@ -8846,11 +8805,11 @@ dependencies = [ [[package]] name = "revm-inspectors" -version = "0.5.7" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec16f9b9d3cdaaf2f4b7ceaf004eb2c89df04e7ea29622584c0a6ec676bd0a83" +checksum = "48184032103bb23788e42e42c7c85207f5b0b8a248b09ea8f5233077f35ab56e" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rpc-types", "alloy-sol-types", "anstyle", @@ -8864,9 +8823,9 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "9.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ad04c7d87dc3421a5ccca76e56dbd0b29a358c03bb41fe9e80976e9d3f397d" +checksum = "a7bad33a4f862ed8e2dc8bb5e7935852990da74f6db986732ef4f47f9021b2e4" dependencies = [ "revm-primitives", "serde", @@ -8874,9 +8833,9 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "10.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3526a4ba5ec400e7bbe71affbc10fe2e67c1cd1fb782bab988873d09a102e271" +checksum = "24db0f8fb5bc636e18b4d36bdc4c402ea941be79cfbdb096469887b616959a46" dependencies = [ "aurora-engine-modexp", "blst", @@ -8894,24 +8853,21 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "8.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4093d98a26601f0a793871c5bc7928410592f76b1f03fc89fde77180c554643c" +checksum = "c13132ed599b17fa9057fcfc1d37d2954921958f3b96173fc4f4cf52803b32c3" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.0", "auto_impl", "bitflags 2.6.0", "bitvec", "c-kzg", "cfg-if", - "derive_more 0.99.18", "dyn-clone", "enumn", "hashbrown 0.14.5", "hex", - "kzg-rs", - "once_cell", "serde", ] @@ -9457,19 +9413,6 @@ dependencies = [ "syn 2.0.76", ] -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "serial_test" version = "3.1.1" @@ -9873,9 +9816,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" +checksum = "284c41c2919303438fcf8dede4036fd1e82d4fc0fbb2b279bd2a1442c909ca92" dependencies = [ "paste", "proc-macro2", @@ -10591,7 +10534,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ - "arbitrary", "byteorder", "crunchy", "hex", @@ -10673,12 +10615,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "unsigned-varint" version = "0.7.2" diff --git a/Cargo.toml b/Cargo.toml index 5adb8aa3ef76..9cfaaeb46093 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -395,59 +395,60 @@ reth-trie-db = { path = "crates/trie/db" } reth-trie-parallel = { path = "crates/trie/parallel" } # revm -revm = { version = "13.0.0", features = [ +revm = { version = "14.0.0", features = [ "std", "secp256k1", "blst", ], default-features = false } -revm-inspectors = "0.5" -revm-primitives = { version = "8.0.0", features = [ +revm-inspectors = "0.6" +revm-primitives = { version = "9.0.0", features = [ "std", ], default-features = false } # eth alloy-chains = "0.1.18" -alloy-dyn-abi = "0.7.2" -alloy-primitives = { version = "0.7.2", default-features = false } +alloy-dyn-abi = "0.8.0" +alloy-primitives = { version = "0.8.0", default-features = false } alloy-rlp = "0.3.4" -alloy-sol-types = "0.7.2" -alloy-trie = { version = "0.4", default-features = false } +alloy-sol-types = "0.8.0" +alloy-trie = { version = "0.5", default-features = false } -alloy-consensus = { version = "0.2.1", default-features = false } -alloy-eips = { version = "0.2.1", default-features = false } -alloy-genesis = { version = "0.2.1", default-features = false } -alloy-json-rpc = { version = "0.2.1", default-features = false } -alloy-network = { version = "0.2.1", default-features = false } -alloy-node-bindings = { version = "0.2.1", default-features = false } -alloy-provider = { version = "0.2.1", features = [ +alloy-consensus = { version = "0.3.0", default-features = false } +alloy-eips = { version = "0.3.0", default-features = false } +alloy-genesis = { version = "0.3.0", default-features = false } +alloy-json-rpc = { version = "0.3.0", default-features = false } +alloy-network = { version = "0.3.0", default-features = false } +alloy-node-bindings = { version = "0.3.0", default-features = false } +alloy-provider = { version = "0.3.0", features = [ "reqwest", ], default-features = false } -alloy-pubsub = { version = "0.2.1", default-features = false } -alloy-rpc-client = { version = "0.2.1", default-features = false } -alloy-rpc-types = { version = "0.2.1", features = [ +alloy-pubsub = { version = "0.3.0", default-features = false } +alloy-rpc-client = { version = "0.3.0", default-features = false } +alloy-rpc-types = { version = "0.3.0", features = [ "eth", ], default-features = false } -alloy-rpc-types-admin = { version = "0.2.1", default-features = false } -alloy-rpc-types-anvil = { version = "0.2.1", default-features = false } -alloy-rpc-types-beacon = { version = "0.2.1", default-features = false } -alloy-rpc-types-engine = { version = "0.2.1", default-features = false } -alloy-rpc-types-eth = { version = "0.2.1", default-features = false } -alloy-rpc-types-mev = { version = "0.2.1", default-features = false } -alloy-rpc-types-trace = { version = "0.2.1", default-features = false } -alloy-rpc-types-txpool = { version = "0.2.1", default-features = false } -alloy-serde = { version = "0.2.1", default-features = false } -alloy-signer = { version = "0.2.1", default-features = false } -alloy-signer-local = { version = "0.2.1", default-features = false } -alloy-transport = { version = "0.2.1" } -alloy-transport-http = { version = "0.2.1", features = [ +alloy-rpc-types-admin = { version = "0.3.0", default-features = false } +alloy-rpc-types-anvil = { version = "0.3.0", default-features = false } +alloy-rpc-types-beacon = { version = "0.3.0", default-features = false } +alloy-rpc-types-engine = { version = "0.3.0", default-features = false } +alloy-rpc-types-eth = { version = "0.3.0", default-features = false } +alloy-rpc-types-mev = { version = "0.3.0", default-features = false } +alloy-rpc-types-trace = { version = "0.3.0", default-features = false } +alloy-rpc-types-txpool = { version = "0.3.0", default-features = false } +alloy-serde = { version = "0.3.0", default-features = false } +alloy-signer = { version = "0.3.0", default-features = false } +alloy-signer-local = { version = "0.3.0", default-features = false } +alloy-transport = { version = "0.3.0" } +alloy-transport-http = { version = "0.3.0", features = [ "reqwest-rustls-tls", ], default-features = false } -alloy-transport-ipc = { version = "0.2.1", default-features = false } -alloy-transport-ws = { version = "0.2.1", default-features = false } +alloy-transport-ipc = { version = "0.3.0", default-features = false } +alloy-transport-ws = { version = "0.3.0", default-features = false } # op -op-alloy-rpc-types = "0.1" -op-alloy-network = "0.1" +op-alloy-rpc-types = "0.2" +op-alloy-rpc-types-engine = "0.2" +op-alloy-network = "0.2" # misc aquamarine = "0.5" diff --git a/bin/reth-bench/src/bench/context.rs b/bin/reth-bench/src/bench/context.rs index 7f45ee6adfe8..37c166b3e723 100644 --- a/bin/reth-bench/src/bench/context.rs +++ b/bin/reth-bench/src/bench/context.rs @@ -3,10 +3,7 @@ use crate::{authenticated_transport::AuthenticatedTransportConnect, bench_mode::BenchMode}; use alloy_eips::BlockNumberOrTag; -use alloy_provider::{ - network::{AnyNetwork, Ethereum}, - Provider, ProviderBuilder, RootProvider, -}; +use alloy_provider::{network::AnyNetwork, Provider, ProviderBuilder, RootProvider}; use alloy_rpc_client::ClientBuilder; use alloy_rpc_types_engine::JwtSecret; use alloy_transport::BoxTransport; @@ -24,7 +21,7 @@ pub(crate) struct BenchContext { /// The auth provider used for engine API queries. pub(crate) auth_provider: RootProvider, /// The block provider used for block queries. - pub(crate) block_provider: RootProvider, Ethereum>, + pub(crate) block_provider: RootProvider, AnyNetwork>, /// The benchmark mode, which defines whether the benchmark should run for a closed or open /// range of blocks. pub(crate) benchmark_mode: BenchMode, @@ -46,7 +43,8 @@ impl BenchContext { } // set up alloy client for blocks - let block_provider = ProviderBuilder::new().on_http(rpc_url.parse()?); + let block_provider = + ProviderBuilder::new().network::().on_http(rpc_url.parse()?); // If neither `--from` nor `--to` are provided, we will run the benchmark continuously, // starting at the latest block. @@ -95,17 +93,7 @@ impl BenchContext { } }; - let next_block = match first_block.header.number { - Some(number) => { - // fetch next block - number + 1 - } - None => { - // this should never happen - return Err(eyre::eyre!("First block number is None")); - } - }; - + let next_block = first_block.header.number + 1; Ok(Self { auth_provider, block_provider, benchmark_mode, next_block }) } } diff --git a/bin/reth-bench/src/bench/new_payload_fcu.rs b/bin/reth-bench/src/bench/new_payload_fcu.rs index f5729151e00d..908cf81b429a 100644 --- a/bin/reth-bench/src/bench/new_payload_fcu.rs +++ b/bin/reth-bench/src/bench/new_payload_fcu.rs @@ -45,17 +45,8 @@ impl Command { while benchmark_mode.contains(next_block) { let block_res = block_provider.get_block_by_number(next_block.into(), true).await; let block = block_res.unwrap().unwrap(); - let block = match block.header.hash { - Some(block_hash) => { - // we can reuse the hash in the response - Block::try_from(block).unwrap().seal(block_hash) - } - None => { - // we don't have the hash, so let's just hash it - Block::try_from(block).unwrap().seal_slow() - } - }; - + let block_hash = block.header.hash; + let block = Block::try_from(block.inner).unwrap().seal(block_hash); let head_block_hash = block.hash(); let safe_block_hash = block_provider .get_block_by_number(block.number.saturating_sub(32).into(), false); @@ -65,18 +56,9 @@ impl Command { let (safe, finalized) = tokio::join!(safe_block_hash, finalized_block_hash,); - let safe_block_hash = safe - .unwrap() - .expect("finalized block exists") - .header - .hash - .expect("finalized block has hash"); - let finalized_block_hash = finalized - .unwrap() - .expect("finalized block exists") - .header - .hash - .expect("finalized block has hash"); + let safe_block_hash = safe.unwrap().expect("finalized block exists").header.hash; + let finalized_block_hash = + finalized.unwrap().expect("finalized block exists").header.hash; next_block += 1; sender diff --git a/bin/reth-bench/src/bench/new_payload_only.rs b/bin/reth-bench/src/bench/new_payload_only.rs index fb5a09ce1f2a..83a5f8c95be8 100644 --- a/bin/reth-bench/src/bench/new_payload_only.rs +++ b/bin/reth-bench/src/bench/new_payload_only.rs @@ -45,16 +45,8 @@ impl Command { while benchmark_mode.contains(next_block) { let block_res = block_provider.get_block_by_number(next_block.into(), true).await; let block = block_res.unwrap().unwrap(); - let block = match block.header.hash { - Some(block_hash) => { - // we can reuse the hash in the response - Block::try_from(block).unwrap().seal(block_hash) - } - None => { - // we don't have the hash, so let's just hash it - Block::try_from(block).unwrap().seal_slow() - } - }; + let block_hash = block.header.hash; + let block = Block::try_from(block.inner).unwrap().seal(block_hash); next_block += 1; sender.send(block).await.unwrap(); diff --git a/bin/reth/src/commands/debug_cmd/build_block.rs b/bin/reth/src/commands/debug_cmd/build_block.rs index 0c3b66148657..098ac1e2722d 100644 --- a/bin/reth/src/commands/debug_cmd/build_block.rs +++ b/bin/reth/src/commands/debug_cmd/build_block.rs @@ -224,7 +224,7 @@ impl Command { #[cfg(feature = "optimism")] reth_node_optimism::OptimismPayloadBuilderAttributes::try_new( best_block.hash(), - reth_rpc_types::engine::OptimismPayloadAttributes { + reth_rpc_types::optimism::OptimismPayloadAttributes { payload_attributes: payload_attrs, transactions: None, no_tx_pool: None, diff --git a/crates/consensus/debug-client/src/client.rs b/crates/consensus/debug-client/src/client.rs index a6ffca6d8694..5e70e120b3f8 100644 --- a/crates/consensus/debug-client/src/client.rs +++ b/crates/consensus/debug-client/src/client.rs @@ -47,7 +47,7 @@ pub trait BlockProvider: Send + Sync + 'static { None => return Ok(B256::default()), }; let block = self.get_block(previous_block_number).await?; - block.header.hash.ok_or_else(|| eyre::eyre!("previous block does not have hash")) + Ok(block.header.hash) } } } @@ -198,13 +198,13 @@ pub fn block_to_execution_payload_v3(block: Block) -> ExecutionNewPayload { receipts_root: block.header.receipts_root, logs_bloom: block.header.logs_bloom, prev_randao: block.header.mix_hash.unwrap(), - block_number: block.header.number.unwrap(), + block_number: block.header.number, gas_limit: block.header.gas_limit.try_into().unwrap(), gas_used: block.header.gas_used.try_into().unwrap(), timestamp: block.header.timestamp, extra_data: block.header.extra_data.clone(), base_fee_per_gas: block.header.base_fee_per_gas.unwrap().try_into().unwrap(), - block_hash: block.header.hash.unwrap(), + block_hash: block.header.hash, transactions: transactions .into_iter() .map(|tx| { diff --git a/crates/consensus/debug-client/src/providers/etherscan.rs b/crates/consensus/debug-client/src/providers/etherscan.rs index f1401d2bc060..c6955a20dc64 100644 --- a/crates/consensus/debug-client/src/providers/etherscan.rs +++ b/crates/consensus/debug-client/src/providers/etherscan.rs @@ -63,7 +63,7 @@ impl BlockProvider for EtherscanBlockProvider { continue } }; - let block_number = block.header.number.unwrap(); + let block_number = block.header.number; if Some(block_number) == last_block_number { continue; } diff --git a/crates/consensus/debug-client/src/providers/rpc.rs b/crates/consensus/debug-client/src/providers/rpc.rs index aa203172e240..088ec965292b 100644 --- a/crates/consensus/debug-client/src/providers/rpc.rs +++ b/crates/consensus/debug-client/src/providers/rpc.rs @@ -33,7 +33,7 @@ impl BlockProvider for RpcBlockProvider { while let Some(block) = stream.next().await { let full_block = ws_provider - .get_block_by_hash(block.header.hash.unwrap(), BlockTransactionsKind::Full) + .get_block_by_hash(block.header.hash, BlockTransactionsKind::Full) .await .expect("failed to get block") .expect("block not found"); diff --git a/crates/e2e-test-utils/src/lib.rs b/crates/e2e-test-utils/src/lib.rs index 032acaccb09f..25fb77f01e73 100644 --- a/crates/e2e-test-utils/src/lib.rs +++ b/crates/e2e-test-utils/src/lib.rs @@ -59,7 +59,9 @@ where N::AddOns: NodeAddOns< Adapter, EthApi: FullEthApiServer< - NetworkTypes: Network, + NetworkTypes: Network< + TransactionResponse = reth_rpc_types::WithOtherFields, + >, > + AddDevSigners + EthApiBuilderProvider>, >, diff --git a/crates/e2e-test-utils/src/node.rs b/crates/e2e-test-utils/src/node.rs index 681a3bbd176a..0040801fa3fa 100644 --- a/crates/e2e-test-utils/src/node.rs +++ b/crates/e2e-test-utils/src/node.rs @@ -17,6 +17,7 @@ use reth::{ }; use reth_node_builder::{EthApiTypes, NodeAddOns, NodeTypes}; use reth_primitives::{BlockHash, BlockNumber, Bytes, B256}; +use reth_rpc_types::WithOtherFields; use reth_stages_types::StageId; use tokio_stream::StreamExt; @@ -94,7 +95,7 @@ where From<::BuiltPayload> + PayloadEnvelopeExt, AddOns::EthApi: EthApiSpec + EthTransactions + TraceExt, ::NetworkTypes: - Network, + Network>, { let mut chain = Vec::with_capacity(length as usize); for i in 0..length { diff --git a/crates/e2e-test-utils/src/rpc.rs b/crates/e2e-test-utils/src/rpc.rs index 4688e435a654..a7d548a931f0 100644 --- a/crates/e2e-test-utils/src/rpc.rs +++ b/crates/e2e-test-utils/src/rpc.rs @@ -9,6 +9,7 @@ use reth::{ }; use reth_node_builder::EthApiTypes; use reth_primitives::{Bytes, B256}; +use reth_rpc_types::WithOtherFields; #[allow(missing_debug_implementations)] pub struct RpcTestContext { @@ -19,8 +20,11 @@ impl RpcTestContext where Node: FullNodeComponents, EthApi: EthApiSpec - + EthTransactions> - + TraceExt, + + EthTransactions< + NetworkTypes: Network< + TransactionResponse = WithOtherFields, + >, + > + TraceExt, { /// Injects a raw transaction into the node tx pool via RPC server pub async fn inject_tx(&self, raw_tx: Bytes) -> Result { diff --git a/crates/e2e-test-utils/src/traits.rs b/crates/e2e-test-utils/src/traits.rs index 2d8b4789da39..7055a21fe133 100644 --- a/crates/e2e-test-utils/src/traits.rs +++ b/crates/e2e-test-utils/src/traits.rs @@ -1,5 +1,5 @@ use reth::rpc::types::{ - engine::{ExecutionPayloadEnvelopeV3, OptimismExecutionPayloadEnvelopeV3}, + engine::ExecutionPayloadEnvelopeV3, optimism::OptimismExecutionPayloadEnvelopeV3, ExecutionPayloadV3, }; diff --git a/crates/ethereum/evm/src/lib.rs b/crates/ethereum/evm/src/lib.rs index 6eda7ca4fc23..bead8ae3923c 100644 --- a/crates/ethereum/evm/src/lib.rs +++ b/crates/ethereum/evm/src/lib.rs @@ -203,9 +203,6 @@ mod tests { // Ensure that the logs database is empty assert!(evm.context.evm.inner.db.logs.is_empty()); - // Ensure that there are no valid authorizations in the EVM context - assert!(evm.context.evm.inner.valid_authorizations.is_empty()); - // No Optimism assert_eq!(evm.handler.cfg, HandlerCfg { spec_id: SpecId::LATEST, ..Default::default() }); } @@ -357,9 +354,6 @@ mod tests { // Ensure that the logs database is empty assert!(evm.context.evm.inner.db.logs.is_empty()); - // Ensure that there are no valid authorizations in the EVM context - assert!(evm.context.evm.inner.valid_authorizations.is_empty()); - // No Optimism assert_eq!(evm.handler.cfg, HandlerCfg { spec_id: SpecId::LATEST, ..Default::default() }); } diff --git a/crates/node/builder/src/builder/mod.rs b/crates/node/builder/src/builder/mod.rs index a4303023a776..156ee05ae03b 100644 --- a/crates/node/builder/src/builder/mod.rs +++ b/crates/node/builder/src/builder/mod.rs @@ -5,6 +5,7 @@ pub mod add_ons; mod states; +use reth_rpc_types::WithOtherFields; pub use states::*; use std::sync::Arc; @@ -330,7 +331,7 @@ where > + FullEthApiServer< NetworkTypes: alloy_network::Network< - TransactionResponse = reth_rpc_types::Transaction + TransactionResponse = WithOtherFields, >, > + AddDevSigners @@ -479,7 +480,9 @@ where NodeAdapter, CB::Components>, EthApi: EthApiBuilderProvider, CB::Components>> + FullEthApiServer< - NetworkTypes: alloy_network::Network, + NetworkTypes: alloy_network::Network< + TransactionResponse = WithOtherFields, + >, > + AddDevSigners, >, { diff --git a/crates/node/builder/src/launch/engine.rs b/crates/node/builder/src/launch/engine.rs index da77057e47c2..62cbd33189f7 100644 --- a/crates/node/builder/src/launch/engine.rs +++ b/crates/node/builder/src/launch/engine.rs @@ -27,7 +27,7 @@ use reth_node_core::{ use reth_node_events::{cl::ConsensusLayerHealthEvents, node}; use reth_provider::providers::BlockchainProvider2; use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi}; -use reth_rpc_types::engine::ClientVersionV1; +use reth_rpc_types::{engine::ClientVersionV1, WithOtherFields}; use reth_tasks::TaskExecutor; use reth_tokio_util::EventSender; use reth_tracing::tracing::{debug, error, info}; @@ -67,7 +67,9 @@ where NodeAdapter, EthApi: EthApiBuilderProvider> + FullEthApiServer< - NetworkTypes: alloy_network::Network, + NetworkTypes: alloy_network::Network< + TransactionResponse = WithOtherFields, + >, > + AddDevSigners, >, { diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index f56600fa5086..c579de92eb2b 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -32,7 +32,7 @@ use reth_node_events::{cl::ConsensusLayerHealthEvents, node}; use reth_primitives::format_ether; use reth_provider::providers::BlockchainProvider; use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi}; -use reth_rpc_types::engine::ClientVersionV1; +use reth_rpc_types::{engine::ClientVersionV1, WithOtherFields}; use reth_tasks::TaskExecutor; use reth_tracing::tracing::{debug, info}; use reth_transaction_pool::TransactionPool; @@ -111,7 +111,9 @@ where NodeAdapter, EthApi: EthApiBuilderProvider> + FullEthApiServer< - NetworkTypes: alloy_network::Network, + NetworkTypes: alloy_network::Network< + TransactionResponse = WithOtherFields, + >, > + AddDevSigners, >, { diff --git a/crates/node/builder/src/rpc.rs b/crates/node/builder/src/rpc.rs index 123eae88e727..141bca1f92bc 100644 --- a/crates/node/builder/src/rpc.rs +++ b/crates/node/builder/src/rpc.rs @@ -21,6 +21,7 @@ use reth_rpc_builder::{ RpcModuleBuilder, RpcRegistryInner, RpcServerHandle, TransportRpcModules, }; use reth_rpc_layer::JwtSecret; +use reth_rpc_types::WithOtherFields; use reth_tasks::TaskExecutor; use reth_tracing::tracing::{debug, info}; @@ -300,7 +301,9 @@ where Engine: EngineApiServer, EthApi: EthApiBuilderProvider + FullEthApiServer< - NetworkTypes: alloy_network::Network, + NetworkTypes: alloy_network::Network< + TransactionResponse = WithOtherFields, + >, >, { let auth_config = config.rpc.auth_server_config(jwt_secret)?; diff --git a/crates/optimism/evm/src/lib.rs b/crates/optimism/evm/src/lib.rs index b721a1d49250..f55616df269f 100644 --- a/crates/optimism/evm/src/lib.rs +++ b/crates/optimism/evm/src/lib.rs @@ -223,9 +223,6 @@ mod tests { // Ensure that the logs database is empty assert!(evm.context.evm.inner.db.logs.is_empty()); - // Ensure that there are no valid authorizations in the EVM context - assert!(evm.context.evm.inner.valid_authorizations.is_empty()); - // Optimism in handler assert_eq!(evm.handler.cfg, HandlerCfg { spec_id: SpecId::LATEST, is_optimism: true }); @@ -372,9 +369,6 @@ mod tests { // Ensure that the logs database is empty assert!(evm.context.evm.inner.db.logs.is_empty()); - // Ensure that there are no valid authorizations in the EVM context - assert!(evm.context.evm.inner.valid_authorizations.is_empty()); - // Default spec ID assert_eq!(evm.handler.spec_id(), SpecId::LATEST); diff --git a/crates/optimism/node/src/engine.rs b/crates/optimism/node/src/engine.rs index d0fc9b53ef1e..7f5c4a286148 100644 --- a/crates/optimism/node/src/engine.rs +++ b/crates/optimism/node/src/engine.rs @@ -9,9 +9,10 @@ use reth_node_api::{ }; use reth_optimism_payload_builder::{OptimismBuiltPayload, OptimismPayloadBuilderAttributes}; use reth_rpc_types::{ - engine::{ - ExecutionPayloadEnvelopeV2, OptimismExecutionPayloadEnvelopeV3, - OptimismExecutionPayloadEnvelopeV4, OptimismPayloadAttributes, + engine::ExecutionPayloadEnvelopeV2, + optimism::{ + OptimismExecutionPayloadEnvelopeV3, OptimismExecutionPayloadEnvelopeV4, + OptimismPayloadAttributes, }, ExecutionPayloadV1, }; diff --git a/crates/optimism/payload/src/payload.rs b/crates/optimism/payload/src/payload.rs index 82c33f8f9ff5..1746b66493ee 100644 --- a/crates/optimism/payload/src/payload.rs +++ b/crates/optimism/payload/src/payload.rs @@ -15,10 +15,10 @@ use reth_primitives::{ U256, }; /// Re-export for use in downstream arguments. -pub use reth_rpc_types::engine::OptimismPayloadAttributes; -use reth_rpc_types::engine::{ - ExecutionPayloadEnvelopeV2, ExecutionPayloadV1, OptimismExecutionPayloadEnvelopeV3, - OptimismExecutionPayloadEnvelopeV4, PayloadId, +pub use reth_rpc_types::optimism::OptimismPayloadAttributes; +use reth_rpc_types::{ + engine::{ExecutionPayloadEnvelopeV2, ExecutionPayloadV1, PayloadId}, + optimism::{OptimismExecutionPayloadEnvelopeV3, OptimismExecutionPayloadEnvelopeV4}, }; use reth_rpc_types_compat::engine::payload::{ block_to_payload_v1, block_to_payload_v3, block_to_payload_v4, diff --git a/crates/optimism/rpc/src/eth/call.rs b/crates/optimism/rpc/src/eth/call.rs index 5018ab129a53..fbcb403accba 100644 --- a/crates/optimism/rpc/src/eth/call.rs +++ b/crates/optimism/rpc/src/eth/call.rs @@ -60,7 +60,7 @@ where chain_id, blob_versioned_hashes, max_fee_per_blob_gas, - // authorization_list, + authorization_list, .. } = request; @@ -98,7 +98,7 @@ where // EIP-4844 fields blob_hashes: blob_versioned_hashes.unwrap_or_default(), max_fee_per_blob_gas, - authorization_list: Default::default(), + authorization_list: authorization_list.map(Into::into), optimism: OptimismFields { enveloped_tx: Some(Bytes::new()), ..Default::default() }, }; diff --git a/crates/optimism/rpc/src/eth/mod.rs b/crates/optimism/rpc/src/eth/mod.rs index 40abdfc83998..8d6690b07e4b 100644 --- a/crates/optimism/rpc/src/eth/mod.rs +++ b/crates/optimism/rpc/src/eth/mod.rs @@ -12,7 +12,7 @@ use std::{fmt, sync::Arc}; use crate::eth::rpc::SequencerClient; use alloy_primitives::U256; -use op_alloy_network::Optimism; +use op_alloy_network::AnyNetwork; use reth_chainspec::ChainSpec; use reth_evm::ConfigureEvm; use reth_network_api::NetworkInfo; @@ -107,7 +107,7 @@ where N: FullNodeComponents, { type Error = OpEthApiError; - type NetworkTypes = Optimism; + type NetworkTypes = AnyNetwork; } impl EthApiSpec for OpEthApi diff --git a/crates/optimism/rpc/src/eth/receipt.rs b/crates/optimism/rpc/src/eth/receipt.rs index c6314932be38..bc2eea7a29e6 100644 --- a/crates/optimism/rpc/src/eth/receipt.rs +++ b/crates/optimism/rpc/src/eth/receipt.rs @@ -7,7 +7,7 @@ use reth_rpc_eth_api::{ FromEthApiError, }; use reth_rpc_eth_types::{EthApiError, EthStateCache, ReceiptBuilder}; -use reth_rpc_types::{AnyTransactionReceipt, OptimismTransactionReceiptFields}; +use reth_rpc_types::{optimism::OptimismTransactionReceiptFields, AnyTransactionReceipt}; use crate::{OpEthApi, OpEthApiError, OptimismTxMeta}; diff --git a/crates/payload/primitives/src/traits.rs b/crates/payload/primitives/src/traits.rs index cbb990c46582..80ae38127e8a 100644 --- a/crates/payload/primitives/src/traits.rs +++ b/crates/payload/primitives/src/traits.rs @@ -5,7 +5,8 @@ use reth_primitives::{ Address, Header, SealedBlock, Withdrawals, B256, U256, }; use reth_rpc_types::{ - engine::{OptimismPayloadAttributes, PayloadAttributes as EthPayloadAttributes, PayloadId}, + engine::{PayloadAttributes as EthPayloadAttributes, PayloadId}, + optimism::OptimismPayloadAttributes, Withdrawal, }; diff --git a/crates/primitives-traits/src/account.rs b/crates/primitives-traits/src/account.rs index 99875ca3e613..b2834fcf28f7 100644 --- a/crates/primitives-traits/src/account.rs +++ b/crates/primitives-traits/src/account.rs @@ -66,9 +66,14 @@ impl Compact for Bytecode { where B: bytes::BufMut + AsMut<[u8]>, { - let bytecode = &self.0.bytecode()[..]; + let bytecode = match &self.0 { + RevmBytecode::LegacyRaw(bytes) => bytes, + RevmBytecode::LegacyAnalyzed(analyzed) => analyzed.bytecode(), + RevmBytecode::Eof(eof) => eof.raw(), + RevmBytecode::Eip7702(eip7702) => eip7702.raw(), + }; buf.put_u32(bytecode.len() as u32); - buf.put_slice(bytecode); + buf.put_slice(bytecode.as_ref()); let len = match &self.0 { RevmBytecode::LegacyRaw(_) => { buf.put_u8(0); @@ -82,10 +87,13 @@ impl Compact for Bytecode { buf.put_slice(map); 1 + 8 + map.len() } - RevmBytecode::Eof(eof) => { + RevmBytecode::Eof(_) => { buf.put_u8(3); - buf.put_slice(eof.raw().as_ref()); - 1 + eof.raw().as_ref().len() + 1 + } + RevmBytecode::Eip7702(_) => { + buf.put_u8(4); + 1 } }; len + bytecode.len() + 4 @@ -109,8 +117,8 @@ impl Compact for Bytecode { JumpTable::from_slice(buf), ) }), - 3 => { - // EOF bytecode object will be decoded from the raw bytecode + 3 | 4 => { + // EOF and EIP-7702 bytecode objects will be decoded from the raw bytecode Self(RevmBytecode::new_raw(bytes)) } _ => unreachable!("Junk data in database: unknown Bytecode variant"), diff --git a/crates/primitives-traits/src/alloy_compat.rs b/crates/primitives-traits/src/alloy_compat.rs index 41f24f2c1fa0..9a92dd52011d 100644 --- a/crates/primitives-traits/src/alloy_compat.rs +++ b/crates/primitives-traits/src/alloy_compat.rs @@ -32,7 +32,7 @@ impl TryFrom for Header { logs_bloom: header.logs_bloom, mix_hash: header.mix_hash.unwrap_or_default(), nonce: u64::from_be_bytes(header.nonce.unwrap_or_default().0), - number: header.number.ok_or(ConversionError::MissingBlockNumber)?, + number: header.number, ommers_hash: header.uncles_hash, parent_beacon_block_root: header.parent_beacon_block_root, parent_hash: header.parent_hash, diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 2c50ad77f196..2da37359c023 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -26,10 +26,14 @@ reth-optimism-chainspec = { workspace = true, optional = true } alloy-primitives = { workspace = true, features = ["rand", "rlp"] } alloy-rlp = { workspace = true, features = ["arrayvec"] } alloy-rpc-types = { workspace = true, optional = true } +alloy-serde = { workspace = true, optional = true } alloy-genesis.workspace = true alloy-eips = { workspace = true, features = ["serde"] } alloy-consensus.workspace = true +# optimism +op-alloy-rpc-types = { workspace = true, optional = true } + # crypto secp256k1 = { workspace = true, features = [ "global-context", @@ -103,7 +107,7 @@ optimism = [ "revm-primitives/optimism", "dep:reth-optimism-chainspec", ] -alloy-compat = ["reth-primitives-traits/alloy-compat", "dep:alloy-rpc-types"] +alloy-compat = ["reth-primitives-traits/alloy-compat", "dep:alloy-rpc-types", "dep:alloy-serde", "dep:op-alloy-rpc-types"] test-utils = ["reth-primitives-traits/test-utils"] [[bench]] diff --git a/crates/primitives/src/alloy_compat.rs b/crates/primitives/src/alloy_compat.rs index be537ea8a46a..ee5843b1e849 100644 --- a/crates/primitives/src/alloy_compat.rs +++ b/crates/primitives/src/alloy_compat.rs @@ -7,37 +7,27 @@ use crate::{ }; use alloy_primitives::TxKind; use alloy_rlp::Error as RlpError; +use alloy_serde::WithOtherFields; +use op_alloy_rpc_types as _; #[cfg(not(feature = "std"))] use alloc::{string::ToString, vec::Vec}; -impl TryFrom for Block { +impl TryFrom>> for Block { type Error = alloy_rpc_types::ConversionError; - fn try_from(block: alloy_rpc_types::Block) -> Result { + fn try_from( + block: alloy_rpc_types::Block>, + ) -> Result { use alloy_rpc_types::ConversionError; let body = { let transactions: Result, ConversionError> = match block .transactions { - alloy_rpc_types::BlockTransactions::Full(transactions) => transactions - .into_iter() - .map(|tx| { - let signature = tx.signature.ok_or(ConversionError::MissingSignature)?; - Ok(TransactionSigned::from_transaction_and_signature( - tx.try_into()?, - crate::Signature { - r: signature.r, - s: signature.s, - odd_y_parity: signature - .y_parity - .unwrap_or_else(|| alloy_rpc_types::Parity(!signature.v.bit(0))) - .0, - }, - )) - }) - .collect(), + alloy_rpc_types::BlockTransactions::Full(transactions) => { + transactions.into_iter().map(|tx| tx.try_into()).collect() + } alloy_rpc_types::BlockTransactions::Hashes(_) | alloy_rpc_types::BlockTransactions::Uncle => { // alloy deserializes empty blocks into `BlockTransactions::Hashes`, if the tx @@ -64,13 +54,18 @@ impl TryFrom for Block { } } -impl TryFrom for Transaction { +impl TryFrom> for Transaction { type Error = alloy_rpc_types::ConversionError; - fn try_from(tx: alloy_rpc_types::Transaction) -> Result { + fn try_from(tx: WithOtherFields) -> Result { use alloy_eips::eip2718::Eip2718Error; use alloy_rpc_types::ConversionError; + #[cfg(feature = "optimism")] + let WithOtherFields { inner: tx, other } = tx; + #[cfg(not(feature = "optimism"))] + let WithOtherFields { inner: tx, other: _ } = tx; + match tx.transaction_type.map(TryInto::try_into).transpose().map_err(|_| { ConversionError::Eip2718Error(Eip2718Error::UnexpectedType( tx.transaction_type.unwrap(), @@ -211,9 +206,8 @@ impl TryFrom for Transaction { } #[cfg(feature = "optimism")] Some(TxType::Deposit) => { - let fields = tx - .other - .deserialize_into::() + let fields = other + .deserialize_into::() .map_err(|e| ConversionError::Custom(e.to_string()))?; Ok(Self::Deposit(crate::transaction::TxDeposit { source_hash: fields @@ -235,10 +229,10 @@ impl TryFrom for Transaction { } } -impl TryFrom for TransactionSigned { +impl TryFrom> for TransactionSigned { type Error = alloy_rpc_types::ConversionError; - fn try_from(tx: alloy_rpc_types::Transaction) -> Result { + fn try_from(tx: WithOtherFields) -> Result { use alloy_rpc_types::ConversionError; let signature = tx.signature.ok_or(ConversionError::MissingSignature)?; @@ -268,10 +262,10 @@ impl TryFrom for TransactionSigned { } } -impl TryFrom for TransactionSignedEcRecovered { +impl TryFrom> for TransactionSignedEcRecovered { type Error = alloy_rpc_types::ConversionError; - fn try_from(tx: alloy_rpc_types::Transaction) -> Result { + fn try_from(tx: WithOtherFields) -> Result { use alloy_rpc_types::ConversionError; let transaction: TransactionSigned = tx.try_into()?; @@ -296,10 +290,10 @@ impl TryFrom for Signature { } } -impl TryFrom for TransactionSignedNoHash { +impl TryFrom> for TransactionSignedNoHash { type Error = alloy_rpc_types::ConversionError; - fn try_from(tx: alloy_rpc_types::Transaction) -> Result { + fn try_from(tx: WithOtherFields) -> Result { Ok(Self { signature: tx.signature.ok_or(Self::Error::MissingSignature)?.try_into()?, transaction: tx.try_into()?, @@ -337,7 +331,7 @@ mod tests { "v": "0x0", "value": "0x0" }"#; - let alloy_tx: AlloyTransaction = + let alloy_tx: WithOtherFields = serde_json::from_str(input).expect("failed to deserialize"); let reth_tx: Transaction = alloy_tx.try_into().expect("failed to convert"); @@ -387,7 +381,7 @@ mod tests { "v": "0x0", "value": "0x239c2e16a5ca590000" }"#; - let alloy_tx: AlloyTransaction = + let alloy_tx: WithOtherFields = serde_json::from_str(input).expect("failed to deserialize"); let reth_tx: Transaction = alloy_tx.try_into().expect("failed to convert"); diff --git a/crates/primitives/src/eip7702.rs b/crates/primitives/src/eip7702.rs index 48e4a01087d3..e05bdc4a4118 100644 --- a/crates/primitives/src/eip7702.rs +++ b/crates/primitives/src/eip7702.rs @@ -2,4 +2,4 @@ /// Re-export from `alloy_eips`. #[doc(inline)] -pub use alloy_eips::eip7702::{Authorization, OptionalNonce, SignedAuthorization}; +pub use alloy_eips::eip7702::{Authorization, SignedAuthorization}; diff --git a/crates/primitives/src/transaction/tx_type.rs b/crates/primitives/src/transaction/tx_type.rs index e73a904d8293..eef61da840d0 100644 --- a/crates/primitives/src/transaction/tx_type.rs +++ b/crates/primitives/src/transaction/tx_type.rs @@ -227,7 +227,7 @@ impl From for TxType { alloy_consensus::TxType::Eip2930 => Self::Eip2930, alloy_consensus::TxType::Eip1559 => Self::Eip1559, alloy_consensus::TxType::Eip4844 => Self::Eip4844, - //alloy_consensus::TxType::Eip7702 => Self::Eip7702, + alloy_consensus::TxType::Eip7702 => Self::Eip7702, } } } diff --git a/crates/rpc/rpc-api/src/engine.rs b/crates/rpc/rpc-api/src/engine.rs index 0b1ca76fa995..8c855aa34c14 100644 --- a/crates/rpc/rpc-api/src/engine.rs +++ b/crates/rpc/rpc-api/src/engine.rs @@ -220,7 +220,7 @@ pub trait EngineApi { /// Specifically for the engine auth server: #[cfg_attr(not(feature = "client"), rpc(server, namespace = "eth"))] #[cfg_attr(feature = "client", rpc(server, client, namespace = "eth"))] -pub trait EngineEthApi { +pub trait EngineEthApi { /// Returns an object with data about the sync status or false. #[method(name = "syncing")] fn syncing(&self) -> RpcResult; diff --git a/crates/rpc/rpc-api/src/otterscan.rs b/crates/rpc/rpc-api/src/otterscan.rs index 165e88d3df46..c232381612c2 100644 --- a/crates/rpc/rpc-api/src/otterscan.rs +++ b/crates/rpc/rpc-api/src/otterscan.rs @@ -5,7 +5,7 @@ use reth_rpc_types::{ BlockDetails, ContractCreator, InternalOperation, OtsBlockTransactions, TraceEntry, TransactionsWithReceipts, }, - Header, + Header, Transaction, WithOtherFields, }; /// Otterscan rpc interface. @@ -61,7 +61,7 @@ pub trait Otterscan { block_number: u64, page_number: usize, page_size: usize, - ) -> RpcResult; + ) -> RpcResult>>; /// Gets paginated inbound/outbound transaction calls for a certain address. #[method(name = "searchTransactionsBefore")] diff --git a/crates/rpc/rpc-api/src/txpool.rs b/crates/rpc/rpc-api/src/txpool.rs index 0fd9c9515630..844bcceaab5d 100644 --- a/crates/rpc/rpc-api/src/txpool.rs +++ b/crates/rpc/rpc-api/src/txpool.rs @@ -1,6 +1,9 @@ use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use reth_primitives::Address; -use reth_rpc_types::txpool::{TxpoolContent, TxpoolContentFrom, TxpoolInspect, TxpoolStatus}; +use reth_rpc_types::{ + txpool::{TxpoolContent, TxpoolContentFrom, TxpoolInspect, TxpoolStatus}, + Transaction, WithOtherFields, +}; /// Txpool rpc interface. #[cfg_attr(not(feature = "client"), rpc(server, namespace = "txpool"))] @@ -25,12 +28,15 @@ pub trait TxPoolApi { /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_contentFrom) for more details #[method(name = "contentFrom")] - async fn txpool_content_from(&self, from: Address) -> RpcResult; + async fn txpool_content_from( + &self, + from: Address, + ) -> RpcResult>>; /// Returns the details of all transactions currently pending for inclusion in the next /// block(s), as well as the ones that are being scheduled for future execution only. /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_content) for more details #[method(name = "content")] - async fn txpool_content(&self) -> RpcResult; + async fn txpool_content(&self) -> RpcResult>>; } diff --git a/crates/rpc/rpc-builder/src/lib.rs b/crates/rpc/rpc-builder/src/lib.rs index 0d271c4b07de..6c454bff6b57 100644 --- a/crates/rpc/rpc-builder/src/lib.rs +++ b/crates/rpc/rpc-builder/src/lib.rs @@ -169,6 +169,7 @@ use reth_rpc_eth_api::{ }; use reth_rpc_eth_types::{EthConfig, EthStateCache, EthSubscriptionIdProvider}; use reth_rpc_layer::{AuthLayer, Claims, JwtAuthValidator, JwtSecret}; +use reth_rpc_types::WithOtherFields; use reth_tasks::{pool::BlockingTaskGuard, TaskSpawner, TokioTaskExecutor}; use reth_transaction_pool::{noop::NoopTransactionPool, TransactionPool}; use serde::{Deserialize, Serialize}; @@ -804,7 +805,10 @@ where /// If called outside of the tokio runtime. See also [`Self::eth_api`] pub fn register_ots(&mut self) -> &mut Self where - EthApi: EthApiServer + TraceExt, + EthApi: EthApiServer< + WithOtherFields, + reth_rpc_types::Block>, + > + TraceExt, { let otterscan_api = self.otterscan_api(); self.modules.insert(RethRpcModule::Ots, otterscan_api.into_rpc().into()); @@ -904,7 +908,10 @@ where /// If called outside of the tokio runtime. See also [`Self::eth_api`] pub fn otterscan_api(&self) -> OtterscanApi where - EthApi: EthApiServer, + EthApi: EthApiServer< + WithOtherFields, + reth_rpc_types::Block>, + > + TraceExt, { let eth_api = self.eth_api().clone(); OtterscanApi::new(eth_api) diff --git a/crates/rpc/rpc-eth-api/src/helpers/call.rs b/crates/rpc/rpc-eth-api/src/helpers/call.rs index b5a8dd1d4f2f..0d309e6e0863 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/call.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/call.rs @@ -853,7 +853,7 @@ pub trait Call: LoadState + SpawnBlocking { chain_id, blob_versioned_hashes, max_fee_per_blob_gas, - // authorization_list, + authorization_list, .. } = request; @@ -892,7 +892,7 @@ pub trait Call: LoadState + SpawnBlocking { blob_hashes: blob_versioned_hashes.unwrap_or_default(), max_fee_per_blob_gas, // EIP-7702 fields - // authorization_list: TODO + authorization_list: authorization_list.map(Into::into), ..Default::default() }; diff --git a/crates/rpc/rpc-eth-api/src/types.rs b/crates/rpc/rpc-eth-api/src/types.rs index 4ab1e947b179..3f0d526b01ce 100644 --- a/crates/rpc/rpc-eth-api/src/types.rs +++ b/crates/rpc/rpc-eth-api/src/types.rs @@ -2,9 +2,9 @@ use std::error::Error; -use alloy_network::{Ethereum, Network}; +use alloy_network::{AnyNetwork, Network}; use reth_rpc_eth_types::EthApiError; -use reth_rpc_types::{Block, Transaction}; +use reth_rpc_types::{Block, Transaction, WithOtherFields}; use crate::{AsEthApiError, FromEthApiError, FromEvmError}; @@ -20,12 +20,12 @@ pub trait EthApiTypes: Send + Sync + Clone { + Sync; /// Blockchain primitive types, specific to network, e.g. block and transaction. // todo: remove restriction `reth_rpc_types::Transaction` - type NetworkTypes: Network; + type NetworkTypes: Network>; } impl EthApiTypes for () { type Error = EthApiError; - type NetworkTypes = Ethereum; + type NetworkTypes = AnyNetwork; } /// Adapter for network specific transaction type. diff --git a/crates/rpc/rpc-eth-types/src/transaction.rs b/crates/rpc/rpc-eth-types/src/transaction.rs index ee4993e4e2fa..89ff584e445a 100644 --- a/crates/rpc/rpc-eth-types/src/transaction.rs +++ b/crates/rpc/rpc-eth-types/src/transaction.rs @@ -2,7 +2,7 @@ //! //! Transaction wrapper that labels transaction with its origin. use reth_primitives::{TransactionSignedEcRecovered, B256}; -use reth_rpc_types::{Transaction, TransactionInfo}; +use reth_rpc_types::{Transaction, TransactionInfo, WithOtherFields}; use reth_rpc_types_compat::transaction::from_recovered_with_block_context; /// Represents from where a transaction was fetched. @@ -77,7 +77,7 @@ impl From for TransactionSignedEcRecovered { } } -impl From for Transaction { +impl From for WithOtherFields { fn from(value: TransactionSource) -> Self { match value { TransactionSource::Pool(tx) => reth_rpc_types_compat::transaction::from_recovered(tx), diff --git a/crates/rpc/rpc-layer/Cargo.toml b/crates/rpc/rpc-layer/Cargo.toml index 903eeb6fbd50..69500df2882a 100644 --- a/crates/rpc/rpc-layer/Cargo.toml +++ b/crates/rpc/rpc-layer/Cargo.toml @@ -11,7 +11,7 @@ repository.workspace = true workspace = true [dependencies] -alloy-rpc-types-engine.workspace = true +alloy-rpc-types-engine = { workspace = true, features = ["jwt"] } http.workspace = true jsonrpsee-http-client.workspace = true diff --git a/crates/rpc/rpc-types-compat/src/block.rs b/crates/rpc/rpc-types-compat/src/block.rs index a3f823de5d48..3b3c22c83b28 100644 --- a/crates/rpc/rpc-types-compat/src/block.rs +++ b/crates/rpc/rpc-types-compat/src/block.rs @@ -6,7 +6,9 @@ use alloy_rpc_types::{Transaction, TransactionInfo}; use reth_primitives::{ Block as PrimitiveBlock, BlockWithSenders, Header as PrimitiveHeader, Withdrawals, B256, U256, }; -use reth_rpc_types::{Block, BlockError, BlockTransactions, BlockTransactionsKind, Header}; +use reth_rpc_types::{ + Block, BlockError, BlockTransactions, BlockTransactionsKind, Header, WithOtherFields, +}; /// Converts the given primitive block into a [`Block`] response with the given /// [`BlockTransactionsKind`] @@ -17,7 +19,7 @@ pub fn from_block( total_difficulty: U256, kind: BlockTransactionsKind, block_hash: Option, -) -> Result { +) -> Result>, BlockError> { match kind { BlockTransactionsKind::Hashes => { Ok(from_block_with_tx_hashes(block, total_difficulty, block_hash)) @@ -35,7 +37,7 @@ pub fn from_block_with_tx_hashes( block: BlockWithSenders, total_difficulty: U256, block_hash: Option, -) -> Block { +) -> Block> { let block_hash = block_hash.unwrap_or_else(|| block.header.hash_slow()); let transactions = block.body.iter().map(|tx| tx.hash()).collect(); @@ -57,7 +59,7 @@ pub fn from_block_full( mut block: BlockWithSenders, total_difficulty: U256, block_hash: Option, -) -> Result { +) -> Result>, BlockError> { let block_hash = block_hash.unwrap_or_else(|| block.block.header.hash_slow()); let block_number = block.block.number; let base_fee_per_gas = block.block.base_fee_per_gas; @@ -125,7 +127,7 @@ pub fn from_primitive_with_hash(primitive_header: reth_primitives::SealedHeader) } = header; Header { - hash: Some(hash), + hash, parent_hash, uncles_hash: ommers_hash, miner: beneficiary, @@ -133,7 +135,7 @@ pub fn from_primitive_with_hash(primitive_header: reth_primitives::SealedHeader) transactions_root, receipts_root, withdrawals_root, - number: Some(number), + number, gas_used: gas_used as u128, gas_limit: gas_limit as u128, extra_data, @@ -157,8 +159,8 @@ fn from_block_with_transactions( block_hash: B256, block: PrimitiveBlock, total_difficulty: U256, - transactions: BlockTransactions, -) -> Block { + transactions: BlockTransactions>, +) -> Block> { let uncles = block.ommers.into_iter().map(|h| h.hash_slow()).collect(); let mut header = from_primitive_with_hash(block.header.seal(block_hash)); header.total_difficulty = Some(total_difficulty); @@ -169,19 +171,12 @@ fn from_block_with_transactions( .then(|| block.withdrawals.map(Withdrawals::into_inner)) .flatten(); - Block { - header, - uncles, - transactions, - size: Some(U256::from(block_length)), - withdrawals, - other: Default::default(), - } + Block { header, uncles, transactions, size: Some(U256::from(block_length)), withdrawals } } /// Build an RPC block response representing /// an Uncle from its header. -pub fn uncle_block_from_header(header: PrimitiveHeader) -> Block { +pub fn uncle_block_from_header(header: PrimitiveHeader) -> Block> { let hash = header.hash_slow(); let rpc_header = from_primitive_with_hash(header.clone().seal(hash)); let uncle_block = PrimitiveBlock { header, ..Default::default() }; @@ -192,6 +187,5 @@ pub fn uncle_block_from_header(header: PrimitiveHeader) -> Block { transactions: BlockTransactions::Uncle, withdrawals: Some(vec![]), size, - other: Default::default(), } } diff --git a/crates/rpc/rpc-types-compat/src/transaction/mod.rs b/crates/rpc/rpc-types-compat/src/transaction/mod.rs index 1c87a7fbd097..0e5130c03eb4 100644 --- a/crates/rpc/rpc-types-compat/src/transaction/mod.rs +++ b/crates/rpc/rpc-types-compat/src/transaction/mod.rs @@ -5,7 +5,7 @@ use alloy_rpc_types::{ TransactionInfo, }; use reth_primitives::{Address, TransactionSignedEcRecovered, TxKind, TxType}; -use reth_rpc_types::Transaction; +use reth_rpc_types::{Transaction, WithOtherFields}; use signature::from_primitive_signature; pub use typed::*; @@ -17,19 +17,22 @@ mod typed; pub fn from_recovered_with_block_context( tx: TransactionSignedEcRecovered, tx_info: TransactionInfo, -) -> Transaction { +) -> WithOtherFields { fill(tx, tx_info) } /// Create a new rpc transaction result for a _pending_ signed transaction, setting block /// environment related fields to `None`. -pub fn from_recovered(tx: TransactionSignedEcRecovered) -> Transaction { +pub fn from_recovered(tx: TransactionSignedEcRecovered) -> WithOtherFields { fill(tx, TransactionInfo::default()) } /// Create a new rpc transaction result for a _pending_ signed transaction, setting block /// environment related fields to `None`. -fn fill(tx: TransactionSignedEcRecovered, tx_info: TransactionInfo) -> Transaction { +fn fill( + tx: TransactionSignedEcRecovered, + tx_info: TransactionInfo, +) -> WithOtherFields { let signer = tx.signer(); let signed_tx = tx.into_signed(); @@ -41,7 +44,7 @@ fn fill(tx: TransactionSignedEcRecovered, tx_info: TransactionInfo) -> Transacti #[allow(unreachable_patterns)] let (gas_price, max_fee_per_gas) = match signed_tx.tx_type() { TxType::Legacy | TxType::Eip2930 => (Some(signed_tx.max_fee_per_gas()), None), - TxType::Eip1559 | TxType::Eip4844 => { + TxType::Eip1559 | TxType::Eip4844 | TxType::Eip7702 => { // the gas price field for EIP1559 is set to `min(tip, gasFeeCap - baseFee) + // baseFee` let gas_price = tx_info @@ -68,30 +71,32 @@ fn fill(tx: TransactionSignedEcRecovered, tx_info: TransactionInfo) -> Transacti let signature = from_primitive_signature(*signed_tx.signature(), signed_tx.tx_type(), signed_tx.chain_id()); - Transaction { - hash: signed_tx.hash(), - nonce: signed_tx.nonce(), - from: signer, - to, - value: signed_tx.value(), - gas_price, - max_fee_per_gas, - max_priority_fee_per_gas: signed_tx.max_priority_fee_per_gas(), - signature: Some(signature), - gas: signed_tx.gas_limit() as u128, - input: signed_tx.input().clone(), - chain_id, - access_list, - transaction_type: Some(signed_tx.tx_type() as u8), - - // These fields are set to None because they are not stored as part of the transaction - block_hash: tx_info.block_hash, - block_number: tx_info.block_number, - transaction_index: tx_info.index, - // EIP-4844 fields - max_fee_per_blob_gas: signed_tx.max_fee_per_blob_gas(), - blob_versioned_hashes, - authorization_list, + WithOtherFields { + inner: Transaction { + hash: signed_tx.hash(), + nonce: signed_tx.nonce(), + from: signer, + to, + value: signed_tx.value(), + gas_price, + max_fee_per_gas, + max_priority_fee_per_gas: signed_tx.max_priority_fee_per_gas(), + signature: Some(signature), + gas: signed_tx.gas_limit() as u128, + input: signed_tx.input().clone(), + chain_id, + access_list, + transaction_type: Some(signed_tx.tx_type() as u8), + // These fields are set to None because they are not stored as part of the transaction + block_hash: tx_info.block_hash, + block_number: tx_info.block_number, + transaction_index: tx_info.index, + // EIP-4844 fields + max_fee_per_blob_gas: signed_tx.max_fee_per_blob_gas(), + blob_versioned_hashes, + // EIP-7702 fields + authorization_list, + }, // Optimism fields #[cfg(feature = "optimism")] other: reth_rpc_types::optimism::OptimismTransactionFields { @@ -100,6 +105,7 @@ fn fill(tx: TransactionSignedEcRecovered, tx_info: TransactionInfo) -> Transacti // only include is_system_tx if true: is_system_tx: (signed_tx.is_deposit() && signed_tx.is_system_transaction()) .then_some(true), + deposit_receipt_version: None, } .into(), #[cfg(not(feature = "optimism"))] @@ -118,7 +124,7 @@ pub fn transaction_to_call_request(tx: TransactionSignedEcRecovered) -> Transact let chain_id = tx.transaction.chain_id(); let access_list = tx.transaction.access_list().cloned(); let max_fee_per_blob_gas = tx.transaction.max_fee_per_blob_gas(); - let _authorization_list = tx.transaction.authorization_list(); + let authorization_list = tx.transaction.authorization_list().map(|l| l.to_vec()); let blob_versioned_hashes = tx.transaction.blob_versioned_hashes(); let tx_type = tx.transaction.tx_type(); @@ -146,5 +152,6 @@ pub fn transaction_to_call_request(tx: TransactionSignedEcRecovered) -> Transact blob_versioned_hashes, transaction_type: Some(tx_type.into()), sidecar: None, + authorization_list, } } diff --git a/crates/rpc/rpc-types/Cargo.toml b/crates/rpc/rpc-types/Cargo.toml index 6c6dd91c5b4b..988716f6da43 100644 --- a/crates/rpc/rpc-types/Cargo.toml +++ b/crates/rpc/rpc-types/Cargo.toml @@ -25,6 +25,10 @@ alloy-rpc-types-txpool.workspace = true alloy-serde.workspace = true alloy-rpc-types-engine = { workspace = true, features = ["jsonrpsee-types"], optional = true } +# optimism +op-alloy-rpc-types.workspace = true +op-alloy-rpc-types-engine.workspace = true + # misc jsonrpsee-types = { workspace = true, optional = true } @@ -41,6 +45,6 @@ jsonrpsee-types = [ "dep:alloy-rpc-types-beacon", "dep:alloy-rpc-types-engine", "alloy-rpc-types/jsonrpsee-types", - "alloy-rpc-types-engine/jsonrpsee-types" + "alloy-rpc-types-engine/jsonrpsee-types", ] arbitrary = ["alloy-primitives/arbitrary", "alloy-rpc-types/arbitrary"] diff --git a/crates/rpc/rpc-types/src/lib.rs b/crates/rpc/rpc-types/src/lib.rs index f2a876f92f32..e886d549ad3c 100644 --- a/crates/rpc/rpc-types/src/lib.rs +++ b/crates/rpc/rpc-types/src/lib.rs @@ -57,3 +57,9 @@ pub use eth::{ ExecutionPayload, ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3, PayloadError, }, }; + +/// Optimism specific rpc types. +pub mod optimism { + pub use op_alloy_rpc_types::*; + pub use op_alloy_rpc_types_engine::*; +} diff --git a/crates/rpc/rpc/src/engine.rs b/crates/rpc/rpc/src/engine.rs index 5149d276d005..d21834213716 100644 --- a/crates/rpc/rpc/src/engine.rs +++ b/crates/rpc/rpc/src/engine.rs @@ -7,7 +7,7 @@ pub use reth_rpc_engine_api::EngineApi; use reth_rpc_eth_api::{EthApiTypes, RpcBlock, RpcTransaction}; use reth_rpc_types::{ state::StateOverride, BlockOverrides, EIP1186AccountProofResponse, Filter, JsonStorageKey, Log, - SyncStatus, TransactionRequest, + SyncStatus, TransactionRequest, WithOtherFields, }; use tracing_futures::Instrument; @@ -33,15 +33,16 @@ impl EngineEthApi { } #[async_trait::async_trait] -impl - EngineEthApiServer< - reth_rpc_types::Transaction, - reth_rpc_types::Block, - > for EngineEthApi +impl EngineEthApiServer> + for EngineEthApi where Eth: EthApiServer, RpcBlock> - + EthApiTypes>, - EthFilter: EthFilterApiServer, + + EthApiTypes< + NetworkTypes: Network< + TransactionResponse = WithOtherFields, + >, + >, + EthFilter: EthFilterApiServer>, { /// Handler for: `eth_syncing` fn syncing(&self) -> Result { diff --git a/crates/rpc/rpc/src/eth/core.rs b/crates/rpc/rpc/src/eth/core.rs index 6d3cd1301b11..c79007fe3d4d 100644 --- a/crates/rpc/rpc/src/eth/core.rs +++ b/crates/rpc/rpc/src/eth/core.rs @@ -3,7 +3,7 @@ use std::sync::Arc; -use alloy_network::Ethereum; +use alloy_network::AnyNetwork; use derive_more::Deref; use reth_node_api::{BuilderProvider, FullNodeComponents}; use reth_primitives::{BlockNumberOrTag, U256}; @@ -123,7 +123,7 @@ where Self: Send + Sync, { type Error = EthApiError; - type NetworkTypes = Ethereum; + type NetworkTypes = AnyNetwork; } impl std::fmt::Debug diff --git a/crates/rpc/rpc/src/eth/filter.rs b/crates/rpc/rpc/src/eth/filter.rs index f3f0ea72b69b..c75b5cd0936f 100644 --- a/crates/rpc/rpc/src/eth/filter.rs +++ b/crates/rpc/rpc/src/eth/filter.rs @@ -22,7 +22,7 @@ use reth_rpc_eth_types::{ use reth_rpc_server_types::ToRpcResult; use reth_rpc_types::{ BlockNumHash, Filter, FilterBlockOption, FilterChanges, FilterId, FilteredParams, Log, - PendingTransactionFilterKind, + PendingTransactionFilterKind, Transaction, WithOtherFields, }; use reth_tasks::TaskSpawner; use reth_transaction_pool::{NewSubpoolTransactionStream, PoolTransaction, TransactionPool}; @@ -132,7 +132,10 @@ where ::Transaction: 'static, { /// Returns all the filter changes for the given id, if any - pub async fn filter_changes(&self, id: FilterId) -> Result { + pub async fn filter_changes( + &self, + id: FilterId, + ) -> Result>, EthFilterError> { let info = self.inner.provider.chain_info()?; let best_number = info.best_number; @@ -222,7 +225,7 @@ where } #[async_trait] -impl EthFilterApiServer for EthFilter +impl EthFilterApiServer> for EthFilter where Provider: BlockReader + BlockIdReader + EvmEnvProvider + 'static, Pool: TransactionPool + 'static, @@ -268,7 +271,10 @@ where } /// Handler for `eth_getFilterChanges` - async fn filter_changes(&self, id: FilterId) -> RpcResult { + async fn filter_changes( + &self, + id: FilterId, + ) -> RpcResult>> { trace!(target: "rpc::eth", "Serving eth_getFilterChanges"); Ok(Self::filter_changes(self, id).await?) } @@ -547,7 +553,7 @@ impl PendingTransactionsReceiver { } /// Returns all new pending transactions received since the last poll. - async fn drain(&self) -> FilterChanges { + async fn drain(&self) -> FilterChanges> { let mut pending_txs = Vec::new(); let mut prepared_stream = self.txs_receiver.lock().await; @@ -576,7 +582,7 @@ where } /// Returns all new pending transactions received since the last poll. - async fn drain(&self) -> FilterChanges + async fn drain(&self) -> FilterChanges> where T: PoolTransaction, { @@ -595,7 +601,7 @@ where /// Helper trait for [FullTransactionsReceiver] to erase the `Transaction` type. #[async_trait] trait FullTransactionsFilter: fmt::Debug + Send + Sync + Unpin + 'static { - async fn drain(&self) -> FilterChanges; + async fn drain(&self) -> FilterChanges>; } #[async_trait] @@ -603,7 +609,7 @@ impl FullTransactionsFilter for FullTransactionsReceiver where T: PoolTransaction + 'static, { - async fn drain(&self) -> FilterChanges { + async fn drain(&self) -> FilterChanges> { Self::drain(self).await } } @@ -620,7 +626,7 @@ enum PendingTransactionKind { } impl PendingTransactionKind { - async fn drain(&self) -> FilterChanges { + async fn drain(&self) -> FilterChanges> { match self { Self::Hashes(receiver) => receiver.drain().await, Self::FullTransaction(receiver) => receiver.drain().await, diff --git a/crates/rpc/rpc/src/eth/pubsub.rs b/crates/rpc/rpc/src/eth/pubsub.rs index 5509f3e933a3..d84f0f263a7e 100644 --- a/crates/rpc/rpc/src/eth/pubsub.rs +++ b/crates/rpc/rpc/src/eth/pubsub.rs @@ -17,7 +17,7 @@ use reth_rpc_types::{ Params, PubSubSyncStatus, SubscriptionKind, SubscriptionResult as EthSubscriptionResult, SyncStatusMetadata, }, - FilteredParams, Header, Log, + FilteredParams, Header, Log, Transaction, WithOtherFields, }; use reth_tasks::{TaskSpawner, TokioTaskExecutor}; use reth_transaction_pool::{NewTransactionEvent, TransactionPool}; @@ -108,9 +108,11 @@ where { match kind { SubscriptionKind::NewHeads => { - let stream = pubsub - .new_headers_stream() - .map(|block| EthSubscriptionResult::Header(Box::new(block.into()))); + let stream = pubsub.new_headers_stream().map(|header| { + EthSubscriptionResult::>::Header(Box::new( + header.into(), + )) + }); pipe_from_stream(accepted_sink, stream).await } SubscriptionKind::Logs => { @@ -122,8 +124,9 @@ where } _ => FilteredParams::default(), }; - let stream = - pubsub.log_stream(filter).map(|log| EthSubscriptionResult::Log(Box::new(log))); + let stream = pubsub.log_stream(filter).map(|log| { + EthSubscriptionResult::>::Log(Box::new(log)) + }); pipe_from_stream(accepted_sink, stream).await } SubscriptionKind::NewPendingTransactions => { @@ -153,7 +156,7 @@ where let stream = pubsub .pending_transaction_hashes_stream() - .map(EthSubscriptionResult::TransactionHash); + .map(EthSubscriptionResult::>::TransactionHash); pipe_from_stream(accepted_sink, stream).await } SubscriptionKind::Syncing => { diff --git a/crates/rpc/rpc/src/otterscan.rs b/crates/rpc/rpc/src/otterscan.rs index f65afe969082..06b95c2e1498 100644 --- a/crates/rpc/rpc/src/otterscan.rs +++ b/crates/rpc/rpc/src/otterscan.rs @@ -15,7 +15,7 @@ use reth_rpc_types::{ }, parity::{Action, CreateAction, CreateOutput, TraceOutput}, }, - AnyTransactionReceipt, BlockTransactions, Header, Rich, + AnyTransactionReceipt, BlockTransactions, Header, Transaction, WithOtherFields, }; use revm_inspectors::{ tracing::{types::CallTraceNode, TracingInspectorConfig}, @@ -40,7 +40,9 @@ impl OtterscanApi { impl OtterscanApi where - Eth: EthApiTypes>, + Eth: EthApiTypes< + NetworkTypes: Network>, + >, { /// Constructs a `BlockDetails` from a block and its receipts. fn block_details( @@ -57,11 +59,7 @@ where .map(|receipt| receipt.gas_used.saturating_mul(receipt.effective_gas_price)) .sum::(); - Ok(BlockDetails::new( - Rich { inner: block, extra_info: Default::default() }, - Default::default(), - U256::from(total_fees), - )) + Ok(BlockDetails::new(block, Default::default(), U256::from(total_fees))) } } @@ -69,8 +67,11 @@ where impl OtterscanServer for OtterscanApi where Eth: EthApiServer, RpcBlock> - + EthApiTypes> - + TraceExt + + EthApiTypes< + NetworkTypes: Network< + TransactionResponse = WithOtherFields, + >, + > + TraceExt + 'static, { /// Handler for `{ots,erigon}_getHeaderByNumber` @@ -187,7 +188,7 @@ where block_number: u64, page_number: usize, page_size: usize, - ) -> RpcResult { + ) -> RpcResult>> { // retrieve full block and its receipts let block = self.eth.block_by_number(block_number.into(), true); let receipts = self.eth.block_receipts(block_number.into()); diff --git a/crates/rpc/rpc/src/txpool.rs b/crates/rpc/rpc/src/txpool.rs index 95a21014f4a3..028cb288a6cc 100644 --- a/crates/rpc/rpc/src/txpool.rs +++ b/crates/rpc/rpc/src/txpool.rs @@ -4,7 +4,7 @@ use reth_primitives::{Address, TransactionSignedEcRecovered}; use reth_rpc_api::TxPoolApiServer; use reth_rpc_types::{ txpool::{TxpoolContent, TxpoolContentFrom, TxpoolInspect, TxpoolInspectSummary, TxpoolStatus}, - Transaction, + Transaction, WithOtherFields, }; use reth_transaction_pool::{AllPoolTransactions, PoolTransaction, TransactionPool}; use std::collections::BTreeMap; @@ -30,11 +30,11 @@ impl TxPoolApi where Pool: TransactionPool + 'static, { - fn content(&self) -> TxpoolContent { + fn content(&self) -> TxpoolContent> { #[inline] fn insert>( tx: &T, - content: &mut BTreeMap>, + content: &mut BTreeMap>>, ) { content.entry(tx.sender()).or_default().insert( tx.nonce().to_string(), @@ -118,7 +118,10 @@ where /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_contentFrom) for more details /// Handler for `txpool_contentFrom` - async fn txpool_content_from(&self, from: Address) -> Result { + async fn txpool_content_from( + &self, + from: Address, + ) -> Result>> { trace!(target: "rpc::eth", ?from, "Serving txpool_contentFrom"); Ok(self.content().remove_from(&from)) } @@ -128,7 +131,7 @@ where /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_content) for more details /// Handler for `txpool_content` - async fn txpool_content(&self) -> Result { + async fn txpool_content(&self) -> Result>> { trace!(target: "rpc::eth", "Serving txpool_content"); Ok(self.content()) } diff --git a/crates/storage/codecs/src/alloy/authorization_list.rs b/crates/storage/codecs/src/alloy/authorization_list.rs index d82eb5d310fc..b59c699e6cf4 100644 --- a/crates/storage/codecs/src/alloy/authorization_list.rs +++ b/crates/storage/codecs/src/alloy/authorization_list.rs @@ -2,7 +2,7 @@ use core::ops::Deref; use crate::Compact; use alloy_eips::eip7702::{Authorization as AlloyAuthorization, SignedAuthorization}; -use alloy_primitives::{Address, ChainId, U256}; +use alloy_primitives::{Address, U256}; use bytes::Buf; use reth_codecs_derive::add_arbitrary_tests; use serde::{Deserialize, Serialize}; @@ -14,9 +14,9 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(test, derive(arbitrary::Arbitrary))] #[add_arbitrary_tests(compact)] struct Authorization { - chain_id: ChainId, + chain_id: U256, address: Address, - nonce: Option, + nonce: u64, } impl Compact for AlloyAuthorization { @@ -34,7 +34,7 @@ impl Compact for AlloyAuthorization { let alloy_authorization = Self { chain_id: authorization.chain_id, address: authorization.address, - nonce: authorization.nonce.into(), + nonce: authorization.nonce, }; (alloy_authorization, buf) } @@ -79,9 +79,9 @@ mod tests { #[test] fn test_roundtrip_compact_authorization_list_item() { let authorization = AlloyAuthorization { - chain_id: 1, + chain_id: U256::from(1), address: address!("dac17f958d2ee523a2206206994597c13d831ec7"), - nonce: None.into(), + nonce: 1, } .into_signed( alloy_primitives::Signature::from_rs_and_parity(