From a0a0cd74b7009397c0529830dac537dc0fb7f615 Mon Sep 17 00:00:00 2001 From: Kolby Moroz Liebl <31669092+KolbyML@users.noreply.github.com> Date: Thu, 12 Sep 2024 21:04:35 -0600 Subject: [PATCH] refactor: remove unmaintained surf for reqwest --- Cargo.lock | 1362 +++++++---------------- Cargo.toml | 3 +- e2store/Cargo.toml | 2 +- e2store/src/utils.rs | 10 +- ethportal-peertest/Cargo.toml | 1 - portal-bridge/Cargo.toml | 4 +- portal-bridge/src/api/consensus.rs | 22 +- portal-bridge/src/api/execution.rs | 127 ++- portal-bridge/src/bridge/era1.rs | 19 +- portal-bridge/src/cli.rs | 135 +-- src/bin/historical_batch.rs | 6 +- src/bin/test_providers.rs | 63 +- trin-execution/Cargo.toml | 2 +- trin-execution/src/era/binary_search.rs | 14 +- trin-execution/src/era/manager.rs | 19 +- trin-execution/src/era/utils.rs | 7 +- 16 files changed, 644 insertions(+), 1152 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e24ebf0da..ee4892fa6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,15 +33,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array", -] - [[package]] name = "aead" version = "0.4.3" @@ -51,17 +42,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher 0.2.5", -] - [[package]] name = "aes" version = "0.7.5" @@ -88,52 +68,18 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" -dependencies = [ - "aead 0.3.2", - "aes 0.6.0", - "cipher 0.2.5", - "ctr 0.6.0", - "ghash 0.3.1", - "subtle", -] - -[[package]] -name = "aes-gcm" -version = "0.9.4" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +checksum = "bc3be92e19a7ef47457b8e6f90707e12b6ac5d20c6f3866584fa3be0787d839f" dependencies = [ - "aead 0.4.3", + "aead", "aes 0.7.5", "cipher 0.3.0", - "ctr 0.8.0", - "ghash 0.4.4", + "ctr 0.7.0", + "ghash", "subtle", ] -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher 0.2.5", - "opaque-debug", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher 0.2.5", - "opaque-debug", -] - [[package]] name = "ahash" version = "0.7.8" @@ -342,7 +288,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "alloy-rlp-derive", - "arrayvec 0.7.6", + "arrayvec", "bytes", ] @@ -783,12 +729,6 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "arrayvec" version = "0.7.6" @@ -810,29 +750,6 @@ dependencies = [ "term", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - [[package]] name = "async-compression" version = "0.4.12" @@ -849,144 +766,13 @@ dependencies = [ "zstd-safe 7.2.1", ] -[[package]] -name = "async-dup" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2886ab563af5038f79ec016dd7b87947ed138b794e8dd64992962c9cca0411" -dependencies = [ - "async-lock 3.4.0", - "futures-io", -] - -[[package]] -name = "async-executor" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand 2.1.1", - "futures-lite 2.3.0", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.3.1", - "async-executor", - "async-io 2.3.4", - "async-lock 3.4.0", - "blocking", - "futures-lite 2.3.0", - "once_cell", -] - -[[package]] -name = "async-h1" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1d1dae8cb2c4258a79d6ed088b7fb9b4763bf4e9b22d040779761e046a2971" -dependencies = [ - "async-channel 1.9.0", - "async-dup", - "async-global-executor", - "async-io 1.13.0", - "futures-lite 1.13.0", - "http-types", - "httparse", - "log", - "pin-project", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" -dependencies = [ - "async-lock 3.4.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.7.3", - "rustix 0.38.36", - "slab", - "tracing", - "windows-sys 0.59.0", -] - [[package]] name = "async-lock" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-std" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c634475f29802fde2b8f0b505b1bd00dfe4df7d4a000f0b36f7671197d5c3615" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 2.3.4", - "async-lock 3.4.0", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 2.3.0", - "gloo-timers 0.3.0", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", + "event-listener", ] [[package]] @@ -1011,25 +797,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - -[[package]] -name = "async-tls" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85a97c4a0ecce878efd3f945f119c78a646d8975340bca0398f9bb05c30cc52" -dependencies = [ - "futures-core", - "futures-io", - "rustls 0.18.1", - "webpki", - "webpki-roots 0.20.0", -] - [[package]] name = "async-trait" version = "0.1.82" @@ -1061,12 +828,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "attohttpc" version = "0.24.1" @@ -1131,24 +892,12 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - [[package]] name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - [[package]] name = "base64" version = "0.13.1" @@ -1209,7 +958,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.77", ] @@ -1282,19 +1031,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "blocking" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" -dependencies = [ - "async-channel 2.3.1", - "async-task", - "futures-io", - "futures-lite 2.3.0", - "piper", -] - [[package]] name = "blst" version = "0.3.13" @@ -1466,7 +1202,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom 7.1.3", + "nom", ] [[package]] @@ -1496,15 +1232,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" -[[package]] -name = "cipher" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" -dependencies = [ - "generic-array", -] - [[package]] name = "cipher" version = "0.3.0" @@ -1584,7 +1311,7 @@ dependencies = [ "bs58", "coins-core", "digest 0.10.7", - "hmac 0.12.1", + "hmac", "k256", "serde", "sha2 0.10.8", @@ -1599,7 +1326,7 @@ checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" dependencies = [ "bitvec", "coins-bip32", - "hmac 0.12.1", + "hmac", "once_cell", "pbkdf2 0.12.2", "rand 0.8.5", @@ -1633,26 +1360,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "config" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b076e143e1d9538dde65da30f8481c2a6c44040edb8e02b9bf1351edb92ce3" -dependencies = [ - "lazy_static", - "nom 5.1.3", - "serde", -] - [[package]] name = "const-hex" version = "1.12.0" @@ -1705,23 +1412,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "cookie" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" -dependencies = [ - "aes-gcm 0.8.0", - "base64 0.13.1", - "hkdf 0.10.0", - "hmac 0.10.1", - "percent-encoding", - "rand 0.8.5", - "sha2 0.9.9", - "time 0.2.27", - "version_check", -] - [[package]] name = "core-foundation" version = "0.9.4" @@ -1756,12 +1446,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cpuid-bool" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" - [[package]] name = "crc" version = "3.2.1" @@ -1805,15 +1489,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "crossbeam-queue" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -1848,16 +1523,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "cssparser" version = "0.31.2" @@ -1883,11 +1548,11 @@ dependencies = [ [[package]] name = "ctr" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" +checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" dependencies = [ - "cipher 0.2.5", + "cipher 0.3.0", ] [[package]] @@ -2005,39 +1670,12 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core 0.9.10", -] - [[package]] name = "data-encoding" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" -[[package]] -name = "deadpool" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d126179d86aee4556e54f5f3c6bf6d9884e7cc52cef82f77ee6f90a7747616d" -dependencies = [ - "async-trait", - "config", - "crossbeam-queue", - "num_cpus", - "serde", - "tokio", -] - [[package]] name = "delay_map" version = "0.3.0" @@ -2205,12 +1843,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" - [[package]] name = "discv5" version = "0.4.1" @@ -2218,15 +1850,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bac33cb3f99889a57e56a8c6ccb77aaf0cfc7787602b7af09783f736d77314e1" dependencies = [ "aes 0.7.5", - "aes-gcm 0.9.4", - "arrayvec 0.7.6", + "aes-gcm", + "arrayvec", "delay_map 0.3.0", "enr", "fnv", "futures", "hashlink 0.8.4", "hex", - "hkdf 0.12.4", + "hkdf", "lazy_static", "lru 0.12.4", "more-asserts", @@ -2279,10 +1911,10 @@ dependencies = [ "ethereum_ssz_derive", "ethportal-api", "rand 0.8.5", + "reqwest 0.12.7", "rstest", "scraper", "snap", - "surf", "tempfile", "tokio", ] @@ -2475,7 +2107,7 @@ dependencies = [ "ctr 0.9.2", "digest 0.10.7", "hex", - "hmac 0.12.1", + "hmac", "pbkdf2 0.11.0", "rand 0.8.5", "scrypt", @@ -2670,7 +2302,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "syn 2.0.77", @@ -2700,7 +2332,7 @@ version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ - "arrayvec 0.7.6", + "arrayvec", "bytes", "cargo_metadata", "chrono", @@ -2732,7 +2364,7 @@ checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" dependencies = [ "chrono", "ethers-core", - "reqwest", + "reqwest 0.11.27", "semver 1.0.23", "serde", "serde_json", @@ -2757,7 +2389,7 @@ dependencies = [ "futures-locks", "futures-util", "instant", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -2790,7 +2422,7 @@ dependencies = [ "jsonwebtoken 8.3.0", "once_cell", "pin-project", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -2925,7 +2557,7 @@ dependencies = [ "ethportal-api", "futures", "hex", - "hyper", + "hyper 0.14.30", "jsonrpsee", "portal-bridge", "rand 0.8.5", @@ -2934,7 +2566,6 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "surf", "tempfile", "tokio", "tracing", @@ -2956,27 +2587,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "event-listener" -version = "5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - [[package]] name = "eyre" version = "0.6.12" @@ -3001,18 +2611,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "1.9.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fastrlp" @@ -3020,7 +2621,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ - "arrayvec 0.7.6", + "arrayvec", "auto_impl", "bytes", ] @@ -3172,34 +2773,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "fastrand 2.1.1", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - [[package]] name = "futures-locks" version = "0.7.1" @@ -3239,7 +2812,7 @@ version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" dependencies = [ - "gloo-timers 0.2.6", + "gloo-timers", "send_wrapper 0.4.0", ] @@ -3320,16 +2893,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "ghash" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" -dependencies = [ - "opaque-debug", - "polyval 0.4.5", -] - [[package]] name = "ghash" version = "0.4.4" @@ -3337,7 +2900,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" dependencies = [ "opaque-debug", - "polyval 0.5.3", + "polyval", ] [[package]] @@ -3398,18 +2961,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "gloo-timers" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "gloo-utils" version = "0.2.0" @@ -3537,12 +3088,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - [[package]] name = "hex" version = "0.4.3" @@ -3558,33 +3103,13 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" -[[package]] -name = "hkdf" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" -dependencies = [ - "digest 0.9.0", - "hmac 0.10.1", -] - [[package]] name = "hkdf" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "hmac 0.12.1", -] - -[[package]] -name = "hmac" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" -dependencies = [ - "crypto-mac", - "digest 0.9.0", + "hmac", ] [[package]] @@ -3653,52 +3178,34 @@ dependencies = [ ] [[package]] -name = "http-client" -version = "6.5.3" +name = "http-body" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1947510dc91e2bf586ea5ffb412caad7673264e14bb39fb9078da114a94ce1a5" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ - "async-h1", - "async-std", - "async-tls", - "async-trait", - "cfg-if", - "dashmap", - "deadpool", - "futures", - "http-types", - "log", - "rustls 0.18.1", + "bytes", + "http 1.1.0", ] [[package]] -name = "http-range-header" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" - -[[package]] -name = "http-types" -version = "2.12.0" +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ - "anyhow", - "async-channel 1.9.0", - "async-std", - "base64 0.13.1", - "cookie", - "futures-lite 1.13.0", - "infer", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", - "rand 0.7.3", - "serde", - "serde_json", - "serde_qs", - "serde_urlencoded", - "url", ] +[[package]] +name = "http-range-header" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" + [[package]] name = "httparse" version = "1.9.4" @@ -3729,7 +3236,7 @@ dependencies = [ "futures-util", "h2", "http 0.2.12", - "http-body", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -3741,6 +3248,25 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -3749,12 +3275,50 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper", + "hyper 0.14.30", "log", "rustls 0.21.12", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.4.1", + "hyper-util", + "rustls 0.23.13", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", + "webpki-roots 0.26.5", +] + +[[package]] +name = "hyper-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", + "pin-project-lite", + "socket2 0.5.7", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -3892,12 +3456,6 @@ dependencies = [ "serde", ] -[[package]] -name = "infer" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" - [[package]] name = "inlinable_string" version = "0.1.15" @@ -3920,17 +3478,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] @@ -4055,7 +3605,7 @@ dependencies = [ "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "tracing", "url", @@ -4069,16 +3619,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f24ea59b037b6b9b0e2ebe2c30a3e782b56bd7c76dcc5d6d70ba55d442af56e3" dependencies = [ "anyhow", - "async-lock 2.8.0", + "async-lock", "async-trait", "beef", "futures-timer", "futures-util", - "hyper", + "hyper 0.14.30", "jsonrpsee-types 0.20.4", "parking_lot 0.12.3", "rand 0.8.5", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "soketto", @@ -4095,8 +3645,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c7b9f95208927653e7965a98525e7fc641781cab89f0e27c43fa2974405683" dependencies = [ "async-trait", - "hyper", - "hyper-rustls", + "hyper 0.14.30", + "hyper-rustls 0.24.2", "jsonrpsee-core", "jsonrpsee-types 0.20.4", "serde", @@ -4129,7 +3679,7 @@ checksum = "a482bc4e25eebd0adb61a3468c722763c381225bd3ec46e926f709df8a8eb548" dependencies = [ "futures-util", "http 0.2.12", - "hyper", + "hyper 0.14.30", "jsonrpsee-core", "jsonrpsee-types 0.20.4", "route-recognizer", @@ -4281,15 +3831,6 @@ version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lalrpop" version = "0.20.2" @@ -4341,19 +3882,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" -[[package]] -name = "lexical-core" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" -dependencies = [ - "arrayvec 0.5.2", - "bitflags 1.3.2", - "cfg-if", - "ryu", - "static_assertions", -] - [[package]] name = "libc" version = "0.2.158" @@ -4452,7 +3980,7 @@ dependencies = [ "jsonrpsee", "log", "portalnet", - "reqwest", + "reqwest 0.11.27", "serde", "serde-this-or-that", "serde_json", @@ -4468,12 +3996,6 @@ dependencies = [ "tree_hash", ] -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -4507,9 +4029,6 @@ name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -dependencies = [ - "value-bag", -] [[package]] name = "lru" @@ -4709,17 +4228,6 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" -[[package]] -name = "nom" -version = "5.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" -dependencies = [ - "lexical-core", - "memchr", - "version_check", -] - [[package]] name = "nom" version = "7.1.3" @@ -4930,7 +4438,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ - "arrayvec 0.7.6", + "arrayvec", "auto_impl", "bytes", "ethereum-types", @@ -4973,7 +4481,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "arrayvec 0.7.6", + "arrayvec", "bitvec", "byte-slice-cast", "impl-trait-for-tuples", @@ -5007,12 +4515,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - [[package]] name = "parking_lot" version = "0.11.2" @@ -5091,7 +4593,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", - "hmac 0.12.1", + "hmac", "password-hash", "sha2 0.10.8", ] @@ -5103,7 +4605,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", - "hmac 0.12.1", + "hmac", ] [[package]] @@ -5297,17 +4799,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" -dependencies = [ - "atomic-waker", - "fastrand 2.1.1", - "futures-io", -] - [[package]] name = "pkcs8" version = "0.10.2" @@ -5324,48 +4815,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix 0.38.36", - "tracing", - "windows-sys 0.59.0", -] - -[[package]] -name = "polyval" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" -dependencies = [ - "cpuid-bool", - "opaque-debug", - "universal-hash", -] - [[package]] name = "polyval" version = "0.5.3" @@ -5400,6 +4849,9 @@ dependencies = [ "portalnet", "prometheus_exporter", "rand 0.8.5", + "reqwest 0.12.7", + "reqwest-middleware", + "reqwest-retry", "revm", "revm-primitives", "rstest", @@ -5408,7 +4860,6 @@ dependencies = [ "serde_json", "serde_yaml", "ssz_types", - "surf", "test-log", "tokio", "tracing", @@ -5578,12 +5029,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" version = "1.0.86" @@ -5682,6 +5127,54 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.0.0", + "rustls 0.23.13", + "socket2 0.5.7", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.17.8", + "rustc-hash 2.0.0", + "rustls 0.23.13", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +dependencies = [ + "libc", + "once_cell", + "socket2 0.5.7", + "tracing", + "windows-sys 0.59.0", +] + [[package]] name = "quote" version = "1.0.37" @@ -5911,9 +5404,9 @@ dependencies = [ "futures-util", "h2", "http 0.2.12", - "http-body", - "hyper", - "hyper-rustls", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-rustls 0.24.2", "ipnet", "js-sys", "log", @@ -5922,14 +5415,14 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls 0.21.12", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -5939,6 +5432,84 @@ dependencies = [ "winreg", ] +[[package]] +name = "reqwest" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-rustls 0.27.3", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls 0.23.13", + "rustls-pemfile 2.1.3", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.26.5", + "windows-registry", +] + +[[package]] +name = "reqwest-middleware" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562ceb5a604d3f7c885a792d42c199fd8af239d0a51b2fa6a78aafa092452b04" +dependencies = [ + "anyhow", + "async-trait", + "http 1.1.0", + "reqwest 0.12.7", + "serde", + "thiserror", + "tower-service", +] + +[[package]] +name = "reqwest-retry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a83df1aaec00176d0fabb65dea13f832d2a446ca99107afc17c5d2d4981221d0" +dependencies = [ + "anyhow", + "async-trait", + "futures", + "getrandom 0.2.15", + "http 1.1.0", + "hyper 1.4.1", + "parking_lot 0.11.2", + "reqwest 0.12.7", + "reqwest-middleware", + "retry-policies", + "tokio", + "tracing", + "wasm-timer", +] + [[package]] name = "reth-ipc" version = "0.2.0-beta.5" @@ -5979,6 +5550,15 @@ dependencies = [ "op-alloy-rpc-types-engine", ] +[[package]] +name = "retry-policies" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5875471e6cab2871bc150ecb8c727db5113c9338cc3354dc5ee3425b6aa40a1c" +dependencies = [ + "rand 0.8.5", +] + [[package]] name = "revm" version = "14.0.1" @@ -6064,7 +5644,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac 0.12.1", + "hmac", "subtle", ] @@ -6154,7 +5734,7 @@ dependencies = [ "discv5", "eth_trie", "ethportal-api", - "hyper", + "hyper 0.14.30", "portalnet", "reth-ipc", "reth-rpc-types", @@ -6299,19 +5879,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] -name = "rustc-hex" -version = "2.1.0" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] -name = "rustc_version" -version = "0.2.3" +name = "rustc-hex" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" @@ -6331,20 +5908,6 @@ dependencies = [ "semver 1.0.23", ] -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.36" @@ -6354,33 +5917,34 @@ dependencies = [ "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.18.1" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ - "base64 0.12.3", "log", - "ring 0.16.20", - "sct 0.6.1", - "webpki", + "ring 0.17.8", + "rustls-webpki 0.101.7", + "sct", ] [[package]] name = "rustls" -version = "0.21.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ - "log", + "once_cell", "ring 0.17.8", - "rustls-webpki", - "sct 0.7.1", + "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", ] [[package]] @@ -6390,7 +5954,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] @@ -6404,6 +5968,22 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -6414,6 +5994,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.17" @@ -6527,22 +6118,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" dependencies = [ - "hmac 0.12.1", + "hmac", "pbkdf2 0.11.0", "salsa20", "sha2 0.10.8", ] -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "sct" version = "0.7.1" @@ -6628,22 +6209,13 @@ dependencies = [ "smallvec", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser 0.7.0", -] - [[package]] name = "semver" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser 0.10.2", + "semver-parser", ] [[package]] @@ -6655,12 +6227,6 @@ dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "semver-parser" version = "0.10.2" @@ -6724,17 +6290,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_qs" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" -dependencies = [ - "percent-encoding", - "serde", - "thiserror", -] - [[package]] name = "serde_spanned" version = "0.6.7" @@ -6771,7 +6326,7 @@ dependencies = [ "serde_derive", "serde_json", "serde_with_macros", - "time 0.3.36", + "time", ] [[package]] @@ -6843,15 +6398,6 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - [[package]] name = "sha1" version = "0.10.6" @@ -6863,12 +6409,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha1_smol" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" - [[package]] name = "sha2" version = "0.9.9" @@ -6934,7 +6474,7 @@ dependencies = [ "const_format", "git2", "is_debug", - "time 0.3.36", + "time", "tzdb", ] @@ -6981,7 +6521,7 @@ dependencies = [ "num-bigint", "num-traits", "thiserror", - "time 0.3.36", + "time", ] [[package]] @@ -7158,70 +6698,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "standback" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" -dependencies = [ - "version_check", -] - [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version 0.2.3", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn 1.0.109", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "sha1 0.6.1", - "syn 1.0.109", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "string_cache" version = "0.8.7" @@ -7291,9 +6773,9 @@ dependencies = [ "bytecodec", "byteorder", "crc", - "hmac 0.12.1", + "hmac", "md5", - "sha1 0.10.6", + "sha1", "trackable 1.3.0", ] @@ -7324,9 +6806,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "superstruct" @@ -7342,30 +6824,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "surf" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718b1ae6b50351982dedff021db0def601677f2120938b070eadb10ba4038dd7" -dependencies = [ - "async-std", - "async-trait", - "cfg-if", - "encoding_rs", - "futures-util", - "getrandom 0.2.15", - "http-client", - "http-types", - "log", - "mime_guess", - "once_cell", - "pin-project-lite", - "rustls 0.18.1", - "serde", - "serde_json", - "web-sys", -] - [[package]] name = "svm-rs" version = "0.3.5" @@ -7376,7 +6834,7 @@ dependencies = [ "fs2", "hex", "once_cell", - "reqwest", + "reqwest 0.11.27", "semver 1.0.23", "serde", "serde_json", @@ -7426,6 +6884,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -7460,9 +6927,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand 2.1.1", + "fastrand", "once_cell", - "rustix 0.38.36", + "rustix", "windows-sys 0.59.0", ] @@ -7558,21 +7025,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "time" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" -dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb", - "time-macros 0.1.1", - "version_check", - "winapi", -] - [[package]] name = "time" version = "0.3.36" @@ -7587,7 +7039,7 @@ dependencies = [ "powerfmt", "serde", "time-core", - "time-macros 0.2.18", + "time-macros", ] [[package]] @@ -7596,16 +7048,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" -[[package]] -name = "time-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - [[package]] name = "time-macros" version = "0.2.18" @@ -7616,19 +7058,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "time-macros-impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "standback", - "syn 1.0.109", -] - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -7647,7 +7076,7 @@ dependencies = [ "ascii", "chunked_transfer", "log", - "time 0.3.36", + "time", "url", ] @@ -7705,6 +7134,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.13", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.16" @@ -7740,7 +7180,7 @@ dependencies = [ "log", "rustls 0.21.12", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tungstenite", "webpki-roots 0.25.4", ] @@ -7839,7 +7279,7 @@ dependencies = [ "futures-core", "futures-util", "http 0.2.12", - "http-body", + "http-body 0.4.6", "http-range-header", "httpdate", "iri-string", @@ -8083,13 +7523,13 @@ dependencies = [ "prometheus_exporter", "rand 0.8.5", "regex", + "reqwest 0.12.7", "reth-ipc", "rpc", "serde_json", "serde_yaml", "serial_test", "sha3 0.9.1", - "surf", "tempfile", "tokio", "tracing", @@ -8153,13 +7593,13 @@ dependencies = [ "parking_lot 0.11.2", "prometheus_exporter", "rayon", + "reqwest 0.12.7", "revm", "revm-inspectors", "revm-primitives", "rocksdb", "serde", "serde_json", - "surf", "tempfile", "test-log", "thiserror", @@ -8316,7 +7756,7 @@ dependencies = [ "log", "rand 0.8.5", "rustls 0.21.12", - "sha1 0.10.6", + "sha1", "thiserror", "url", "utf-8", @@ -8445,9 +7885,9 @@ checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "universal-hash" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ "generic-array", "subtle", @@ -8482,7 +7922,7 @@ dependencies = [ "log", "once_cell", "rustls 0.21.12", - "rustls-webpki", + "rustls-webpki 0.101.7", "serde", "serde_json", "url", @@ -8498,7 +7938,6 @@ dependencies = [ "form_urlencoded", "idna 0.5.0", "percent-encoding", - "serde", ] [[package]] @@ -8610,12 +8049,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "value-bag" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" - [[package]] name = "vcpkg" version = "0.2.15" @@ -8637,12 +8070,6 @@ dependencies = [ "libc", ] -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - [[package]] name = "walkdir" version = "2.5.0" @@ -8742,39 +8169,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] -name = "web-sys" -version = "0.3.70" +name = "wasm-timer" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ + "futures", "js-sys", + "parking_lot 0.11.2", + "pin-utils", "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", ] [[package]] -name = "webpki" -version = "0.21.4" +name = "web-sys" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "js-sys", + "wasm-bindgen", ] [[package]] name = "webpki-roots" -version = "0.20.0" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f" -dependencies = [ - "webpki", -] +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +dependencies = [ + "rustls-pki-types", +] [[package]] name = "winapi" @@ -8816,6 +8248,36 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -9101,10 +8563,10 @@ dependencies = [ "crc32fast", "crossbeam-utils", "flate2", - "hmac 0.12.1", + "hmac", "pbkdf2 0.11.0", - "sha1 0.10.6", - "time 0.3.36", + "sha1", + "time", "zstd 0.11.2+zstd.1.5.2", ] diff --git a/Cargo.toml b/Cargo.toml index 96f79f397..c31ed126e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,11 +32,11 @@ portalnet.workspace = true prometheus_exporter.workspace = true rand.workspace = true regex = "1.10.2" +reqwest.workspace = true reth-ipc.workspace = true rpc.workspace = true serde_json = { workspace = true, features = ["preserve_order"]} sha3.workspace = true -surf.workspace = true tempfile.workspace = true tokio.workspace = true tracing.workspace = true @@ -111,6 +111,7 @@ quickcheck = "1.0.3" r2d2 = "0.8.9" r2d2_sqlite = "0.24.0" rand = "0.8.5" +reqwest = { version = "0.12.7", default-features = false, features = ["rustls-tls", "json"] } reth-ipc = { tag = "v0.2.0-beta.5", git = "https://github.com/paradigmxyz/reth.git"} reth-rpc-types = { tag = "v1.0.6", git = "https://github.com/paradigmxyz/reth.git"} revm = { version = "14.0.1", features = ["std", "secp256k1", "serde-json"], default-features = false } diff --git a/e2store/Cargo.toml b/e2store/Cargo.toml index dd61e5d81..1b8f1bad3 100644 --- a/e2store/Cargo.toml +++ b/e2store/Cargo.toml @@ -19,9 +19,9 @@ ethereum_ssz.workspace = true ethereum_ssz_derive.workspace = true ethportal-api.workspace = true rand.workspace = true +reqwest.workspace = true scraper.workspace = true snap.workspace = true -surf.workspace = true [dev-dependencies] rstest.workspace = true diff --git a/e2store/src/utils.rs b/e2store/src/utils.rs index 353a28aa6..bfad2b142 100644 --- a/e2store/src/utils.rs +++ b/e2store/src/utils.rs @@ -1,9 +1,9 @@ use std::{collections::HashMap, io}; -use anyhow::{anyhow, ensure, Error}; +use anyhow::{ensure, Error}; use rand::{seq::SliceRandom, thread_rng}; +use reqwest::Client; use scraper::{Html, Selector}; -use surf::Client; const ERA_DIR_URL: &str = "https://mainnet.era.nimbus.team/"; const ERA1_DIR_URL: &str = "https://era1.ethportal.net/"; @@ -22,11 +22,7 @@ pub async fn download_era_links( http_client: &Client, url: &str, ) -> anyhow::Result> { - let index_html = http_client - .get(url) - .recv_string() - .await - .map_err(|e| anyhow!("{e}"))?; + let index_html = http_client.get(url).send().await?.text().await?; let index_html = Html::parse_document(&index_html); let selector = Selector::parse("a[href*='mainnet-']").expect("to be able to parse selector"); let era_files: HashMap = index_html diff --git a/ethportal-peertest/Cargo.toml b/ethportal-peertest/Cargo.toml index df24b2884..5d98f6ec2 100644 --- a/ethportal-peertest/Cargo.toml +++ b/ethportal-peertest/Cargo.toml @@ -28,7 +28,6 @@ rpc.workspace = true serde.workspace = true serde_json.workspace = true serde_yaml.workspace = true -surf.workspace = true tempfile.workspace = true tokio.workspace = true tracing.workspace = true diff --git a/portal-bridge/Cargo.toml b/portal-bridge/Cargo.toml index e745afec6..9e3f925db 100644 --- a/portal-bridge/Cargo.toml +++ b/portal-bridge/Cargo.toml @@ -34,6 +34,9 @@ jsonrpsee = { workspace = true, features = [ portalnet.workspace = true prometheus_exporter.workspace = true rand.workspace = true +reqwest.workspace = true +reqwest-middleware = { version = "0.3.3", features = ["json"] } +reqwest-retry = "0.6.1" revm.workspace = true revm-primitives.workspace = true scraper.workspace = true @@ -41,7 +44,6 @@ serde = { workspace = true, features = ["rc"] } serde_json.workspace = true serde_yaml.workspace = true ssz_types.workspace = true -surf.workspace = true tokio.workspace = true tracing.workspace = true trin-execution.workspace = true diff --git a/portal-bridge/src/api/consensus.rs b/portal-bridge/src/api/consensus.rs index 1aa305093..37a8dfbff 100644 --- a/portal-bridge/src/api/consensus.rs +++ b/portal-bridge/src/api/consensus.rs @@ -1,7 +1,7 @@ use std::fmt::Display; use anyhow::anyhow; -use surf::Client; +use reqwest_middleware::ClientWithMiddleware; use tokio::time::sleep; use tracing::{debug, warn}; use url::Url; @@ -16,7 +16,7 @@ pub struct ConsensusApi { } impl ConsensusApi { - pub async fn new(primary: Url, fallback: Url) -> Result { + pub async fn new(primary: Url, fallback: Url) -> Result { debug!( "Starting ConsensusApi with primary provider: {} and fallback provider: {}", primary, fallback @@ -90,7 +90,7 @@ impl ConsensusApi { let client = url_to_client(self.primary.clone()).map_err(|err| { anyhow!("Unable to create client for primary consensus data provider: {err:?}") })?; - match client.get(&endpoint).recv_string().await { + match client.get(&endpoint).send().await?.text().await { Ok(response) => Ok(response), Err(err) => { warn!("Error requesting consensus data from provider, retrying with fallback provider: {err:?}"); @@ -98,18 +98,24 @@ impl ConsensusApi { let client = url_to_client(self.fallback.clone()).map_err(|err| { anyhow!("Unable to create client for fallback consensus data provider: {err:?}") })?; - client.get(endpoint).recv_string().await.map_err(|err| { - anyhow!("Unable to request consensus data from fallback provider: {err:?}") - }) + client + .get(endpoint) + .send() + .await? + .text() + .await + .map_err(|err| { + anyhow!("Unable to request consensus data from fallback provider: {err:?}") + }) } } } } /// Check that provider is valid and accessible. -async fn check_provider(client: &Client) -> anyhow::Result<()> { +async fn check_provider(client: &ClientWithMiddleware) -> anyhow::Result<()> { let endpoint = "/eth/v1/node/version".to_string(); - match client.get(endpoint).recv_string().await { + match client.get(endpoint).send().await?.text().await { Ok(_) => Ok(()), Err(err) => Err(anyhow!( "Unable to request consensus data from provider: {err:?}" diff --git a/portal-bridge/src/api/execution.rs b/portal-bridge/src/api/execution.rs index 906a87c52..34b36cde7 100644 --- a/portal-bridge/src/api/execution.rs +++ b/portal-bridge/src/api/execution.rs @@ -2,18 +2,6 @@ use std::sync::Arc; use alloy_primitives::B256; use anyhow::{anyhow, bail}; -use futures::future::join_all; -use serde_json::{json, Value}; -use surf::Client; -use tokio::time::sleep; -use tracing::{debug, error, warn}; -use url::Url; - -use crate::{ - cli::url_to_client, - constants::{FALLBACK_RETRY_AFTER, GET_RECEIPTS_RETRY_AFTER}, - types::full_header::FullHeader, -}; use ethportal_api::{ types::{ execution::{ @@ -32,10 +20,22 @@ use ethportal_api::{ BlockBodyKey, BlockHeaderKey, BlockReceiptsKey, Header, HistoryContentKey, HistoryContentValue, Receipts, }; +use futures::future::join_all; +use reqwest_middleware::ClientWithMiddleware; +use serde_json::{json, Value}; +use tokio::time::sleep; +use tracing::{debug, error, warn}; use trin_validation::{ accumulator::PreMergeAccumulator, constants::MERGE_BLOCK_NUMBER, header_validator::HeaderValidator, }; +use url::Url; + +use crate::{ + cli::url_to_client, + constants::{FALLBACK_RETRY_AFTER, GET_RECEIPTS_RETRY_AFTER}, + types::full_header::FullHeader, +}; /// Limit the number of requests in a single batch to avoid exceeding the /// provider's batch size limit configuration of 100. @@ -51,7 +51,7 @@ pub struct ExecutionApi { } impl ExecutionApi { - pub async fn new(primary: Url, fallback: Url) -> Result { + pub async fn new(primary: Url, fallback: Url) -> Result { // Only check that provider is connected & available if not using a test provider. debug!( "Starting ExecutionApi with primary provider: {primary} and fallback provider: {fallback}", @@ -320,19 +320,27 @@ impl ExecutionApi { } async fn send_batch_request( - client: &Client, + client: &ClientWithMiddleware, requests: &Vec, ) -> anyhow::Result> { - let result = client - .post("") - .body_json(&json!(requests)) - .map_err(|e| anyhow!("Unable to construct json post for batched requests: {e:?}"))?; - let response = result - .recv_string() + let request = client.post("").json(&requests).build().map_err(|e| { + anyhow!( + "Unable to construct JSON POST for batched requests: {:?}", + e + ) + })?; + + let response = client + .execute(request) + .await + .map_err(|err| anyhow!("Unable to request execution batch from provider: {:?}", err))?; + + let response_text = response + .text() .await - .map_err(|err| anyhow!("Unable to request execution batch from provider: {err:?}"))?; - serde_json::from_str::>(&response).map_err(|err| { - anyhow!("Unable to parse execution batch from provider: {err:?} response: {response:?}") + .map_err(|e| anyhow!("Unable to read response body: {:?}", e))?; + serde_json::from_str::>(&response_text).map_err(|err| { + anyhow!("Unable to parse execution batch from provider: {err:?} response: {response_text:?}") }) } @@ -355,19 +363,31 @@ impl ExecutionApi { } } - async fn send_request(client: &Client, request: &JsonRequest) -> anyhow::Result { - let result = client - .post("") - .body_json(&request) - .map_err(|e| anyhow!("Unable to construct json post for single request: {e:?}"))?; - let response = result - .recv_string() - .await - .map_err(|err| anyhow!("Unable to request execution payload from provider: {err:?}"))?; - serde_json::from_str::(&response).map_err(|err| { + async fn send_request( + client: &ClientWithMiddleware, + request: &JsonRequest, + ) -> anyhow::Result { + let request = + client.post("").json(&request).build().map_err(|e| { + anyhow!("Unable to construct JSON POST for single request: {:?}", e) + })?; + + let response = client.execute(request).await.map_err(|err| { anyhow!( - "Unable to parse execution response from provider: {err:?} response: {response:?}" + "Unable to request execution payload from provider: {:?}", + err ) + })?; + + let response_text = response + .text() + .await + .map_err(|e| anyhow!("Unable to read response body: {:?}", e))?; + + serde_json::from_str::(&response_text).map_err(|err| { + anyhow!( + "Unable to parse execution response from provider: {err:?} response: {response_text:?}", + ) }) } } @@ -383,20 +403,39 @@ pub async fn construct_proof( } /// Check that provider is valid and accessible. -async fn check_provider(client: &Client) -> anyhow::Result<()> { +async fn check_provider(client: &ClientWithMiddleware) -> anyhow::Result<()> { let request = client .post("") - .body_json( - &json!({"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}), - ) - .map_err(|e| anyhow!("Unable to construct json post request: {e:?}"))?; - let response = request - .recv_string() + .json(&json!({ + "jsonrpc": "2.0", + "method": "web3_clientVersion", + "params": [], + "id": 1, + })) + .build() + .map_err(|e| anyhow!("Unable to construct json post request: {:?}", e))?; + + let response = client + .execute(request) .await - .map_err(|err| anyhow!("Unable to request execution batch from provider: {err:?}"))?; - let response: Value = serde_json::from_str(&response).map_err(|err| anyhow!("Unable to parse json response from execution provider, it's likely unavailable/configured incorrectly: {err:?} response: {response:?}"))?; - if response["result"].as_str().is_none() { + .map_err(|err| anyhow!("Unable to request execution batch from provider: {:?}", err))?; + + let response_text = response + .text() + .await + .map_err(|e| anyhow!("Unable to read response body: {:?}", e))?; + + let response_json: Value = serde_json::from_str(&response_text).map_err(|err| { + anyhow!( + "Unable to parse json response from execution provider, it's likely unavailable/configured incorrectly: {:?} response: {:?}", + err, + response_text + ) +})?; + + if response_json["result"].as_str().is_none() { bail!("Invalid response from execution provider check, it's likely unavailable/configured incorrectly"); } + Ok(()) } diff --git a/portal-bridge/src/bridge/era1.rs b/portal-bridge/src/bridge/era1.rs index e1bff9022..f7c0e847d 100644 --- a/portal-bridge/src/bridge/era1.rs +++ b/portal-bridge/src/bridge/era1.rs @@ -12,7 +12,10 @@ use e2store::{ }; use futures::future::join_all; use rand::{seq::SliceRandom, thread_rng}; -use surf::{Client, Config}; +use reqwest::{ + header::{HeaderMap, HeaderValue, CONTENT_TYPE}, + Client, +}; use tokio::{ sync::{OwnedSemaphorePermit, Semaphore}, task::JoinHandle, @@ -65,10 +68,9 @@ impl Era1Bridge { gossip_limit: usize, execution_api: ExecutionApi, ) -> anyhow::Result { - let http_client: Client = Config::new() - .add_header("Content-Type", "application/xml") - .expect("to be able to add header") - .try_into()?; + let mut headers = HeaderMap::new(); + headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/xml")); + let http_client: Client = Client::builder().default_headers(headers).build()?; let era1_files = get_shuffled_era1_files(&http_client).await?; let metrics = BridgeMetricsReporter::new("era1".to_string(), &format!("{mode:?}")); let gossip_semaphore = Arc::new(Semaphore::new(gossip_limit)); @@ -235,7 +237,10 @@ impl Era1Bridge { let raw_era1 = self .http_client .get(era1_path.clone()) - .recv_bytes() + .send() + .await + .expect("to be able to send request") + .bytes() .await .unwrap_or_else(|err| { panic!("unable to read era1 file at path: {era1_path:?} : {err}") @@ -256,7 +261,7 @@ impl Era1Bridge { let header_validator = Arc::new(self.header_oracle.header_validator.clone()); info!("Era1 file read successfully, gossiping block tuples for epoch: {epoch_index}"); let mut serve_block_tuple_handles = vec![]; - for block_tuple in Era1::iter_tuples(raw_era1) { + for block_tuple in Era1::iter_tuples(raw_era1.to_vec()) { let block_number = block_tuple.header.header.number; if let Some(range) = gossip_range.clone() { if !range.contains(&block_number) { diff --git a/portal-bridge/src/cli.rs b/portal-bridge/src/cli.rs index b8b55cfd7..4c06e1c30 100644 --- a/portal-bridge/src/cli.rs +++ b/portal-bridge/src/cli.rs @@ -3,15 +3,14 @@ use std::{env, net::SocketAddr, path::PathBuf, str::FromStr, sync::Arc}; use alloy_primitives::B256; use anyhow::anyhow; use clap::{Parser, Subcommand}; -use surf::{ - middleware::{Middleware, Next}, - Body, Client, Config, Request, Response, +use reqwest::{ + header::{HeaderMap, HeaderValue, CONTENT_TYPE}, + Client, }; -use tokio::{ - process::Child, - time::{sleep, Duration}, -}; -use tracing::{error, warn}; +use reqwest_middleware::{ClientBuilder, ClientWithMiddleware}; +use reqwest_retry::{policies::ExponentialBackoff, RetryTransientMiddleware}; +use tokio::process::Child; +use tracing::error; use url::Url; use crate::{ @@ -155,38 +154,49 @@ pub struct BridgeConfig { pub gossip_limit: usize, } -pub fn url_to_client(url: Url) -> Result { - let mut config = Config::new() - .add_header("Content-Type", "application/json") - .expect("to be able to add content type header") - .set_timeout(Some(HTTP_REQUEST_TIMEOUT)); - if url - .host_str() - .expect("to find host string") - .contains("pandaops.io") - { - let client_id = env::var("PANDAOPS_CLIENT_ID").unwrap_or_else(|_| { - error!("Pandoaps provider detected without PANDAOPS_CLIENT_ID set"); - "null".to_string() - }); - let client_secret = env::var("PANDAOPS_CLIENT_SECRET").unwrap_or_else(|_| { - error!("Pandoaps provider detected without PANDAOPS_CLIENT_SECRET set"); - "null".to_string() - }); - config = config - .clone() - .add_header("CF-Access-Client-Id", client_id) - .map_err(|_| "to be able to add client id header")? - .add_header("CF-Access-Client-Secret", client_secret) - .map_err(|_| "to be able to add client secret header")? - .set_base_url(url); +pub fn url_to_client(url: Url) -> Result { + let mut headers = HeaderMap::new(); + headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); + + if let Some(host) = url.host_str() { + if host.contains("pandaops.io") { + let client_id = env::var("PANDAOPS_CLIENT_ID").unwrap_or_else(|_| { + error!("Pandaops provider detected without PANDAOPS_CLIENT_ID set"); + "null".to_string() + }); + + let client_secret = env::var("PANDAOPS_CLIENT_SECRET").unwrap_or_else(|_| { + error!("Pandaops provider detected without PANDAOPS_CLIENT_SECRET set"); + "null".to_string() + }); + + headers.insert( + "CF-Access-Client-Id", + HeaderValue::from_str(&client_id).map_err(|_| "Invalid client id header value")?, + ); + + headers.insert( + "CF-Access-Client-Secret", + HeaderValue::from_str(&client_secret) + .map_err(|_| "Invalid client secret header value")?, + ); + } } else { - config = config.set_base_url(url); + return Err("Failed to find host string".into()); } - let client: Client = config - .try_into() - .map_err(|_| "to convert config to client")?; - Ok(client.with(Retry::default())) + + // Add retry middleware + let reqwest_client = Client::builder() + .default_headers(headers) + .timeout(HTTP_REQUEST_TIMEOUT) + .build() + .map_err(|_| "Failed to build HTTP client")?; + let retry_policy: ExponentialBackoff = ExponentialBackoff::builder().build_with_max_retries(3); + let client = ClientBuilder::new(reqwest_client) + .with(RetryTransientMiddleware::new_with_policy(retry_policy)) + .build(); + + Ok(client) } // parser for subnetworks, makes sure that the state network is not ran alongside other subnetworks @@ -201,55 +211,6 @@ fn subnetwork_parser(subnetwork_string: &str) -> Result>, S Ok(Arc::new(active_subnetworks)) } -#[derive(Debug)] -pub struct Retry { - attempts: u8, -} - -impl Retry { - pub fn new(attempts: u8) -> Self { - Retry { attempts } - } -} - -#[async_trait::async_trait] -impl Middleware for Retry { - async fn handle( - &self, - mut req: Request, - client: Client, - next: Next<'_>, - ) -> Result { - let mut retry_count: u8 = 0; - let body = req.take_body().into_bytes().await?; - while retry_count < self.attempts { - if retry_count > 0 { - warn!("Retrying request"); - } - let mut new_req = req.clone(); - new_req.set_body(Body::from_bytes(body.clone())); - if let Ok(val) = next.run(new_req, client.clone()).await { - if val.status().is_success() { - return Ok(val); - } - tracing::error!("Execution client request failed with: {:?}", val); - }; - retry_count += 1; - sleep(Duration::from_millis(100)).await; - } - Err(surf::Error::from_str( - 500, - "Unable to fetch batch after 3 retries", - )) - } -} - -impl Default for Retry { - fn default() -> Self { - Self { attempts: 3 } - } -} - type ParseError = &'static str; #[derive(Clone, Debug, PartialEq, Eq, Subcommand)] diff --git a/src/bin/historical_batch.rs b/src/bin/historical_batch.rs index da18754e6..4e216d25b 100644 --- a/src/bin/historical_batch.rs +++ b/src/bin/historical_batch.rs @@ -2,13 +2,13 @@ use anyhow::ensure; use e2store::era::Era; use ethportal_api::{consensus::beacon_state::HistoricalBatch, utils::bytes::hex_encode}; use regex::Regex; +use reqwest::get; use ssz::Encode; use std::{ fs::{File, OpenOptions}, io, io::{BufRead, Write}, }; -use surf::get; use tree_hash::TreeHash; const _BELLATRIX_SLOT: u64 = 4700013; @@ -21,7 +21,7 @@ async fn main() -> anyhow::Result<()> { let download_dir = dirs::download_dir().unwrap(); let file_path = download_dir.join("historical_batches"); - let body = get(ERA_URL).recv_string().await.unwrap(); + let body = get(ERA_URL).await?.text().await.unwrap(); // Match era files with epoch between 00573 and 00759 let re = Regex::new(r#"".*((0057[3-9])|(005[8-9][0-9])|006[0-9][0-9]|(007[0-5][0-9])).*\.era""#) @@ -60,7 +60,7 @@ async fn main() -> anyhow::Result<()> { continue; } - let res = get(url).recv_bytes().await.unwrap(); + let res = get(url).await?.bytes().await.unwrap(); let beacon_state = Era::deserialize_to_beacon_state(&res).unwrap(); let historical_batch = HistoricalBatch { block_roots: beacon_state.block_roots().clone(), diff --git a/src/bin/test_providers.rs b/src/bin/test_providers.rs index 68b09d3f8..9cb58be63 100644 --- a/src/bin/test_providers.rs +++ b/src/bin/test_providers.rs @@ -6,19 +6,17 @@ use rand::{ distributions::{Distribution, Uniform}, thread_rng, }; +use reqwest::{ + header::{HeaderMap, HeaderValue, CONTENT_TYPE}, + Client, +}; use serde_json::json; use ssz::Decode; -use surf::{Client, Config}; use tracing::{debug, info, warn}; use url::Url; use ethportal_api::{ - types::{ - execution::accumulator::EpochAccumulator, - jsonrpc::{params::Params, request::JsonRequest}, - }, - utils::bytes::hex_encode, - Header, + types::execution::accumulator::EpochAccumulator, utils::bytes::hex_encode, Header, }; use portal_bridge::api::execution::ExecutionApi; use trin_utils::log::init_tracing_logger; @@ -425,24 +423,39 @@ impl Providers { } async fn get_latest_block_number() -> Result { - let config = Config::new() - .add_header("Content-Type", "application/json") - .unwrap() - .add_header("CF-Access-Client-Id", PANDAOPS_CLIENT_ID.to_string()) - .unwrap() - .add_header( - "CF-Access-Client-Secret", - PANDAOPS_CLIENT_SECRET.to_string(), - ) - .unwrap() - .set_base_url(Url::parse("https://geth-lighthouse.mainnet.eu1.ethpandaops.io/").unwrap()); - let client: Client = config.try_into()?; - let params = Params::Array(vec![json!("latest"), json!(false)]); - let method = "eth_getBlockByNumber".to_string(); - let request = JsonRequest::new(method, params, 1); - let response = client.post("").body_json(&request).unwrap(); - let response = response.recv_string().await.unwrap(); - let response = serde_json::from_str::(&response)?; + let mut headers = HeaderMap::new(); + headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); + headers.insert( + "CF-Access-Client-Id", + HeaderValue::from_str(&PANDAOPS_CLIENT_ID) + .map_err(|_| anyhow!("Invalid CF-Access-Client-Id header value"))?, + ); + headers.insert( + "CF-Access-Client-Secret", + HeaderValue::from_str(&PANDAOPS_CLIENT_SECRET) + .map_err(|_| anyhow!("Invalid CF-Access-Client-Secret header value"))?, + ); + let client = Client::builder() + .default_headers(headers) + .build() + .map_err(|e| anyhow!("Failed to build HTTP client: {:?}", e))?; + let request_body = json!({ + "jsonrpc": "2.0", + "method": "eth_getBlockByNumber", + "params": ["latest", false], + "id": 1 + }); + let response = client + .post("https://geth-lighthouse.mainnet.eu1.ethpandaops.io/") + .json(&request_body) + .send() + .await + .map_err(|e| anyhow!("Request failed: {:?}", e))?; + let response_text = response + .text() + .await + .map_err(|e| anyhow!("Failed to read response text: {:?}", e))?; + let response = serde_json::from_str::(&response_text)?; let result = response .get("result") .ok_or_else(|| anyhow!("Unable to fetch latest block"))?; diff --git a/trin-execution/Cargo.toml b/trin-execution/Cargo.toml index 1ad0a6773..fda774ac6 100644 --- a/trin-execution/Cargo.toml +++ b/trin-execution/Cargo.toml @@ -26,13 +26,13 @@ lazy_static.workspace = true parking_lot.workspace = true prometheus_exporter.workspace = true rayon = "1.10.0" +reqwest.workspace = true revm.workspace = true revm-inspectors = "0.6" revm-primitives.workspace = true rocksdb = "0.22.0" serde = { workspace = true, features = ["rc"] } serde_json.workspace = true -surf.workspace = true tempfile.workspace = true thiserror.workspace = true tokio.workspace = true diff --git a/trin-execution/src/era/binary_search.rs b/trin-execution/src/era/binary_search.rs index eb544629a..3b5f57a08 100644 --- a/trin-execution/src/era/binary_search.rs +++ b/trin-execution/src/era/binary_search.rs @@ -3,8 +3,8 @@ use e2store::{ era::{get_beacon_fork, CompressedSignedBeaconBlock, Era, SLOTS_PER_HISTORICAL_ROOT}, utils::get_era_files, }; +use reqwest::Client; use revm_primitives::SpecId; -use surf::Client; use crate::evm::spec_id::get_spec_block_number; @@ -58,7 +58,7 @@ impl EraBinarySearch { let decoded_era = Era::deserialize(&era_to_check)?; if decoded_era.contains(block_number) { - return process_era_file(era_to_check, mid); + return process_era_file(era_to_check.to_vec(), mid); } return Err(anyhow::anyhow!("Block not found in any era file")); } @@ -84,7 +84,7 @@ impl EraBinarySearch { let decoded_era = Era::deserialize(&era_to_check)?; if decoded_era.contains(block_number) { - return process_era_file(era_to_check, mid); + return process_era_file(era_to_check.to_vec(), mid); } } @@ -107,14 +107,18 @@ impl EraBinarySearch { let e2store_header = http_client .get(&era_path) .header("Range", "bytes=8-15") - .recv_bytes() + .send() + .await? + .bytes() .await .expect("to be able to download e2store header"); let e2store_header = E2StoreHeader::deserialize(&e2store_header)?; let compressed_beacon_block = http_client .get(&era_path) .header("Range", format!("bytes=8-{}", 15 + e2store_header.length)) - .recv_bytes() + .send() + .await? + .bytes() .await .expect("to be able to download compressed beacon block"); let entry = Entry::deserialize(&compressed_beacon_block)?; diff --git a/trin-execution/src/era/manager.rs b/trin-execution/src/era/manager.rs index 4a9f4a664..48bc234b4 100644 --- a/trin-execution/src/era/manager.rs +++ b/trin-execution/src/era/manager.rs @@ -5,7 +5,10 @@ use e2store::{ era1::Era1, utils::{get_era1_files, get_era_files, ERA1_FILE_COUNT}, }; -use surf::{Client, Config}; +use reqwest::{ + header::{HeaderMap, HeaderValue, CONTENT_TYPE}, + Client, +}; use tokio::task::JoinHandle; use tracing::info; @@ -30,10 +33,10 @@ pub struct EraManager { impl EraManager { pub async fn new(next_block_number: u64) -> anyhow::Result { - let http_client: Client = Config::new() - .add_header("Content-Type", "application/xml") - .expect("to be able to add header") - .try_into()?; + let mut headers = HeaderMap::new(); + headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/xml")); + let http_client: Client = Client::builder().default_headers(headers).build()?; + let era1_files = get_era1_files(&http_client).await?; let era_files = get_era_files(&http_client).await?; @@ -124,8 +127,8 @@ impl EraManager { }; let raw_era = download_raw_era(next_era_path, http_client.clone()).await?; match next_era_type { - EraType::Era1 => process_era1_file(raw_era, next_epoch_index), - EraType::Era => process_era_file(raw_era, next_epoch_index), + EraType::Era1 => process_era1_file(raw_era.to_vec(), next_epoch_index), + EraType::Era => process_era_file(raw_era.to_vec(), next_epoch_index), } }); self.next_era = Some(join_handle); @@ -145,7 +148,7 @@ impl EraManager { }; let raw_era1 = download_raw_era(era1_path, http_client.clone()).await?; - return process_era1_file(raw_era1, epoch_index); + return process_era1_file(raw_era1.to_vec(), epoch_index); } EraBinarySearch::find_era_file(http_client.clone(), block_number).await diff --git a/trin-execution/src/era/utils.rs b/trin-execution/src/era/utils.rs index cfdcdf695..6294da9ae 100644 --- a/trin-execution/src/era/utils.rs +++ b/trin-execution/src/era/utils.rs @@ -1,5 +1,6 @@ use std::time::Duration; +use alloy_rlp::Bytes; use anyhow::anyhow; use e2store::{ era::Era, @@ -7,7 +8,7 @@ use e2store::{ }; use ethportal_api::BlockBody; use rayon::iter::{IntoParallelIterator, ParallelIterator}; -use surf::Client; +use reqwest::Client; use tokio::time::sleep; use tracing::{info, warn}; @@ -82,11 +83,11 @@ pub fn process_era_file(raw_era: Vec, epoch_index: u64) -> anyhow::Result anyhow::Result> { +pub async fn download_raw_era(era_path: String, http_client: Client) -> anyhow::Result { info!("Downloading era file {era_path}"); let mut attempts = 1u32; let raw_era1 = loop { - match http_client.get(&era_path).recv_bytes().await { + match http_client.get(&era_path).send().await?.bytes().await { Ok(raw_era1) => break raw_era1, Err(err) => { warn!("Failed to download era1 file {attempts} times | Error: {err} | Path {era_path}");