From 1790010260a7ce90a29af7267831d28ca3f7a576 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Fri, 29 Oct 2021 01:59:29 +0000 Subject: [PATCH] Upgrade to latest libp2p (#2605) This is a pre-cursor to the next libp2p upgrade. It is currently being used for staging a number of PR upgrades which are contingent on the latest libp2p. --- Cargo.lock | 1028 ++++++----------- beacon_node/lighthouse_network/Cargo.toml | 10 +- .../lighthouse_network/src/behaviour/mod.rs | 30 +- .../lighthouse_network/src/discovery/mod.rs | 29 +- beacon_node/lighthouse_network/src/rpc/mod.rs | 15 +- beacon_node/lighthouse_network/src/service.rs | 23 +- 6 files changed, 393 insertions(+), 742 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7813b5513..d2230424e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -193,131 +193,6 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" -[[package]] -name = "async-channel" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-executor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "once_cell", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" -dependencies = [ - "async-channel", - "async-executor", - "async-io", - "async-mutex", - "blocking", - "futures-lite", - "num_cpus", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" -dependencies = [ - "concurrent-queue", - "futures-lite", - "libc", - "log", - "once_cell", - "parking", - "polling", - "slab", - "socket2 0.4.2", - "waker-fn", - "winapi", -] - -[[package]] -name = "async-lock" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-mutex" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-std" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952" -dependencies = [ - "async-channel", - "async-global-executor", - "async-io", - "async-lock", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "num_cpus", - "once_cell", - "pin-project-lite 0.2.7", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-std-resolver" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4e2c3da14d8ad45acb1e3191db7a918e9505b6f155b218e70a7c9a1a48c638" -dependencies = [ - "async-std", - "async-trait", - "futures-io", - "futures-util", - "pin-utils", - "trust-dns-resolver", -] - -[[package]] -name = "async-task" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" - [[package]] name = "async-trait" version = "0.1.51" @@ -335,7 +210,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690" dependencies = [ - "bytes 1.1.0", + "bytes", "futures-sink", "futures-util", "memchr", @@ -351,12 +226,6 @@ dependencies = [ "autocfg 1.0.1", ] -[[package]] -name = "atomic-waker" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" - [[package]] name = "attohttpc" version = "0.10.1" @@ -393,9 +262,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.61" +version = "0.3.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01" +checksum = "091bcdf2da9950f96aa522681ce805e6857f6ca8df73833d35736ab2dc78e152" dependencies = [ "addr2line", "cc", @@ -573,20 +442,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "blocking" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9" -dependencies = [ - "async-channel", - "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "once_cell", -] - [[package]] name = "bls" version = "0.2.0" @@ -668,9 +523,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "byte-slice-cast" @@ -680,9 +535,9 @@ checksum = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" [[package]] name = "byte-slice-cast" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0796d76a983651b4a0ddda16203032759f2fd9103d9181f7c65c06ee8872e6" +checksum = "1d30c751592b77c499e7bce34d99d67c2c11bdc0574e9a488ddade14150a4698" [[package]] name = "byteorder" @@ -690,12 +545,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.1.0" @@ -723,12 +572,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "cache-padded" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" - [[package]] name = "cached_tree_hash" version = "0.1.0" @@ -874,7 +717,7 @@ dependencies = [ "slot_clock", "store", "task_executor", - "time 0.3.3", + "time 0.3.4", "timer", "tokio", "toml", @@ -905,15 +748,6 @@ dependencies = [ "syn", ] -[[package]] -name = "concurrent-queue" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" -dependencies = [ - "cache-padded", -] - [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -1107,16 +941,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ctor" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "ctr" version = "0.8.0" @@ -1136,17 +960,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "cuckoofilter" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b810a8449931679f64cd7eef1bbd0fa315801b6d5d9cdc1ace2804d6529eee18" -dependencies = [ - "byteorder", - "fnv", - "rand 0.7.3", -] - [[package]] name = "curve25519-dalek" version = "3.2.0" @@ -1413,16 +1226,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "dns-parser" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" -dependencies = [ - "byteorder", - "quick-error", -] - [[package]] name = "dtoa" version = "0.4.8" @@ -1515,9 +1318,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.28" +version = "0.8.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" +checksum = "a74ea89a0a1b98f6332de42c95baff457ada66d1cb4030f9ff151b2041a1c746" dependencies = [ "cfg-if 1.0.0", ] @@ -1530,7 +1333,7 @@ checksum = "809869a1328bfb586b48c9c0f87761c47c41793a85bcb06f66074a87cafc1bcd" dependencies = [ "base64 0.13.0", "bs58", - "bytes 1.1.0", + "bytes", "ed25519-dalek", "hex", "k256", @@ -1655,7 +1458,7 @@ name = "eth2" version = "0.1.0" dependencies = [ "account_utils", - "bytes 1.1.0", + "bytes", "eth2_keystore", "eth2_serde_utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "eth2_ssz", @@ -1948,12 +1751,6 @@ dependencies = [ "uint 0.9.1", ] -[[package]] -name = "event-listener" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" - [[package]] name = "exit-future" version = "0.2.0" @@ -1982,15 +1779,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" -[[package]] -name = "fastrand" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b394ed3d285a429378d3b384b9eb1285267e7df4b166df24b7a6939a04dc392e" -dependencies = [ - "instant", -] - [[package]] name = "ff" version = "0.9.0" @@ -2056,6 +1844,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" +[[package]] +name = "fixedbitset" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e" + [[package]] name = "flate2" version = "1.0.22" @@ -2177,21 +1971,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" -[[package]] -name = "futures-lite" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite 0.2.7", - "waker-fn", -] - [[package]] name = "futures-macro" version = "0.3.17" @@ -2354,19 +2133,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" -[[package]] -name = "gloo-timers" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "group" version = "0.9.0" @@ -2380,11 +2146,11 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c06815895acec637cd6ed6e9662c935b866d20a106f8361892893a7d9234964" +checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" dependencies = [ - "bytes 1.1.0", + "bytes", "fnv", "futures-core", "futures-sink", @@ -2399,9 +2165,9 @@ dependencies = [ [[package]] name = "half" -version = "1.8.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5956d4e63858efaec57e0d6c1c2f6a41e1487f830314a324ccd7e2223a7ca0" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hashbrown" @@ -2432,18 +2198,18 @@ dependencies = [ [[package]] name = "headers" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b7591fb62902706ae8e7aaff416b1b0fa2c0fd0878b46dc13baa3712d8a855" +checksum = "a4c4eb0471fcb85846d8b0690695ef354f9afb11cb03cac2e1d7c9253351afb0" dependencies = [ "base64 0.13.0", "bitflags", - "bytes 1.1.0", + "bytes", "headers-core", "http", + "httpdate", "mime", "sha-1", - "time 0.1.43", ] [[package]] @@ -2543,18 +2309,18 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" dependencies = [ - "bytes 1.1.0", + "bytes", "fnv", "itoa", ] [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ - "bytes 1.1.0", + "bytes", "http", "pin-project-lite 0.2.7", ] @@ -2631,11 +2397,11 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.13" +version = "0.14.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" +checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" dependencies = [ - "bytes 1.1.0", + "bytes", "futures-channel", "futures-core", "futures-util", @@ -2659,7 +2425,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 1.1.0", + "bytes", "hyper", "native-tls", "tokio", @@ -2704,22 +2470,6 @@ dependencies = [ "libc", ] -[[package]] -name = "if-watch" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8ab7f67bad3240049cb24fb9cb0b4c2c6af4c245840917fbbdededeee91179" -dependencies = [ - "async-io", - "futures", - "futures-lite", - "if-addrs", - "ipnet", - "libc", - "log", - "winapi", -] - [[package]] name = "igd" version = "0.11.1" @@ -2805,14 +2555,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" dependencies = [ - "bytes 1.1.0", + "bytes", ] [[package]] name = "instant" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", ] @@ -2821,7 +2571,7 @@ dependencies = [ name = "int_to_bytes" version = "0.2.0" dependencies = [ - "bytes 1.1.0", + "bytes", "hex", "yaml-rust", ] @@ -2910,15 +2660,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" -[[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 = "lazy_static" version = "1.4.0" @@ -2985,9 +2726,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.104" +version = "0.2.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f96d100e1cf1929e7719b7edb3b90ab5298072638fccd77be9ce942ecdfce" +checksum = "869d572136620d55835903746bcb5cdc54cb2851fd0aeec53220b4bb65ef3013" [[package]] name = "libflate" @@ -3017,33 +2758,24 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.40.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.40.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7ebded4becafc3eee99d2021a29d9a82efd77723f1febccfb2ca2d800be9e5" dependencies = [ "atomic", - "bytes 1.1.0", + "bytes", "futures", "lazy_static", - "libp2p-core 0.30.0", - "libp2p-deflate", + "libp2p-core 0.30.0-rc.2", "libp2p-dns", - "libp2p-floodsub", "libp2p-gossipsub", "libp2p-identify", - "libp2p-kad", - "libp2p-mdns", + "libp2p-metrics", "libp2p-mplex", "libp2p-noise", - "libp2p-ping", - "libp2p-plaintext", - "libp2p-pnet", - "libp2p-relay", - "libp2p-request-response", "libp2p-swarm", "libp2p-swarm-derive", "libp2p-tcp", - "libp2p-uds", - "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", "multiaddr", @@ -3071,11 +2803,11 @@ dependencies = [ "log", "multiaddr", "multihash", - "multistream-select 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", + "multistream-select", "parking_lot", "pin-project 1.0.8", - "prost", - "prost-build", + "prost 0.8.0", + "prost-build 0.8.0", "rand 0.7.3", "ring", "rw-stream-sink", @@ -3089,8 +2821,9 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.30.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.30.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d1d6f1eb6db73ef794543aa2701cb512675d56f3ce75cf936fd3a1649f5bbf2" dependencies = [ "asn1_der", "bs58", @@ -3100,16 +2833,16 @@ dependencies = [ "futures", "futures-timer", "lazy_static", - "libsecp256k1 0.6.0", + "libsecp256k1 0.7.0", "log", "multiaddr", "multihash", - "multistream-select 0.10.4 (git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d)", + "multistream-select", "parking_lot", "pin-project 1.0.8", - "prost", - "prost-build", - "rand 0.7.3", + "prost 0.9.0", + "prost-build 0.9.0", + "rand 0.8.4", "ring", "rw-stream-sink", "sha2", @@ -3120,63 +2853,37 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-deflate" -version = "0.30.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "flate2", - "futures", - "libp2p-core 0.30.0", -] - [[package]] name = "libp2p-dns" -version = "0.30.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.30.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3756d04f91224c95ca24d2894e6b180f5465f1ed0f03d070f77bfd74c527b9" dependencies = [ - "async-std-resolver", "futures", - "libp2p-core 0.30.0", + "libp2p-core 0.30.0-rc.2", "log", "smallvec", "trust-dns-resolver", ] -[[package]] -name = "libp2p-floodsub" -version = "0.31.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "cuckoofilter", - "fnv", - "futures", - "libp2p-core 0.30.0", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "smallvec", -] - [[package]] name = "libp2p-gossipsub" -version = "0.33.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.33.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d02524892b942932f1aa59f729ecc1781ed0680379e6752d5e6e373791f4bd16" dependencies = [ "asynchronous-codec", "base64 0.13.0", "byteorder", - "bytes 1.1.0", + "bytes", "fnv", "futures", "hex_fmt", - "libp2p-core 0.30.0", + "libp2p-core 0.30.0-rc.2", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.9.0", + "prost-build 0.9.0", "rand 0.7.3", "regex", "sha2", @@ -3187,73 +2894,43 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.31.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.31.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed451536ea0c9cf4e3a7ae5ab9451bb52bcbfae83f92009cbdc803b06eedaac" dependencies = [ "futures", - "libp2p-core 0.30.0", + "libp2p-core 0.30.0-rc.2", "libp2p-swarm", "log", - "prost", - "prost-build", + "lru", + "prost 0.9.0", + "prost-build 0.9.0", "smallvec", "wasm-timer", ] [[package]] -name = "libp2p-kad" -version = "0.32.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +name = "libp2p-metrics" +version = "0.1.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20d8a654f4b4da33d2dd1fa4e060c7ac09e34b01882b08aa114176a40ec371c6" dependencies = [ - "arrayvec 0.5.2", - "asynchronous-codec", - "bytes 1.1.0", - "either", - "fnv", - "futures", - "libp2p-core 0.30.0", + "libp2p-core 0.30.0-rc.2", + "libp2p-identify", "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "sha2", - "smallvec", - "uint 0.9.1", - "unsigned-varint 0.7.0", - "void", - "wasm-timer", -] - -[[package]] -name = "libp2p-mdns" -version = "0.32.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "async-io", - "data-encoding", - "dns-parser", - "futures", - "if-watch", - "lazy_static", - "libp2p-core 0.30.0", - "libp2p-swarm", - "log", - "rand 0.8.4", - "smallvec", - "socket2 0.4.2", - "void", + "open-metrics-client", ] [[package]] name = "libp2p-mplex" -version = "0.30.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.30.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f221b185fa4e0b49510699e886072a646e31214d1b76d03d3220f5cd48f603" dependencies = [ "asynchronous-codec", - "bytes 1.1.0", + "bytes", "futures", - "libp2p-core 0.30.0", + "libp2p-core 0.30.0-rc.2", "log", "nohash-hasher", "parking_lot", @@ -3264,17 +2941,18 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.33.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.33.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce91ef34c441d507745b137d51f00a49fb83a3229ec560ecb1c0fe7fde5a65b" dependencies = [ - "bytes 1.1.0", + "bytes", "curve25519-dalek", "futures", "lazy_static", - "libp2p-core 0.30.0", + "libp2p-core 0.30.0-rc.2", "log", - "prost", - "prost-build", + "prost 0.9.0", + "prost-build 0.9.0", "rand 0.8.4", "sha2", "snow", @@ -3283,98 +2961,15 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-ping" -version = "0.31.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "futures", - "libp2p-core 0.30.0", - "libp2p-swarm", - "log", - "rand 0.7.3", - "void", - "wasm-timer", -] - -[[package]] -name = "libp2p-plaintext" -version = "0.30.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "asynchronous-codec", - "bytes 1.1.0", - "futures", - "libp2p-core 0.30.0", - "log", - "prost", - "prost-build", - "unsigned-varint 0.7.0", - "void", -] - -[[package]] -name = "libp2p-pnet" -version = "0.21.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "futures", - "log", - "pin-project 1.0.8", - "rand 0.7.3", - "salsa20", - "sha3", -] - -[[package]] -name = "libp2p-relay" -version = "0.4.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "asynchronous-codec", - "bytes 1.1.0", - "futures", - "futures-timer", - "libp2p-core 0.30.0", - "libp2p-swarm", - "log", - "pin-project 1.0.8", - "prost", - "prost-build", - "rand 0.7.3", - "smallvec", - "unsigned-varint 0.7.0", - "void", - "wasm-timer", -] - -[[package]] -name = "libp2p-request-response" -version = "0.13.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "async-trait", - "bytes 1.1.0", - "futures", - "libp2p-core 0.30.0", - "libp2p-swarm", - "log", - "lru", - "minicbor", - "rand 0.7.3", - "smallvec", - "unsigned-varint 0.7.0", - "wasm-timer", -] - [[package]] name = "libp2p-swarm" -version = "0.31.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.31.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d4f04c710ce6500e8fc3cfda3d7a7423caa99cbfd0e09f2ff29cb8bdcdef660" dependencies = [ "either", "futures", - "libp2p-core 0.30.0", + "libp2p-core 0.30.0-rc.2", "log", "rand 0.7.3", "smallvec", @@ -3384,8 +2979,9 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" -version = "0.24.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.25.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4d34b88c742b903813bb1fc5b87cc42f9da29314c9eba35abb2eb5d31a0588" dependencies = [ "quote", "syn", @@ -3393,70 +2989,47 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.30.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.30.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0431b74198d05004a706b78fd5f7d217d15fbacd2b8e4d116ade24d5510992b3" dependencies = [ - "async-io", "futures", "futures-timer", "if-addrs", - "if-watch", "ipnet", "libc", - "libp2p-core 0.30.0", + "libp2p-core 0.30.0-rc.2", "log", "socket2 0.4.2", "tokio", ] -[[package]] -name = "libp2p-uds" -version = "0.30.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "async-std", - "futures", - "libp2p-core 0.30.0", - "log", -] - -[[package]] -name = "libp2p-wasm-ext" -version = "0.30.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "futures", - "js-sys", - "libp2p-core 0.30.0", - "parity-send-wrapper", - "wasm-bindgen", - "wasm-bindgen-futures", -] - [[package]] name = "libp2p-websocket" -version = "0.31.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.31.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "262e768479476a4b8ac4eb2714a4cdcaf642edf3a515ba10f30751dbd0c4353c" dependencies = [ "either", "futures", "futures-rustls", - "libp2p-core 0.30.0", + "libp2p-core 0.30.0-rc.2", "log", "quicksink", "rw-stream-sink", - "soketto 0.4.2", + "soketto 0.7.0", "url", "webpki-roots", ] [[package]] name = "libp2p-yamux" -version = "0.34.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.34.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2569b1509317a854e124c4e9266415195def3184c865423e01c39ed0cf07351" dependencies = [ "futures", - "libp2p-core 0.30.0", + "libp2p-core 0.30.0-rc.2", "parking_lot", "thiserror", "yamux", @@ -3472,9 +3045,9 @@ dependencies = [ "base64 0.12.3", "digest", "hmac-drbg", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", + "libsecp256k1-core 0.2.2", + "libsecp256k1-gen-ecmult 0.2.1", + "libsecp256k1-gen-genmult 0.2.1", "rand 0.7.3", "serde", "sha2", @@ -3491,15 +3064,34 @@ dependencies = [ "base64 0.12.3", "digest", "hmac-drbg", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", + "libsecp256k1-core 0.2.2", + "libsecp256k1-gen-ecmult 0.2.1", + "libsecp256k1-gen-genmult 0.2.1", "rand 0.7.3", "serde", "sha2", "typenum", ] +[[package]] +name = "libsecp256k1" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0452aac8bab02242429380e9b2f94ea20cea2b37e2c1777a1358799bbe97f37" +dependencies = [ + "arrayref", + "base64 0.13.0", + "digest", + "hmac-drbg", + "libsecp256k1-core 0.3.0", + "libsecp256k1-gen-ecmult 0.3.0", + "libsecp256k1-gen-genmult 0.3.0", + "rand 0.8.4", + "serde", + "sha2", + "typenum", +] + [[package]] name = "libsecp256k1-core" version = "0.2.2" @@ -3511,13 +3103,33 @@ dependencies = [ "subtle", ] +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest", + "subtle", +] + [[package]] name = "libsecp256k1-gen-ecmult" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" dependencies = [ - "libsecp256k1-core", + "libsecp256k1-core 0.2.2", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core 0.3.0", ] [[package]] @@ -3526,7 +3138,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" dependencies = [ - "libsecp256k1-core", + "libsecp256k1-core 0.2.2", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core 0.3.0", ] [[package]] @@ -3696,7 +3317,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ "cfg-if 1.0.0", - "value-bag", ] [[package]] @@ -3836,26 +3456,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "minicbor" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb74931969d99aeabd31fdffbcb7dfcc1b4cb07aed2c56480f28ea90dab5cb6" -dependencies = [ - "minicbor-derive", -] - -[[package]] -name = "minicbor-derive" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54999f917cd092b13904737e26631aa2b2b88d625db68e4bab461dcd8006c788" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "miniz_oxide" version = "0.4.4" @@ -3983,20 +3583,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56a336acba8bc87c8876f6425407dbbe6c417bf478b22015f8fb0994ef3bc0ab" dependencies = [ - "bytes 1.1.0", - "futures", - "log", - "pin-project 1.0.8", - "smallvec", - "unsigned-varint 0.7.0", -] - -[[package]] -name = "multistream-select" -version = "0.10.4" -source = "git+https://github.com/libp2p/rust-libp2p?rev=ce23cbe76a0382b6fcb0e49f1b2612df86f6465d#ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" -dependencies = [ - "bytes 1.1.0", + "bytes", "futures", "log", "pin-project 1.0.8", @@ -4184,9 +3771,9 @@ dependencies = [ [[package]] name = "object" -version = "0.26.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" dependencies = [ "memchr", ] @@ -4210,10 +3797,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "openssl" -version = "0.10.36" +name = "open-metrics-client" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a" +checksum = "7337d80c23c2d8b1349563981bc4fb531220733743ba8115454a67b181173f0d" +dependencies = [ + "dtoa", + "itoa", + "open-metrics-client-derive-text-encode", + "owning_ref", +] + +[[package]] +name = "open-metrics-client-derive-text-encode" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15c83b586f00268c619c1cb3340ec1a6f59dd9ba1d9833a273a68e6d5cd8ffc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl" +version = "0.10.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc6b9e4403633698352880b22cbe2f0e45dd0177f6fabe4585536e56a3e4f75" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -4240,9 +3850,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.67" +version = "0.9.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69df2d8dfc6ce3aaf44b40dec6f487d5a886516cf6879c49e98e0710f310a058" +checksum = "1c571f25d3f66dd427e417cebf73dbe2361d6125cf6e3a70d143fdf97c9f5150" dependencies = [ "autocfg 1.0.1", "cc", @@ -4272,6 +3882,15 @@ dependencies = [ "types", ] +[[package]] +name = "owning_ref" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" +dependencies = [ + "stable_deref_trait", +] + [[package]] name = "parity-scale-codec" version = "1.3.7" @@ -4292,7 +3911,7 @@ checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" dependencies = [ "arrayvec 0.7.1", "bitvec 0.20.4", - "byte-slice-cast 1.1.0", + "byte-slice-cast 1.2.0", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -4310,18 +3929,6 @@ dependencies = [ "syn", ] -[[package]] -name = "parity-send-wrapper" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" - -[[package]] -name = "parking" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" - [[package]] name = "parking_lot" version = "0.11.2" @@ -4392,7 +3999,17 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" dependencies = [ - "fixedbitset", + "fixedbitset 0.2.0", + "indexmap", +] + +[[package]] +name = "petgraph" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" +dependencies = [ + "fixedbitset 0.4.0", "indexmap", ] @@ -4466,9 +4083,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.20" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb" +checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f" [[package]] name = "platforms" @@ -4504,19 +4121,6 @@ dependencies = [ "plotters-backend", ] -[[package]] -name = "polling" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92341d779fa34ea8437ef4d82d440d5e1ce3f3ff7f824aa64424cd481f9a1f25" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "log", - "wepoll-ffi", - "winapi", -] - [[package]] name = "poly1305" version = "0.7.2" @@ -4542,9 +4146,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "primitive-types" @@ -4633,9 +4237,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.30" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] @@ -4673,8 +4277,18 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" dependencies = [ - "bytes 1.1.0", - "prost-derive", + "bytes", + "prost-derive 0.8.0", +] + +[[package]] +name = "prost" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +dependencies = [ + "bytes", + "prost-derive 0.9.0", ] [[package]] @@ -4683,14 +4297,34 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" dependencies = [ - "bytes 1.1.0", + "bytes", "heck", "itertools", "log", "multimap", - "petgraph", - "prost", - "prost-types", + "petgraph 0.5.1", + "prost 0.8.0", + "prost-types 0.8.0", + "tempfile", + "which", +] + +[[package]] +name = "prost-build" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" +dependencies = [ + "bytes", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph 0.6.0", + "prost 0.9.0", + "prost-types 0.9.0", + "regex", "tempfile", "which", ] @@ -4708,14 +4342,37 @@ dependencies = [ "syn", ] +[[package]] +name = "prost-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "prost-types" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" dependencies = [ - "bytes 1.1.0", - "prost", + "bytes", + "prost 0.8.0", +] + +[[package]] +name = "prost-types" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" +dependencies = [ + "bytes", + "prost 0.9.0", ] [[package]] @@ -4732,9 +4389,9 @@ dependencies = [ [[package]] name = "protobuf" -version = "2.25.1" +version = "2.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23129d50f2c9355ced935fce8a08bd706ee2e7ce2b3b33bf61dace0e379ac63a" +checksum = "47c327e191621a2158159df97cdbc2e7074bb4e940275e35abf38eb3d2595754" [[package]] name = "psutil" @@ -5013,12 +4670,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51c732d463dd300362ffb44b7b125f299c23d2990411a4253824630ebc7467fb" +checksum = "66d2927ca2f685faf0fc620ac4834690d29e7abb153add10f5812eef20b5e280" dependencies = [ "base64 0.13.0", - "bytes 1.1.0", + "bytes", "encoding_rs", "futures-core", "futures-util", @@ -5092,7 +4749,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "999508abb0ae792aabed2460c45b89106d97fe4adac593bdaef433c2605847b5" dependencies = [ - "bytes 1.1.0", + "bytes", "rustc-hex", ] @@ -5505,9 +5162,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335" +checksum = "f2807892cfa58e081aa1f1111391c7a0649d4fa127a4ffbe34bcbfb35a1171a4" dependencies = [ "digest", "rand_core 0.6.3", @@ -5758,22 +5415,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "soketto" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c71ed3d54db0a699f4948e1bb3e45b450fa31fe602621dee6680361d569c88" -dependencies = [ - "base64 0.12.3", - "bytes 0.5.6", - "flate2", - "futures", - "httparse", - "log", - "rand 0.7.3", - "sha-1", -] - [[package]] name = "soketto" version = "0.5.0" @@ -5781,7 +5422,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4919971d141dbadaa0e82b5d369e2d7666c98e4625046140615ca363e50d4daa" dependencies = [ "base64 0.13.0", - "bytes 1.1.0", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.4", + "sha-1", +] + +[[package]] +name = "soketto" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "083624472e8817d44d02c0e55df043737ff11f279af924abdf93845717c2b75c" +dependencies = [ + "base64 0.13.0", + "bytes", + "flate2", "futures", "httparse", "log", @@ -5804,6 +5461,12 @@ dependencies = [ "der", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "state_processing" version = "0.2.0" @@ -5932,9 +5595,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -6099,9 +5762,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde1cf55178e0293453ba2cca0d5f8392a922e52aa958aee9c28ed02becc6d03" +checksum = "99beeb0daeac2bd1e86ac2c21caddecb244b39a093594da1a661ec2060c7aedd" dependencies = [ "libc", ] @@ -6186,7 +5849,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" dependencies = [ "autocfg 1.0.1", - "bytes 1.1.0", + "bytes", "libc", "memchr", "mio", @@ -6272,7 +5935,7 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" dependencies = [ - "bytes 1.1.0", + "bytes", "futures-core", "futures-io", "futures-sink", @@ -6485,7 +6148,7 @@ checksum = "8ada8297e8d70872fa9a551d93250a9f407beb9f37ef86494eb20012a2ff7c24" dependencies = [ "base64 0.13.0", "byteorder", - "bytes 1.1.0", + "bytes", "http", "httparse", "input_buffer", @@ -6650,7 +6313,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35581ff83d4101e58b582e607120c7f5ffb17e632a980b1f38334d76b36908b2" dependencies = [ - "bytes 1.1.0", + "bytes", "tokio-util", ] @@ -6661,9 +6324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f8d425fafb8cd76bc3f22aace4af471d3156301d7508f2107e98fbeae10bc7f" dependencies = [ "asynchronous-codec", - "bytes 1.1.0", - "futures-io", - "futures-util", + "bytes", ] [[package]] @@ -6768,16 +6429,6 @@ dependencies = [ "types", ] -[[package]] -name = "value-bag" -version = "1.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840ae" -dependencies = [ - "ctor", - "version_check", -] - [[package]] name = "vcpkg" version = "0.2.15" @@ -6802,12 +6453,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - [[package]] name = "walkdir" version = "2.3.2" @@ -6834,7 +6479,7 @@ name = "warp" version = "0.3.0" source = "git+https://github.com/macladson/warp?rev=dfa259e#dfa259e19b7490e6bc4bf247e8b76f671d29a0eb" dependencies = [ - "bytes 1.1.0", + "bytes", "futures", "headers", "http", @@ -7011,7 +6656,7 @@ checksum = "cd24abe6f2b68e0677f843059faea87bcbd4892e39f02886f366d8222c3c540d" dependencies = [ "arrayvec 0.5.2", "base64 0.13.0", - "bytes 1.1.0", + "bytes", "derive_more", "ethabi 14.1.0", "ethereum-types 0.11.0", @@ -7092,15 +6737,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - [[package]] name = "which" version = "4.2.2" diff --git a/beacon_node/lighthouse_network/Cargo.toml b/beacon_node/lighthouse_network/Cargo.toml index ebe02f867..435d9d9d1 100644 --- a/beacon_node/lighthouse_network/Cargo.toml +++ b/beacon_node/lighthouse_network/Cargo.toml @@ -39,15 +39,9 @@ regex = "1.3.9" strum = { version = "0.21.0", features = ["derive"] } superstruct = "0.2.0" -# TODO: remove the rev-reference and go back to release versions once there is a release that -# includes the following PR: -# -# https://github.com/libp2p/rust-libp2p/pull/2175 [dependencies.libp2p] -#version = "0.39.1" -#default-features = false -git = "https://github.com/libp2p/rust-libp2p" -rev = "ce23cbe76a0382b6fcb0e49f1b2612df86f6465d" +version = "0.40.0-rc.3" +default-features = false features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns-tokio", "tcp-tokio"] [dev-dependencies] diff --git a/beacon_node/lighthouse_network/src/behaviour/mod.rs b/beacon_node/lighthouse_network/src/behaviour/mod.rs index 0ef194a82..d99efb7e4 100644 --- a/beacon_node/lighthouse_network/src/behaviour/mod.rs +++ b/beacon_node/lighthouse_network/src/behaviour/mod.rs @@ -4,7 +4,8 @@ use crate::behaviour::gossipsub_scoring_parameters::{ use crate::config::gossipsub_config; use crate::discovery::{subnet_predicate, Discovery, DiscoveryEvent, TARGET_SUBNET_PEERS}; use crate::peer_manager::{ - peerdb::score::ReportSource, ConnectionDirection, PeerManager, PeerManagerEvent, + peerdb::score::PeerAction, peerdb::score::ReportSource, ConnectionDirection, PeerManager, + PeerManagerEvent, }; use crate::rpc::*; use crate::service::METADATA_FILENAME; @@ -26,7 +27,7 @@ use libp2p::{ }, identify::{Identify, IdentifyConfig, IdentifyEvent}, swarm::{ - AddressScore, DialPeerCondition, NetworkBehaviourAction as NBAction, + AddressScore, DialPeerCondition, NetworkBehaviour, NetworkBehaviourAction as NBAction, NetworkBehaviourEventProcess, PollParameters, }, NetworkBehaviour, PeerId, @@ -121,7 +122,11 @@ enum InternalBehaviourMessage { /// This core behaviour is managed by `Behaviour` which adds peer management to all core /// behaviours. #[derive(NetworkBehaviour)] -#[behaviour(out_event = "BehaviourEvent", poll_method = "poll")] +#[behaviour( + out_event = "BehaviourEvent", + poll_method = "poll", + event_process = true +)] pub struct Behaviour { /* Sub-Behaviours */ /// The routing pub-sub mechanism for eth2. @@ -192,9 +197,11 @@ impl Behaviour { "".into(), local_key.public(), // Still send legitimate public key ) + .with_cache_size(0) } else { IdentifyConfig::new("eth2/1.0.0".into(), local_key.public()) .with_agent_version(lighthouse_version::version_with_platform()) + .with_cache_size(0) }; // Build and start the discovery sub-behaviour @@ -848,6 +855,15 @@ impl NetworkBehaviourEventProcess for Behaviour< .remove_subscription(&peer_id, &subnet_id); } } + GossipsubEvent::GossipsubNotSupported { peer_id } => { + debug!(self.log, "Peer does not support gossipsub"; "peer_id" => %peer_id); + self.peer_manager.report_peer( + &peer_id, + PeerAction::LowToleranceError, + ReportSource::Gossipsub, + Some(GoodbyeReason::Unknown), + ); + } } } } @@ -1031,11 +1047,13 @@ impl NetworkBehaviourEventProcess for Behaviour Behaviour { /// Consumes the events list and drives the Lighthouse global NetworkBehaviour. - fn poll( + fn poll( &mut self, cx: &mut Context, _: &mut impl PollParameters, - ) -> Poll>> { + ) -> Poll< + NBAction, as NetworkBehaviour>::ProtocolsHandler>, + > { if let Some(waker) = &self.waker { if waker.will_wake(cx.waker()) { self.waker = Some(cx.waker().clone()); @@ -1048,9 +1066,11 @@ impl Behaviour { if let Some(event) = self.internal_events.pop_front() { match event { InternalBehaviourMessage::DialPeer(peer_id) => { + let handler = self.new_handler(); return Poll::Ready(NBAction::DialPeer { peer_id, condition: DialPeerCondition::Disconnected, + handler, }); } InternalBehaviourMessage::SocketUpdated(address) => { diff --git a/beacon_node/lighthouse_network/src/discovery/mod.rs b/beacon_node/lighthouse_network/src/discovery/mod.rs index f2957c0ce..68e085683 100644 --- a/beacon_node/lighthouse_network/src/discovery/mod.rs +++ b/beacon_node/lighthouse_network/src/discovery/mod.rs @@ -23,8 +23,8 @@ use futures::stream::FuturesUnordered; pub use libp2p::{ core::{connection::ConnectionId, ConnectedPoint, Multiaddr, PeerId}, swarm::{ - protocols_handler::ProtocolsHandler, NetworkBehaviour, NetworkBehaviourAction as NBAction, - NotifyHandler, PollParameters, SubstreamProtocol, + protocols_handler::ProtocolsHandler, DialError, NetworkBehaviour, + NetworkBehaviourAction as NBAction, NotifyHandler, PollParameters, SubstreamProtocol, }, }; use lru::LruCache; @@ -933,9 +933,10 @@ impl NetworkBehaviour for Discovery { fn inject_disconnected(&mut self, _peer_id: &PeerId) {} fn inject_connection_established( &mut self, - _: &PeerId, - _: &ConnectionId, - _connected_point: &ConnectedPoint, + _peer_id: &PeerId, + _connection_id: &ConnectionId, + _endpoint: &ConnectedPoint, + _failed_addresses: Option<&Vec>, ) { } fn inject_connection_closed( @@ -943,6 +944,7 @@ impl NetworkBehaviour for Discovery { _: &PeerId, _: &ConnectionId, _connected_point: &ConnectedPoint, + _handler: Self::ProtocolsHandler, ) { } fn inject_event( @@ -953,10 +955,17 @@ impl NetworkBehaviour for Discovery { ) { } - fn inject_dial_failure(&mut self, peer_id: &PeerId) { - // set peer as disconnected in discovery DHT - debug!(self.log, "Marking peer disconnected in DHT"; "peer_id" => %peer_id); - self.disconnect_peer(peer_id); + fn inject_dial_failure( + &mut self, + peer_id: Option, + _handler: Self::ProtocolsHandler, + _error: &DialError, + ) { + if let Some(peer_id) = peer_id { + // set peer as disconnected in discovery DHT + debug!(self.log, "Marking peer disconnected in DHT"; "peer_id" => %peer_id); + self.disconnect_peer(&peer_id); + } } // Main execution loop to drive the behaviour @@ -964,7 +973,7 @@ impl NetworkBehaviour for Discovery { &mut self, cx: &mut Context, _: &mut impl PollParameters, - ) -> Poll::InEvent, Self::OutEvent>> { + ) -> Poll> { if !self.started { return Poll::Pending; } diff --git a/beacon_node/lighthouse_network/src/rpc/mod.rs b/beacon_node/lighthouse_network/src/rpc/mod.rs index 96fa23506..3d386148d 100644 --- a/beacon_node/lighthouse_network/src/rpc/mod.rs +++ b/beacon_node/lighthouse_network/src/rpc/mod.rs @@ -101,7 +101,7 @@ pub struct RPC { /// Rate limiter limiter: RateLimiter, /// Queue of events to be processed. - events: Vec, RPCMessage>>, + events: Vec, RPCHandler>>, fork_context: Arc, /// Slog logger for RPC behaviour. log: slog::Logger, @@ -218,8 +218,9 @@ where fn inject_connection_established( &mut self, _peer_id: &PeerId, - _: &ConnectionId, - _connected_point: &ConnectedPoint, + _connection_id: &ConnectionId, + _endpoint: &ConnectedPoint, + _failed_addresses: Option<&Vec>, ) { } @@ -228,6 +229,7 @@ where _peer_id: &PeerId, _: &ConnectionId, _connected_point: &ConnectedPoint, + _handler: Self::ProtocolsHandler, ) { } @@ -297,12 +299,7 @@ where &mut self, cx: &mut Context, _: &mut impl PollParameters, - ) -> Poll< - NetworkBehaviourAction< - ::InEvent, - Self::OutEvent, - >, - > { + ) -> Poll> { // let the rate limiter prune let _ = self.limiter.poll_unpin(cx); if !self.events.is_empty() { diff --git a/beacon_node/lighthouse_network/src/service.rs b/beacon_node/lighthouse_network/src/service.rs index 5e7add8ac..c88eb4585 100644 --- a/beacon_node/lighthouse_network/src/service.rs +++ b/beacon_node/lighthouse_network/src/service.rs @@ -320,6 +320,7 @@ impl Service { peer_id, endpoint, num_established, + concurrent_dial_errors: _, } => { // Inform the peer manager. // We require the ENR to inject into the peer db, if it exists. @@ -364,20 +365,14 @@ impl Service { SwarmEvent::BannedPeer { peer_id, .. } => { debug!(self.log, "Banned peer connection rejected"; "peer_id" => %peer_id); } - SwarmEvent::UnreachableAddr { - peer_id, - address, - error, - attempts_remaining, - } => { - debug!(self.log, "Failed to dial address"; "peer_id" => %peer_id, "address" => %address, "error" => %error, "attempts_remaining" => attempts_remaining); - self.swarm - .behaviour_mut() - .peer_manager_mut() - .inject_dial_failure(&peer_id); - } - SwarmEvent::UnknownPeerUnreachableAddr { address, error } => { - debug!(self.log, "Peer not known at dialed address"; "address" => %address, "error" => %error); + SwarmEvent::OutgoingConnectionError { peer_id, error } => { + debug!(self.log, "Failed to dial address"; "peer_id" => ?peer_id, "error" => %error); + if let Some(peer_id) = peer_id { + self.swarm + .behaviour_mut() + .peer_manager_mut() + .inject_dial_failure(&peer_id); + } } SwarmEvent::ExpiredListenAddr { address, .. } => { debug!(self.log, "Listen address expired"; "address" => %address)