From 08293cd48ad108a3b27395ffeea0b2df6e49b594 Mon Sep 17 00:00:00 2001 From: Milos Stankovic <82043364+morph-dev@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:06:37 +0300 Subject: [PATCH] chore(deps): update jsonrpsee dependency (#1462) --- Cargo.lock | 650 ++++++++------------- Cargo.toml | 5 +- ethportal-peertest/Cargo.toml | 1 - ethportal-peertest/src/lib.rs | 2 +- ethportal-peertest/src/scenarios/gossip.rs | 6 +- portal-bridge/src/gossip.rs | 29 +- portal-bridge/src/stats.rs | 51 +- rpc/Cargo.toml | 4 +- rpc/src/cors.rs | 2 +- rpc/src/errors.rs | 44 +- rpc/src/rpc_server.rs | 102 ++-- 11 files changed, 341 insertions(+), 555 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5bb644e6b..84bbb626e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -59,7 +59,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.15", + "getrandom", "once_cell", "version_check", ] @@ -71,7 +71,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom 0.2.15", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -203,7 +203,7 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -328,13 +328,13 @@ dependencies = [ "cfg-if", "const-hex", "derive_more 1.0.0", - "getrandom 0.2.15", + "getrandom", "hex-literal", "itoa", "k256", "keccak-asm", "proptest", - "rand 0.8.5", + "rand", "ruint", "serde", "tiny-keccak", @@ -468,7 +468,7 @@ dependencies = [ "alloy-serde", "derive_more 1.0.0", "jsonwebtoken", - "rand 0.8.5", + "rand", "serde", ] @@ -544,7 +544,7 @@ dependencies = [ "alloy-signer", "async-trait", "k256", - "rand 0.8.5", + "rand", "thiserror", ] @@ -571,7 +571,7 @@ dependencies = [ "alloy-json-abi", "alloy-sol-macro-input", "const-hex", - "heck 0.5.0", + "heck", "indexmap 2.5.0", "proc-macro-error2", "proc-macro2", @@ -590,7 +590,7 @@ dependencies = [ "alloy-json-abi", "const-hex", "dunce", - "heck 0.5.0", + "heck", "proc-macro2", "quote", "serde_json", @@ -605,7 +605,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3edae8ea1de519ccba896b6834dec874230f72fe695ff3c9c118e90ec7cff783" dependencies = [ "serde", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -684,7 +684,7 @@ dependencies = [ "alloy-transport", "futures", "http 1.1.0", - "rustls 0.23.13", + "rustls", "serde_json", "tokio", "tokio-tungstenite", @@ -882,7 +882,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ "num-traits", - "rand 0.8.5", + "rand", ] [[package]] @@ -892,7 +892,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand 0.8.5", + "rand", ] [[package]] @@ -923,15 +923,6 @@ dependencies = [ "zstd-safe", ] -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener", -] - [[package]] name = "async-stream" version = "0.3.5" @@ -1085,15 +1076,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" -dependencies = [ - "serde", -] - [[package]] name = "bimap" version = "0.6.3" @@ -1115,7 +1097,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.77", ] @@ -1301,6 +1283,12 @@ dependencies = [ "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cexpr" version = "0.6.0" @@ -1384,7 +1372,7 @@ version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.77", @@ -1402,6 +1390,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "const-hex" version = "1.12.0" @@ -1544,7 +1542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -1882,7 +1880,7 @@ dependencies = [ "lru 0.12.4", "more-asserts", "parking_lot 0.11.2", - "rand 0.8.5", + "rand", "rlp", "smallvec", "socket2 0.4.10", @@ -1935,7 +1933,7 @@ dependencies = [ "ethereum_ssz", "ethereum_ssz_derive", "ethportal-api", - "rand 0.8.5", + "rand", "reqwest", "rstest", "scraper", @@ -1976,7 +1974,7 @@ checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", - "rand_core 0.6.4", + "rand_core", "serde", "sha2 0.10.8", "subtle", @@ -2008,7 +2006,7 @@ dependencies = [ "generic-array", "group", "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", "subtle", "zeroize", @@ -2035,7 +2033,7 @@ dependencies = [ "hex", "k256", "log", - "rand 0.8.5", + "rand", "rlp", "serde", "sha3 0.10.8", @@ -2202,7 +2200,7 @@ dependencies = [ "nanotemplate", "once_cell", "quickcheck", - "rand 0.8.5", + "rand", "rlp", "rs_merkle", "rstest", @@ -2241,10 +2239,9 @@ dependencies = [ "ethportal-api", "futures", "hex", - "hyper 0.14.30", "jsonrpsee", "portal-bridge", - "rand 0.8.5", + "rand", "reth-ipc", "rpc", "serde", @@ -2265,12 +2262,6 @@ dependencies = [ "url", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "fallible-iterator" version = "0.3.0" @@ -2306,7 +2297,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2337,7 +2328,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -2532,17 +2523,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - [[package]] name = "getrandom" version = "0.2.15" @@ -2552,7 +2532,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] @@ -2593,15 +2573,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "gloo-net" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ac9e8288ae2c632fa9f8657ac70bfe38a1530f345282d7ba66a1f70b72b7dc4" +checksum = "c06f627b1a58ca3d42b45d6104bf1e1a03799df472df00988b6ba21accc10580" dependencies = [ "futures-channel", "futures-core", "futures-sink", "gloo-utils", - "http 0.2.12", + "http 1.1.0", "js-sys", "pin-project", "serde", @@ -2644,29 +2624,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.4", + "rand_core", "subtle", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.5.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.6" @@ -2734,12 +2695,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -2830,17 +2785,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.1" @@ -2860,15 +2804,15 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.1", + "http-body", "pin-project-lite", ] [[package]] name = "http-range-header" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" [[package]] name = "httparse" @@ -2888,30 +2832,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" -[[package]] -name = "hyper" -version = "0.14.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.7", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.4.1" @@ -2921,10 +2841,11 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", + "h2", "http 1.1.0", - "http-body 1.0.1", + "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -2932,22 +2853,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper 0.14.30", - "log", - "rustls 0.21.12", - "rustls-native-certs", - "tokio", - "tokio-rustls 0.24.1", -] - [[package]] name = "hyper-rustls" version = "0.27.3" @@ -2956,12 +2861,13 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper", "hyper-util", - "rustls 0.23.13", + "log", + "rustls", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "tower-service", ] @@ -2973,7 +2879,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-util", "native-tls", "tokio", @@ -2991,8 +2897,8 @@ dependencies = [ "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.1", - "hyper 1.4.1", + "http-body", + "hyper", "pin-project-lite", "socket2 0.5.7", "tokio", @@ -3065,7 +2971,7 @@ checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" dependencies = [ "attohttpc", "log", - "rand 0.8.5", + "rand", "url", "xmltree", ] @@ -3204,6 +3110,26 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "jobserver" version = "0.1.32" @@ -3224,9 +3150,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.20.4" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138572befc78a9793240645926f30161f8b4143d2be18d09e44ed9814bd7ee2c" +checksum = "8fd1ead9fb95614e8dc5556d12a8681c2f6d352d0c1d3efc8708c7ccbba47bc6" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -3242,64 +3168,72 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.20.4" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c671353e4adf926799107bd7f5724a06b6bc0a333db442a0843c58640bdd0c1" +checksum = "89841d4f03a14c055eb41d4f41901819573ef948e8ee0d5c86466fd286b2ce7f" dependencies = [ + "base64 0.22.1", "futures-channel", "futures-util", "gloo-net", - "http 0.2.12", + "http 1.1.0", "jsonrpsee-core", "pin-project", - "rustls-native-certs", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", "soketto", "thiserror", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", "tokio-util", "tracing", "url", - "webpki-roots 0.25.4", ] [[package]] name = "jsonrpsee-core" -version = "0.20.4" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f24ea59b037b6b9b0e2ebe2c30a3e782b56bd7c76dcc5d6d70ba55d442af56e3" +checksum = "ff79651479f69ada7bda604ef2acf3f1aa50755d97cc36d25ff04c2664f9d96f" dependencies = [ - "anyhow", - "async-lock", "async-trait", - "beef", + "bytes", "futures-timer", "futures-util", - "hyper 0.14.30", + "http 1.1.0", + "http-body", + "http-body-util", "jsonrpsee-types", "parking_lot 0.12.3", - "rand 0.8.5", - "rustc-hash", + "pin-project", + "rand", + "rustc-hash 2.0.0", "serde", "serde_json", - "soketto", "thiserror", "tokio", + "tokio-stream", "tracing", "wasm-bindgen-futures", ] [[package]] name = "jsonrpsee-http-client" -version = "0.20.4" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c7b9f95208927653e7965a98525e7fc641781cab89f0e27c43fa2974405683" +checksum = "68ed8b301b19f4dad8ddc66ed956a70fc227def5c19b3898e0a29ce8f0edee06" dependencies = [ "async-trait", - "hyper 0.14.30", - "hyper-rustls 0.24.2", + "base64 0.22.1", + "http-body", + "hyper", + "hyper-rustls", + "hyper-util", "jsonrpsee-core", "jsonrpsee-types", + "rustls", + "rustls-platform-verifier", "serde", "serde_json", "thiserror", @@ -3311,28 +3245,32 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.20.4" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc0eba68ba205452bcb4c7b80a79ddcb3bf36c261a841b239433142db632d24" +checksum = "a0d4c6bec4909c966f59f52db3655c0e9d4685faae8b49185973d9d7389bb884" dependencies = [ - "heck 0.4.1", - "proc-macro-crate 1.3.1", + "heck", + "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] name = "jsonrpsee-server" -version = "0.20.4" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a482bc4e25eebd0adb61a3468c722763c381225bd3ec46e926f709df8a8eb548" +checksum = "ebe2198e5fd96cf2153ecc123364f699b6e2151317ea09c7bf799c43c2fe1415" dependencies = [ "futures-util", - "http 0.2.12", - "hyper 0.14.30", + "http 1.1.0", + "http-body", + "http-body-util", + "hyper", + "hyper-util", "jsonrpsee-core", "jsonrpsee-types", + "pin-project", "route-recognizer", "serde", "serde_json", @@ -3347,23 +3285,21 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.20.4" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3264e339143fe37ed081953842ee67bfafa99e3b91559bdded6e4abd8fc8535e" +checksum = "531e386460425e49679587871a056f2895a47dade21457324ad1262cd78ef6d9" dependencies = [ - "anyhow", - "beef", + "http 1.1.0", "serde", "serde_json", "thiserror", - "tracing", ] [[package]] name = "jsonrpsee-wasm-client" -version = "0.20.4" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9437dd0e8728897d0aa5a0075b8710266300e55ced07101ca0930fac4a611384" +checksum = "5a2d2206c8f04c6b79a11bd1d92d6726b6f7fd3dec57c91e07fa53e867268bbb" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -3372,11 +3308,11 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.20.4" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d06eeabbb55f0af8405288390a358ebcceb6e79e1390741e6f152309c4d6076" +checksum = "87bc869e143d430e748988261d19b630e8f1692074e68f1a7f0eb4c521d2fc58" dependencies = [ - "http 0.2.12", + "http 1.1.0", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", @@ -3757,7 +3693,7 @@ checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.52.0", ] @@ -4067,26 +4003,12 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", ] -[[package]] -name = "parity-tokio-ipc" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9981e32fb75e004cc148f5fb70342f393830e0a4aa62e3cc93b50976218d42b6" -dependencies = [ - "futures", - "libc", - "log", - "rand 0.7.3", - "tokio", - "winapi", -] - [[package]] name = "parking_lot" version = "0.11.2" @@ -4237,7 +4159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ "phf_shared 0.10.0", - "rand 0.8.5", + "rand", ] [[package]] @@ -4247,7 +4169,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared 0.11.2", - "rand 0.8.5", + "rand", ] [[package]] @@ -4362,7 +4284,7 @@ dependencies = [ "jsonrpsee", "portalnet", "prometheus_exporter", - "rand 0.8.5", + "rand", "reqwest", "reqwest-middleware", "reqwest-retry", @@ -4411,7 +4333,7 @@ dependencies = [ "lru 0.7.8", "parking_lot 0.11.2", "quickcheck", - "rand 0.8.5", + "rand", "rstest", "serde", "serial_test", @@ -4465,23 +4387,13 @@ dependencies = [ "uint", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro-crate" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.21", + "toml_edit", ] [[package]] @@ -4591,8 +4503,8 @@ dependencies = [ "bitflags 2.6.0", "lazy_static", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_xorshift", "regex-syntax 0.8.4", "rusty-fork", @@ -4614,7 +4526,7 @@ checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6" dependencies = [ "env_logger 0.8.4", "log", - "rand 0.8.5", + "rand", ] [[package]] @@ -4665,19 +4577,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -4685,18 +4584,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -4706,16 +4595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] @@ -4724,16 +4604,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", + "getrandom", ] [[package]] @@ -4742,7 +4613,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -4795,7 +4666,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.15", + "getrandom", "libredox", "thiserror", ] @@ -4861,12 +4732,12 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.4.6", + "h2", "http 1.1.0", - "http-body 1.0.1", + "http-body", "http-body-util", - "hyper 1.4.1", - "hyper-rustls 0.27.3", + "hyper", + "hyper-rustls", "hyper-tls", "hyper-util", "ipnet", @@ -4877,7 +4748,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.3", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", @@ -4917,9 +4788,9 @@ dependencies = [ "anyhow", "async-trait", "futures", - "getrandom 0.2.15", + "getrandom", "http 1.1.0", - "hyper 1.4.1", + "hyper", "parking_lot 0.11.2", "reqwest", "reqwest-middleware", @@ -4931,14 +4802,15 @@ dependencies = [ [[package]] name = "reth-ipc" -version = "0.2.0-beta.5" -source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.2.0-beta.5#54f75cdcc82125a97ffd82952c2a8bc8ed324b48" +version = "1.0.7" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v1.0.7#75b7172cf77eb4fd65fe1a6924f75066fb09fcd1" dependencies = [ "async-trait", "bytes", "futures", + "futures-util", + "interprocess", "jsonrpsee", - "parity-tokio-ipc", "pin-project", "serde_json", "thiserror", @@ -4955,7 +4827,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5875471e6cab2871bc150ecb8c727db5113c9338cc3354dc5ee3425b6aa40a1c" dependencies = [ - "rand 0.8.5", + "rand", ] [[package]] @@ -5056,7 +4928,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom", "libc", "spin", "untrusted", @@ -5108,7 +4980,7 @@ dependencies = [ "discv5", "eth_trie", "ethportal-api", - "hyper 0.14.30", + "http 1.1.0", "portalnet", "reth-ipc", "revm", @@ -5179,7 +5051,7 @@ dependencies = [ "parity-scale-codec", "primitive-types", "proptest", - "rand 0.8.5", + "rand", "rlp", "ruint-macro", "serde", @@ -5253,6 +5125,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -5290,18 +5168,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.21.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.7", - "sct", -] - [[package]] name = "rustls" version = "0.23.13" @@ -5312,32 +5178,24 @@ dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.8", + "rustls-webpki", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.4", + "rustls-pemfile", + "rustls-pki-types", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - [[package]] name = "rustls-pemfile" version = "2.1.3" @@ -5355,15 +5213,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] -name = "rustls-webpki" -version = "0.101.7" +name = "rustls-platform-verifier" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" dependencies = [ - "ring", - "untrusted", + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-roots", + "winapi", ] +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" version = "0.102.8" @@ -5427,7 +5302,7 @@ version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -5473,16 +5348,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "sec1" version = "0.7.3" @@ -5503,7 +5368,7 @@ version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ - "rand 0.8.5", + "rand", "secp256k1-sys", ] @@ -5526,6 +5391,7 @@ dependencies = [ "core-foundation", "core-foundation-sys", "libc", + "num-bigint", "security-framework-sys", ] @@ -5701,19 +5567,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - [[package]] name = "sha1" version = "0.10.6" @@ -5825,7 +5678,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -5885,7 +5738,7 @@ dependencies = [ "hex", "lazy_static", "parity-scale-codec", - "rand 0.8.5", + "rand", "scale-info", "snowbridge-amcl", "zeroize", @@ -5913,18 +5766,18 @@ dependencies = [ [[package]] name = "soketto" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" dependencies = [ - "base64 0.13.1", + "base64 0.22.1", "bytes", "futures", - "http 0.2.12", + "http 1.1.0", "httparse", "log", - "rand 0.8.5", - "sha-1", + "rand", + "sha1", ] [[package]] @@ -6050,7 +5903,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", @@ -6079,7 +5932,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c969a14b4a4c09c320416ebf880b3d5a81ad1612065741eb10521951c06c8991" dependencies = [ "bytecodec", - "rand 0.8.5", + "rand", "stun_codec", "tokio", ] @@ -6093,7 +5946,7 @@ dependencies = [ "byteorder", "crunchy", "lazy_static", - "rand 0.8.5", + "rand", "rustc-hex", ] @@ -6396,23 +6249,13 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.12", - "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", "rustls-pki-types", "tokio", ] @@ -6450,12 +6293,12 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.13", + "rustls", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "tungstenite", - "webpki-roots 0.26.6", + "webpki-roots", ] [[package]] @@ -6482,7 +6325,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.21", + "toml_edit", ] [[package]] @@ -6494,17 +6337,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.5.0", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.21" @@ -6515,7 +6347,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -6530,7 +6362,7 @@ dependencies = [ "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand 0.8.5", + "rand", "slab", "tokio", "tokio-util", @@ -6555,9 +6387,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.4" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ "async-compression", "base64 0.21.7", @@ -6565,8 +6397,9 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 0.2.12", - "http-body 0.4.6", + "http 1.1.0", + "http-body", + "http-body-util", "http-range-header", "httpdate", "iri-string", @@ -6796,7 +6629,7 @@ dependencies = [ "portal-bridge", "portalnet", "prometheus_exporter", - "rand 0.8.5", + "rand", "regex", "reqwest", "reth-ipc", @@ -6912,7 +6745,7 @@ dependencies = [ "parking_lot 0.11.2", "portalnet", "quickcheck", - "rand 0.8.5", + "rand", "rstest", "serde_json", "serial_test", @@ -6980,7 +6813,7 @@ dependencies = [ "quickcheck", "r2d2", "r2d2_sqlite", - "rand 0.8.5", + "rand", "rstest", "rusqlite", "strum", @@ -7047,8 +6880,8 @@ dependencies = [ "http 1.1.0", "httparse", "log", - "rand 0.8.5", - "rustls 0.23.13", + "rand", + "rustls", "rustls-pki-types", "sha1", "thiserror", @@ -7208,12 +7041,12 @@ dependencies = [ "flate2", "log", "once_cell", - "rustls 0.23.13", + "rustls", "rustls-pki-types", "serde", "serde_json", "url", - "webpki-roots 0.26.6", + "webpki-roots", ] [[package]] @@ -7247,7 +7080,7 @@ dependencies = [ "async-trait", "delay_map 0.3.0", "futures", - "rand 0.8.5", + "rand", "tokio", "tracing", ] @@ -7262,7 +7095,7 @@ dependencies = [ "ethportal-api", "jsonrpsee", "portalnet", - "rand 0.8.5", + "rand", "tokio", "tracing", "tracing-subscriber 0.3.18", @@ -7277,8 +7110,8 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ - "getrandom 0.2.15", - "rand 0.8.5", + "getrandom", + "rand", ] [[package]] @@ -7366,12 +7199,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -7470,12 +7297,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "0.26.6" @@ -7709,15 +7530,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.6.18" diff --git a/Cargo.toml b/Cargo.toml index 808fb0f58..8867077cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,8 +97,7 @@ ethereum_ssz_derive = "0.7.1" ethportal-api = { path = "ethportal-api" } futures = "0.3.23" hex = "0.4.3" -hyper = "0.14.28" -jsonrpsee = "0.20.0" +jsonrpsee = "0.24.4" keccak-hash = "0.10.0" lazy_static = "1.4.0" light-client = { path = "light-client" } @@ -111,7 +110,7 @@ r2d2 = "0.8.9" r2d2_sqlite = "0.24.0" rand = "0.8.5" reqwest = { version = "0.12.7", features = ["native-tls-vendored", "json"] } -reth-ipc = { tag = "v0.2.0-beta.5", git = "https://github.com/paradigmxyz/reth.git"} +reth-ipc = { tag = "v1.0.7", git = "https://github.com/paradigmxyz/reth.git"} revm = { version = "14.0.2", default-features = false, features = ["std", "secp256k1", "serde-json"] } revm-primitives = { version = "9.0.2", default-features = false, features = ["std", "serde"] } rpc = { path = "rpc"} diff --git a/ethportal-peertest/Cargo.toml b/ethportal-peertest/Cargo.toml index 81081a0ad..e65a5b1b4 100644 --- a/ethportal-peertest/Cargo.toml +++ b/ethportal-peertest/Cargo.toml @@ -19,7 +19,6 @@ ethereum_ssz.workspace = true ethportal-api.workspace = true futures.workspace = true hex.workspace = true -hyper = { workspace = true, features = ["full"] } jsonrpsee = { workspace = true, features = ["async-client", "client", "macros", "server"]} portal-bridge.workspace = true rand.workspace = true diff --git a/ethportal-peertest/src/lib.rs b/ethportal-peertest/src/lib.rs index d0fc3a8a7..c1377295a 100644 --- a/ethportal-peertest/src/lib.rs +++ b/ethportal-peertest/src/lib.rs @@ -45,7 +45,7 @@ async fn launch_node(trin_config: TrinConfig) -> anyhow::Result { // Short sleep to make sure all peertest nodes can connect thread::sleep(time::Duration::from_secs(2)); let ipc_client = reth_ipc::client::IpcClientBuilder::default() - .build(web3_ipc_path) + .build(&web3_ipc_path.to_string_lossy()) .await .unwrap(); diff --git a/ethportal-peertest/src/scenarios/gossip.rs b/ethportal-peertest/src/scenarios/gossip.rs index 2433bf2d2..18265f7cf 100644 --- a/ethportal-peertest/src/scenarios/gossip.rs +++ b/ethportal-peertest/src/scenarios/gossip.rs @@ -40,7 +40,7 @@ pub async fn test_gossip_with_trace(peertest: &Peertest, target: &Client) { let (fresh_ipc_path, trin_config) = fresh_node_config(); let _test_client_rpc_handle = trin::run_trin(trin_config).await.unwrap(); let fresh_target = reth_ipc::client::IpcClientBuilder::default() - .build(fresh_ipc_path) + .build(&fresh_ipc_path) .await .unwrap(); let fresh_enr = fresh_target.node_info().await.unwrap().enr; @@ -86,7 +86,7 @@ pub async fn test_gossip_dropped_with_offer(peertest: &Peertest, target: &Client let (fresh_ipc_path, trin_config) = fresh_node_config(); let _test_client_rpc_handle = trin::run_trin(trin_config).await.unwrap(); let fresh_target = reth_ipc::client::IpcClientBuilder::default() - .build(fresh_ipc_path) + .build(&fresh_ipc_path) .await .unwrap(); let fresh_enr = fresh_target.node_info().await.unwrap().enr; @@ -245,7 +245,7 @@ pub async fn test_gossip_dropped_with_find_content(peertest: &Peertest, target: let (fresh_ipc_path, trin_config) = fresh_node_config(); let _test_client_rpc_handle = trin::run_trin(trin_config).await.unwrap(); let fresh_target = reth_ipc::client::IpcClientBuilder::default() - .build(fresh_ipc_path) + .build(&fresh_ipc_path) .await .unwrap(); diff --git a/portal-bridge/src/gossip.rs b/portal-bridge/src/gossip.rs index ff086c481..984115812 100644 --- a/portal-bridge/src/gossip.rs +++ b/portal-bridge/src/gossip.rs @@ -6,7 +6,6 @@ use tracing::{debug, warn, Instrument}; use crate::stats::{BeaconSlotStats, HistoryBlockStats, StatsReporter}; use ethportal_api::{ - jsonrpsee::core::Error, types::portal::{ContentInfo, TraceGossipInfo}, BeaconContentKey, BeaconContentValue, BeaconNetworkApiClient, ContentValue, HistoryContentKey, HistoryContentValue, HistoryNetworkApiClient, OverlayContentKey, @@ -38,7 +37,7 @@ async fn beacon_trace_gossip( client: HttpClient, content_key: BeaconContentKey, content_value: BeaconContentValue, -) -> Result { +) -> GossipReport { let mut retries = 0; let mut traces = vec![]; let mut found = false; @@ -53,11 +52,11 @@ async fn beacon_trace_gossip( if let Ok(trace) = result { traces.push(trace.clone()); if !trace.transferred.is_empty() { - return Ok(GossipReport { + return GossipReport { traces, retries, found, - }); + }; } } // if not, make rfc request to see if data is available on network @@ -66,11 +65,11 @@ async fn beacon_trace_gossip( if let Ok(ContentInfo::Content { .. }) = result { debug!("Found content on network, after failing to gossip, aborting gossip. content key={:?}", content_key.to_hex()); found = true; - return Ok(GossipReport { + return GossipReport { traces, retries, found, - }); + }; } retries += 1; debug!("Unable to locate content on network, after failing to gossip, retrying in {:?} seconds. content key={:?}", RETRY_AFTER, content_key.to_hex()); @@ -81,11 +80,11 @@ async fn beacon_trace_gossip( GOSSIP_RETRY_COUNT, content_key.to_hex(), ); - Ok(GossipReport { + GossipReport { traces, retries, found, - }) + } } /// Gossip any given content key / value to the history network. @@ -111,7 +110,7 @@ async fn history_trace_gossip( client: HttpClient, content_key: HistoryContentKey, content_value: HistoryContentValue, -) -> Result { +) -> GossipReport { let mut retries = 0; let mut traces = vec![]; let mut found = false; @@ -126,11 +125,11 @@ async fn history_trace_gossip( if let Ok(trace) = result { traces.push(trace.clone()); if !trace.transferred.is_empty() { - return Ok(GossipReport { + return GossipReport { traces, retries, found, - }); + }; } } // if not, make rfc request to see if data is available on network @@ -139,11 +138,11 @@ async fn history_trace_gossip( if let Ok(ContentInfo::Content { .. }) = result { debug!("Found content on network, after failing to gossip, aborting gossip. content key={:?}", content_key.to_hex()); found = true; - return Ok(GossipReport { + return GossipReport { traces, retries, found, - }); + }; } retries += 1; debug!("Unable to locate content on network, after failing to gossip, retrying in {:?} seconds. content key={:?}", RETRY_AFTER, content_key.to_hex()); @@ -154,11 +153,11 @@ async fn history_trace_gossip( GOSSIP_RETRY_COUNT, content_key.to_hex(), ); - Ok(GossipReport { + GossipReport { traces, retries, found, - }) + } } pub struct GossipReport { diff --git a/portal-bridge/src/stats.rs b/portal-bridge/src/stats.rs index 0bd87dfe0..14db59826 100644 --- a/portal-bridge/src/stats.rs +++ b/portal-bridge/src/stats.rs @@ -3,7 +3,7 @@ use std::{collections::HashSet, str::FromStr}; use tracing::{debug, info}; use crate::gossip::GossipReport; -use ethportal_api::{jsonrpsee::core::Error, types::enr::Enr, BeaconContentKey, HistoryContentKey}; +use ethportal_api::{types::enr::Enr, BeaconContentKey, HistoryContentKey}; // Trait for tracking / reporting gossip stats pub trait StatsReporter { @@ -194,34 +194,27 @@ impl std::fmt::Display for ContentStats { } } -impl From> for ContentStats { - fn from(result: Result) -> Self { - let mut content_stats = ContentStats::default(); - match result { - Ok(gossip_report) => { - content_stats.retries += gossip_report.retries; - content_stats.found = gossip_report.found; - for trace in &gossip_report.traces { - for enr in trace.offered.iter() { - let enr = Enr::from_str(enr) - .expect("ENR from trace gossip response to successfully decode."); - content_stats.offered.insert(enr); - } - - for enr in trace.accepted.iter() { - let enr = Enr::from_str(enr) - .expect("ENR from trace gossip response to successfully decode."); - content_stats.accepted.insert(enr); - } - - for enr in trace.transferred.iter() { - let enr = Enr::from_str(enr) - .expect("ENR from trace gossip response to successfully decode."); - content_stats.transferred.insert(enr); - } - } - } - Err(_) => content_stats.failures += 1, +impl From for ContentStats { + fn from(gossip_report: GossipReport) -> Self { + let mut content_stats = ContentStats { + retries: gossip_report.retries, + found: gossip_report.found, + ..ContentStats::default() + }; + + let enr_from_str = |enr: &String| { + Enr::from_str(enr).expect("ENR from trace gossip response to successfully decode.") + }; + for trace in &gossip_report.traces { + content_stats + .offered + .extend(trace.offered.iter().map(enr_from_str)); + content_stats + .accepted + .extend(trace.accepted.iter().map(enr_from_str)); + content_stats + .transferred + .extend(trace.transferred.iter().map(enr_from_str)); } content_stats } diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 153cd74f2..9444a2459 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -17,7 +17,7 @@ alloy-rpc-types.workspace = true discv5.workspace = true eth_trie.workspace = true ethportal-api.workspace = true -hyper.workspace = true +http = "1.1.0" portalnet.workspace = true reth-ipc.workspace = true revm.workspace = true @@ -27,7 +27,7 @@ strum.workspace = true thiserror.workspace = true tokio.workspace = true tower = { version = "0.4.13", features = ["full"] } -tower-http = { version = "0.4.4", features = ["full"] } +tower-http = { version = "0.5.0", features = ["full"] } tracing.workspace = true trin-evm.workspace = true trin-utils.workspace = true diff --git a/rpc/src/cors.rs b/rpc/src/cors.rs index a52c26edb..8151456a9 100644 --- a/rpc/src/cors.rs +++ b/rpc/src/cors.rs @@ -1,4 +1,4 @@ -use hyper::{http::HeaderValue, Method}; +use http::{HeaderValue, Method}; use tower_http::cors::{AllowOrigin, Any, CorsLayer}; /// Error thrown when parsing cors domains went wrong diff --git a/rpc/src/errors.rs b/rpc/src/errors.rs index 44f7edaa1..c5e2adf9b 100644 --- a/rpc/src/errors.rs +++ b/rpc/src/errors.rs @@ -1,58 +1,36 @@ use crate::{ jsonrpsee::{ - core::Error as JsonRpseeError, + server::AlreadyStoppedError, types::{ErrorObject, ErrorObjectOwned}, }, rpc_server::ServerKind, PortalRpcModule, }; use ethportal_api::{types::query_trace::QueryTrace, ContentValueError}; +use reth_ipc::server::IpcServerStartError; use serde::{Deserialize, Serialize}; use std::io; /// Rpc Errors. #[derive(Debug, thiserror::Error)] -#[allow(clippy::enum_variant_names)] pub enum RpcError { - /// Wrapper for `jsonrpsee::core::Error`. - #[error(transparent)] - RpcError(#[from] JsonRpseeError), - /// Address already in use. - #[error("Address {kind} is already in use (os error 98)")] - AddressAlreadyInUse { - /// Server kind. - kind: ServerKind, - /// IO error. - error: io::Error, - }, + /// More descriptive io::Error. + #[error("IO Error: {0} for server kind: {1}")] + IoError(io::Error, ServerKind), /// Http and WS server configured on the same port but with conflicting settings. #[error(transparent)] WsHttpSamePortError(#[from] WsHttpSamePortError), + /// Error while starting ipc server. + #[error(transparent)] + IpcServerStartError(#[from] IpcServerStartError), + /// Server already stopped. + #[error(transparent)] + AlreadyStoppedError(#[from] AlreadyStoppedError), /// Custom error. #[error("{0}")] Custom(String), } -impl RpcError { - /// Converts a `jsonrpsee::core::Error` to a more descriptive `RpcError`. - pub fn from_jsonrpsee_error(err: JsonRpseeError, kind: ServerKind) -> RpcError { - match err { - JsonRpseeError::Transport(err) => { - if let Some(io_error) = err.downcast_ref::() { - if io_error.kind() == io::ErrorKind::AddrInUse { - return RpcError::AddressAlreadyInUse { - kind, - error: io::Error::from(io_error.kind()), - }; - } - } - RpcError::RpcError(JsonRpseeError::Transport(err)) - } - _ => err.into(), - } - } -} - #[derive(Debug, PartialEq, Eq, thiserror::Error)] pub enum RpcServeError { /// A generic error with no data diff --git a/rpc/src/rpc_server.rs b/rpc/src/rpc_server.rs index 1f0745e19..25fb5e521 100644 --- a/rpc/src/rpc_server.rs +++ b/rpc/src/rpc_server.rs @@ -4,16 +4,17 @@ use crate::{ errors::WsHttpSamePortError, jsonrpsee::{ http_client::{HttpClient, HttpClientBuilder}, - server::{IdProvider, Server, ServerBuilder, ServerHandle}, + server::{Server, ServerBuilder, ServerHandle}, ws_client::{WsClient, WsClientBuilder}, RpcModule, }, RpcError, TransportRpcModuleConfig, }; -use ethportal_api::types::cli::{ - DEFAULT_WEB3_HTTP_PORT, DEFAULT_WEB3_IPC_PATH, DEFAULT_WEB3_WS_PORT, +use ethportal_api::{ + jsonrpsee::server::IdProvider, + types::cli::{DEFAULT_WEB3_HTTP_PORT, DEFAULT_WEB3_IPC_PATH, DEFAULT_WEB3_WS_PORT}, }; -use reth_ipc::server::{Builder as IpcServerBuilder, Endpoint, IpcServer}; +use reth_ipc::server::{Builder as IpcServerBuilder, IpcServer}; use std::{ fmt, net::{Ipv4Addr, SocketAddr, SocketAddrV4}, @@ -48,8 +49,8 @@ impl RpcServer { self.ws_http.ws_local_addr } - /// Returns the [`Endpoint`] of the ipc server if started. - pub fn ipc_endpoint(&self) -> Option<&Endpoint> { + /// Returns the `endpoint` of the ipc server if started. + pub fn ipc_endpoint(&self) -> Option { self.ipc.as_ref().map(|ipc| ipc.endpoint()) } @@ -57,7 +58,12 @@ impl RpcServer { /// /// This returns an [RpcServerHandle] that's connected to the server task(s) until the server is /// stopped or the [RpcServerHandle] is dropped. - #[instrument(name = "start", skip_all, fields(http = ?self.http_local_addr(), ws = ?self.ws_local_addr(), ipc = ?self.ipc_endpoint().map(|ipc|ipc.path())), target = "rpc", level = "TRACE")] + #[instrument( + name = "start", + skip_all, + fields(http = ?self.http_local_addr(), ws = ?self.ws_local_addr(), ipc = ?self.ipc_endpoint()), + target = "rpc", + level = "TRACE")] pub async fn start( self, modules: TransportRpcModules<()>, @@ -195,8 +201,6 @@ pub enum ServerKind { WS(SocketAddr), /// WS and http on the same port WsHttp(SocketAddr), - /// Auth. - Auth(SocketAddr), } impl fmt::Display for ServerKind { @@ -205,7 +209,6 @@ impl fmt::Display for ServerKind { ServerKind::Http(addr) => write!(f, "{addr} (HTTP-RPC server)"), ServerKind::WS(addr) => write!(f, "{addr} (WS-RPC server)"), ServerKind::WsHttp(addr) => write!(f, "{addr} (WS-HTTP-RPC server)"), - ServerKind::Auth(addr) => write!(f, "{addr} (AUTH server)"), } } } @@ -224,41 +227,41 @@ impl fmt::Display for ServerKind { #[derive(Default)] pub struct RpcServerConfig { /// Configs for JSON-RPC Http. - http_server_config: Option, + http_server_config: Option>, /// Allowed CORS Domains for http http_cors_domains: Option, /// Address where to bind the http server to http_addr: Option, /// Configs for WS server - ws_server_config: Option, + ws_server_config: Option>, /// Allowed CORS Domains for ws. ws_cors_domains: Option, /// Address where to bind the ws server to ws_addr: Option, /// Configs for JSON-RPC IPC server - ipc_server_config: Option, - /// The Endpoint where to launch the ipc server - ipc_endpoint: Option, + ipc_server_config: Option>, + /// The endpoint where to launch the ipc server + ipc_endpoint: Option, } impl RpcServerConfig { /// Creates a new config with only http set - pub fn http(config: ServerBuilder) -> Self { + pub fn http(config: ServerBuilder) -> Self { Self::default().with_http(config) } /// Creates a new config with only ws set - pub fn ws(config: ServerBuilder) -> Self { + pub fn ws(config: ServerBuilder) -> Self { Self::default().with_ws(config) } /// Creates a new config with only ipc set - pub fn ipc(config: IpcServerBuilder) -> Self { + pub fn ipc(config: IpcServerBuilder) -> Self { Self::default().with_ipc(config) } /// Configures the http server - pub fn with_http(mut self, config: ServerBuilder) -> Self { + pub fn with_http(mut self, config: ServerBuilder) -> Self { self.http_server_config = Some(config); self } @@ -282,7 +285,7 @@ impl RpcServerConfig { } /// Configures the ws server - pub fn with_ws(mut self, config: ServerBuilder) -> Self { + pub fn with_ws(mut self, config: ServerBuilder) -> Self { self.ws_server_config = Some(config); self } @@ -304,7 +307,7 @@ impl RpcServerConfig { } /// Configures the ipc server - pub fn with_ipc(mut self, config: IpcServerBuilder) -> Self { + pub fn with_ipc(mut self, config: IpcServerBuilder) -> Self { self.ipc_server_config = Some(config); self } @@ -333,7 +336,7 @@ impl RpcServerConfig { /// /// Default is [DEFAULT_WEB3_IPC_PATH] pub fn with_ipc_endpoint(mut self, path: impl Into) -> Self { - self.ipc_endpoint = Some(Endpoint::new(path.into())); + self.ipc_endpoint = Some(path.into()); self } @@ -356,9 +359,9 @@ impl RpcServerConfig { self.ws_addr } - /// Returns the [Endpoint] of the ipc server - pub fn ipc_endpoint(&self) -> Option<&Endpoint> { - self.ipc_endpoint.as_ref() + /// Returns the endpoint of the ipc server + pub fn ipc_endpoint(&self) -> Option { + self.ipc_endpoint.clone() } /// Convenience function to do [RpcServerConfig::build] and [RpcServer::start] in one step @@ -409,7 +412,7 @@ impl RpcServerConfig { self.ws_server_config.take(); let builder = self.http_server_config.take().expect("is set; qed"); - let (server, addr) = WsHttpServerKind::build( + let server = WsHttpServerKind::build( builder, http_socket_addr, cors, @@ -417,8 +420,8 @@ impl RpcServerConfig { ) .await?; return Ok(WsHttpServer { - http_local_addr: Some(addr), - ws_local_addr: Some(addr), + http_local_addr: Some(server.local_addr()), + ws_local_addr: Some(server.local_addr()), server: WsHttpServers::SamePort(server), }); } @@ -437,27 +440,27 @@ impl RpcServerConfig { }); let builder = builder.ws_only(); - let (server, addr) = WsHttpServerKind::build( + let server = WsHttpServerKind::build( builder, ws_socket_addr, self.ws_cors_domains.take(), ServerKind::WS(ws_socket_addr), ) .await?; - ws_local_addr = Some(addr); + ws_local_addr = Some(server.local_addr()); ws_server = Some(server); } if let Some(builder) = self.http_server_config.take() { let builder = builder.http_only(); - let (server, addr) = WsHttpServerKind::build( + let server = WsHttpServerKind::build( builder, http_socket_addr, self.http_cors_domains.take(), ServerKind::Http(http_socket_addr), ) .await?; - http_local_addr = Some(addr); + http_local_addr = Some(server.local_addr()); http_server = Some(server); } @@ -483,8 +486,8 @@ impl RpcServerConfig { if let Some(builder) = self.ipc_server_config { let ipc_path = self .ipc_endpoint - .unwrap_or_else(|| Endpoint::new(DEFAULT_WEB3_IPC_PATH.to_string())); - let ipc = builder.build(ipc_path.path())?; + .unwrap_or_else(|| DEFAULT_WEB3_IPC_PATH.to_string()); + let ipc = builder.build(ipc_path); server.ipc = Some(ipc); } @@ -582,32 +585,35 @@ impl WsHttpServerKind { /// Builds async fn build( - builder: ServerBuilder, + builder: ServerBuilder, socket_addr: SocketAddr, cors_domains: Option, server_kind: ServerKind, - ) -> Result<(Self, SocketAddr), RpcError> { + ) -> Result { if let Some(cors) = cors_domains.as_deref().map(cors::create_cors_layer) { let cors = cors.map_err(|err| RpcError::Custom(err.to_string()))?; - let middleware = tower::ServiceBuilder::new().layer(cors); let server = builder - .set_middleware(middleware) + .set_http_middleware(tower::ServiceBuilder::new().layer(cors)) .build(socket_addr) .await - .map_err(|err| RpcError::from_jsonrpsee_error(err, server_kind))?; - let local_addr = server.local_addr()?; - let server = WsHttpServerKind::WithCors(server); - Ok((server, local_addr)) + .map_err(|err| RpcError::IoError(err, server_kind))?; + Ok(WsHttpServerKind::WithCors(server)) } else { let server = builder .build(socket_addr) .await - .map_err(|err| RpcError::from_jsonrpsee_error(err, server_kind))?; - let local_addr = server.local_addr()?; - let server = WsHttpServerKind::Plain(server); - Ok((server, local_addr)) + .map_err(|err| RpcError::IoError(err, server_kind))?; + Ok(WsHttpServerKind::Plain(server)) } } + + fn local_addr(&self) -> SocketAddr { + match self { + WsHttpServerKind::Plain(server) => server.local_addr(), + WsHttpServerKind::WithCors(server) => server.local_addr(), + } + .expect("Expect to get local address") + } } #[cfg(test)] @@ -627,8 +633,8 @@ mod tests { fn is_addr_in_use_kind(err: &RpcError, kind: ServerKind) -> bool { match err { - RpcError::AddressAlreadyInUse { kind: k, error } => { - *k == kind && error.kind() == io::ErrorKind::AddrInUse + RpcError::IoError(err, server_kind) => { + server_kind == &kind && err.kind() == io::ErrorKind::AddrInUse } _ => false, }