diff --git a/Cargo.lock b/Cargo.lock index 94f8533b2..b897fb130 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,15 +27,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" @@ -45,17 +36,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" @@ -82,52 +62,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" @@ -337,7 +283,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "alloy-rlp-derive", - "arrayvec 0.7.6", + "arrayvec", "bytes", ] @@ -779,12 +725,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" @@ -806,29 +746,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" @@ -845,144 +762,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.37", - "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]] @@ -1007,25 +793,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" @@ -1057,12 +824,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" @@ -1127,24 +888,12 @@ dependencies = [ "windows-targets 0.52.6", ] -[[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" @@ -1205,7 +954,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.77", ] @@ -1278,19 +1027,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" @@ -1462,7 +1198,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom 7.1.3", + "nom", ] [[package]] @@ -1492,15 +1228,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" @@ -1580,7 +1307,7 @@ dependencies = [ "bs58", "coins-core", "digest 0.10.7", - "hmac 0.12.1", + "hmac", "k256", "serde", "sha2 0.10.8", @@ -1595,7 +1322,7 @@ checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" dependencies = [ "bitvec", "coins-bip32", - "hmac 0.12.1", + "hmac", "once_cell", "pbkdf2 0.12.2", "rand 0.8.5", @@ -1629,26 +1356,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" @@ -1701,23 +1408,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" @@ -1743,12 +1433,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" @@ -1792,15 +1476,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" @@ -1835,16 +1510,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" @@ -1870,11 +1535,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]] @@ -1992,39 +1657,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" @@ -2192,12 +1830,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" @@ -2205,15 +1837,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", @@ -2266,10 +1898,10 @@ dependencies = [ "ethereum_ssz_derive", "ethportal-api", "rand 0.8.5", + "reqwest 0.12.7", "rstest", "scraper", "snap", - "surf", "tempfile", "tokio", ] @@ -2462,7 +2094,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", @@ -2645,7 +2277,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "syn 2.0.77", @@ -2675,7 +2307,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", @@ -2707,7 +2339,7 @@ checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" dependencies = [ "chrono", "ethers-core", - "reqwest", + "reqwest 0.11.27", "semver 1.0.23", "serde", "serde_json", @@ -2732,7 +2364,7 @@ dependencies = [ "futures-locks", "futures-util", "instant", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -2765,7 +2397,7 @@ dependencies = [ "jsonwebtoken 8.3.0", "once_cell", "pin-project", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -2900,7 +2532,7 @@ dependencies = [ "ethportal-api", "futures", "hex", - "hyper", + "hyper 0.14.30", "jsonrpsee", "portal-bridge", "rand 0.8.5", @@ -2909,7 +2541,6 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "surf", "tempfile", "tokio", "tracing", @@ -2931,27 +2562,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" @@ -2976,18 +2586,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" @@ -2995,7 +2596,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", ] @@ -3147,34 +2748,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" @@ -3214,7 +2787,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", ] @@ -3295,16 +2868,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" @@ -3312,7 +2875,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" dependencies = [ "opaque-debug", - "polyval 0.5.3", + "polyval", ] [[package]] @@ -3373,18 +2936,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" @@ -3512,12 +3063,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" @@ -3533,33 +3078,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]] @@ -3628,52 +3153,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" @@ -3704,7 +3211,7 @@ dependencies = [ "futures-util", "h2", "http 0.2.12", - "http-body", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -3716,6 +3223,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" @@ -3724,12 +3250,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]] @@ -3867,12 +3431,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" @@ -3895,17 +3453,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]] @@ -4030,7 +3580,7 @@ dependencies = [ "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "tracing", "url", @@ -4044,16 +3594,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", @@ -4070,8 +3620,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", @@ -4104,7 +3654,7 @@ checksum = "a482bc4e25eebd0adb61a3468c722763c381225bd3ec46e926f709df8a8eb548" dependencies = [ "futures-util", "http 0.2.12", - "hyper", + "hyper 0.14.30", "jsonrpsee-core", "jsonrpsee-types 0.20.4", "route-recognizer", @@ -4256,15 +3806,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" @@ -4316,19 +3857,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" @@ -4427,7 +3955,7 @@ dependencies = [ "jsonrpsee", "log", "portalnet", - "reqwest", + "reqwest 0.12.7", "serde", "serde-this-or-that", "serde_json", @@ -4443,12 +3971,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" @@ -4482,9 +4004,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" @@ -4675,17 +4194,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" @@ -4915,7 +4423,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", @@ -4958,7 +4466,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", @@ -4992,12 +4500,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" @@ -5076,7 +4578,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", ] @@ -5088,7 +4590,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", - "hmac 0.12.1", + "hmac", ] [[package]] @@ -5282,17 +4784,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" @@ -5309,48 +4800,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.37", - "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" @@ -5385,6 +4834,9 @@ dependencies = [ "portalnet", "prometheus_exporter", "rand 0.8.5", + "reqwest 0.12.7", + "reqwest-middleware", + "reqwest-retry", "revm", "revm-primitives", "rstest", @@ -5393,7 +4845,6 @@ dependencies = [ "serde_json", "serde_yaml", "ssz_types", - "surf", "test-log", "tokio", "tracing", @@ -5563,12 +5014,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" @@ -5667,6 +5112,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" @@ -5896,9 +5389,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", @@ -5907,14 +5400,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", @@ -5924,6 +5417,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" @@ -5964,6 +5535,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" @@ -6049,7 +5629,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac 0.12.1", + "hmac", "subtle", ] @@ -6139,7 +5719,7 @@ dependencies = [ "discv5", "eth_trie", "ethportal-api", - "hyper", + "hyper 0.14.30", "portalnet", "reth-ipc", "reth-rpc-types", @@ -6286,19 +5866,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" @@ -6318,20 +5895,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.37" @@ -6341,33 +5904,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]] @@ -6377,7 +5941,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", ] @@ -6391,6 +5955,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" @@ -6401,6 +5981,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" @@ -6514,22 +6105,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" @@ -6615,22 +6196,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]] @@ -6642,12 +6214,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" @@ -6711,17 +6277,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_repr" version = "0.1.19" @@ -6769,7 +6324,7 @@ dependencies = [ "serde_derive", "serde_json", "serde_with_macros", - "time 0.3.36", + "time", ] [[package]] @@ -6841,15 +6396,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" @@ -6861,12 +6407,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" @@ -6932,7 +6472,7 @@ dependencies = [ "const_format", "git2", "is_debug", - "time 0.3.36", + "time", "tzdb", ] @@ -6979,7 +6519,7 @@ dependencies = [ "num-bigint", "num-traits", "thiserror", - "time 0.3.36", + "time", ] [[package]] @@ -7156,70 +6696,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" @@ -7289,9 +6771,9 @@ dependencies = [ "bytecodec", "byteorder", "crc", - "hmac 0.12.1", + "hmac", "md5", - "sha1 0.10.6", + "sha1", "trackable 1.3.0", ] @@ -7322,9 +6804,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 = "superchain-primitives" @@ -7357,30 +6839,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" @@ -7391,7 +6849,7 @@ dependencies = [ "fs2", "hex", "once_cell", - "reqwest", + "reqwest 0.11.27", "semver 1.0.23", "serde", "serde_json", @@ -7441,6 +6899,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" @@ -7475,9 +6942,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.37", + "rustix", "windows-sys 0.59.0", ] @@ -7573,21 +7040,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" @@ -7602,7 +7054,7 @@ dependencies = [ "powerfmt", "serde", "time-core", - "time-macros 0.2.18", + "time-macros", ] [[package]] @@ -7611,16 +7063,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" @@ -7631,19 +7073,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" @@ -7662,7 +7091,7 @@ dependencies = [ "ascii", "chunked_transfer", "log", - "time 0.3.36", + "time", "url", ] @@ -7720,6 +7149,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" @@ -7755,7 +7195,7 @@ dependencies = [ "log", "rustls 0.21.12", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tungstenite", "webpki-roots 0.25.4", ] @@ -7854,7 +7294,7 @@ dependencies = [ "futures-core", "futures-util", "http 0.2.12", - "http-body", + "http-body 0.4.6", "http-range-header", "httpdate", "iri-string", @@ -8098,13 +7538,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", @@ -8168,6 +7608,7 @@ dependencies = [ "parking_lot 0.11.2", "prometheus_exporter", "rayon", + "reqwest 0.12.7", "reth-rpc-types", "revm", "revm-inspectors", @@ -8175,7 +7616,6 @@ dependencies = [ "rocksdb", "serde", "serde_json", - "surf", "tempfile", "test-log", "thiserror", @@ -8332,7 +7772,7 @@ dependencies = [ "log", "rand 0.8.5", "rustls 0.21.12", - "sha1 0.10.6", + "sha1", "thiserror", "url", "utf-8", @@ -8461,9 +7901,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", @@ -8498,7 +7938,7 @@ dependencies = [ "log", "once_cell", "rustls 0.21.12", - "rustls-webpki", + "rustls-webpki 0.101.7", "serde", "serde_json", "url", @@ -8514,7 +7954,6 @@ dependencies = [ "form_urlencoded", "idna 0.5.0", "percent-encoding", - "serde", ] [[package]] @@ -8626,12 +8065,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" @@ -8653,12 +8086,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" @@ -8758,39 +8185,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" @@ -8832,6 +8264,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" @@ -9117,10 +8579,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 663ec9274..052bd1740 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", default-features = false, features = ["std", "secp256k1", "serde-json"] } @@ -128,7 +129,6 @@ sha3 = "0.9.1" snap = "1.1.1" ssz_types = "0.8.0" strum = { version = "0.26.1", features = ["derive"] } -surf = { version = "2.3.2", default-features = false, features = ["h1-client-rustls", "middleware-logger", "encoding"] } # we use rustls because OpenSSL cause issues compiling on aarch64 tempfile = "3.3.0" test-log = { version = "0.2.11", features = ["trace"] } thiserror = "1.0.57" 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-api/src/types/execution/block_body.rs b/ethportal-api/src/types/execution/block_body.rs index c0d075960..ec0ad4e96 100644 --- a/ethportal-api/src/types/execution/block_body.rs +++ b/ethportal-api/src/types/execution/block_body.rs @@ -263,9 +263,7 @@ impl ssz::Decode for BlockBodyLegacy { )) })?; let uncles: Vec
= Decodable::decode(&mut uncles.as_slice()).map_err(|e| { - ssz::DecodeError::BytesInvalid( - format!("Legacy block body contains invalid txs: {e:?}",), - ) + ssz::DecodeError::BytesInvalid(format!("Legacy block body contains invalid txs: {e:?}")) })?; Ok(Self { txs, uncles }) } @@ -350,7 +348,7 @@ impl ssz::Decode for BlockBodyMerge { )) })?; let uncles: Vec
= Decodable::decode(&mut uncles.as_slice()).map_err(|e| { - ssz::DecodeError::BytesInvalid(format!("Merge block body contains invalid txs: {e:?}",)) + ssz::DecodeError::BytesInvalid(format!("Merge block body contains invalid txs: {e:?}")) })?; if !uncles.is_empty() { return Err(ssz::DecodeError::BytesInvalid( 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/light-client/Cargo.toml b/light-client/Cargo.toml index e0603baa0..c3a320289 100644 --- a/light-client/Cargo.toml +++ b/light-client/Cargo.toml @@ -22,7 +22,7 @@ jsonrpsee = { workspace = true, features = ["full"] } log = "0.4.17" milagro_bls = { package="snowbridge-milagro-bls", git = "https://github.com/Snowfork/milagro_bls" } portalnet.workspace = true -reqwest = { version = "0.11.13", default-features = false, features = ["json", "rustls-tls"] } +reqwest.workspace = true serde.workspace = true serde-this-or-that.workspace = true serde_json.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..23a350e4f 100644 --- a/portal-bridge/src/api/consensus.rs +++ b/portal-bridge/src/api/consensus.rs @@ -1,12 +1,14 @@ use std::fmt::Display; use anyhow::anyhow; -use surf::Client; use tokio::time::sleep; use tracing::{debug, warn}; use url::Url; -use crate::{cli::url_to_client, constants::FALLBACK_RETRY_AFTER}; +use crate::{ + cli::{url_to_client, ClientWithBaseUrl}, + constants::FALLBACK_RETRY_AFTER, +}; /// Implements endpoints from the Beacon API to access data from the consensus layer. #[derive(Clone, Debug)] @@ -16,10 +18,9 @@ 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 + "Starting ConsensusApi with primary provider: {primary} and fallback provider: {fallback}", ); let client = url_to_client(primary.clone()).map_err(|err| { anyhow!("Unable to create primary client for consensus data provider: {err:?}") @@ -90,7 +91,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 +99,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: &ClientWithBaseUrl) -> 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..61e8ee19d 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,21 @@ use ethportal_api::{ BlockBodyKey, BlockHeaderKey, BlockReceiptsKey, Header, HistoryContentKey, HistoryContentValue, Receipts, }; +use futures::future::join_all; +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, ClientWithBaseUrl}, + 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 +50,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}", @@ -273,9 +272,6 @@ impl ExecutionApi { Ok(header.number) } - /// Used the "surf" library here instead of "ureq" since "surf" is much more capable of handling - /// multiple async requests. Using "ureq" consistently resulted in errors as soon as the number - /// of concurrent tasks increased significantly. async fn batch_requests(&self, obj: Vec) -> anyhow::Result { let batched_request_futures = obj .chunks(BATCH_LIMIT) @@ -320,20 +316,19 @@ impl ExecutionApi { } async fn send_batch_request( - client: &Client, + client: &ClientWithBaseUrl, 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 response = client + .post("")? + .json(&requests) + .send() .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:?}") - }) + response + .json::>() + .await + .map_err(|err| anyhow!("Unable to parse execution batch from provider: {err:?}")) } async fn try_request(&self, request: JsonRequest) -> anyhow::Result { @@ -355,19 +350,27 @@ 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() + async fn send_request( + client: &ClientWithBaseUrl, + 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 request execution payload from provider: {err:?}"))?; - serde_json::from_str::(&response).map_err(|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:?}" - ) + "Unable to parse execution response from provider: {err:?} response: {response_text:?}", + ) }) } } @@ -383,19 +386,31 @@ 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: &ClientWithBaseUrl) -> anyhow::Result<()> { let request = client - .post("") - .body_json( - &json!({"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}), - ) + .post("")? + .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 = request - .recv_string() + 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() { + 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: {err:?} response: {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..38faabfca 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,12 @@ 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 http_client = Client::builder() + .default_headers(HeaderMap::from_iter([( + CONTENT_TYPE, + HeaderValue::from_static("application/xml"), + )])) + .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 +240,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 +264,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..f83982ff4 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, IntoUrl, Request, Response, }; -use tokio::{ - process::Child, - time::{sleep, Duration}, -}; -use tracing::{error, warn}; +use reqwest_middleware::{ClientBuilder, ClientWithMiddleware, RequestBuilder}; +use reqwest_retry::{policies::ExponentialBackoff, RetryTransientMiddleware}; +use tokio::process::Child; +use tracing::error; use url::Url; use crate::{ @@ -155,38 +154,84 @@ 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()); + } + + // Add retry middleware + let reqwest_client = Client::builder() + .default_headers(headers) + .timeout(HTTP_REQUEST_TIMEOUT) + .build() + .map_err(|_| "Failed to build HTTP client")?; + let client = ClientBuilder::new(reqwest_client) + .with(RetryTransientMiddleware::new_with_policy( + ExponentialBackoff::builder().build_with_max_retries(3), + )) + .build(); + let client_with_base_url = ClientWithBaseUrl::new(client, url); + + Ok(client_with_base_url) +} + +pub struct ClientWithBaseUrl { + client: ClientWithMiddleware, + base_url: Url, +} + +impl ClientWithBaseUrl { + pub fn new(client: ClientWithMiddleware, base_url: Url) -> Self { + Self { client, base_url } + } + + pub fn client(&self) -> &ClientWithMiddleware { + &self.client + } + + pub fn base_url(&self) -> &Url { + &self.base_url + } + + pub fn get(&self, url: U) -> anyhow::Result { + let url = self.base_url.join(url.as_str())?; + Ok(self.client.get(url)) + } + + pub fn post(&self, url: U) -> anyhow::Result { + let url = self.base_url.join(url.as_str())?; + Ok(self.client.post(url)) + } + + pub async fn execute(&self, request: Request) -> Result { + self.client.execute(request).await } - let client: Client = config - .try_into() - .map_err(|_| "to convert config to client")?; - Ok(client.with(Retry::default())) } // parser for subnetworks, makes sure that the state network is not ran alongside other subnetworks @@ -201,55 +246,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/portal-bridge/src/stats.rs b/portal-bridge/src/stats.rs index 7b3003436..04d3e7f61 100644 --- a/portal-bridge/src/stats.rs +++ b/portal-bridge/src/stats.rs @@ -102,15 +102,15 @@ impl StatsReporter for HistoryBlockStats { let block_number = self.block_number; if let Some(stats) = &self.header_with_proof { info!("GossipReport: block#{block_number}: header_with_proof - {stats}"); - debug!("GossipReport: block#{block_number}: header_with_proof - {stats:?}",); + debug!("GossipReport: block#{block_number}: header_with_proof - {stats:?}"); } if let Some(stats) = &self.block_body { info!("GossipReport: block#{block_number}: block_body - {stats}"); - debug!("GossipReport: block#{block_number}: block_body - {stats:?}",); + debug!("GossipReport: block#{block_number}: block_body - {stats:?}"); } if let Some(stats) = &self.receipts { info!("GossipReport: block#{block_number}: receipts - {stats}"); - debug!("GossipReport: block#{block_number}: receipts - {stats:?}",); + debug!("GossipReport: block#{block_number}: receipts - {stats:?}"); } if let Some(stats) = &self.epoch_accumulator { info!("GossipReport: block#{block_number}: epoch_accumulator - {stats}"); 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..8e2222e7e 100644 --- a/src/bin/test_providers.rs +++ b/src/bin/test_providers.rs @@ -2,16 +2,6 @@ use std::{fmt, fs, ops::Range, sync::Arc}; use anyhow::{anyhow, Result}; use clap::Parser; -use rand::{ - distributions::{Distribution, Uniform}, - thread_rng, -}; -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, @@ -21,6 +11,17 @@ use ethportal_api::{ Header, }; use portal_bridge::api::execution::ExecutionApi; +use rand::{ + distributions::{Distribution, Uniform}, + thread_rng, +}; +use reqwest::{ + header::{HeaderMap, HeaderValue, CONTENT_TYPE}, + Client, +}; +use serde_json::json; +use ssz::Decode; +use tracing::{debug, info, warn}; use trin_utils::log::init_tracing_logger; use trin_validation::{ accumulator::PreMergeAccumulator, @@ -31,6 +32,7 @@ use trin_validation::{ }, header_validator::HeaderValidator, }; +use url::Url; lazy_static::lazy_static! { static ref PANDAOPS_CLIENT_ID: String = std::env::var("PANDAOPS_CLIENT_ID").unwrap(); @@ -425,24 +427,34 @@ 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 request = JsonRequest::new( + "eth_getBlockByNumber".to_string(), + Params::Array(vec![json!("latest"), json!(false)]), + /* id= */ 1, + ); + let response = Client::new() + .post("https://geth-lighthouse.mainnet.eu1.ethpandaops.io/") + .headers(headers) + .json(&request) + .send() + .await + .map_err(|e| anyhow!("Request failed: {:?}", e))?; + let response = response + .json::() + .await + .map_err(|e| anyhow!("Failed to read response text: {:?}", e))?; let result = response .get("result") .ok_or_else(|| anyhow!("Unable to fetch latest block"))?; diff --git a/trin-beacon/src/validation.rs b/trin-beacon/src/validation.rs index fcc8453ca..cfe1854ee 100644 --- a/trin-beacon/src/validation.rs +++ b/trin-beacon/src/validation.rs @@ -179,7 +179,7 @@ impl BeaconValidator { ) -> anyhow::Result { let fork_versioned_historical_summaries = ForkVersionedHistoricalSummariesWithProof::from_ssz_bytes(content).map_err(|err| { - anyhow!("Historical summaries with proof has invalid SSZ bytes: {err:?}",) + anyhow!("Historical summaries with proof has invalid SSZ bytes: {err:?}") })?; // Check if the historical summaries with proof epoch matches the content key epoch diff --git a/trin-execution/Cargo.toml b/trin-execution/Cargo.toml index 920fbeae3..49edda85c 100644 --- a/trin-execution/Cargo.toml +++ b/trin-execution/Cargo.toml @@ -26,6 +26,7 @@ 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 @@ -33,7 +34,6 @@ reth-rpc-types.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..f2e750eae 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,12 @@ 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 http_client = Client::builder() + .default_headers(HeaderMap::from_iter([( + CONTENT_TYPE, + HeaderValue::from_static("application/xml"), + )])) + .build()?; let era1_files = get_era1_files(&http_client).await?; let era_files = get_era_files(&http_client).await?; @@ -124,8 +129,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 +150,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}");