diff --git a/Cargo.lock b/Cargo.lock index 611cdf57a37..6c6e8652f18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,7 +111,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", "once_cell", "version_check", ] @@ -141,15 +141,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.53" +version = "1.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +checksum = "159bb86af3a200e19a068f4224eae4c8bb2d0fa054c7e5d1cacd5cef95e684cd" [[package]] name = "arbitrary" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510c76ecefdceada737ea728f4f9a84bd2e1ef29f1ba555e560940fe279954de" +checksum = "c38b6b6b79f671c25e1a3e785b7b82d7562ffc9cd3efdc98627e5668a2472490" dependencies = [ "derive_arbitrary", ] @@ -308,7 +308,7 @@ dependencies = [ "maplit", "merkle_proof", "operation_pool", - "parking_lot", + "parking_lot 0.11.2", "proto_array", "rand 0.7.3", "rayon", @@ -434,11 +434,11 @@ dependencies = [ [[package]] name = "blake2" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b94ba84325db59637ffc528bbe8c7f86c02c57cff5c0e2b9b00f9a851f42f309" +checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" dependencies = [ - "digest 0.10.1", + "digest 0.10.3", ] [[package]] @@ -752,7 +752,7 @@ dependencies = [ "lighthouse_network", "monitoring_api", "network", - "parking_lot", + "parking_lot 0.11.2", "sensitive_url", "serde", "serde_derive", @@ -955,11 +955,12 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" dependencies = [ "generic-array", + "typenum", ] [[package]] @@ -1148,9 +1149,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b24629208e87a2d8b396ff43b15c4afb0a69cea3fbbaa9ed9b92b7c02f0aed73" +checksum = "98e23c06c035dac87bd802d98f368df73a7f2cb05a66ffbd1f377e821fac4af9" dependencies = [ "proc-macro2", "quote", @@ -1181,13 +1182,12 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ "block-buffer 0.10.2", "crypto-common", - "generic-array", "subtle", ] @@ -1250,7 +1250,7 @@ dependencies = [ "aes", "aes-gcm", "arrayvec 0.7.2", - "digest 0.10.1", + "digest 0.10.3", "enr", "fnv", "futures", @@ -1260,8 +1260,8 @@ dependencies = [ "lazy_static", "libp2p-core 0.30.2", "lru", - "parking_lot", - "rand 0.8.4", + "parking_lot 0.11.2", + "rand 0.8.5", "rlp 0.5.1", "sha2 0.9.9", "smallvec", @@ -1389,7 +1389,7 @@ dependencies = [ "hex", "k256", "log", - "rand 0.8.4", + "rand 0.8.5", "rlp 0.5.1", "serde", "sha3", @@ -1476,7 +1476,7 @@ dependencies = [ "lazy_static", "lighthouse_metrics", "merkle_proof", - "parking_lot", + "parking_lot 0.11.2", "reqwest", "sensitive_url", "serde", @@ -1838,7 +1838,7 @@ dependencies = [ "futures", "hex", "lru", - "parking_lot", + "parking_lot 0.11.2", "reqwest", "sensitive_url", "serde", @@ -1944,7 +1944,7 @@ source = "git+https://github.com/paritytech/parity-common?rev=df638ab0885293d21d dependencies = [ "arbitrary", "byteorder", - "rand 0.8.4", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -2094,7 +2094,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d383f0425d991a05e564c2f3ec150bd6dde863179c131dd60d8aa73a05434461" dependencies = [ "futures-io", - "rustls 0.20.2", + "rustls 0.20.4", "webpki 0.22.0", ] @@ -2180,9 +2180,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" dependencies = [ "cfg-if", "libc", @@ -2298,9 +2298,9 @@ dependencies = [ [[package]] name = "headers" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84c647447a07ca16f5fbd05b633e535cc41a08d2d74ab1e08648df53be9cb89" +checksum = "4cff78e5788be1e0ab65b04d306b2ed5092c815ec97ec70f4ebd5aee158aa55d" dependencies = [ "base64 0.13.0", "bitflags", @@ -2309,7 +2309,7 @@ dependencies = [ "http", "httpdate", "mime", - "sha-1", + "sha-1 0.10.0", ] [[package]] @@ -2442,7 +2442,7 @@ dependencies = [ "lighthouse_network", "lighthouse_version", "network", - "parking_lot", + "parking_lot 0.11.2", "safe_arith", "sensitive_url", "serde", @@ -2499,9 +2499,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.16" +version = "0.14.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ec3e62bdc98a2f0393a5048e4c30ef659440ea6e0e572965103e72bd836f55" +checksum = "043f0e083e9901b6cc658a77d1eb86f4fc650bbb977a4337dd63192826aa85dd" dependencies = [ "bytes", "futures-channel", @@ -2512,7 +2512,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 0.4.8", + "itoa 1.0.1", "pin-project-lite 0.2.8", "socket2 0.4.4", "tokio", @@ -2851,9 +2851,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.117" +version = "0.2.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" +checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" [[package]] name = "libflate" @@ -2903,20 +2903,21 @@ dependencies = [ "indexmap", "libc", "mdbx-sys", - "parking_lot", + "parking_lot 0.11.2", "thiserror", ] [[package]] name = "libp2p" version = "0.43.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e8570e25fa03d4385405dbeaf540ba00e3ee50942f03d84e1a8928a029f35f9" dependencies = [ "atomic", "bytes", "futures", "futures-timer", - "getrandom 0.2.4", + "getrandom 0.2.5", "instant", "lazy_static", "libp2p-core 0.32.0", @@ -2933,7 +2934,7 @@ dependencies = [ "libp2p-websocket", "libp2p-yamux", "multiaddr 0.14.0", - "parking_lot", + "parking_lot 0.12.0", "pin-project 1.0.10", "rand 0.7.3", "smallvec", @@ -2959,11 +2960,11 @@ dependencies = [ "multiaddr 0.13.0", "multihash 0.14.0", "multistream-select 0.10.4", - "parking_lot", + "parking_lot 0.11.2", "pin-project 1.0.10", "prost", "prost-build", - "rand 0.8.4", + "rand 0.8.5", "ring", "rw-stream-sink", "sha2 0.9.9", @@ -2977,7 +2978,8 @@ dependencies = [ [[package]] name = "libp2p-core" version = "0.32.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9164ec41455856e8187addc870bb4fe1ea2ee28e1a9244831d449a2429b32c1a" dependencies = [ "asn1_der", "bs58", @@ -2993,14 +2995,14 @@ dependencies = [ "multiaddr 0.14.0", "multihash 0.16.1", "multistream-select 0.11.0", - "parking_lot", + "parking_lot 0.12.0", "pin-project 1.0.10", "prost", "prost-build", - "rand 0.8.4", + "rand 0.8.5", "ring", "rw-stream-sink", - "sha2 0.10.1", + "sha2 0.10.2", "smallvec", "thiserror", "unsigned-varint 0.7.1", @@ -3011,7 +3013,8 @@ dependencies = [ [[package]] name = "libp2p-dns" version = "0.32.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7838647d33978b77f943687412f4a39e74234c8342cbfdad14282b465b272cb4" dependencies = [ "futures", "libp2p-core 0.32.0", @@ -3023,7 +3026,8 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" version = "0.36.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f62943fba0b0dae02b87868620c52a581c54ec9fb04b5e195cf20313fc510c3" dependencies = [ "asynchronous-codec", "base64 0.13.0", @@ -3041,16 +3045,17 @@ dependencies = [ "prost-build", "rand 0.7.3", "regex", - "sha2 0.10.1", + "sha2 0.10.2", "smallvec", - "tokio", "unsigned-varint 0.7.1", + "wasm-timer", ] [[package]] name = "libp2p-identify" version = "0.34.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f219b4d4660fe3a04bf5fe6b5970902b7c1918e25b2536be8c70efc480f88f8" dependencies = [ "futures", "futures-timer", @@ -3066,7 +3071,8 @@ dependencies = [ [[package]] name = "libp2p-metrics" version = "0.4.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29e4e5e4c5aa567fe1ee3133afe088dc2d2fd104e20c5c2c5c2649f75129677" dependencies = [ "libp2p-core 0.32.0", "libp2p-gossipsub", @@ -3078,7 +3084,8 @@ dependencies = [ [[package]] name = "libp2p-mplex" version = "0.32.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442eb0c9fff0bf22a34f015724b4143ce01877e079ed0963c722d94c07c72160" dependencies = [ "asynchronous-codec", "bytes", @@ -3086,7 +3093,7 @@ dependencies = [ "libp2p-core 0.32.0", "log", "nohash-hasher", - "parking_lot", + "parking_lot 0.12.0", "rand 0.7.3", "smallvec", "unsigned-varint 0.7.1", @@ -3095,7 +3102,8 @@ dependencies = [ [[package]] name = "libp2p-noise" version = "0.35.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd7e0c94051cda67123be68cf6b65211ba3dde7277be9068412de3e7ffd63ef" dependencies = [ "bytes", "curve25519-dalek 3.2.0", @@ -3105,8 +3113,8 @@ dependencies = [ "log", "prost", "prost-build", - "rand 0.8.4", - "sha2 0.10.1", + "rand 0.8.5", + "sha2 0.10.2", "snow", "static_assertions", "x25519-dalek", @@ -3116,7 +3124,8 @@ dependencies = [ [[package]] name = "libp2p-plaintext" version = "0.32.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "962c0fb0e7212fb96a69b87f2d09bcefd317935239bdc79cda900e7a8897a3fe" dependencies = [ "asynchronous-codec", "bytes", @@ -3132,23 +3141,28 @@ dependencies = [ [[package]] name = "libp2p-swarm" version = "0.34.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53ab2d4eb8ef2966b10fdf859245cdd231026df76d3c6ed2cf9e418a8f688ec9" dependencies = [ "either", + "fnv", "futures", "futures-timer", "instant", "libp2p-core 0.32.0", "log", + "pin-project 1.0.10", "rand 0.7.3", "smallvec", + "thiserror", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.26.1" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8153a6472e84ec888ef2bf21deafe8d4214e811f0f162abbf07156c27f8fa8" dependencies = [ "quote", "syn", @@ -3157,7 +3171,8 @@ dependencies = [ [[package]] name = "libp2p-tcp" version = "0.32.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193447aa729c85aac2376828df76d171c1a589c9e6b58fcc7f9d9a020734122c" dependencies = [ "futures", "futures-timer", @@ -3173,7 +3188,8 @@ dependencies = [ [[package]] name = "libp2p-websocket" version = "0.34.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c932834c3754501c368d1bf3d0fb458487a642b90fc25df082a3a2f3d3b32e37" dependencies = [ "either", "futures", @@ -3190,11 +3206,12 @@ dependencies = [ [[package]] name = "libp2p-yamux" version = "0.36.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be902ebd89193cd020e89e89107726a38cfc0d16d18f613f4a37d046e92c7517" dependencies = [ "futures", "libp2p-core 0.32.0", - "parking_lot", + "parking_lot 0.12.0", "thiserror", "yamux", ] @@ -3231,7 +3248,7 @@ dependencies = [ "libsecp256k1-core 0.3.0", "libsecp256k1-gen-ecmult 0.3.0", "libsecp256k1-gen-genmult 0.3.0", - "rand 0.8.4", + "rand 0.8.5", "serde", "sha2 0.9.9", "typenum", @@ -3381,7 +3398,7 @@ dependencies = [ "lighthouse_metrics", "lighthouse_version", "lru", - "parking_lot", + "parking_lot 0.11.2", "prometheus-client", "rand 0.7.3", "regex", @@ -3500,7 +3517,7 @@ dependencies = [ "lazy_static", "libc", "lighthouse_metrics", - "parking_lot", + "parking_lot 0.11.2", ] [[package]] @@ -3589,9 +3606,9 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime_guess" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ "mime", "unicase", @@ -3615,9 +3632,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.14" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" dependencies = [ "libc", "log", @@ -3711,9 +3728,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7392bffd88bc0c4f8297e36a777ab9f80b7127409c4a1acb8fee99c9f27addcd" dependencies = [ "core2", - "digest 0.10.1", + "digest 0.10.3", "multihash-derive 0.8.0", - "sha2 0.10.1", + "sha2 0.10.2", "unsigned-varint 0.7.1", ] @@ -3781,7 +3798,7 @@ dependencies = [ "mime", "mime_guess", "quick-error", - "rand 0.8.4", + "rand 0.8.5", "safemem", "tempfile", "twoway", @@ -3804,7 +3821,8 @@ dependencies = [ [[package]] name = "multistream-select" version = "0.11.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=e213703e616eaba3c482d7714775e0d37c4ae8e5#e213703e616eaba3c482d7714775e0d37c4ae8e5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" dependencies = [ "bytes", "futures", @@ -3939,9 +3957,9 @@ dependencies = [ [[package]] name = "ntapi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ "winapi", ] @@ -4106,7 +4124,7 @@ dependencies = [ "itertools", "lazy_static", "lighthouse_metrics", - "parking_lot", + "parking_lot 0.11.2", "rayon", "serde", "serde_derive", @@ -4170,7 +4188,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.1", ] [[package]] @@ -4187,6 +4215,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "parking_lot_core" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + [[package]] name = "paste" version = "1.0.6" @@ -4420,9 +4461,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ "thiserror", "toml", @@ -4489,7 +4530,7 @@ dependencies = [ "fnv", "lazy_static", "memchr", - "parking_lot", + "parking_lot 0.11.2", "protobuf", "thiserror", ] @@ -4662,7 +4703,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f" dependencies = [ "log", - "parking_lot", + "parking_lot 0.11.2", "scheduled-thread-pool", ] @@ -4704,20 +4745,19 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_hc", "rand_pcg", ] [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.3", - "rand_hc 0.3.1", ] [[package]] @@ -4755,7 +4795,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", ] [[package]] @@ -4767,15 +4807,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rand_pcg" version = "0.2.1" @@ -4834,7 +4865,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", "redox_syscall", ] @@ -5027,7 +5058,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.5", + "semver 1.0.6", ] [[package]] @@ -5045,9 +5076,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.2" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" +checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" dependencies = [ "log", "ring", @@ -5122,7 +5153,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc6f74fd1204073fa02d5d5d68bec8021be4c38690b61264b2fdb48083d0e7d7" dependencies = [ - "parking_lot", + "parking_lot 0.11.2", ] [[package]] @@ -5230,9 +5261,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" +checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d" [[package]] name = "semver-parser" @@ -5299,9 +5330,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa 1.0.1", "ryu", @@ -5356,6 +5387,17 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "sha-1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.1", + "digest 0.10.3", +] + [[package]] name = "sha2" version = "0.9.9" @@ -5371,13 +5413,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" dependencies = [ "cfg-if", "cpufeatures 0.2.1", - "digest 0.10.1", + "digest 0.10.3", ] [[package]] @@ -5436,7 +5478,7 @@ dependencies = [ "eth1_test_rig", "futures", "node_test_rig", - "parking_lot", + "parking_lot 0.11.2", "rayon", "sensitive_url", "tokio", @@ -5465,7 +5507,7 @@ dependencies = [ "logging", "lru", "maplit", - "parking_lot", + "parking_lot 0.11.2", "rand 0.7.3", "rayon", "safe_arith", @@ -5535,14 +5577,14 @@ dependencies = [ [[package]] name = "slog-json" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f7f7a952ce80fca9da17bf0a53895d11f8aa1ba063668ca53fc72e7869329e9" +checksum = "70f825ce7346f40aa318111df5d3a94945a7fdca9081584cb9b05692fb3dfcb4" dependencies = [ - "chrono", "serde", "serde_json", "slog", + "time 0.3.7", ] [[package]] @@ -5579,15 +5621,15 @@ dependencies = [ [[package]] name = "slog-term" -version = "2.8.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3668dd2252f4381d64de0c79e6c8dc6bd509d1cab3535b35a3fc9bafd1241d5" +checksum = "87d29185c55b7b258b4f120eab00f48557d4d9bc814f41713f449d35b0f8977c" dependencies = [ "atty", - "chrono", "slog", "term", "thread_local", + "time 0.3.7", ] [[package]] @@ -5620,7 +5662,7 @@ version = "0.2.0" dependencies = [ "lazy_static", "lighthouse_metrics", - "parking_lot", + "parking_lot 0.11.2", "types", ] @@ -5649,7 +5691,7 @@ dependencies = [ "rand_core 0.6.3", "ring", "rustc_version 0.4.0", - "sha2 0.10.1", + "sha2 0.10.2", "subtle", ] @@ -5685,8 +5727,8 @@ dependencies = [ "futures", "httparse", "log", - "rand 0.8.4", - "sha-1", + "rand 0.8.5", + "sha-1 0.9.8", ] [[package]] @@ -5701,8 +5743,8 @@ dependencies = [ "futures", "httparse", "log", - "rand 0.8.4", - "sha-1", + "rand 0.8.5", + "sha-1 0.9.8", ] [[package]] @@ -5781,7 +5823,7 @@ dependencies = [ "leveldb", "lighthouse_metrics", "lru", - "parking_lot", + "parking_lot 0.11.2", "serde", "serde_derive", "slog", @@ -6025,10 +6067,18 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "004cbc98f30fa233c61a38bc77e96a9106e65c88f2d3bef182ae952027e5753d" dependencies = [ + "itoa 1.0.1", "libc", "num_threads", + "time-macros", ] +[[package]] +name = "time-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25eb0ca3468fc0acc11828786797f6ef9aa1555e4a211a60d64cc8e4d1be47d6" + [[package]] name = "timer" version = "0.2.0" @@ -6104,9 +6154,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.16.1" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" +checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" dependencies = [ "bytes", "libc", @@ -6114,9 +6164,10 @@ dependencies = [ "mio", "num_cpus", "once_cell", - "parking_lot", + "parking_lot 0.12.0", "pin-project-lite 0.2.8", "signal-hook-registry", + "socket2 0.4.4", "tokio-macros", "winapi", ] @@ -6234,9 +6285,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8d93354fe2a8e50d5953f5ae2e47a3fc2ef03292e7ea46e3cc38f549525fb9" +checksum = "f6c650a8ef0cd2dd93736f033d21cbd1224c5a967aa0c258d00fcf7dafef9b9f" dependencies = [ "cfg-if", "log", @@ -6289,9 +6340,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74786ce43333fcf51efe947aed9718fbe46d5c7328ec3f1029e818083966d9aa" +checksum = "9e0ab7bdc962035a87fba73f3acca9b8a8d0034c2e6f60b84aeaaddddc155dce" dependencies = [ "ansi_term", "lazy_static", @@ -6376,7 +6427,7 @@ dependencies = [ "ipnet", "lazy_static", "log", - "rand 0.8.4", + "rand 0.8.5", "smallvec", "thiserror", "tinyvec", @@ -6396,7 +6447,7 @@ dependencies = [ "lazy_static", "log", "lru-cache", - "parking_lot", + "parking_lot 0.11.2", "resolv-conf", "smallvec", "thiserror", @@ -6423,8 +6474,8 @@ dependencies = [ "httparse", "input_buffer", "log", - "rand 0.8.4", - "sha-1", + "rand 0.8.5", + "sha-1 0.9.8", "url", "utf-8", ] @@ -6441,8 +6492,8 @@ dependencies = [ "http", "httparse", "log", - "rand 0.8.4", - "sha-1", + "rand 0.8.5", + "sha-1 0.9.8", "thiserror", "url", "utf-8", @@ -6487,7 +6538,7 @@ dependencies = [ "itertools", "lazy_static", "log", - "parking_lot", + "parking_lot 0.11.2", "rand 0.7.3", "rand_xorshift", "rayon", @@ -6652,7 +6703,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", "serde", ] @@ -6685,7 +6736,7 @@ dependencies = [ "lockfile", "logging", "monitoring_api", - "parking_lot", + "parking_lot 0.11.2", "rand 0.7.3", "reqwest", "ring", @@ -6956,6 +7007,21 @@ dependencies = [ "quote", ] +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "web-sys" version = "0.3.56" @@ -6984,7 +7050,7 @@ dependencies = [ "hex", "jsonrpc-core", "log", - "parking_lot", + "parking_lot 0.11.2", "pin-project 1.0.10", "reqwest", "rlp 0.5.1", @@ -7125,6 +7191,49 @@ dependencies = [ "winapi", ] +[[package]] +name = "windows-sys" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" + +[[package]] +name = "windows_i686_gnu" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" + +[[package]] +name = "windows_i686_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" + [[package]] name = "winreg" version = "0.6.2" @@ -7193,8 +7302,8 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot", - "rand 0.8.4", + "parking_lot 0.11.2", + "rand 0.8.5", "static_assertions", ] @@ -7209,9 +7318,9 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ "proc-macro2", "quote", diff --git a/beacon_node/lighthouse_network/Cargo.toml b/beacon_node/lighthouse_network/Cargo.toml index 70a50c02d57..f5f3b221401 100644 --- a/beacon_node/lighthouse_network/Cargo.toml +++ b/beacon_node/lighthouse_network/Cargo.toml @@ -42,9 +42,7 @@ prometheus-client = "0.15.0" unused_port = { path = "../../common/unused_port" } [dependencies.libp2p] -git = "https://github.com/sigp/rust-libp2p" -# branch libp2p-gossipsub-interval-hotfix -rev = "e213703e616eaba3c482d7714775e0d37c4ae8e5" +version = "0.43.0" default-features = false features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns-tokio", "tcp-tokio", "plaintext", "secp256k1"] diff --git a/beacon_node/lighthouse_network/src/behaviour/mod.rs b/beacon_node/lighthouse_network/src/behaviour/mod.rs index 155e01d7890..f03e13948ee 100644 --- a/beacon_node/lighthouse_network/src/behaviour/mod.rs +++ b/beacon_node/lighthouse_network/src/behaviour/mod.rs @@ -1147,7 +1147,7 @@ impl Behaviour { cx: &mut Context, _: &mut impl PollParameters, ) -> Poll< - NBAction, as NetworkBehaviour>::ProtocolsHandler>, + NBAction, as NetworkBehaviour>::ConnectionHandler>, > { if let Some(waker) = &self.waker { if waker.will_wake(cx.waker()) { diff --git a/beacon_node/lighthouse_network/src/discovery/mod.rs b/beacon_node/lighthouse_network/src/discovery/mod.rs index ab4d54a1e7d..23b8895cf33 100644 --- a/beacon_node/lighthouse_network/src/discovery/mod.rs +++ b/beacon_node/lighthouse_network/src/discovery/mod.rs @@ -24,7 +24,7 @@ use futures::stream::FuturesUnordered; pub use libp2p::{ core::{connection::ConnectionId, ConnectedPoint, Multiaddr, PeerId}, swarm::{ - protocols_handler::ProtocolsHandler, DialError, NetworkBehaviour, + handler::ConnectionHandler, DialError, NetworkBehaviour, NetworkBehaviourAction as NBAction, NotifyHandler, PollParameters, SubstreamProtocol, }, }; @@ -908,11 +908,11 @@ impl Discovery { impl NetworkBehaviour for Discovery { // Discovery is not a real NetworkBehaviour... - type ProtocolsHandler = libp2p::swarm::protocols_handler::DummyProtocolsHandler; + type ConnectionHandler = libp2p::swarm::handler::DummyConnectionHandler; type OutEvent = DiscoveryEvent; - fn new_handler(&mut self) -> Self::ProtocolsHandler { - libp2p::swarm::protocols_handler::DummyProtocolsHandler::default() + fn new_handler(&mut self) -> Self::ConnectionHandler { + libp2p::swarm::handler::DummyConnectionHandler::default() } // Handles the libp2p request to obtain multiaddrs for peer_id's in order to dial them. @@ -932,14 +932,14 @@ impl NetworkBehaviour for Discovery { &mut self, _: PeerId, _: ConnectionId, - _: ::OutEvent, + _: ::OutEvent, ) { } fn inject_dial_failure( &mut self, peer_id: Option, - _handler: Self::ProtocolsHandler, + _handler: Self::ConnectionHandler, error: &DialError, ) { if let Some(peer_id) = peer_id { @@ -967,7 +967,7 @@ impl NetworkBehaviour for Discovery { &mut self, cx: &mut Context, _: &mut impl PollParameters, - ) -> Poll> { + ) -> Poll> { if !self.started { return Poll::Pending; } diff --git a/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs b/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs index d4eef65b0c4..394eff15236 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs @@ -3,9 +3,9 @@ use std::task::{Context, Poll}; use futures::StreamExt; use libp2p::core::connection::ConnectionId; use libp2p::core::ConnectedPoint; -use libp2p::swarm::protocols_handler::DummyProtocolsHandler; +use libp2p::swarm::handler::DummyConnectionHandler; use libp2p::swarm::{ - DialError, NetworkBehaviour, NetworkBehaviourAction, PollParameters, ProtocolsHandler, + ConnectionHandler, DialError, NetworkBehaviour, NetworkBehaviourAction, PollParameters, }; use libp2p::{Multiaddr, PeerId}; use slog::{debug, error}; @@ -19,21 +19,21 @@ use super::peerdb::BanResult; use super::{PeerManager, PeerManagerEvent, ReportSource}; impl NetworkBehaviour for PeerManager { - type ProtocolsHandler = DummyProtocolsHandler; + type ConnectionHandler = DummyConnectionHandler; type OutEvent = PeerManagerEvent; /* Required trait members */ - fn new_handler(&mut self) -> Self::ProtocolsHandler { - DummyProtocolsHandler::default() + fn new_handler(&mut self) -> Self::ConnectionHandler { + DummyConnectionHandler::default() } fn inject_event( &mut self, _: PeerId, _: ConnectionId, - _: ::OutEvent, + _: ::OutEvent, ) { unreachable!("Dummy handler does not emit events") } @@ -42,7 +42,7 @@ impl NetworkBehaviour for PeerManager { &mut self, cx: &mut Context<'_>, _params: &mut impl PollParameters, - ) -> Poll> { + ) -> Poll> { // perform the heartbeat when necessary while self.heartbeat.poll_tick(cx).is_ready() { self.heartbeat(); @@ -178,7 +178,7 @@ impl NetworkBehaviour for PeerManager { peer_id: &PeerId, _: &ConnectionId, _: &ConnectedPoint, - _: DummyProtocolsHandler, + _: DummyConnectionHandler, remaining_established: usize, ) { if remaining_established > 0 { @@ -243,7 +243,7 @@ impl NetworkBehaviour for PeerManager { fn inject_dial_failure( &mut self, peer_id: Option, - _handler: DummyProtocolsHandler, + _handler: DummyConnectionHandler, _error: &DialError, ) { if let Some(peer_id) = peer_id { diff --git a/beacon_node/lighthouse_network/src/rpc/handler.rs b/beacon_node/lighthouse_network/src/rpc/handler.rs index 37724e028ad..e471e8ec47a 100644 --- a/beacon_node/lighthouse_network/src/rpc/handler.rs +++ b/beacon_node/lighthouse_network/src/rpc/handler.rs @@ -15,8 +15,9 @@ use futures::{Sink, SinkExt}; use libp2p::core::upgrade::{ InboundUpgrade, NegotiationError, OutboundUpgrade, ProtocolError, UpgradeError, }; -use libp2p::swarm::protocols_handler::{ - KeepAlive, ProtocolsHandler, ProtocolsHandlerEvent, ProtocolsHandlerUpgrErr, SubstreamProtocol, +use libp2p::swarm::handler::{ + ConnectionHandler, ConnectionHandlerEvent, ConnectionHandlerUpgrErr, KeepAlive, + SubstreamProtocol, }; use libp2p::swarm::NegotiatedSubstream; use slog::{crit, debug, trace, warn}; @@ -76,7 +77,7 @@ pub enum HandlerErr { }, } -/// Implementation of `ProtocolsHandler` for the RPC protocol. +/// Implementation of `ConnectionHandler` for the RPC protocol. pub struct RPCHandler where TSpec: EthSpec, @@ -309,7 +310,7 @@ where } } -impl ProtocolsHandler for RPCHandler +impl ConnectionHandler for RPCHandler where TSpec: EthSpec, { @@ -442,12 +443,13 @@ where fn inject_dial_upgrade_error( &mut self, request_info: Self::OutboundOpenInfo, - error: ProtocolsHandlerUpgrErr< + error: ConnectionHandlerUpgrErr< >::Error, >, ) { let (id, req) = request_info; - if let ProtocolsHandlerUpgrErr::Upgrade(UpgradeError::Apply(RPCError::IoError(_))) = error { + if let ConnectionHandlerUpgrErr::Upgrade(UpgradeError::Apply(RPCError::IoError(_))) = error + { self.outbound_io_error_retries += 1; if self.outbound_io_error_retries < IO_ERROR_RETRIES { self.send_request(id, req); @@ -461,13 +463,13 @@ where self.outbound_io_error_retries = 0; // map the error let error = match error { - ProtocolsHandlerUpgrErr::Timer => RPCError::InternalError("Timer failed"), - ProtocolsHandlerUpgrErr::Timeout => RPCError::NegotiationTimeout, - ProtocolsHandlerUpgrErr::Upgrade(UpgradeError::Apply(e)) => e, - ProtocolsHandlerUpgrErr::Upgrade(UpgradeError::Select(NegotiationError::Failed)) => { + ConnectionHandlerUpgrErr::Timer => RPCError::InternalError("Timer failed"), + ConnectionHandlerUpgrErr::Timeout => RPCError::NegotiationTimeout, + ConnectionHandlerUpgrErr::Upgrade(UpgradeError::Apply(e)) => e, + ConnectionHandlerUpgrErr::Upgrade(UpgradeError::Select(NegotiationError::Failed)) => { RPCError::UnsupportedProtocol } - ProtocolsHandlerUpgrErr::Upgrade(UpgradeError::Select( + ConnectionHandlerUpgrErr::Upgrade(UpgradeError::Select( NegotiationError::ProtocolError(e), )) => match e { ProtocolError::IoError(io_err) => RPCError::IoError(io_err.to_string()), @@ -517,7 +519,7 @@ where &mut self, cx: &mut Context<'_>, ) -> Poll< - ProtocolsHandlerEvent< + ConnectionHandlerEvent< Self::OutboundProtocol, Self::OutboundOpenInfo, Self::OutEvent, @@ -533,7 +535,7 @@ where } // return any events that need to be reported if !self.events_out.is_empty() { - return Poll::Ready(ProtocolsHandlerEvent::Custom(self.events_out.remove(0))); + return Poll::Ready(ConnectionHandlerEvent::Custom(self.events_out.remove(0))); } else { self.events_out.shrink_to_fit(); } @@ -543,7 +545,7 @@ where if delay.is_elapsed() { self.state = HandlerState::Deactivated; debug!(self.log, "Handler deactivated"); - return Poll::Ready(ProtocolsHandlerEvent::Close(RPCError::InternalError( + return Poll::Ready(ConnectionHandlerEvent::Close(RPCError::InternalError( "Shutdown timeout", ))); } @@ -575,7 +577,7 @@ where Poll::Ready(Some(Err(e))) => { warn!(self.log, "Inbound substream poll failed"; "error" => ?e); // drops the peer if we cannot read the delay queue - return Poll::Ready(ProtocolsHandlerEvent::Close(RPCError::InternalError( + return Poll::Ready(ConnectionHandlerEvent::Close(RPCError::InternalError( "Could not poll inbound stream timer", ))); } @@ -596,14 +598,14 @@ where error: RPCError::StreamTimeout, }; // notify the user - return Poll::Ready(ProtocolsHandlerEvent::Custom(Err(outbound_err))); + return Poll::Ready(ConnectionHandlerEvent::Custom(Err(outbound_err))); } else { crit!(self.log, "timed out substream not in the books"; "stream_id" => outbound_id.get_ref()); } } Poll::Ready(Some(Err(e))) => { warn!(self.log, "Outbound substream poll failed"; "error" => ?e); - return Poll::Ready(ProtocolsHandlerEvent::Close(RPCError::InternalError( + return Poll::Ready(ConnectionHandlerEvent::Close(RPCError::InternalError( "Could not poll outbound stream timer", ))); } @@ -856,7 +858,7 @@ where }), }; - return Poll::Ready(ProtocolsHandlerEvent::Custom(received)); + return Poll::Ready(ConnectionHandlerEvent::Custom(received)); } Poll::Ready(None) => { // stream closed @@ -871,7 +873,7 @@ where // notify the application error if request.expected_responses() > 1 { // return an end of stream result - return Poll::Ready(ProtocolsHandlerEvent::Custom(Ok( + return Poll::Ready(ConnectionHandlerEvent::Custom(Ok( RPCReceived::EndOfStream(request_id, request.stream_termination()), ))); } @@ -882,7 +884,7 @@ where proto: request.protocol(), error: RPCError::IncompleteStream, }; - return Poll::Ready(ProtocolsHandlerEvent::Custom(Err(outbound_err))); + return Poll::Ready(ConnectionHandlerEvent::Custom(Err(outbound_err))); } Poll::Pending => { entry.get_mut().state = @@ -898,7 +900,7 @@ where error: e, }; entry.remove_entry(); - return Poll::Ready(ProtocolsHandlerEvent::Custom(Err(outbound_err))); + return Poll::Ready(ConnectionHandlerEvent::Custom(Err(outbound_err))); } }, OutboundSubstreamState::Closing(mut substream) => { @@ -924,7 +926,7 @@ where }; if let Some(termination) = termination { - return Poll::Ready(ProtocolsHandlerEvent::Custom(Ok( + return Poll::Ready(ConnectionHandlerEvent::Custom(Ok( RPCReceived::EndOfStream(request_id, termination), ))); } @@ -946,7 +948,7 @@ where self.dial_negotiated += 1; let (id, req) = self.dial_queue.remove(0); self.dial_queue.shrink_to_fit(); - return Poll::Ready(ProtocolsHandlerEvent::OutboundSubstreamRequest { + return Poll::Ready(ConnectionHandlerEvent::OutboundSubstreamRequest { protocol: SubstreamProtocol::new( OutboundRequestContainer { req: req.clone(), @@ -967,7 +969,7 @@ where && self.events_out.is_empty() && self.dial_negotiated == 0 { - return Poll::Ready(ProtocolsHandlerEvent::Close(RPCError::Disconnected)); + return Poll::Ready(ConnectionHandlerEvent::Close(RPCError::Disconnected)); } } diff --git a/beacon_node/lighthouse_network/src/rpc/mod.rs b/beacon_node/lighthouse_network/src/rpc/mod.rs index 8c4a0b14c71..ba88f66bb34 100644 --- a/beacon_node/lighthouse_network/src/rpc/mod.rs +++ b/beacon_node/lighthouse_network/src/rpc/mod.rs @@ -8,7 +8,7 @@ use futures::future::FutureExt; use handler::RPCHandler; use libp2p::core::{connection::ConnectionId, ConnectedPoint}; use libp2p::swarm::{ - protocols_handler::ProtocolsHandler, NetworkBehaviour, NetworkBehaviourAction, NotifyHandler, + handler::ConnectionHandler, NetworkBehaviour, NetworkBehaviourAction, NotifyHandler, PollParameters, SubstreamProtocol, }; use libp2p::{Multiaddr, PeerId}; @@ -92,7 +92,7 @@ pub struct RPCMessage { /// Handler managing this message. pub conn_id: ConnectionId, /// The message that was sent. - pub event: as ProtocolsHandler>::OutEvent, + pub event: as ConnectionHandler>::OutEvent, } /// Implements the libp2p `NetworkBehaviour` trait and therefore manages network-level @@ -178,10 +178,10 @@ impl NetworkBehaviour for RPC where TSpec: EthSpec, { - type ProtocolsHandler = RPCHandler; + type ConnectionHandler = RPCHandler; type OutEvent = RPCMessage; - fn new_handler(&mut self) -> Self::ProtocolsHandler { + fn new_handler(&mut self) -> Self::ConnectionHandler { RPCHandler::new( SubstreamProtocol::new( RPCProtocol { @@ -227,7 +227,7 @@ where &mut self, peer_id: PeerId, conn_id: ConnectionId, - event: ::OutEvent, + event: ::OutEvent, ) { if let Ok(RPCReceived::Request(ref id, ref req)) = event { // check if the request is conformant to the quota @@ -289,7 +289,7 @@ where &mut self, cx: &mut Context, _: &mut impl PollParameters, - ) -> Poll> { + ) -> 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 7dcee51870b..0f5607e54da 100644 --- a/beacon_node/lighthouse_network/src/service.rs +++ b/beacon_node/lighthouse_network/src/service.rs @@ -12,13 +12,12 @@ use crate::EnrExt; use crate::{NetworkConfig, NetworkGlobals, PeerAction, ReportSource}; use futures::prelude::*; use libp2p::core::{ - connection::ConnectionLimits, identity::Keypair, multiaddr::Multiaddr, muxing::StreamMuxerBox, - transport::Boxed, + identity::Keypair, multiaddr::Multiaddr, muxing::StreamMuxerBox, transport::Boxed, }; use libp2p::{ bandwidth::{BandwidthLogging, BandwidthSinks}, core, noise, - swarm::{SwarmBuilder, SwarmEvent}, + swarm::{ConnectionLimits, SwarmBuilder, SwarmEvent}, PeerId, Swarm, Transport, }; use prometheus_client::registry::Registry; diff --git a/beacon_node/lighthouse_network/tests/common/behaviour.rs b/beacon_node/lighthouse_network/tests/common/behaviour.rs index 75797e63d1c..76eecfcbc57 100644 --- a/beacon_node/lighthouse_network/tests/common/behaviour.rs +++ b/beacon_node/lighthouse_network/tests/common/behaviour.rs @@ -24,9 +24,7 @@ use std::collections::HashMap; use std::task::{Context, Poll}; use libp2p::core::connection::{ConnectedPoint, ConnectionId, ListenerId}; -use libp2p::swarm::protocols_handler::{ - DummyProtocolsHandler, IntoProtocolsHandler, ProtocolsHandler, -}; +use libp2p::swarm::handler::{ConnectionHandler, DummyConnectionHandler, IntoConnectionHandler}; use libp2p::swarm::{DialError, NetworkBehaviour, NetworkBehaviourAction, PollParameters}; use libp2p::{Multiaddr, PeerId}; @@ -34,10 +32,10 @@ use libp2p::{Multiaddr, PeerId}; /// the instrumentation of return values, without keeping /// any further state. pub struct MockBehaviour< - THandler = DummyProtocolsHandler, - TOutEvent = ::OutEvent, + THandler = DummyConnectionHandler, + TOutEvent = ::OutEvent, > where - THandler: ProtocolsHandler, + THandler: ConnectionHandler, { /// The prototype protocols handler that is cloned for every /// invocation of `new_handler`. @@ -52,7 +50,7 @@ pub struct MockBehaviour< impl MockBehaviour where - THandler: ProtocolsHandler, + THandler: ConnectionHandler, { pub fn new(handler_proto: THandler) -> Self { MockBehaviour { @@ -65,14 +63,14 @@ where impl NetworkBehaviour for MockBehaviour where - THandler: ProtocolsHandler + Clone, + THandler: ConnectionHandler + Clone, THandler::OutEvent: Clone, TOutEvent: Send + 'static, { - type ProtocolsHandler = THandler; + type ConnectionHandler = THandler; type OutEvent = TOutEvent; - fn new_handler(&mut self) -> Self::ProtocolsHandler { + fn new_handler(&mut self) -> Self::ConnectionHandler { self.handler_proto.clone() } @@ -86,7 +84,7 @@ where &mut self, _: &mut Context, _: &mut impl PollParameters, - ) -> Poll> { + ) -> Poll> { Option::take(&mut self.next_action).map_or(Poll::Pending, Poll::Ready) } } @@ -105,7 +103,7 @@ where pub inject_event: Vec<( PeerId, ConnectionId, - <::Handler as ProtocolsHandler>::OutEvent, + <::Handler as ConnectionHandler>::OutEvent, )>, pub inject_dial_failure: Vec>, pub inject_new_listener: Vec, @@ -212,13 +210,13 @@ where impl NetworkBehaviour for CallTraceBehaviour where TInner: NetworkBehaviour, - <::Handler as ProtocolsHandler>::OutEvent: + <::Handler as ConnectionHandler>::OutEvent: Clone, { - type ProtocolsHandler = TInner::ProtocolsHandler; + type ConnectionHandler = TInner::ConnectionHandler; type OutEvent = TInner::OutEvent; - fn new_handler(&mut self) -> Self::ProtocolsHandler { + fn new_handler(&mut self) -> Self::ConnectionHandler { self.inner.new_handler() } @@ -273,7 +271,7 @@ where p: &PeerId, c: &ConnectionId, e: &ConnectedPoint, - handler: ::Handler, + handler: ::Handler, remaining_established: usize, ) { let mut other_closed_connections = self @@ -320,7 +318,7 @@ where &mut self, p: PeerId, c: ConnectionId, - e: <::Handler as ProtocolsHandler>::OutEvent, + e: <::Handler as ConnectionHandler>::OutEvent, ) { assert!( self.inject_connection_established @@ -343,7 +341,7 @@ where fn inject_dial_failure( &mut self, p: Option, - handler: Self::ProtocolsHandler, + handler: Self::ConnectionHandler, error: &DialError, ) { self.inject_dial_failure.push(p); @@ -389,7 +387,7 @@ where &mut self, cx: &mut Context, args: &mut impl PollParameters, - ) -> Poll> { + ) -> Poll> { self.poll += 1; self.inner.poll(cx, args) } diff --git a/beacon_node/lighthouse_network/tests/common/swarm.rs b/beacon_node/lighthouse_network/tests/common/swarm.rs index 2930e2e4da2..aa41a5c066d 100644 --- a/beacon_node/lighthouse_network/tests/common/swarm.rs +++ b/beacon_node/lighthouse_network/tests/common/swarm.rs @@ -5,8 +5,8 @@ use super::behaviour::{CallTraceBehaviour, MockBehaviour}; use futures::stream::Stream; use futures::task::{Context, Poll}; -use libp2p::swarm::protocols_handler::ProtocolsHandler; -use libp2p::swarm::{IntoProtocolsHandler, NetworkBehaviour, Swarm, SwarmBuilder, SwarmEvent}; +use libp2p::swarm::handler::ConnectionHandler; +use libp2p::swarm::{IntoConnectionHandler, NetworkBehaviour, Swarm, SwarmBuilder, SwarmEvent}; use libp2p::{PeerId, Transport}; use futures::StreamExt; @@ -82,10 +82,10 @@ impl SwarmPool { impl Stream for SwarmPool where B: NetworkBehaviour, - ::ProtocolsHandler: ProtocolsHandler, + ::ConnectionHandler: ConnectionHandler, { type Item = (PeerId, - SwarmEvent<::OutEvent, <<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::Error>); + SwarmEvent<::OutEvent, <<::ConnectionHandler as IntoConnectionHandler>::Handler as ConnectionHandler>::Error>); fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let mut polls = self diff --git a/beacon_node/lighthouse_network/tests/pm_tests.rs b/beacon_node/lighthouse_network/tests/pm_tests.rs index 9b26e4939fa..96767204db9 100644 --- a/beacon_node/lighthouse_network/tests/pm_tests.rs +++ b/beacon_node/lighthouse_network/tests/pm_tests.rs @@ -20,7 +20,7 @@ use futures::StreamExt; use libp2p::{ core::either::EitherError, swarm::SwarmEvent, - swarm::{protocols_handler::DummyProtocolsHandler, DummyBehaviour, KeepAlive, Swarm}, + swarm::{handler::DummyConnectionHandler, DummyBehaviour, KeepAlive, Swarm}, NetworkBehaviour, }; @@ -77,7 +77,7 @@ impl Behaviour { fn new(pm: PeerManager) -> Self { Behaviour { pm_call_trace: CallTraceBehaviour::new(pm), - sibling: MockBehaviour::new(DummyProtocolsHandler { + sibling: MockBehaviour::new(DummyConnectionHandler { // The peer manager votes No, so we make sure the combined handler stays alive this // way. keep_alive: KeepAlive::Yes,