diff --git a/Cargo.lock b/Cargo.lock index c7c1e8e3e6a..61a7e45c37a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,7 +173,7 @@ dependencies = [ [[package]] name = "alloy-genesis" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#48f1c0fbf6e22f09c1b3f297955f5acea0b0f99d" +source = "git+https://github.com/alloy-rs/alloy?branch=main#80206e7ba7686c514da291c06a5e7912b5361047" dependencies = [ "alloy-primitives", "alloy-rpc-types", @@ -195,7 +195,7 @@ dependencies = [ [[package]] name = "alloy-node-bindings" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#48f1c0fbf6e22f09c1b3f297955f5acea0b0f99d" +source = "git+https://github.com/alloy-rs/alloy?branch=main#80206e7ba7686c514da291c06a5e7912b5361047" dependencies = [ "alloy-genesis", "alloy-primitives", @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "alloy-rpc-engine-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#48f1c0fbf6e22f09c1b3f297955f5acea0b0f99d" +source = "git+https://github.com/alloy-rs/alloy?branch=main#80206e7ba7686c514da291c06a5e7912b5361047" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -271,7 +271,7 @@ dependencies = [ [[package]] name = "alloy-rpc-trace-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#48f1c0fbf6e22f09c1b3f297955f5acea0b0f99d" +source = "git+https://github.com/alloy-rs/alloy?branch=main#80206e7ba7686c514da291c06a5e7912b5361047" dependencies = [ "alloy-primitives", "alloy-rpc-types", @@ -282,7 +282,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy#48f1c0fbf6e22f09c1b3f297955f5acea0b0f99d" +source = "git+https://github.com/alloy-rs/alloy?branch=main#80206e7ba7686c514da291c06a5e7912b5361047" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -394,9 +394,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -844,16 +844,16 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.69.2" +version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ "bitflags 2.4.2", "cexpr", "clang-sys", + "itertools 0.12.1", "lazy_static", "lazycell", - "peeking_take_while", "proc-macro2", "quote", "regex", @@ -1163,9 +1163,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" [[package]] name = "byteorder" @@ -1207,9 +1207,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -1339,9 +1339,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" dependencies = [ "clap_builder", "clap_derive", @@ -1349,21 +1349,21 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.10.0", + "strsim 0.11.0", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", @@ -1373,9 +1373,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "cli-extension-event-hooks" @@ -1510,9 +1510,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" +checksum = "18d59688ad0945eaf6b84cb44fedbe93484c81b48970e98f09db8a22832d7961" dependencies = [ "cfg-if", "cpufeatures", @@ -2251,9 +2251,9 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", @@ -2787,9 +2787,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" +checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" [[package]] name = "findshlibs" @@ -3046,9 +3046,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "git2" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" +checksum = "1b3ba52851e73b46a4c3df1d89343741112003f0f6f13beb0dfac9e457c3fdcd" dependencies = [ "bitflags 2.4.2", "libc", @@ -3217,9 +3217,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hex" @@ -3772,12 +3772,12 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "fe8f25ce1159c7740ff0b9b2f5cdf4a8428742ba7c112b9f20f22cd5219c7dab" dependencies = [ "hermit-abi", - "rustix", + "libc", "windows-sys 0.52.0", ] @@ -3847,18 +3847,18 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -4113,9 +4113,9 @@ dependencies = [ [[package]] name = "libgit2-sys" -version = "0.16.1+1.7.1" +version = "0.16.2+1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" dependencies = [ "cc", "libc", @@ -4584,9 +4584,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" dependencies = [ "num-traits", ] @@ -4609,19 +4609,18 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" dependencies = [ "autocfg", "num-integer", @@ -4642,9 +4641,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -4961,9 +4960,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.6" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" +checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" dependencies = [ "memchr", "thiserror", @@ -6239,7 +6238,7 @@ dependencies = [ name = "reth-mdbx-sys" version = "0.1.0-alpha.17" dependencies = [ - "bindgen 0.69.2", + "bindgen 0.69.4", "cc", "libc", ] @@ -7004,8 +7003,8 @@ dependencies = [ [[package]] name = "revm" -version = "3.5.0" -source = "git+https://github.com/bluealloy/revm?branch=main#45403345c18c4395be3bf0d5940e1bba53852613" +version = "4.0.0" +source = "git+https://github.com/bluealloy/revm?branch=main#bbca12830be2757ff3e608a36f062f5e2d62231b" dependencies = [ "auto_impl", "cfg-if", @@ -7018,7 +7017,7 @@ dependencies = [ [[package]] name = "revm-inspectors" version = "0.1.0" -source = "git+https://github.com/paradigmxyz/evm-inspectors?branch=main#573cf0f09c8f0f267dd387e8e4d13d75e09021c7" +source = "git+https://github.com/paradigmxyz/evm-inspectors?branch=onbjerg/rm-callrequest#70807da74e46641532f67caac9e37fbf5d7080c1" dependencies = [ "alloy-primitives", "alloy-rpc-trace-types", @@ -7034,8 +7033,8 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "1.3.0" -source = "git+https://github.com/bluealloy/revm?branch=main#45403345c18c4395be3bf0d5940e1bba53852613" +version = "2.0.0" +source = "git+https://github.com/bluealloy/revm?branch=main#bbca12830be2757ff3e608a36f062f5e2d62231b" dependencies = [ "revm-primitives", "serde", @@ -7043,8 +7042,8 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "2.2.0" -source = "git+https://github.com/bluealloy/revm?branch=main#45403345c18c4395be3bf0d5940e1bba53852613" +version = "3.0.0" +source = "git+https://github.com/bluealloy/revm?branch=main#bbca12830be2757ff3e608a36f062f5e2d62231b" dependencies = [ "aurora-engine-modexp", "blst", @@ -7060,8 +7059,8 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "1.3.0" -source = "git+https://github.com/bluealloy/revm?branch=main#45403345c18c4395be3bf0d5940e1bba53852613" +version = "2.0.0" +source = "git+https://github.com/bluealloy/revm?branch=main#bbca12830be2757ff3e608a36f062f5e2d62231b" dependencies = [ "alloy-primitives", "auto_impl", @@ -7626,9 +7625,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0ed1662c5a68664f45b76d18deb0e234aff37207086803165c961eb695e981" +checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" dependencies = [ "base64 0.21.7", "chrono", @@ -7636,6 +7635,7 @@ dependencies = [ "indexmap 1.9.3", "indexmap 2.2.2", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -7643,9 +7643,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" +checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" dependencies = [ "darling 0.20.5", "proc-macro2", @@ -7848,9 +7848,9 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "sketches-ddsketch" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a406c1882ed7f29cd5e248c9848a80e7cb6ae0fea82346d2746f2f941c07e1" +checksum = "85636c14b73d81f541e525f585c0a2109e6744e1565b5c1668e31c70c10ed65c" [[package]] name = "slab" @@ -7981,6 +7981,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + [[package]] name = "strum" version = "0.25.0" @@ -8166,13 +8172,12 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand 2.0.1", - "redox_syscall 0.4.1", "rustix", "windows-sys 0.52.0", ] @@ -8500,14 +8505,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.1", + "toml_edit 0.22.4", ] [[package]] @@ -8546,6 +8551,17 @@ name = "toml_edit" version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.2", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" dependencies = [ "indexmap 2.2.2", "serde", @@ -8955,9 +8971,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" @@ -9129,9 +9145,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -9139,9 +9155,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", @@ -9154,9 +9170,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -9166,9 +9182,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9176,9 +9192,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", @@ -9189,9 +9205,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "wasm-streams" @@ -9208,9 +9224,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -9412,9 +9428,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.37" +version = "0.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index c731577fabe..6b22b4843d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -175,7 +175,7 @@ revm = { git = "https://github.com/bluealloy/revm", branch = "main", features = revm-primitives = { git = "https://github.com/bluealloy/revm", branch = "main", features = [ "std", ], default-features = false } -revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", branch = "main" } +revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", branch = "onbjerg/rm-callrequest" } # eth alloy-chains = { version = "0.1", feature = ["serde", "rlp", "arbitrary"] } @@ -184,11 +184,11 @@ alloy-dyn-abi = "0.6" alloy-sol-types = "0.6" alloy-rlp = "0.3" alloy-trie = "0.2" -alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy" } -alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy" } -alloy-rpc-engine-types = { git = "https://github.com/alloy-rs/alloy" } -alloy-genesis = { git = "https://github.com/alloy-rs/alloy" } -alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy" } +alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", branch = "main" } +alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", branch = "main" } +alloy-rpc-engine-types = { git = "https://github.com/alloy-rs/alloy", branch = "main" } +alloy-genesis = { git = "https://github.com/alloy-rs/alloy", branch = "main" } +alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", branch = "main" } ethers-core = { version = "2.0", default-features = false } ethers-providers = { version = "2.0", default-features = false } ethers-signers = { version = "2.0", default-features = false } diff --git a/crates/primitives/src/proofs.rs b/crates/primitives/src/proofs.rs index 6389f59b23e..096221e2599 100644 --- a/crates/primitives/src/proofs.rs +++ b/crates/primitives/src/proofs.rs @@ -100,7 +100,7 @@ pub fn calculate_receipt_root( return ordered_trie_root_with_encoder(receipts.as_slice(), |r, buf| { r.encode_inner(buf, false) - }) + }); } ordered_trie_root_with_encoder(receipts, |r, buf| r.encode_inner(buf, false)) @@ -144,7 +144,7 @@ pub fn calculate_receipt_root_ref( return ordered_trie_root_with_encoder(&receipts, |r, buf| { ReceiptWithBloomRef::from(r).encode_inner(buf, false) - }) + }); } ordered_trie_root_with_encoder(receipts, |r, buf| { @@ -156,7 +156,7 @@ pub fn calculate_receipt_root_ref( pub fn calculate_ommers_root(ommers: &[Header]) -> B256 { // Check if `ommers` list is empty if ommers.is_empty() { - return EMPTY_OMMER_ROOT_HASH + return EMPTY_OMMER_ROOT_HASH; } // RLP Encode let mut ommers_rlp = Vec::new(); @@ -627,6 +627,7 @@ mod tests { let mut genesis_alloc = HashMap::new(); genesis_alloc .insert(test_addr, GenesisAccount { balance: U256::MAX, ..Default::default() }); + let root = state_root_unhashed(genesis_alloc); assert_eq!(root, expected_root); diff --git a/crates/rpc/rpc-api/src/debug.rs b/crates/rpc/rpc-api/src/debug.rs index 3304d672b1a..b9bae42079f 100644 --- a/crates/rpc/rpc-api/src/debug.rs +++ b/crates/rpc/rpc-api/src/debug.rs @@ -5,7 +5,7 @@ use reth_rpc_types::{ BlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult, }, - Bundle, CallRequest, RichBlock, StateContext, + Bundle, RichBlock, StateContext, TransactionRequest, }; /// Debug rpc interface. @@ -102,7 +102,7 @@ pub trait DebugApi { #[method(name = "traceCall")] async fn debug_trace_call( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, opts: Option, ) -> RpcResult; diff --git a/crates/rpc/rpc-api/src/engine.rs b/crates/rpc/rpc-api/src/engine.rs index 15a6deb820e..6320afc8439 100644 --- a/crates/rpc/rpc-api/src/engine.rs +++ b/crates/rpc/rpc-api/src/engine.rs @@ -13,7 +13,7 @@ use reth_rpc_types::{ ForkchoiceUpdated, PayloadId, PayloadStatus, TransitionConfiguration, }, state::StateOverride, - BlockOverrides, CallRequest, Filter, Log, RichBlock, SyncStatus, + BlockOverrides, Filter, Log, RichBlock, SyncStatus, TransactionRequest, }; // NOTE: We can't use associated types in the `EngineApi` trait because of jsonrpsee, so we use a @@ -183,7 +183,7 @@ pub trait EngineEthApi { #[method(name = "call")] async fn call( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, state_overrides: Option, block_overrides: Option>, diff --git a/crates/rpc/rpc-api/src/eth.rs b/crates/rpc/rpc-api/src/eth.rs index c301864ee02..6ae452e2186 100644 --- a/crates/rpc/rpc-api/src/eth.rs +++ b/crates/rpc/rpc-api/src/eth.rs @@ -4,7 +4,7 @@ use reth_primitives::{ Address, BlockId, BlockNumberOrTag, Bytes, B256, B64, U256, U64, }; use reth_rpc_types::{ - state::StateOverride, AccessListWithGasUsed, BlockOverrides, Bundle, CallRequest, + state::StateOverride, AccessListWithGasUsed, BlockOverrides, Bundle, EIP1186AccountProofResponse, EthCallResponse, FeeHistory, Index, RichBlock, StateContext, SyncStatus, Transaction, TransactionReceipt, TransactionRequest, Work, }; @@ -146,7 +146,7 @@ pub trait EthApi { #[method(name = "call")] async fn call( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, state_overrides: Option, block_overrides: Option>, @@ -179,7 +179,7 @@ pub trait EthApi { #[method(name = "createAccessList")] async fn create_access_list( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, ) -> RpcResult; @@ -188,7 +188,7 @@ pub trait EthApi { #[method(name = "estimateGas")] async fn estimate_gas( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, state_override: Option, ) -> RpcResult; @@ -262,7 +262,7 @@ pub trait EthApi { /// Signs a transaction that can be submitted to the network at a later time using with /// `sendRawTransaction.` #[method(name = "signTransaction")] - async fn sign_transaction(&self, transaction: CallRequest) -> RpcResult; + async fn sign_transaction(&self, transaction: TransactionRequest) -> RpcResult; /// Signs data via [EIP-712](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md). #[method(name = "signTypedData")] diff --git a/crates/rpc/rpc-api/src/trace.rs b/crates/rpc/rpc-api/src/trace.rs index 557016a9a57..9caf4a1d487 100644 --- a/crates/rpc/rpc-api/src/trace.rs +++ b/crates/rpc/rpc-api/src/trace.rs @@ -3,7 +3,7 @@ use reth_primitives::{BlockId, Bytes, B256}; use reth_rpc_types::{ state::StateOverride, trace::{filter::TraceFilter, parity::*}, - BlockOverrides, CallRequest, Index, + BlockOverrides, Index, TransactionRequest, }; use std::collections::HashSet; @@ -15,7 +15,7 @@ pub trait TraceApi { #[method(name = "call")] async fn trace_call( &self, - call: CallRequest, + call: TransactionRequest, trace_types: HashSet, block_id: Option, state_overrides: Option, @@ -28,7 +28,7 @@ pub trait TraceApi { #[method(name = "callMany")] async fn trace_call_many( &self, - calls: Vec<(CallRequest, HashSet)>, + calls: Vec<(TransactionRequest, HashSet)>, block_id: Option, ) -> RpcResult>; diff --git a/crates/rpc/rpc-builder/tests/it/http.rs b/crates/rpc/rpc-builder/tests/it/http.rs index 41b27732179..2a46db0f90c 100644 --- a/crates/rpc/rpc-builder/tests/it/http.rs +++ b/crates/rpc/rpc-builder/tests/it/http.rs @@ -21,7 +21,7 @@ use reth_rpc_api::{ }; use reth_rpc_builder::RethRpcModule; use reth_rpc_types::{ - trace::filter::TraceFilter, CallRequest, Filter, Index, Log, PendingTransactionFilterKind, + trace::filter::TraceFilter, Filter, Index, Log, PendingTransactionFilterKind, TransactionRequest, }; use serde::{Deserialize, Serialize}; @@ -129,7 +129,7 @@ where let hash = B256::default(); let tx_hash = TxHash::default(); let block_number = BlockNumberOrTag::default(); - let call_request = CallRequest::default(); + let call_request = TransactionRequest::default(); let transaction_request = TransactionRequest::default(); let bytes = Bytes::default(); let tx = Bytes::from(hex!("02f871018303579880850555633d1b82520894eee27662c2b8eba3cd936a23f039f3189633e4c887ad591c62bdaeb180c080a07ea72c68abfb8fca1bd964f0f99132ed9280261bdca3e549546c0205e800f7d0a05b4ef3039e9c9b9babc179a1878fb825b5aaf5aed2fa8744854150157b08d6f3")); diff --git a/crates/rpc/rpc-testing-util/src/debug.rs b/crates/rpc/rpc-testing-util/src/debug.rs index 7e40e7778af..282a11308a5 100644 --- a/crates/rpc/rpc-testing-util/src/debug.rs +++ b/crates/rpc/rpc-testing-util/src/debug.rs @@ -6,7 +6,7 @@ use reth_primitives::{BlockId, TxHash, B256}; use reth_rpc_api::{clients::DebugApiClient, EthApiClient}; use reth_rpc_types::{ trace::geth::{GethDebugTracerType, GethDebugTracingOptions}, - CallRequest, + TransactionRequest, }; use std::{ pin::Pin, @@ -42,7 +42,7 @@ pub trait DebugApiExt { /// method for debug_traceCall async fn debug_trace_call_json( &self, - request: CallRequest, + request: TransactionRequest, opts: GethDebugTracingOptions, ) -> Result; @@ -98,7 +98,7 @@ where } async fn debug_trace_call_json( &self, - request: CallRequest, + request: TransactionRequest, opts: GethDebugTracingOptions, ) -> Result { let mut params = jsonrpsee::core::params::ArrayParams::new(); @@ -112,7 +112,7 @@ where request_json: String, opts_json: String, ) -> Result { - let request = serde_json::from_str::(&request_json) + let request = serde_json::from_str::(&request_json) .map_err(|e| RpcError::Custom(e.to_string()))?; let opts = serde_json::from_str::(&opts_json) .map_err(|e| RpcError::Custom(e.to_string()))?; diff --git a/crates/rpc/rpc-testing-util/src/trace.rs b/crates/rpc/rpc-testing-util/src/trace.rs index 8d90cd8253d..72d071640e7 100644 --- a/crates/rpc/rpc-testing-util/src/trace.rs +++ b/crates/rpc/rpc-testing-util/src/trace.rs @@ -10,7 +10,7 @@ use reth_rpc_types::{ parity::{LocalizedTransactionTrace, TraceResults, TraceType}, tracerequest::TraceCallRequest, }, - CallRequest, Index, + Index, TransactionRequest, }; use std::{ collections::HashSet, @@ -29,8 +29,8 @@ pub type ReplayTransactionResult = Result<(TraceResults, TxHash), (RpcError, TxH /// A type representing the result of calling `trace_call_many` method. pub type CallManyTraceResult = Result< - (Vec, Vec<(CallRequest, HashSet)>), - (RpcError, Vec<(CallRequest, HashSet)>), + (Vec, Vec<(TransactionRequest, HashSet)>), + (RpcError, Vec<(TransactionRequest, HashSet)>), >; /// Result type for the `trace_get` method that also captures the requested transaction hash and /// index. @@ -91,7 +91,7 @@ pub trait TraceApiExt { block_id: Option, ) -> CallManyTraceStream<'_> where - I: IntoIterator)>; + I: IntoIterator)>; /// Returns a new stream that yields the traces for the given transaction hash and indices. fn trace_get_stream(&self, hash: B256, indices: I) -> TraceGetStream<'_> where @@ -306,7 +306,7 @@ impl TraceApiExt for T { block_id: Option, ) -> CallManyTraceStream<'_> where - I: IntoIterator)>, + I: IntoIterator)>, { let call_set = calls.into_iter().collect::>(); let stream = futures::stream::once(async move { @@ -569,8 +569,8 @@ mod tests { async fn can_create_trace_call_many_stream() { let client = HttpClientBuilder::default().build("http://localhost:8545").unwrap(); - let call_request_1 = CallRequest::default(); - let call_request_2 = CallRequest::default(); + let call_request_1 = TransactionRequest::default(); + let call_request_2 = TransactionRequest::default(); let trace_types = HashSet::from([TraceType::StateDiff, TraceType::VmTrace]); let calls = vec![(call_request_1, trace_types.clone()), (call_request_2, trace_types)]; diff --git a/crates/rpc/rpc-types-compat/src/transaction/mod.rs b/crates/rpc/rpc-types-compat/src/transaction/mod.rs index b7268e7213b..5ecad24dca8 100644 --- a/crates/rpc/rpc-types-compat/src/transaction/mod.rs +++ b/crates/rpc/rpc-types-compat/src/transaction/mod.rs @@ -1,13 +1,17 @@ //! Compatibility functions for rpc `Transaction` type. mod signature; mod typed; +use alloy_rpc_types::{ + other::OtherFields, + request::{TransactionInput, TransactionRequest}, +}; use reth_primitives::{ BlockNumber, Transaction as PrimitiveTransaction, TransactionKind as PrimitiveTransactionKind, TransactionSignedEcRecovered, TxType, B256, U128, U256, U64, }; #[cfg(feature = "optimism")] use reth_rpc_types::optimism::OptimismTransactionFields; -use reth_rpc_types::{AccessListItem, CallInput, CallRequest, Transaction}; +use reth_rpc_types::{AccessListItem, Transaction}; use signature::from_primitive_signature; pub use typed::*; /// Create a new rpc transaction result for a mined transaction, using the given block hash, @@ -167,8 +171,8 @@ pub fn from_primitive_access_list( ) } -/// Convert [TransactionSignedEcRecovered] to [CallRequest] -pub fn transaction_to_call_request(tx: TransactionSignedEcRecovered) -> CallRequest { +/// Convert [TransactionSignedEcRecovered] to [TransactionRequest] +pub fn transaction_to_call_request(tx: TransactionSignedEcRecovered) -> TransactionRequest { let from = tx.signer(); let to = tx.transaction.to(); let gas = tx.transaction.gas_limit(); @@ -189,7 +193,7 @@ pub fn transaction_to_call_request(tx: TransactionSignedEcRecovered) -> CallRequ }; let max_priority_fee_per_gas = tx.transaction.max_priority_fee_per_gas(); - CallRequest { + TransactionRequest { from: Some(from), to, gas_price: gas_price.map(U256::from), @@ -197,12 +201,14 @@ pub fn transaction_to_call_request(tx: TransactionSignedEcRecovered) -> CallRequ max_priority_fee_per_gas: max_priority_fee_per_gas.map(U256::from), gas: Some(U256::from(gas)), value: Some(value.into()), - input: CallInput::new(input), + input: TransactionInput::new(input), nonce: Some(U64::from(nonce)), chain_id: chain_id.map(U64::from), access_list, max_fee_per_blob_gas: max_fee_per_blob_gas.map(U256::from), blob_versioned_hashes, transaction_type: Some(tx_type.into()), + sidecar: None, + other: OtherFields::default(), } } diff --git a/crates/rpc/rpc-types/src/eth/transaction/request.rs b/crates/rpc/rpc-types/src/eth/transaction/request.rs index 410095fa8fb..831718f357d 100644 --- a/crates/rpc/rpc-types/src/eth/transaction/request.rs +++ b/crates/rpc/rpc-types/src/eth/transaction/request.rs @@ -1,223 +1 @@ -use crate::{ - eth::transaction::typed::{ - EIP1559TransactionRequest, EIP2930TransactionRequest, EIP4844TransactionRequest, - LegacyTransactionRequest, TransactionKind, TypedTransactionRequest, - }, - AccessList, -}; -use alloy_primitives::{Address, Bytes, B256, U128, U256, U64, U8}; -use alloy_rpc_types::BlobTransactionSidecar; -use serde::{Deserialize, Serialize}; - -/// Represents _all_ transaction requests received from RPC -#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)] -#[serde(deny_unknown_fields)] -#[serde(rename_all = "camelCase")] -pub struct TransactionRequest { - /// from address - pub from: Option
, - /// to address - pub to: Option
, - /// legacy, gas Price - pub gas_price: Option, - /// max base fee per gas sender is willing to pay - pub max_fee_per_gas: Option, - /// miner tip - pub max_priority_fee_per_gas: Option, - /// gas - pub gas: Option, - /// value of th tx in wei - pub value: Option, - /// Any additional data sent - #[serde(alias = "data")] - pub input: Option, - /// Transaction nonce - pub nonce: Option, - /// warm storage access pre-payment - pub access_list: Option, - /// EIP-2718 type - #[serde(rename = "type", skip_serializing_if = "Option::is_none")] - pub transaction_type: Option, - /// max fee per blob gas for EIP-4844 transactions - pub max_fee_per_blob_gas: Option, - /// blob versioned hashes for EIP-4844 transactions. - pub blob_versioned_hashes: Option>, - /// sidecar for EIP-4844 transactions - pub sidecar: Option, -} - -// == impl TransactionRequest == - -impl TransactionRequest { - /// Converts the request into a [`TypedTransactionRequest`] - /// - /// Returns None if mutual exclusive fields `gasPrice` and `max_fee_per_gas` are either missing - /// or both set. - pub fn into_typed_request(self) -> Option { - let TransactionRequest { - to, - gas_price, - max_fee_per_gas, - max_priority_fee_per_gas, - gas, - value, - input: data, - nonce, - mut access_list, - max_fee_per_blob_gas, - blob_versioned_hashes, - sidecar, - .. - } = self; - match ( - gas_price, - max_fee_per_gas, - access_list.take(), - max_fee_per_blob_gas, - blob_versioned_hashes, - sidecar, - ) { - // legacy transaction - // gas price required - (Some(_), None, None, None, None, None) => { - Some(TypedTransactionRequest::Legacy(LegacyTransactionRequest { - nonce: nonce.unwrap_or_default(), - gas_price: gas_price.unwrap_or_default(), - gas_limit: gas.unwrap_or_default(), - value: value.unwrap_or_default(), - input: data.unwrap_or_default(), - kind: match to { - Some(to) => TransactionKind::Call(to), - None => TransactionKind::Create, - }, - chain_id: None, - })) - } - // EIP2930 - // if only accesslist is set, and no eip1599 fees - (_, None, Some(access_list), None, None, None) => { - Some(TypedTransactionRequest::EIP2930(EIP2930TransactionRequest { - nonce: nonce.unwrap_or_default(), - gas_price: gas_price.unwrap_or_default(), - gas_limit: gas.unwrap_or_default(), - value: value.unwrap_or_default(), - input: data.unwrap_or_default(), - kind: match to { - Some(to) => TransactionKind::Call(to), - None => TransactionKind::Create, - }, - chain_id: 0, - access_list, - })) - } - // EIP1559 - // if 4844 fields missing - // gas_price, max_fee_per_gas, access_list, max_fee_per_blob_gas, blob_versioned_hashes, - // sidecar, - (None, _, _, None, None, None) => { - // Empty fields fall back to the canonical transaction schema. - Some(TypedTransactionRequest::EIP1559(EIP1559TransactionRequest { - nonce: nonce.unwrap_or_default(), - max_fee_per_gas: max_fee_per_gas.unwrap_or_default(), - max_priority_fee_per_gas: max_priority_fee_per_gas.unwrap_or_default(), - gas_limit: gas.unwrap_or_default(), - value: value.unwrap_or_default(), - input: data.unwrap_or_default(), - kind: match to { - Some(to) => TransactionKind::Call(to), - None => TransactionKind::Create, - }, - chain_id: 0, - access_list: access_list.unwrap_or_default(), - })) - } - // EIP4884 - // all blob fields required - ( - None, - _, - _, - Some(max_fee_per_blob_gas), - Some(blob_versioned_hashes), - Some(sidecar), - ) => { - // As per the EIP, we follow the same semantics as EIP-1559. - Some(TypedTransactionRequest::EIP4844(EIP4844TransactionRequest { - chain_id: 0, - nonce: nonce.unwrap_or_default(), - max_priority_fee_per_gas: max_priority_fee_per_gas.unwrap_or_default(), - max_fee_per_gas: max_fee_per_gas.unwrap_or_default(), - gas_limit: gas.unwrap_or_default(), - value: value.unwrap_or_default(), - input: data.unwrap_or_default(), - kind: match to { - Some(to) => TransactionKind::Call(to), - None => TransactionKind::Create, - }, - access_list: access_list.unwrap_or_default(), - - // eip-4844 specific. - max_fee_per_blob_gas, - blob_versioned_hashes, - sidecar, - })) - } - - _ => None, - } - } - - /// Sets the gas limit for the transaction. - pub fn gas_limit(mut self, gas_limit: u64) -> Self { - self.gas = Some(U256::from(gas_limit)); - self - } - - /// Sets the nonce for the transaction. - pub fn nonce(mut self, nonce: u64) -> Self { - self.nonce = Some(U64::from(nonce)); - self - } - - /// Sets the maximum fee per gas for the transaction. - pub fn max_fee_per_gas(mut self, max_fee_per_gas: u128) -> Self { - self.max_fee_per_gas = Some(U128::from(max_fee_per_gas)); - self - } - - /// Sets the maximum priority fee per gas for the transaction. - pub fn max_priority_fee_per_gas(mut self, max_priority_fee_per_gas: u128) -> Self { - self.max_priority_fee_per_gas = Some(U128::from(max_priority_fee_per_gas)); - self - } - - /// Sets the recipient address for the transaction. - pub fn to(mut self, to: Address) -> Self { - self.to = Some(to); - self - } - /// Sets the value (amount) for the transaction. - - pub fn value(mut self, value: u128) -> Self { - self.value = Some(U256::from(value)); - self - } - - /// Sets the access list for the transaction. - pub fn access_list(mut self, access_list: AccessList) -> Self { - self.access_list = Some(access_list); - self - } - - /// Sets the input data for the transaction. - pub fn input(mut self, input: impl Into) -> Self { - self.input = Some(input.into()); - self - } - - /// Sets the transactions type for the transactions. - pub fn transaction_type(mut self, transaction_type: u8) -> Self { - self.transaction_type = Some(U8::from(transaction_type)); - self - } -} +pub use alloy_rpc_types::request::TransactionRequest; diff --git a/crates/rpc/rpc-types/src/eth/transaction/typed.rs b/crates/rpc/rpc-types/src/eth/transaction/typed.rs index 60b910f9057..7b301a33835 100644 --- a/crates/rpc/rpc-types/src/eth/transaction/typed.rs +++ b/crates/rpc/rpc-types/src/eth/transaction/typed.rs @@ -2,7 +2,7 @@ //! transaction deserialized from the json input of an RPC call. Depending on what fields are set, //! it can be converted into the container type [`TypedTransactionRequest`]. -use alloy_primitives::{Address, Bytes, B256, U128, U256, U64}; +use alloy_primitives::{Address, Bytes, B256, U256, U64}; use alloy_rlp::{BufMut, Decodable, Encodable, Error as RlpError}; use alloy_rpc_types::{AccessList, BlobTransactionSidecar}; use serde::{Deserialize, Serialize}; @@ -32,7 +32,7 @@ pub struct LegacyTransactionRequest { /// The nonce of the transaction pub nonce: U64, /// The gas price for the transaction - pub gas_price: U128, + pub gas_price: U256, /// The gas limit for the transaction pub gas_limit: U256, /// The kind of transaction (e.g., Call, Create) @@ -53,7 +53,7 @@ pub struct EIP2930TransactionRequest { /// The nonce of the transaction pub nonce: U64, /// The gas price for the transaction - pub gas_price: U128, + pub gas_price: U256, /// The gas limit for the transaction pub gas_limit: U256, /// The kind of transaction (e.g., Call, Create) @@ -74,9 +74,9 @@ pub struct EIP1559TransactionRequest { /// The nonce of the transaction pub nonce: U64, /// The maximum priority fee per gas for the transaction - pub max_priority_fee_per_gas: U128, + pub max_priority_fee_per_gas: U256, /// The maximum fee per gas for the transaction - pub max_fee_per_gas: U128, + pub max_fee_per_gas: U256, /// The gas limit for the transaction pub gas_limit: U256, /// The kind of transaction (e.g., Call, Create) @@ -97,9 +97,9 @@ pub struct EIP4844TransactionRequest { /// The nonce of the transaction pub nonce: U64, /// The maximum priority fee per gas for the transaction - pub max_priority_fee_per_gas: U128, + pub max_priority_fee_per_gas: U256, /// The maximum fee per gas for the transaction - pub max_fee_per_gas: U128, + pub max_fee_per_gas: U256, /// The gas limit for the transaction pub gas_limit: U256, /// The kind of transaction (e.g., Call, Create) @@ -111,7 +111,7 @@ pub struct EIP4844TransactionRequest { /// The access list for the transaction pub access_list: AccessList, /// The maximum fee per blob gas for the transaction - pub max_fee_per_blob_gas: U128, + pub max_fee_per_blob_gas: U256, /// Versioned hashes associated with the transaction pub blob_versioned_hashes: Vec, /// Sidecar information for the transaction diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index 31d1c5be6ed..c0ae69f051e 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -27,7 +27,7 @@ use reth_rpc_types::{ BlockTraceResult, FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerType, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, NoopFrame, TraceResult, }, - BlockError, Bundle, CallRequest, RichBlock, StateContext, + BlockError, Bundle, RichBlock, StateContext, TransactionRequest, }; use revm::{ db::CacheDB, @@ -263,7 +263,7 @@ where /// - `debug_traceCall` executes with __enabled__ basefee check, `eth_call` does not: pub async fn debug_trace_call( &self, - call: CallRequest, + call: TransactionRequest, block_id: Option, opts: GethDebugTracingCallOptions, ) -> EthResult { @@ -286,7 +286,7 @@ where Ok(inspector) }) .await?; - return Ok(FourByteFrame::from(inspector).into()) + return Ok(FourByteFrame::from(inspector).into()); } GethDebugBuiltInTracerType::CallTracer => { let call_config = tracer_config @@ -309,7 +309,7 @@ where Ok(frame.into()) }) .await?; - return Ok(frame) + return Ok(frame); } GethDebugBuiltInTracerType::PreStateTracer => { let prestate_config = tracer_config @@ -334,7 +334,7 @@ where Ok(frame) }) .await?; - return Ok(frame.into()) + return Ok(frame.into()); } GethDebugBuiltInTracerType::NoopTracer => Ok(NoopFrame::default().into()), }, @@ -356,7 +356,7 @@ where Ok(GethTrace::JS(res)) } - } + }; } // default structlog tracer @@ -388,7 +388,7 @@ where opts: Option, ) -> EthResult>> { if bundles.is_empty() { - return Err(EthApiError::InvalidParams(String::from("bundles are empty."))) + return Err(EthApiError::InvalidParams(String::from("bundles are empty."))); } let StateContext { transaction_index, block_number } = state_context.unwrap_or_default(); @@ -505,7 +505,7 @@ where GethDebugBuiltInTracerType::FourByteTracer => { let mut inspector = FourByteInspector::default(); let (res, _) = inspect(db, env, &mut inspector)?; - return Ok((FourByteFrame::from(inspector).into(), res.state)) + return Ok((FourByteFrame::from(inspector).into(), res.state)); } GethDebugBuiltInTracerType::CallTracer => { let call_config = tracer_config @@ -523,7 +523,7 @@ where .into_geth_builder() .geth_call_traces(call_config, res.result.gas_used()); - return Ok((frame.into(), res.state)) + return Ok((frame.into(), res.state)); } GethDebugBuiltInTracerType::PreStateTracer => { let prestate_config = tracer_config @@ -544,7 +544,7 @@ where &*db, )?; - return Ok((frame.into(), res.state)) + return Ok((frame.into(), res.state)); } GethDebugBuiltInTracerType::NoopTracer => { Ok((NoopFrame::default().into(), Default::default())) @@ -563,7 +563,7 @@ where let result = inspector.json_result(res, &env, db)?; Ok((GethTrace::JS(result), state)) } - } + }; } // default structlog tracer @@ -721,7 +721,7 @@ where /// Handler for `debug_traceCall` async fn debug_trace_call( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, opts: Option, ) -> RpcResult { diff --git a/crates/rpc/rpc/src/engine.rs b/crates/rpc/rpc/src/engine.rs index d7c53221c49..7afe4313642 100644 --- a/crates/rpc/rpc/src/engine.rs +++ b/crates/rpc/rpc/src/engine.rs @@ -4,7 +4,7 @@ use reth_rpc_api::{EngineEthApiServer, EthApiServer, EthFilterApiServer}; /// Re-export for convenience pub use reth_rpc_engine_api::EngineApi; use reth_rpc_types::{ - state::StateOverride, BlockOverrides, CallRequest, Filter, Log, RichBlock, SyncStatus, + state::StateOverride, BlockOverrides, Filter, Log, RichBlock, SyncStatus, TransactionRequest, }; use tracing_futures::Instrument; @@ -59,7 +59,7 @@ where /// Handler for: `eth_call` async fn call( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, state_overrides: Option, block_overrides: Option>, diff --git a/crates/rpc/rpc/src/eth/api/call.rs b/crates/rpc/rpc/src/eth/api/call.rs index bef38a4da93..8b72feb3f92 100644 --- a/crates/rpc/rpc/src/eth/api/call.rs +++ b/crates/rpc/rpc/src/eth/api/call.rs @@ -20,7 +20,8 @@ use reth_provider::{ }; use reth_revm::{access_list::AccessListInspector, database::StateProviderDatabase}; use reth_rpc_types::{ - state::StateOverride, AccessListWithGasUsed, Bundle, CallRequest, EthCallResponse, StateContext, + state::StateOverride, AccessListWithGasUsed, Bundle, EthCallResponse, StateContext, + TransactionRequest, }; use reth_transaction_pool::TransactionPool; use revm::{ @@ -47,7 +48,7 @@ where /// Estimate gas needed for execution of the `request` at the [BlockId]. pub async fn estimate_gas_at( &self, - request: CallRequest, + request: TransactionRequest, at: BlockId, state_override: Option, ) -> EthResult { @@ -63,7 +64,7 @@ where /// Executes the call request (`eth_call`) and returns the output pub async fn call( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, overrides: EvmOverrides, ) -> EthResult { @@ -88,7 +89,7 @@ where ) -> EthResult> { let Bundle { transactions, block_override } = bundle; if transactions.is_empty() { - return Err(EthApiError::InvalidParams(String::from("transactions are empty."))) + return Err(EthApiError::InvalidParams(String::from("transactions are empty."))); } let StateContext { transaction_index, block_number } = state_context.unwrap_or_default(); @@ -173,12 +174,12 @@ where /// Estimates the gas usage of the `request` with the state. /// - /// This will execute the [CallRequest] and find the best gas limit via binary search + /// This will execute the [TransactionRequest] and find the best gas limit via binary search pub fn estimate_gas_with( &self, mut cfg: CfgEnvWithHandlerCfg, block: BlockEnv, - request: CallRequest, + request: TransactionRequest, state: S, state_override: Option, ) -> EthResult @@ -223,9 +224,9 @@ where if env.tx.value > available_funds { return Err( RpcInvalidTransactionError::InsufficientFundsForTransfer.into() - ) + ); } - return Ok(U256::from(MIN_TRANSACTION_GAS)) + return Ok(U256::from(MIN_TRANSACTION_GAS)); } } } @@ -257,7 +258,7 @@ where // if price or limit was included in the request then we can execute the request // again with the block's gas limit to check if revert is gas related or not if request_gas.is_some() || request_gas_price.is_some() { - return Err(map_out_of_gas_err(env_gas_limit, env, &mut db)) + return Err(map_out_of_gas_err(env_gas_limit, env, &mut db)); } } @@ -269,7 +270,7 @@ where ExecutionResult::Halt { reason, gas_used } => { // here we don't check for invalid opcode because already executed with highest gas // limit - return Err(RpcInvalidTransactionError::halt(reason, gas_used).into()) + return Err(RpcInvalidTransactionError::halt(reason, gas_used).into()); } ExecutionResult::Revert { output, .. } => { // if price or limit was included in the request then we can execute the request @@ -279,7 +280,7 @@ where } else { // the transaction did revert Err(RpcInvalidTransactionError::Revert(RevertError::new(output)).into()) - } + }; } } @@ -316,7 +317,7 @@ where // new midpoint mid_gas_limit = ((highest_gas_limit as u128 + lowest_gas_limit as u128) / 2) as u64; - continue + continue; } let (res, _) = ethres?; @@ -342,7 +343,7 @@ where err => { // these should be unreachable because we know the transaction succeeds, // but we consider these cases an error - return Err(RpcInvalidTransactionError::EvmHalt(err).into()) + return Err(RpcInvalidTransactionError::EvmHalt(err).into()); } } } @@ -357,7 +358,7 @@ where /// Creates the AccessList for the `request` at the [BlockId] or latest. pub(crate) async fn create_access_list_at( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, ) -> EthResult { self.on_blocking_task(|this| async move { @@ -368,7 +369,7 @@ where async fn create_access_list_with( &self, - mut request: CallRequest, + mut request: TransactionRequest, at: Option, ) -> EthResult { let block_id = at.unwrap_or(BlockId::Number(BlockNumberOrTag::Latest)); diff --git a/crates/rpc/rpc/src/eth/api/server.rs b/crates/rpc/rpc/src/eth/api/server.rs index aa5d91ee14e..c27c1765473 100644 --- a/crates/rpc/rpc/src/eth/api/server.rs +++ b/crates/rpc/rpc/src/eth/api/server.rs @@ -23,7 +23,7 @@ use reth_provider::{ }; use reth_rpc_api::EthApiServer; use reth_rpc_types::{ - state::StateOverride, AccessListWithGasUsed, BlockOverrides, Bundle, CallRequest, + state::StateOverride, AccessListWithGasUsed, BlockOverrides, Bundle, EIP1186AccountProofResponse, EthCallResponse, FeeHistory, Index, RichBlock, StateContext, SyncStatus, TransactionReceipt, TransactionRequest, Work, }; @@ -229,7 +229,7 @@ where /// Handler for: `eth_call` async fn call( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, state_overrides: Option, block_overrides: Option>, @@ -254,7 +254,7 @@ where /// Handler for: `eth_createAccessList` async fn create_access_list( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, ) -> Result { trace!(target: "rpc::eth", ?request, ?block_number, "Serving eth_createAccessList"); @@ -266,7 +266,7 @@ where /// Handler for: `eth_estimateGas` async fn estimate_gas( &self, - request: CallRequest, + request: TransactionRequest, block_number: Option, state_override: Option, ) -> Result { @@ -283,19 +283,19 @@ where /// Handler for: `eth_gasPrice` async fn gas_price(&self) -> Result { trace!(target: "rpc::eth", "Serving eth_gasPrice"); - return Ok(EthApi::gas_price(self).await?) + return Ok(EthApi::gas_price(self).await?); } /// Handler for: `eth_blobGasPrice` async fn blob_gas_price(&self) -> Result { trace!(target: "rpc::eth", "Serving eth_blobGasPrice"); - return Ok(EthApi::blob_gas_price(self).await?) + return Ok(EthApi::blob_gas_price(self).await?); } /// Handler for: `eth_maxPriorityFeePerGas` async fn max_priority_fee_per_gas(&self) -> Result { trace!(target: "rpc::eth", "Serving eth_maxPriorityFeePerGas"); - return Ok(EthApi::suggested_priority_fee(self).await?) + return Ok(EthApi::suggested_priority_fee(self).await?); } // FeeHistory is calculated based on lazy evaluation of fees for historical blocks, and further @@ -316,7 +316,7 @@ where trace!(target: "rpc::eth", ?block_count, ?newest_block, ?reward_percentiles, "Serving eth_feeHistory"); return Ok( EthApi::fee_history(self, block_count.to(), newest_block, reward_percentiles).await? - ) + ); } /// Handler for: `eth_mining` @@ -363,7 +363,7 @@ where } /// Handler for: `eth_signTransaction` - async fn sign_transaction(&self, _transaction: CallRequest) -> Result { + async fn sign_transaction(&self, _transaction: TransactionRequest) -> Result { Err(internal_rpc_err("unimplemented")) } diff --git a/crates/rpc/rpc/src/eth/api/transactions.rs b/crates/rpc/rpc/src/eth/api/transactions.rs index d4873ae7a31..36348db5fc3 100644 --- a/crates/rpc/rpc/src/eth/api/transactions.rs +++ b/crates/rpc/rpc/src/eth/api/transactions.rs @@ -1,5 +1,4 @@ //! Contains RPC handler implementations specific to transactions - use crate::{ eth::{ api::pending_block::PendingBlockEnv, @@ -31,8 +30,12 @@ use reth_revm::{ tracing::{TracingInspector, TracingInspectorConfig}, }; use reth_rpc_types::{ - CallRequest, Index, Log, Transaction, TransactionInfo, TransactionReceipt, TransactionRequest, - TypedTransactionRequest, + transaction::{ + EIP1559TransactionRequest, EIP2930TransactionRequest, EIP4844TransactionRequest, + LegacyTransactionRequest, + }, + Index, Log, Transaction, TransactionInfo, TransactionKind as RpcTransactionKind, + TransactionReceipt, TransactionRequest, TypedTransactionRequest, }; use reth_rpc_types_compat::transaction::from_recovered_with_block_context; use reth_transaction_pool::{TransactionOrigin, TransactionPool}; @@ -69,7 +72,7 @@ pub(crate) type StateCacheDB = CacheDB>; /// /// ## Calls /// -/// There are subtle differences between when transacting [CallRequest]: +/// There are subtle differences between when transacting [TransactionRequest]: /// /// The endpoints `eth_call` and `eth_estimateGas` and `eth_createAccessList` should always /// __disable__ the base fee check in the [EnvWithHandlerCfg] @@ -181,14 +184,14 @@ pub trait EthTransactions: Send + Sync { /// Returns the hash of the signed transaction. async fn send_transaction(&self, request: TransactionRequest) -> EthResult; - /// Prepares the state and env for the given [CallRequest] at the given [BlockId] and executes - /// the closure on a new task returning the result of the closure. + /// Prepares the state and env for the given [TransactionRequest] at the given [BlockId] and + /// executes the closure on a new task returning the result of the closure. /// - /// This returns the configured [EnvWithHandlerCfg] for the given [CallRequest] at the given - /// [BlockId] and with configured call settings: `prepare_call_env`. + /// This returns the configured [EnvWithHandlerCfg] for the given [TransactionRequest] at the + /// given [BlockId] and with configured call settings: `prepare_call_env`. async fn spawn_with_call_at( &self, - request: CallRequest, + request: TransactionRequest, at: BlockId, overrides: EvmOverrides, f: F, @@ -200,7 +203,7 @@ pub trait EthTransactions: Send + Sync { /// Executes the call request at the given [BlockId]. async fn transact_call_at( &self, - request: CallRequest, + request: TransactionRequest, at: BlockId, overrides: EvmOverrides, ) -> EthResult<(ResultAndState, EnvWithHandlerCfg)>; @@ -209,7 +212,7 @@ pub trait EthTransactions: Send + Sync { /// inspect call. async fn spawn_inspect_call_at( &self, - request: CallRequest, + request: TransactionRequest, at: BlockId, overrides: EvmOverrides, inspector: I, @@ -379,7 +382,7 @@ where let PendingBlockEnv { cfg, block_env, origin } = self.pending_block_env_and_cfg()?; Ok((cfg, block_env, origin.state_block_id())) } else { - // Use cached values if there is no pending block + // Use cached values if there is no pending block let block_hash = self .provider() .block_hash_for_id(at)? @@ -571,21 +574,22 @@ where let estimated_gas = self .estimate_gas_at( - CallRequest { + TransactionRequest { from: Some(from), to: request.to, gas: request.gas, - gas_price: Some(U256::from(gas_price)), - max_fee_per_gas: Some(U256::from(max_fee_per_gas)), + gas_price: Some(gas_price), + max_fee_per_gas: Some(max_fee_per_gas), value: request.value, - input: request.input.clone().into(), + input: request.input.clone(), nonce: request.nonce, chain_id: Some(chain_id), access_list: request.access_list.clone(), - max_priority_fee_per_gas: Some(U256::from(max_fee_per_gas)), + max_priority_fee_per_gas: Some(max_fee_per_gas), transaction_type: None, blob_versioned_hashes: None, max_fee_per_blob_gas: None, + ..Default::default() }, BlockId::Number(BlockNumberOrTag::Pending), None, @@ -593,32 +597,146 @@ where .await?; let gas_limit = estimated_gas; - let transaction = match request.into_typed_request() { + let TransactionRequest { + to, + gas_price, + max_fee_per_gas, + max_priority_fee_per_gas, + gas, + value, + input: data, + nonce, + mut access_list, + max_fee_per_blob_gas, + blob_versioned_hashes, + sidecar, + .. + } = request; + + // todo: remove this inlining after https://github.com/alloy-rs/alloy/pull/183#issuecomment-1928161285 + let transaction = match ( + gas_price, + max_fee_per_gas, + access_list.take(), + max_fee_per_blob_gas, + blob_versioned_hashes, + sidecar, + ) { + // legacy transaction + // gas price required + (Some(_), None, None, None, None, None) => { + Some(TypedTransactionRequest::Legacy(LegacyTransactionRequest { + nonce: nonce.unwrap_or_default(), + gas_price: gas_price.unwrap_or_default(), + gas_limit: gas.unwrap_or_default(), + value: value.unwrap_or_default(), + input: data.into_input().unwrap_or_default(), + kind: match to { + Some(to) => RpcTransactionKind::Call(to), + None => RpcTransactionKind::Create, + }, + chain_id: None, + })) + } + // EIP2930 + // if only accesslist is set, and no eip1599 fees + (_, None, Some(access_list), None, None, None) => { + Some(TypedTransactionRequest::EIP2930(EIP2930TransactionRequest { + nonce: nonce.unwrap_or_default(), + gas_price: gas_price.unwrap_or_default(), + gas_limit: gas.unwrap_or_default(), + value: value.unwrap_or_default(), + input: data.into_input().unwrap_or_default(), + kind: match to { + Some(to) => RpcTransactionKind::Call(to), + None => RpcTransactionKind::Create, + }, + chain_id: 0, + access_list, + })) + } + // EIP1559 + // if 4844 fields missing + // gas_price, max_fee_per_gas, access_list, max_fee_per_blob_gas, blob_versioned_hashes, + // sidecar, + (None, _, _, None, None, None) => { + // Empty fields fall back to the canonical transaction schema. + Some(TypedTransactionRequest::EIP1559(EIP1559TransactionRequest { + nonce: nonce.unwrap_or_default(), + max_fee_per_gas: max_fee_per_gas.unwrap_or_default(), + max_priority_fee_per_gas: max_priority_fee_per_gas.unwrap_or_default(), + gas_limit: gas.unwrap_or_default(), + value: value.unwrap_or_default(), + input: data.into_input().unwrap_or_default(), + kind: match to { + Some(to) => RpcTransactionKind::Call(to), + None => RpcTransactionKind::Create, + }, + chain_id: 0, + access_list: access_list.unwrap_or_default(), + })) + } + // EIP4884 + // all blob fields required + ( + None, + _, + _, + Some(max_fee_per_blob_gas), + Some(blob_versioned_hashes), + Some(sidecar), + ) => { + // As per the EIP, we follow the same semantics as EIP-1559. + Some(TypedTransactionRequest::EIP4844(EIP4844TransactionRequest { + chain_id: 0, + nonce: nonce.unwrap_or_default(), + max_priority_fee_per_gas: max_priority_fee_per_gas.unwrap_or_default(), + max_fee_per_gas: max_fee_per_gas.unwrap_or_default(), + gas_limit: gas.unwrap_or_default(), + value: value.unwrap_or_default(), + input: data.into_input().unwrap_or_default(), + kind: match to { + Some(to) => RpcTransactionKind::Call(to), + None => RpcTransactionKind::Create, + }, + access_list: access_list.unwrap_or_default(), + + // eip-4844 specific. + max_fee_per_blob_gas, + blob_versioned_hashes, + sidecar, + })) + } + + _ => None, + }; + + let transaction = match transaction { Some(TypedTransactionRequest::Legacy(mut m)) => { m.chain_id = Some(chain_id.to()); m.gas_limit = gas_limit; - m.gas_price = gas_price; + m.gas_price = gas_price.unwrap_or_default(); TypedTransactionRequest::Legacy(m) } Some(TypedTransactionRequest::EIP2930(mut m)) => { m.chain_id = chain_id.to(); m.gas_limit = gas_limit; - m.gas_price = gas_price; + m.gas_price = gas_price.unwrap_or_default(); TypedTransactionRequest::EIP2930(m) } Some(TypedTransactionRequest::EIP1559(mut m)) => { m.chain_id = chain_id.to(); m.gas_limit = gas_limit; - m.max_fee_per_gas = max_fee_per_gas; + m.max_fee_per_gas = max_fee_per_gas.unwrap_or_default(); TypedTransactionRequest::EIP1559(m) } Some(TypedTransactionRequest::EIP4844(mut m)) => { m.chain_id = chain_id.to(); m.gas_limit = gas_limit; - m.max_fee_per_gas = max_fee_per_gas; + m.max_fee_per_gas = max_fee_per_gas.unwrap_or_default(); TypedTransactionRequest::EIP4844(m) } @@ -641,7 +759,7 @@ where async fn spawn_with_call_at( &self, - request: CallRequest, + request: TransactionRequest, at: BlockId, overrides: EvmOverrides, f: F, @@ -674,7 +792,7 @@ where async fn transact_call_at( &self, - request: CallRequest, + request: TransactionRequest, at: BlockId, overrides: EvmOverrides, ) -> EthResult<(ResultAndState, EnvWithHandlerCfg)> { @@ -684,7 +802,7 @@ where async fn spawn_inspect_call_at( &self, - request: CallRequest, + request: TransactionRequest, at: BlockId, overrides: EvmOverrides, inspector: I, @@ -1072,7 +1190,7 @@ where return match signer.sign_transaction(request, from) { Ok(tx) => Ok(tx), Err(e) => Err(e.into()), - } + }; } } Err(EthApiError::InvalidTransactionSignature) @@ -1097,7 +1215,7 @@ where block_number, base_fee_per_gas, index.into(), - ))) + ))); } } diff --git a/crates/rpc/rpc/src/eth/error.rs b/crates/rpc/rpc/src/eth/error.rs index 5bd4cb78064..cae7cc0dd04 100644 --- a/crates/rpc/rpc/src/eth/error.rs +++ b/crates/rpc/rpc/src/eth/error.rs @@ -9,7 +9,7 @@ use jsonrpsee::{ use reth_interfaces::RethError; use reth_primitives::{revm_primitives::InvalidHeader, Address, Bytes, U256}; use reth_revm::tracing::js::JsInspectorError; -use reth_rpc_types::{error::EthRpcErrorCode, BlockError, CallInputError}; +use reth_rpc_types::{error::EthRpcErrorCode, request::TransactionInputError, BlockError}; use reth_transaction_pool::error::{ Eip4844PoolTransactionError, InvalidPoolTransactionError, PoolError, PoolErrorKind, PoolTransactionError, @@ -105,7 +105,7 @@ pub enum EthApiError { InternalJsTracerError(String), #[error(transparent)] /// Call Input error when both `data` and `input` fields are set and not equal. - CallInputError(#[from] CallInputError), + TransactionInputError(#[from] TransactionInputError), /// Optimism related error #[error(transparent)] #[cfg(feature = "optimism")] @@ -170,7 +170,7 @@ impl From for ErrorObject<'static> { } err @ EthApiError::InternalBlockingTaskError => internal_rpc_err(err.to_string()), err @ EthApiError::InternalEthError => internal_rpc_err(err.to_string()), - err @ EthApiError::CallInputError(_) => invalid_params_rpc_err(err.to_string()), + err @ EthApiError::TransactionInputError(_) => invalid_params_rpc_err(err.to_string()), #[cfg(feature = "optimism")] EthApiError::Optimism(err) => match err { OptimismEthApiError::HyperError(err) => internal_rpc_err(err.to_string()), diff --git a/crates/rpc/rpc/src/eth/revm_utils.rs b/crates/rpc/rpc/src/eth/revm_utils.rs index a6b0f9d471e..653d27a0328 100644 --- a/crates/rpc/rpc/src/eth/revm_utils.rs +++ b/crates/rpc/rpc/src/eth/revm_utils.rs @@ -11,7 +11,7 @@ use reth_primitives::{ }; use reth_rpc_types::{ state::{AccountOverride, StateOverride}, - BlockOverrides, CallRequest, + BlockOverrides, TransactionRequest, }; #[cfg(feature = "optimism")] use revm::primitives::{Bytes, OptimismFields}; @@ -214,7 +214,7 @@ where for tx in transactions.into_iter() { if tx.hash() == target_tx_hash { // reached the target transaction - break + break; } tx.try_fill_tx_env(evm.tx_mut())?; @@ -235,7 +235,7 @@ where pub(crate) fn prepare_call_env( mut cfg: CfgEnvWithHandlerCfg, block: BlockEnv, - request: CallRequest, + request: TransactionRequest, gas_limit: u64, db: &mut CacheDB, overrides: EvmOverrides, @@ -296,29 +296,33 @@ where Ok(env) } -/// Creates a new [EnvWithHandlerCfg] to be used for executing the [CallRequest] in `eth_call`. +/// Creates a new [EnvWithHandlerCfg] to be used for executing the [TransactionRequest] in +/// `eth_call`. /// /// Note: this does _not_ access the Database to check the sender. pub(crate) fn build_call_evm_env( cfg: CfgEnvWithHandlerCfg, block: BlockEnv, - request: CallRequest, + request: TransactionRequest, ) -> EthResult { let tx = create_txn_env(&block, request)?; Ok(EnvWithHandlerCfg::new_with_cfg_env(cfg, block, tx)) } -/// Configures a new [TxEnv] for the [CallRequest] +/// Configures a new [TxEnv] for the [TransactionRequest] /// -/// All [TxEnv] fields are derived from the given [CallRequest], if fields are `None`, they fall -/// back to the [BlockEnv]'s settings. -pub(crate) fn create_txn_env(block_env: &BlockEnv, request: CallRequest) -> EthResult { +/// All [TxEnv] fields are derived from the given [TransactionRequest], if fields are `None`, they +/// fall back to the [BlockEnv]'s settings. +pub(crate) fn create_txn_env( + block_env: &BlockEnv, + request: TransactionRequest, +) -> EthResult { // Ensure that if versioned hashes are set, they're not empty if request.has_empty_blob_hashes() { - return Err(RpcInvalidTransactionError::BlobTransactionMissingBlobHashes.into()) + return Err(RpcInvalidTransactionError::BlobTransactionMissingBlobHashes.into()); } - let CallRequest { + let TransactionRequest { from, to, gas_price, @@ -412,7 +416,7 @@ where .unwrap_or_default()) } -/// Helper type for representing the fees of a [CallRequest] +/// Helper type for representing the fees of a [TransactionRequest] pub(crate) struct CallFees { /// EIP-1559 priority fee max_priority_fee_per_gas: Option, @@ -430,7 +434,7 @@ pub(crate) struct CallFees { // === impl CallFees === impl CallFees { - /// Ensures the fields of a [CallRequest] are not conflicting. + /// Ensures the fields of a [TransactionRequest] are not conflicting. /// /// If no `gasPrice` or `maxFeePerGas` is set, then the `gas_price` in the returned `gas_price` /// will be `0`. See: @@ -463,7 +467,7 @@ impl CallFees { return Err( // `max_priority_fee_per_gas` is greater than the `max_fee_per_gas` RpcInvalidTransactionError::TipAboveFeeCap.into(), - ) + ); } } Ok(()) @@ -500,7 +504,7 @@ impl CallFees { // Ensure blob_hashes are present if !has_blob_hashes { // Blob transaction but no blob hashes - return Err(RpcInvalidTransactionError::BlobTransactionMissingBlobHashes.into()) + return Err(RpcInvalidTransactionError::BlobTransactionMissingBlobHashes.into()); } Ok(CallFees { diff --git a/crates/rpc/rpc/src/trace.rs b/crates/rpc/rpc/src/trace.rs index 64bbbe54573..ded4153ab4d 100644 --- a/crates/rpc/rpc/src/trace.rs +++ b/crates/rpc/rpc/src/trace.rs @@ -22,7 +22,7 @@ use reth_rpc_api::TraceApiServer; use reth_rpc_types::{ state::StateOverride, trace::{filter::TraceFilter, parity::*, tracerequest::TraceCallRequest}, - BlockError, BlockOverrides, CallRequest, Index, + BlockError, BlockOverrides, Index, TransactionRequest, }; use revm::{ db::{CacheDB, DatabaseCommit}, @@ -125,7 +125,7 @@ where /// Note: Allows tracing dependent transactions, hence all transactions are traced in sequence pub async fn trace_call_many( &self, - calls: Vec<(CallRequest, HashSet)>, + calls: Vec<(TransactionRequest, HashSet)>, block_id: Option, ) -> EthResult> { let at = block_id.unwrap_or(BlockId::Number(BlockNumberOrTag::Pending)); @@ -211,7 +211,7 @@ where ) -> EthResult> { if indices.len() != 1 { // The OG impl failed if it gets more than a single index - return Ok(None) + return Ok(None); } self.trace_get_index(hash, indices[0]).await } @@ -249,7 +249,7 @@ where if distance > 100 { return Err(EthApiError::InvalidParams( "Block range too large; currently limited to 100 blocks".to_string(), - )) + )); } // fetch all blocks in that range @@ -285,7 +285,7 @@ where if let Some(idx) = tx_info.index { if !indices.contains(&idx) { // only record traces for relevant transactions - return Ok(None) + return Ok(None); } } let traces = inspector @@ -432,7 +432,7 @@ where /// Handler for `trace_call` async fn trace_call( &self, - call: CallRequest, + call: TransactionRequest, trace_types: HashSet, block_id: Option, state_overrides: Option, @@ -447,7 +447,7 @@ where /// Handler for `trace_callMany` async fn trace_call_many( &self, - calls: Vec<(CallRequest, HashSet)>, + calls: Vec<(TransactionRequest, HashSet)>, block_id: Option, ) -> Result> { let _permit = self.acquire_trace_permit().await;