From 61806fef2abc9e9ad75a78cdbc1b35da65aac14c Mon Sep 17 00:00:00 2001 From: refcell Date: Fri, 10 Nov 2023 19:00:41 -0500 Subject: [PATCH] fix(mev-build-rs): reduce ethers dependency size --- Cargo.lock | 703 +----------------- bin/mev/Cargo.toml | 2 - bin/utils/Cargo.toml | 2 - mev-boost-rs/Cargo.toml | 2 - mev-build-rs/Cargo.toml | 5 +- mev-build-rs/src/reth_builder/build.rs | 2 +- mev-build-rs/src/reth_builder/builder.rs | 4 +- .../src/reth_builder/payload_builder.rs | 37 +- mev-build-rs/src/reth_builder/service.rs | 17 +- mev-build-rs/src/reth_builder/service_ext.rs | 7 +- 10 files changed, 41 insertions(+), 740 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 50eb9923..e4b69801 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,16 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - [[package]] name = "addr2line" version = "0.21.0" @@ -468,15 +458,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] - [[package]] name = "async-channel" version = "1.9.0" @@ -560,17 +541,6 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version 0.4.0", -] - [[package]] name = "atomic-polyfill" version = "0.1.11" @@ -1164,27 +1134,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "c-kzg" version = "0.4.0" @@ -1200,38 +1149,6 @@ dependencies = [ "serde", ] -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.20", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "cassowary" version = "0.3.0" @@ -1483,12 +1400,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aca749d3d3f5b87a0d6100509879f9cf486ab510803a4a4e1001da1ff61c2bd6" -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "convert_case" version = "0.4.0" @@ -2220,15 +2131,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" -[[package]] -name = "ena" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" -dependencies = [ - "log", -] - [[package]] name = "encoding_rs" version = "0.8.33" @@ -2463,93 +2365,6 @@ dependencies = [ "uint", ] -[[package]] -name = "ethers" -version = "2.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad13497f6e0a24292fc7b408e30d22fe9dc262da1f40d7b542c3a44e7fc0476" -dependencies = [ - "ethers-addressbook", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-middleware", - "ethers-providers", - "ethers-signers", - "ethers-solc", -] - -[[package]] -name = "ethers-addressbook" -version = "2.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e9e8acd0ed348403cc73a670c24daba3226c40b98dc1a41903766b3ab6240a" -dependencies = [ - "ethers-core", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "ethers-contract" -version = "2.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d79269278125006bb0552349c03593ffa9702112ca88bc7046cc669f148fb47c" -dependencies = [ - "const-hex", - "ethers-contract-abigen", - "ethers-contract-derive", - "ethers-core", - "ethers-providers", - "futures-util", - "once_cell", - "pin-project", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "ethers-contract-abigen" -version = "2.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95a43c939b2e4e2f3191c5ad4a1f279780b8a39139c9905b43a7433531e2ab" -dependencies = [ - "Inflector", - "const-hex", - "dunce", - "ethers-core", - "ethers-etherscan", - "eyre", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "reqwest", - "serde", - "serde_json", - "syn 2.0.38", - "toml 0.7.8", - "walkdir", -] - -[[package]] -name = "ethers-contract-derive" -version = "2.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9ce44906fc871b3ee8c69a695ca7ec7f70e50cb379c9b9cb5e532269e492f6" -dependencies = [ - "Inflector", - "const-hex", - "ethers-contract-abigen", - "ethers-core", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.38", -] - [[package]] name = "ethers-core" version = "2.0.10" @@ -2558,7 +2373,6 @@ checksum = "c0a17f0708692024db9956b31d7a20163607d2745953f5ae8125ab368ba280ad" dependencies = [ "arrayvec", "bytes", - "cargo_metadata", "chrono", "const-hex", "elliptic-curve 0.13.6", @@ -2566,99 +2380,18 @@ dependencies = [ "generic-array", "k256 0.13.1", "num_enum 0.7.1", - "once_cell", "open-fastrlp", "rand 0.8.5", "rlp", "serde", "serde_json", "strum", - "syn 2.0.38", "tempfile", "thiserror", "tiny-keccak", "unicode-xid", ] -[[package]] -name = "ethers-etherscan" -version = "2.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e53451ea4a8128fbce33966da71132cf9e1040dcfd2a2084fd7733ada7b2045" -dependencies = [ - "ethers-core", - "reqwest", - "semver 1.0.20", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "ethers-middleware" -version = "2.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473f1ccd0c793871bbc248729fa8df7e6d2981d6226e4343e3bbaa9281074d5d" -dependencies = [ - "async-trait", - "auto_impl", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-providers", - "ethers-signers", - "futures-channel", - "futures-locks", - "futures-util", - "instant", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "url", -] - -[[package]] -name = "ethers-providers" -version = "2.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6838fa110e57d572336178b7c79e94ff88ef976306852d8cb87d9e5b1fc7c0b5" -dependencies = [ - "async-trait", - "auto_impl", - "base64 0.21.5", - "bytes", - "const-hex", - "enr 0.9.1", - "ethers-core", - "futures-core", - "futures-timer", - "futures-util", - "hashers", - "http", - "instant", - "jsonwebtoken", - "once_cell", - "pin-project", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-tungstenite", - "tracing", - "tracing-futures", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "ws_stream_wasm", -] - [[package]] name = "ethers-signers" version = "2.0.10" @@ -2678,38 +2411,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "ethers-solc" -version = "2.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de34e484e7ae3cab99fbfd013d6c5dc7f9013676a4e0e414d8b12e1213e8b3ba" -dependencies = [ - "cfg-if", - "const-hex", - "dirs", - "dunce", - "ethers-core", - "glob", - "home", - "md-5", - "num_cpus", - "once_cell", - "path-slash", - "rayon", - "regex", - "semver 1.0.20", - "serde", - "serde_json", - "solang-parser", - "svm-rs", - "thiserror", - "tiny-keccak", - "tokio", - "tracing", - "walkdir", - "yansi", -] - [[package]] name = "event-listener" version = "2.5.3" @@ -2805,12 +2506,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "flate2" version = "1.0.28" @@ -2851,16 +2546,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "funty" version = "2.0.0" @@ -2930,16 +2615,6 @@ dependencies = [ "waker-fn", ] -[[package]] -name = "futures-locks" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ec6fe3675af967e67c5536c0b9d44e34e6c52f86bedc4ea49c5317b8e94d06" -dependencies = [ - "futures-channel", - "futures-task", -] - [[package]] name = "futures-macro" version = "0.3.29" @@ -2970,7 +2645,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" dependencies = [ "gloo-timers", - "send_wrapper 0.4.0", + "send_wrapper", ] [[package]] @@ -2991,15 +2666,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -3177,15 +2843,6 @@ dependencies = [ "serde", ] -[[package]] -name = "hashers" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" -dependencies = [ - "fxhash", -] - [[package]] name = "hashlink" version = "0.8.4" @@ -3774,17 +3431,6 @@ dependencies = [ "serde", ] -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix 0.38.21", - "windows-sys 0.48.0", -] - [[package]] name = "itertools" version = "0.10.5" @@ -4068,34 +3714,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "lalrpop" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" -dependencies = [ - "ascii-canvas", - "bit-set", - "diff", - "ena", - "is-terminal", - "itertools 0.10.5", - "lalrpop-util", - "petgraph", - "regex", - "regex-syntax 0.7.5", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", -] - -[[package]] -name = "lalrpop-util" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" - [[package]] name = "lazy_static" version = "1.4.0" @@ -4262,16 +3880,6 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest 0.10.7", -] - [[package]] name = "memchr" version = "2.6.4" @@ -4419,7 +4027,8 @@ dependencies = [ "beacon-api-client", "clap", "ethereum-consensus", - "ethers", + "ethers-core", + "ethers-signers", "eyre", "futures", "mev-rs", @@ -4646,12 +4255,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "new_debug_unreachable" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" - [[package]] name = "nibble_vec" version = "0.1.0" @@ -5040,29 +4643,12 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "paste" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - [[package]] name = "pbkdf2" version = "0.11.0" @@ -5070,9 +4656,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", - "hmac", - "password-hash", - "sha2 0.10.8", ] [[package]] @@ -5117,16 +4700,6 @@ dependencies = [ "ucd-trie", ] -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap 2.0.2", -] - [[package]] name = "ph" version = "0.8.1" @@ -5140,16 +4713,6 @@ dependencies = [ "wyhash", ] -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version 0.4.0", -] - [[package]] name = "phf" version = "0.11.2" @@ -5157,7 +4720,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_macros", - "phf_shared 0.11.2", + "phf_shared", ] [[package]] @@ -5166,7 +4729,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "phf_shared 0.11.2", + "phf_shared", "rand 0.8.5", ] @@ -5177,21 +4740,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ "phf_generator", - "phf_shared 0.11.2", + "phf_shared", "proc-macro2", "quote", "syn 2.0.38", ] -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - [[package]] name = "phf_shared" version = "0.11.2" @@ -5313,12 +4867,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - [[package]] name = "pretty_assertions" version = "1.4.0" @@ -5369,7 +4917,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "toml_edit 0.20.7", + "toml_edit", ] [[package]] @@ -5730,7 +5278,6 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -5740,15 +5287,12 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls", "tokio-util", "tower-service", "url", @@ -5756,7 +5300,6 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots", "winreg", ] @@ -7082,15 +6625,6 @@ dependencies = [ "cipher 0.4.4", ] -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "scale-info" version = "2.10.0" @@ -7266,9 +6800,6 @@ name = "semver" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" -dependencies = [ - "serde", -] [[package]] name = "semver-parser" @@ -7285,12 +6816,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - [[package]] name = "serde" version = "1.0.190" @@ -7427,17 +6952,6 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha2" version = "0.9.9" @@ -7636,20 +7150,6 @@ dependencies = [ "sha-1", ] -[[package]] -name = "solang-parser" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cb9fa2fa2fa6837be8a2495486ff92e3ffe68a99b6eeba288e139efdd842457" -dependencies = [ - "itertools 0.11.0", - "lalrpop", - "lalrpop-util", - "phf", - "thiserror", - "unicode-xid", -] - [[package]] name = "spin" version = "0.5.2" @@ -7726,19 +7226,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "string_cache" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot 0.12.1", - "phf_shared 0.10.0", - "precomputed-hash", -] - [[package]] name = "strsim" version = "0.9.3" @@ -7811,26 +7298,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "svm-rs" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0cc95be7cc2c384a2f57cac56548d2178650905ebe5725bc8970ccc25529060" -dependencies = [ - "dirs", - "fs2", - "hex", - "once_cell", - "reqwest", - "semver 1.0.20", - "serde", - "serde_json", - "sha2 0.10.8", - "thiserror", - "url", - "zip", -] - [[package]] name = "syn" version = "1.0.109" @@ -7935,17 +7402,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - [[package]] name = "thin-vec" version = "0.2.12" @@ -8119,21 +7575,6 @@ dependencies = [ "tokio-util", ] -[[package]] -name = "tokio-tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" -dependencies = [ - "futures-util", - "log", - "rustls", - "tokio", - "tokio-rustls", - "tungstenite", - "webpki-roots", -] - [[package]] name = "tokio-util" version = "0.7.10" @@ -8159,18 +7600,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.15", -] - [[package]] name = "toml" version = "0.8.6" @@ -8180,7 +7609,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.7", + "toml_edit", ] [[package]] @@ -8192,19 +7621,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.0.2", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - [[package]] name = "toml_edit" version = "0.20.7" @@ -8487,26 +7903,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http", - "httparse", - "log", - "rand 0.8.5", - "rustls", - "sha1", - "thiserror", - "url", - "utf-8", -] - [[package]] name = "typenum" version = "1.17.0" @@ -8625,12 +8021,6 @@ dependencies = [ "serde", ] -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf16_iter" version = "1.0.4" @@ -8712,16 +8102,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" -[[package]] -name = "walkdir" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "want" version = "0.3.1" @@ -8878,15 +8258,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -9075,25 +8446,6 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0af0c3d13faebf8dda0b5256fa7096a2d5ccb662f7b9f54a40fe201077ab1c2" -[[package]] -name = "ws_stream_wasm" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" -dependencies = [ - "async_io_stream", - "futures", - "js-sys", - "log", - "pharos", - "rustc_version 0.4.0", - "send_wrapper 0.6.0", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "wyhash" version = "0.5.0" @@ -9250,35 +8602,6 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "aes 0.8.3", - "byteorder", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2 0.11.0", - "sha1", - "time", - "zstd 0.11.2+zstd.1.5.2", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", -] - [[package]] name = "zstd" version = "0.12.4" @@ -9297,16 +8620,6 @@ dependencies = [ "zstd-safe 7.0.0", ] -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - [[package]] name = "zstd-safe" version = "6.0.6" diff --git a/bin/mev/Cargo.toml b/bin/mev/Cargo.toml index 275d70d4..b53ccf12 100644 --- a/bin/mev/Cargo.toml +++ b/bin/mev/Cargo.toml @@ -4,8 +4,6 @@ version.workspace = true edition = "2021" license = "MIT OR Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [features] default = ["boost", "build", "relay"] boost = ["mev-boost-rs"] diff --git a/bin/utils/Cargo.toml b/bin/utils/Cargo.toml index 478f2948..9f898c46 100644 --- a/bin/utils/Cargo.toml +++ b/bin/utils/Cargo.toml @@ -4,8 +4,6 @@ version.workspace = true edition = "2021" license = "MIT OR Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] tokio = { version = "1.0", features = ["full"] } url = { version = "2.2.2", default-features = false } diff --git a/mev-boost-rs/Cargo.toml b/mev-boost-rs/Cargo.toml index dc56ff7f..8ab3dbfa 100644 --- a/mev-boost-rs/Cargo.toml +++ b/mev-boost-rs/Cargo.toml @@ -4,8 +4,6 @@ version.workspace = true edition = "2021" license = "MIT OR Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] tokio = { version = "1.0", features = ["full"] } tracing = "0.1" diff --git a/mev-build-rs/Cargo.toml b/mev-build-rs/Cargo.toml index b60c0409..a52652a9 100644 --- a/mev-build-rs/Cargo.toml +++ b/mev-build-rs/Cargo.toml @@ -4,8 +4,6 @@ version.workspace = true edition = "2021" license = "MIT OR Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] tokio = { version = "1.0", features = ["full"] } tokio-stream = "0.1.14" @@ -32,6 +30,7 @@ reth-interfaces = { workspace = true } reth-revm = { workspace = true } reth = { workspace = true } -ethers = "2.0" +ethers-core = "2.0" +ethers-signers = "2.0" eyre = { workspace = true } clap = { version = "4.1.4", features = ["derive", "env"] } diff --git a/mev-build-rs/src/reth_builder/build.rs b/mev-build-rs/src/reth_builder/build.rs index 22f36a8f..953daf3b 100644 --- a/mev-build-rs/src/reth_builder/build.rs +++ b/mev-build-rs/src/reth_builder/build.rs @@ -8,7 +8,7 @@ use ethereum_consensus::{ ssz::prelude::*, state_transition::Context, }; -use ethers::signers::LocalWallet; +use ethers_signers::LocalWallet; use mev_rs::{ signing::sign_builder_message, types::{BidTrace, SignedBidSubmission}, diff --git a/mev-build-rs/src/reth_builder/builder.rs b/mev-build-rs/src/reth_builder/builder.rs index 5b78291f..9b895693 100644 --- a/mev-build-rs/src/reth_builder/builder.rs +++ b/mev-build-rs/src/reth_builder/builder.rs @@ -8,7 +8,7 @@ use ethereum_consensus::{ primitives::{BlsPublicKey, Epoch, ExecutionAddress, Slot}, state_transition::Context, }; -use ethers::signers::{LocalWallet, Signer}; +use ethers_signers::{LocalWallet, Signer}; use mev_rs::{blinded_block_relayer::BlindedBlockRelayer, compute_preferred_gas_limit, Relay}; use reth_payload_builder::PayloadBuilderAttributes; use reth_primitives::{Address, BlockNumberOrTag, Bytes, ChainSpec, B256, U256}; @@ -316,7 +316,7 @@ impl Bui let build_identifier = compute_build_id(slot, parent_hash, &proposer.public_key); if state.builds.contains_key(&build_identifier) { - return Ok(PayloadAttributesProcessingOutcome::Duplicate(payload_attributes)) + return Ok(PayloadAttributesProcessingOutcome::Duplicate(payload_attributes)); } tracing::info!(slot, ?relays, %build_identifier, "constructing new build"); diff --git a/mev-build-rs/src/reth_builder/payload_builder.rs b/mev-build-rs/src/reth_builder/payload_builder.rs index 27919aa1..3724ce16 100644 --- a/mev-build-rs/src/reth_builder/payload_builder.rs +++ b/mev-build-rs/src/reth_builder/payload_builder.rs @@ -5,13 +5,10 @@ use crate::reth_builder::{ cancelled::Cancelled, error::Error, }; -use ethers::{ - signers::Signer, - types::{ - transaction::eip2718::TypedTransaction, Eip1559TransactionRequest, H160, - U256 as ethers_U256, - }, +use ethers_core::types::transaction::{ + eip1559::Eip1559TransactionRequest, eip2718::TypedTransaction, eip2930::AccessList, }; +use ethers_signers::Signer; use reth_interfaces::RethError; use reth_primitives::{ constants::{BEACON_NONCE, EMPTY_OMMER_ROOT_HASH}, @@ -63,14 +60,14 @@ fn assemble_txs_from_pool( let effective_gas_limit = block_gas_limit - context.build.gas_reserve; while let Some(pool_tx) = best_txs.next() { if context.is_cancelled() { - return Ok(()) + return Ok(()); } // NOTE: we withhold the `gas_reserve` so the "bidder" has some guaranteed room // to play with the payload after it is built. if context.cumulative_gas_used + pool_tx.gas_limit() > effective_gas_limit { best_txs.mark_invalid(&pool_tx); - continue + continue; } let tx = pool_tx.to_recovered_transaction(); @@ -81,7 +78,7 @@ fn assemble_txs_from_pool( if !matches!(err, InvalidTransaction::NonceTooLow { .. }) { best_txs.mark_invalid(&pool_tx); } - continue + continue; } _ => return Err(err), } @@ -106,7 +103,7 @@ fn assemble_payload_with_payments( )?; if context.is_cancelled() { - return Ok(BuildOutcome::Cancelled) + return Ok(BuildOutcome::Cancelled); } context.db.merge_transitions(BundleRetention::PlainState); @@ -169,18 +166,18 @@ fn construct_payment_tx( let nonce = signer_account.account_info().expect("account exists").nonce; let chain_id = context.build.chain_spec.chain().id(); - let fee_recipient = H160::from_slice(context.build.proposer_fee_recipient.as_ref()); - let value = ethers_U256::from_big_endian(&context.total_payment.to_be_bytes::<32>()); + let fee_recipient = Address::from_slice(context.build.proposer_fee_recipient.as_ref()); + let value = U256::from_be_bytes(context.total_payment.to_be_bytes::<32>()); let tx = Eip1559TransactionRequest::new() .from(sender) - .to(fee_recipient) + .to(fee_recipient.to_string()) // TODO: support smart contract payments .gas(21000) .max_fee_per_gas(context.build.base_fee()) .max_priority_fee_per_gas(0) - .value(value) - .data(ethers::types::Bytes::default()) - .access_list(ethers::types::transaction::eip2930::AccessList::default()) + .value(value.to_be_bytes()) + .data(ethers_core::types::Bytes::default()) + .access_list(AccessList::default()) .nonce(nonce) .chain_id(chain_id); @@ -301,12 +298,12 @@ pub fn build_payload< let mut context = ExecutionContext::try_from(context, cancel, provider)?; if context.is_cancelled() { - return Ok(BuildOutcome::Cancelled) + return Ok(BuildOutcome::Cancelled); } assemble_txs_from_pool(&mut context, pool)?; if context.total_fees < threshold_value { - return Ok(BuildOutcome::Worse { threshold: threshold_value, provided: context.total_fees }) + return Ok(BuildOutcome::Worse { threshold: threshold_value, provided: context.total_fees }); } context.compute_payment_from_fees(); @@ -314,14 +311,14 @@ pub fn build_payload< let payment_tx = construct_payment_tx(&mut context)?; if context.is_cancelled() { - return Ok(BuildOutcome::Cancelled) + return Ok(BuildOutcome::Cancelled); } // NOTE: assume payment transaction always succeeds context.extend_transaction(payment_tx)?; if context.is_cancelled() { - return Ok(BuildOutcome::Cancelled) + return Ok(BuildOutcome::Cancelled); } assemble_payload_with_payments(context, provider) diff --git a/mev-build-rs/src/reth_builder/service.rs b/mev-build-rs/src/reth_builder/service.rs index 9d4413fd..82a483e3 100644 --- a/mev-build-rs/src/reth_builder/service.rs +++ b/mev-build-rs/src/reth_builder/service.rs @@ -8,14 +8,13 @@ use ethereum_consensus::{ crypto::SecretKey, state_transition::Context, }; -use ethers::signers::{coins_bip39::English, MnemonicBuilder, Signer}; +use ethers_signers::{coins_bip39::English, MnemonicBuilder, Signer}; use futures::StreamExt; use mev_rs::{relay::parse_relay_endpoints, Error, Relay}; use reth_primitives::{Bytes, ChainSpec}; use serde::Deserialize; use std::{future::Future, pin::Pin, sync::Arc, task::Poll}; use tokio::task::{JoinError, JoinHandle}; -use tracing::{error, info}; const DEFAULT_BID_PERCENT: f64 = 0.9; @@ -61,12 +60,12 @@ impl< .collect::>(); if relays.is_empty() { - error!("no valid relays provided; please restart with correct configuration"); + tracing::error!("no valid relays provided; please restart with correct configuration"); } else { let count = relays.len(); - info!("configured with {count} relay(s)"); + tracing::info!("configured with {count} relay(s)"); for relay in &relays { - info!(%relay, "configured with relay"); + tracing::info!(%relay, "configured with relay"); } } @@ -134,7 +133,7 @@ impl< Ok(stream) => stream, Err(err) => { tracing::error!(err = ?err, "could not open builds stream"); - return + return; } }; @@ -175,7 +174,7 @@ impl< Ok(stream) => stream, Err(err) => { tracing::error!(err = ?err, "could not open payload attributes stream"); - return + return; } }; @@ -230,11 +229,11 @@ impl Future for ServiceHandle { let clock = this.clock.poll(cx); if clock.is_ready() { - return clock + return clock; } let builder = this.payload_builder.poll(cx); if builder.is_ready() { - return builder + return builder; } this.bidder.poll(cx) } diff --git a/mev-build-rs/src/reth_builder/service_ext.rs b/mev-build-rs/src/reth_builder/service_ext.rs index 31d0c526..0085f292 100644 --- a/mev-build-rs/src/reth_builder/service_ext.rs +++ b/mev-build-rs/src/reth_builder/service_ext.rs @@ -15,7 +15,6 @@ use reth::{ }; use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService}; use std::{sync::Arc, time::Duration}; -use tracing::info; #[derive(Debug, Args)] pub struct ServiceExt { @@ -46,7 +45,7 @@ impl RethNodeCommandConfig for ServiceExt { let config = from_toml_file::<_, Config>(config_file)?; let network = &config.network; - info!("configured for `{network}`"); + tracing::info!("configured for `{network}`"); self.config = Some(config); Ok(()) @@ -61,7 +60,7 @@ impl RethNodeCommandConfig for ServiceExt { Conf: PayloadBuilderConfig, Reth: RethNodeComponents, { - let config = self.config.as_ref().expect("already loaded config"); + let config = self.config.as_ref().ok_or(eyre::eyre!("already loaded config"))?; let context = Arc::new(Context::try_from(config.network.clone())?); let clock = context.clock().unwrap_or_else(|| { let genesis_time = networks::typical_genesis_time(&context); @@ -79,7 +78,7 @@ impl RethNodeCommandConfig for ServiceExt { bidder, components.chain_spec(), ) - .unwrap(); + .map_err(|err| eyre::eyre!(err))?; let (payload_service, payload_builder) = PayloadBuilderService::new(builder);