Temporary noise fix (#1311)
* Add workaround to noise and add back secio fallback * Hardcoded size hack * prioritise secio
This commit is contained in:
parent
721323f045
commit
fc0b8adcd7
421
Cargo.lock
generated
421
Cargo.lock
generated
@ -45,6 +45,74 @@ version = "1.0.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2"
|
checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aead"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4cf01b9b56e767bb57b94ebf91a58b338002963785cdd7013e21c0d4679471e4"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aes"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9"
|
||||||
|
dependencies = [
|
||||||
|
"aes-soft",
|
||||||
|
"aesni",
|
||||||
|
"block-cipher-trait",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aes-ctr"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d2e5b0458ea3beae0d1d8c0f3946564f8e10f90646cf78c06b4351052058d1ee"
|
||||||
|
dependencies = [
|
||||||
|
"aes-soft",
|
||||||
|
"aesni",
|
||||||
|
"ctr",
|
||||||
|
"stream-cipher",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aes-gcm"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "834a6bda386024dbb7c8fc51322856c10ffe69559f972261c868485f5759c638"
|
||||||
|
dependencies = [
|
||||||
|
"aead",
|
||||||
|
"aes",
|
||||||
|
"block-cipher-trait",
|
||||||
|
"ghash",
|
||||||
|
"subtle 2.2.3",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aes-soft"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d"
|
||||||
|
dependencies = [
|
||||||
|
"block-cipher-trait",
|
||||||
|
"byteorder",
|
||||||
|
"opaque-debug",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aesni"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100"
|
||||||
|
dependencies = [
|
||||||
|
"block-cipher-trait",
|
||||||
|
"opaque-debug",
|
||||||
|
"stream-cipher",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ahash"
|
name = "ahash"
|
||||||
version = "0.2.18"
|
version = "0.2.18"
|
||||||
@ -108,15 +176,6 @@ version = "0.3.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
|
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "arrayvec"
|
|
||||||
version = "0.4.12"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9"
|
|
||||||
dependencies = [
|
|
||||||
"nodrop",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arrayvec"
|
name = "arrayvec"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
@ -332,13 +391,15 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "blake2-rfc"
|
name = "blake2"
|
||||||
version = "0.2.18"
|
version = "0.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400"
|
checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec 0.4.12",
|
"byte-tools",
|
||||||
"constant_time_eq",
|
"crypto-mac",
|
||||||
|
"digest",
|
||||||
|
"opaque-debug",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -348,7 +409,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a"
|
checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayref",
|
"arrayref",
|
||||||
"arrayvec 0.5.1",
|
"arrayvec",
|
||||||
"constant_time_eq",
|
"constant_time_eq",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -359,7 +420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "ab9e07352b829279624ceb7c64adb4f585dacdb81d35cafae81139ccd617cf44"
|
checksum = "ab9e07352b829279624ceb7c64adb4f585dacdb81d35cafae81139ccd617cf44"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayref",
|
"arrayref",
|
||||||
"arrayvec 0.5.1",
|
"arrayvec",
|
||||||
"constant_time_eq",
|
"constant_time_eq",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -375,6 +436,15 @@ dependencies = [
|
|||||||
"generic-array",
|
"generic-array",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "block-cipher-trait"
|
||||||
|
version = "0.6.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block-padding"
|
name = "block-padding"
|
||||||
version = "0.1.5"
|
version = "0.1.5"
|
||||||
@ -534,12 +604,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chacha20-poly1305-aead"
|
name = "chacha20"
|
||||||
version = "0.1.2"
|
version = "0.3.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "77d2058ba29594f69c75e8a9018e0485e3914ca5084e3613cd64529042f5423b"
|
checksum = "f6a7ae4c498f8447d86baef0fa0831909333f558866fabcb21600625ac5a31c7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"constant_time_eq",
|
"stream-cipher",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "chacha20poly1305"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "48901293601228db2131606f741db33561f7576b5d19c99cd66222380a7dc863"
|
||||||
|
dependencies = [
|
||||||
|
"aead",
|
||||||
|
"chacha20",
|
||||||
|
"poly1305",
|
||||||
|
"stream-cipher",
|
||||||
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -878,6 +962,16 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ctr"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "022cd691704491df67d25d006fe8eca083098253c4d43516c2206479c58c6736"
|
||||||
|
dependencies = [
|
||||||
|
"block-cipher-trait",
|
||||||
|
"stream-cipher",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ctrlc"
|
name = "ctrlc"
|
||||||
version = "3.1.4"
|
version = "3.1.4"
|
||||||
@ -1021,7 +1115,7 @@ version = "0.1.0-alpha.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "66319abef3e2f4dc434bf0c9bcb5dee5907d7fece3327dfd7da82db905d02441"
|
checksum = "66319abef3e2f4dc434bf0c9bcb5dee5907d7fece3327dfd7da82db905d02441"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec 0.5.1",
|
"arrayvec",
|
||||||
"digest",
|
"digest",
|
||||||
"enr",
|
"enr",
|
||||||
"fnv",
|
"fnv",
|
||||||
@ -1029,7 +1123,7 @@ dependencies = [
|
|||||||
"hex 0.4.2",
|
"hex 0.4.2",
|
||||||
"hkdf",
|
"hkdf",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.1",
|
||||||
"libsecp256k1",
|
"libsecp256k1",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"lru_time_cache",
|
"lru_time_cache",
|
||||||
@ -1299,7 +1393,6 @@ dependencies = [
|
|||||||
"hex 0.4.2",
|
"hex 0.4.2",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libp2p",
|
"libp2p",
|
||||||
"libp2p-tcp",
|
|
||||||
"lighthouse_metrics",
|
"lighthouse_metrics",
|
||||||
"lru 0.5.1",
|
"lru 0.5.1",
|
||||||
"parking_lot 0.10.2",
|
"parking_lot 0.10.2",
|
||||||
@ -1693,9 +1786,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures_codec"
|
name = "futures_codec"
|
||||||
version = "0.3.4"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a0a73299e4718f5452e45980fc1d6957a070abe308d3700b63b8673f47e1c2b3"
|
checksum = "fe8859feb7140742ed1a2a85a07941100ad2b5f98a421b353931d718a34144d1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes 0.5.4",
|
"bytes 0.5.4",
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
@ -1775,6 +1868,15 @@ dependencies = [
|
|||||||
"wasi",
|
"wasi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ghash"
|
||||||
|
version = "0.2.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9f0930ed19a7184089ea46d2fedead2f6dc2b674c5db4276b7da336c7cd83252"
|
||||||
|
dependencies = [
|
||||||
|
"polyval",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gimli"
|
name = "gimli"
|
||||||
version = "0.21.0"
|
version = "0.21.0"
|
||||||
@ -2315,25 +2417,26 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p"
|
name = "libp2p"
|
||||||
version = "0.19.1"
|
version = "0.20.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "057eba5432d3e740e313c6e13c9153d0cb76b4f71bfc2e5242ae5bdb7d41af67"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes 0.5.4",
|
"bytes 0.5.4",
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.2",
|
||||||
"libp2p-core-derive",
|
"libp2p-core-derive",
|
||||||
"libp2p-dns",
|
"libp2p-dns",
|
||||||
"libp2p-gossipsub",
|
"libp2p-gossipsub",
|
||||||
"libp2p-identify",
|
"libp2p-identify",
|
||||||
"libp2p-mplex",
|
"libp2p-mplex",
|
||||||
"libp2p-noise",
|
"libp2p-noise",
|
||||||
|
"libp2p-secio",
|
||||||
"libp2p-swarm",
|
"libp2p-swarm",
|
||||||
|
"libp2p-tcp",
|
||||||
"libp2p-websocket",
|
"libp2p-websocket",
|
||||||
"libp2p-yamux",
|
"libp2p-yamux",
|
||||||
"multihash",
|
"multihash",
|
||||||
"parity-multiaddr",
|
"parity-multiaddr 0.9.1",
|
||||||
"parking_lot 0.10.2",
|
"parking_lot 0.10.2",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"smallvec 1.4.0",
|
"smallvec 1.4.0",
|
||||||
@ -2357,8 +2460,8 @@ dependencies = [
|
|||||||
"libsecp256k1",
|
"libsecp256k1",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"multihash",
|
"multihash",
|
||||||
"multistream-select",
|
"multistream-select 0.8.1",
|
||||||
"parity-multiaddr",
|
"parity-multiaddr 0.9.0",
|
||||||
"parking_lot 0.10.2",
|
"parking_lot 0.10.2",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"prost",
|
"prost",
|
||||||
@ -2374,11 +2477,43 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libp2p-core"
|
||||||
|
version = "0.19.2"
|
||||||
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
|
dependencies = [
|
||||||
|
"asn1_der",
|
||||||
|
"bs58",
|
||||||
|
"ed25519-dalek",
|
||||||
|
"either",
|
||||||
|
"fnv",
|
||||||
|
"futures 0.3.5",
|
||||||
|
"futures-timer",
|
||||||
|
"lazy_static",
|
||||||
|
"libsecp256k1",
|
||||||
|
"log 0.4.8",
|
||||||
|
"multihash",
|
||||||
|
"multistream-select 0.8.2",
|
||||||
|
"parity-multiaddr 0.9.1",
|
||||||
|
"parking_lot 0.10.2",
|
||||||
|
"pin-project",
|
||||||
|
"prost",
|
||||||
|
"prost-build",
|
||||||
|
"rand 0.7.3",
|
||||||
|
"ring",
|
||||||
|
"rw-stream-sink",
|
||||||
|
"sha2",
|
||||||
|
"smallvec 1.4.0",
|
||||||
|
"thiserror",
|
||||||
|
"unsigned-varint 0.4.0",
|
||||||
|
"void",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-core-derive"
|
name = "libp2p-core-derive"
|
||||||
version = "0.19.1"
|
version = "0.19.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "f09548626b737ed64080fde595e06ce1117795b8b9fc4d2629fa36561c583171"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
@ -2387,19 +2522,17 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-dns"
|
name = "libp2p-dns"
|
||||||
version = "0.19.0"
|
version = "0.19.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "3cc186d9a941fd0207cf8f08ef225a735e2d7296258f570155e525f6ee732f87"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.2",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-gossipsub"
|
name = "libp2p-gossipsub"
|
||||||
version = "0.19.1"
|
version = "0.19.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "1675c23765e37ddbf6bf05fb520be8f7df3f5f4981d68f185bb95f9b047c576a"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.11.0",
|
"base64 0.11.0",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
@ -2407,7 +2540,7 @@ dependencies = [
|
|||||||
"fnv",
|
"fnv",
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"futures_codec",
|
"futures_codec",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.2",
|
||||||
"libp2p-swarm",
|
"libp2p-swarm",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"lru 0.4.3",
|
"lru 0.4.3",
|
||||||
@ -2416,18 +2549,17 @@ dependencies = [
|
|||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"sha2",
|
"sha2",
|
||||||
"smallvec 1.4.0",
|
"smallvec 1.4.0",
|
||||||
"unsigned-varint 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unsigned-varint 0.4.0",
|
||||||
"wasm-timer",
|
"wasm-timer",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-identify"
|
name = "libp2p-identify"
|
||||||
version = "0.19.1"
|
version = "0.19.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "6438ed8ca240c7635c9caa3be6c5258bc0058553ae97ba81737f04e5d33804f5"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.2",
|
||||||
"libp2p-swarm",
|
"libp2p-swarm",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"prost",
|
"prost",
|
||||||
@ -2438,30 +2570,28 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-mplex"
|
name = "libp2p-mplex"
|
||||||
version = "0.19.1"
|
version = "0.19.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "34ce63313ad4bce2d76e54c292a1293ea47a0ebbe16708f1513fa62184992f53"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes 0.5.4",
|
"bytes 0.5.4",
|
||||||
"fnv",
|
"fnv",
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"futures_codec",
|
"futures_codec",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.2",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"parking_lot 0.10.2",
|
"parking_lot 0.10.2",
|
||||||
"unsigned-varint 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unsigned-varint 0.4.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-noise"
|
name = "libp2p-noise"
|
||||||
version = "0.19.0"
|
version = "0.19.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "84fd504e27b0eadd451e06b67694ef714bd8374044e7db339bb0cdb83755ddf4"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"curve25519-dalek",
|
"curve25519-dalek",
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.2",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"prost",
|
"prost",
|
||||||
"prost-build",
|
"prost-build",
|
||||||
@ -2473,14 +2603,42 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libp2p-secio"
|
||||||
|
version = "0.19.2"
|
||||||
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
|
dependencies = [
|
||||||
|
"aes-ctr",
|
||||||
|
"ctr",
|
||||||
|
"futures 0.3.5",
|
||||||
|
"hmac",
|
||||||
|
"js-sys",
|
||||||
|
"lazy_static",
|
||||||
|
"libp2p-core 0.19.2",
|
||||||
|
"log 0.4.8",
|
||||||
|
"parity-send-wrapper",
|
||||||
|
"pin-project",
|
||||||
|
"prost",
|
||||||
|
"prost-build",
|
||||||
|
"quicksink",
|
||||||
|
"rand 0.7.3",
|
||||||
|
"ring",
|
||||||
|
"rw-stream-sink",
|
||||||
|
"sha2",
|
||||||
|
"static_assertions",
|
||||||
|
"twofish",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-bindgen-futures",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-swarm"
|
name = "libp2p-swarm"
|
||||||
version = "0.19.0"
|
version = "0.19.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "b4a8101a0e0d5f04562137a476bf5f5423cd5bdab2f7e43a75909668e63cb102"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.2",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"smallvec 1.4.0",
|
"smallvec 1.4.0",
|
||||||
@ -2490,15 +2648,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-tcp"
|
name = "libp2p-tcp"
|
||||||
version = "0.19.1"
|
version = "0.19.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "309f95fce9bec755eff5406f8b822fd3969990830c2b54f752e1fc181d5ace3e"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"futures-timer",
|
"futures-timer",
|
||||||
"get_if_addrs",
|
"get_if_addrs",
|
||||||
"ipnet",
|
"ipnet",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.2",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"socket2",
|
"socket2",
|
||||||
"tokio 0.2.21",
|
"tokio 0.2.21",
|
||||||
@ -2506,15 +2663,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-websocket"
|
name = "libp2p-websocket"
|
||||||
version = "0.19.0"
|
version = "0.20.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "085fbe4c05c4116c2164ab4d5a521eb6e00516c444f61b3ee9f68c7b1e53580b"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-tls",
|
"async-tls",
|
||||||
"bytes 0.5.4",
|
|
||||||
"either",
|
"either",
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.2",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"quicksink",
|
"quicksink",
|
||||||
"rustls",
|
"rustls",
|
||||||
@ -2527,12 +2682,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-yamux"
|
name = "libp2p-yamux"
|
||||||
version = "0.19.0"
|
version = "0.19.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
checksum = "0b305d3a8981e68f11c0e17f2d11d5c52fae95e0d7c283f9e462b5b2dab413b2"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"libp2p-core",
|
"libp2p-core 0.19.2",
|
||||||
"parking_lot 0.10.2",
|
"parking_lot 0.10.2",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"yamux",
|
"yamux",
|
||||||
@ -2891,6 +3045,19 @@ dependencies = [
|
|||||||
"unsigned-varint 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unsigned-varint 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "multistream-select"
|
||||||
|
version = "0.8.2"
|
||||||
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
|
dependencies = [
|
||||||
|
"bytes 0.5.4",
|
||||||
|
"futures 0.3.5",
|
||||||
|
"log 0.4.8",
|
||||||
|
"pin-project",
|
||||||
|
"smallvec 1.4.0",
|
||||||
|
"unsigned-varint 0.4.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "native-tls"
|
name = "native-tls"
|
||||||
version = "0.2.4"
|
version = "0.2.4"
|
||||||
@ -2988,12 +3155,6 @@ dependencies = [
|
|||||||
"validator_dir",
|
"validator_dir",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nodrop"
|
|
||||||
version = "0.1.14"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nohash-hasher"
|
name = "nohash-hasher"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
@ -3170,18 +3331,41 @@ dependencies = [
|
|||||||
"url 2.1.1",
|
"url 2.1.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "parity-multiaddr"
|
||||||
|
version = "0.9.1"
|
||||||
|
source = "git+https://github.com/sigp/rust-libp2p?rev=a6232506278b9e686248f8d04b79400861b143c2#a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
|
dependencies = [
|
||||||
|
"arrayref",
|
||||||
|
"bs58",
|
||||||
|
"byteorder",
|
||||||
|
"data-encoding",
|
||||||
|
"multihash",
|
||||||
|
"percent-encoding 2.1.0",
|
||||||
|
"serde",
|
||||||
|
"static_assertions",
|
||||||
|
"unsigned-varint 0.4.0",
|
||||||
|
"url 2.1.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parity-scale-codec"
|
name = "parity-scale-codec"
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "329c8f7f4244ddb5c37c103641027a76c530e65e8e4b8240b29f81ea40508b17"
|
checksum = "329c8f7f4244ddb5c37c103641027a76c530e65e8e4b8240b29f81ea40508b17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec 0.5.1",
|
"arrayvec",
|
||||||
"bitvec",
|
"bitvec",
|
||||||
"byte-slice-cast",
|
"byte-slice-cast",
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "parity-send-wrapper"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot"
|
name = "parking_lot"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
@ -3320,6 +3504,25 @@ dependencies = [
|
|||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "poly1305"
|
||||||
|
version = "0.5.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b5829f50f48e9ddb79f3f7c3097029d0caee30f8286accb241416df603b080b8"
|
||||||
|
dependencies = [
|
||||||
|
"universal-hash",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "polyval"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7ec3341498978de3bfd12d1b22f1af1de22818f5473a11e8a6ef997989e3a212"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"universal-hash",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ppv-lite86"
|
name = "ppv-lite86"
|
||||||
version = "0.2.8"
|
version = "0.2.8"
|
||||||
@ -4444,13 +4647,13 @@ checksum = "f7fb9b0bb877b35a1cc1474a3b43d9c226a2625311760cdda2cbccbc0c7a8376"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "snow"
|
name = "snow"
|
||||||
version = "0.6.2"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "afb767eee7d257ba202f0b9b08673bc13b22281632ef45267b19f13100accd2f"
|
checksum = "ce0f91be479494dd92e69d9971bd23ed27037dd1c94fcf558f6c6e74e6afa654"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayref",
|
"aes-gcm",
|
||||||
"blake2-rfc",
|
"blake2",
|
||||||
"chacha20-poly1305-aead",
|
"chacha20poly1305",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"rand_core 0.5.1",
|
"rand_core 0.5.1",
|
||||||
"ring",
|
"ring",
|
||||||
@ -4474,22 +4677,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "soketto"
|
name = "soketto"
|
||||||
version = "0.3.2"
|
version = "0.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1c9dab3f95c9ebdf3a88268c19af668f637a3c5039c2c56ff2d40b1b2d64a25b"
|
checksum = "85457366ae0c6ce56bf05a958aef14cd38513c236568618edbcd9a8c52cb80b0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.11.0",
|
"base64 0.12.1",
|
||||||
"bytes 0.5.4",
|
"bytes 0.5.4",
|
||||||
"flate2",
|
"flate2",
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
"http 0.2.1",
|
|
||||||
"httparse",
|
"httparse",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"sha1",
|
"sha-1",
|
||||||
"smallvec 1.4.0",
|
|
||||||
"static_assertions",
|
|
||||||
"thiserror",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4623,6 +4822,15 @@ dependencies = [
|
|||||||
"types",
|
"types",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "stream-cipher"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8131256a5896cabcf5eb04f4d6dacbe1aefda854b0d9896e09cb58829ec5638c"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "string"
|
name = "string"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
@ -5277,6 +5485,17 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382"
|
checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "twofish"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1"
|
||||||
|
dependencies = [
|
||||||
|
"block-cipher-trait",
|
||||||
|
"byteorder",
|
||||||
|
"opaque-debug",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typeable"
|
name = "typeable"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
@ -5407,6 +5626,16 @@ version = "0.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
|
checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "universal-hash"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "df0c900f2f9b4116803415878ff48b63da9edb268668e08cf9292d7503114a01"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array",
|
||||||
|
"subtle 2.2.3",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unsigned-varint"
|
name = "unsigned-varint"
|
||||||
version = "0.3.3"
|
version = "0.3.3"
|
||||||
@ -5421,6 +5650,12 @@ name = "unsigned-varint"
|
|||||||
version = "0.3.3"
|
version = "0.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f67332660eb59a6f1eb24ff1220c9e8d01738a8503c6002e30bcfe4bd9f2b4a9"
|
checksum = "f67332660eb59a6f1eb24ff1220c9e8d01738a8503c6002e30bcfe4bd9f2b4a9"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unsigned-varint"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "669d776983b692a906c881fcd0cfb34271a48e197e4d6cb8df32b05bfc3d3fa5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes 0.5.4",
|
"bytes 0.5.4",
|
||||||
"futures_codec",
|
"futures_codec",
|
||||||
@ -5717,7 +5952,7 @@ version = "0.11.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9a681e8d15deced7c510db88c59133d2eafa7b6298b6e91b545e2a3fed93b3fe"
|
checksum = "9a681e8d15deced7c510db88c59133d2eafa7b6298b6e91b545e2a3fed93b3fe"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec 0.5.1",
|
"arrayvec",
|
||||||
"base64 0.12.1",
|
"base64 0.12.1",
|
||||||
"derive_more",
|
"derive_more",
|
||||||
"ethabi",
|
"ethabi",
|
||||||
|
@ -35,13 +35,13 @@ tokio-util = { version = "0.3.1", features = ["codec", "compat"] }
|
|||||||
discv5 = { version = "0.1.0-alpha.5", features = ["libp2p"] }
|
discv5 = { version = "0.1.0-alpha.5", features = ["libp2p"] }
|
||||||
tiny-keccak = "2.0.2"
|
tiny-keccak = "2.0.2"
|
||||||
environment = { path = "../../lighthouse/environment" }
|
environment = { path = "../../lighthouse/environment" }
|
||||||
libp2p-tcp = { version = "0.19.1", default-features = false, features = ["tokio"] }
|
|
||||||
|
|
||||||
[dependencies.libp2p]
|
[dependencies.libp2p]
|
||||||
version = "0.19.1"
|
#version = "0.19.1"
|
||||||
|
git = "https://github.com/sigp/rust-libp2p"
|
||||||
|
rev = "a6232506278b9e686248f8d04b79400861b143c2"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns"]
|
features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns", "secio", "tcp-tokio"]
|
||||||
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio = { version = "0.2.21", features = ["full"] }
|
tokio = { version = "0.2.21", features = ["full"] }
|
||||||
|
@ -7,7 +7,11 @@ use crate::EnrExt;
|
|||||||
use crate::{NetworkConfig, NetworkGlobals};
|
use crate::{NetworkConfig, NetworkGlobals};
|
||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
use libp2p::core::{
|
use libp2p::core::{
|
||||||
identity::Keypair, multiaddr::Multiaddr, muxing::StreamMuxerBox, transport::boxed::Boxed,
|
identity::Keypair,
|
||||||
|
multiaddr::Multiaddr,
|
||||||
|
muxing::StreamMuxerBox,
|
||||||
|
transport::boxed::Boxed,
|
||||||
|
upgrade::{InboundUpgradeExt, OutboundUpgradeExt},
|
||||||
ConnectedPoint,
|
ConnectedPoint,
|
||||||
};
|
};
|
||||||
use libp2p::{
|
use libp2p::{
|
||||||
@ -367,10 +371,11 @@ impl<TSpec: EthSpec> Service<TSpec> {
|
|||||||
|
|
||||||
/// The implementation supports TCP/IP, WebSockets over TCP/IP, noise as the encryption layer, and
|
/// The implementation supports TCP/IP, WebSockets over TCP/IP, noise as the encryption layer, and
|
||||||
/// yamux or mplex as the multiplexing layer.
|
/// yamux or mplex as the multiplexing layer.
|
||||||
|
|
||||||
fn build_transport(
|
fn build_transport(
|
||||||
local_private_key: Keypair,
|
local_private_key: Keypair,
|
||||||
) -> Result<Boxed<(PeerId, StreamMuxerBox), Error>, Error> {
|
) -> Result<Boxed<(PeerId, StreamMuxerBox), Error>, Error> {
|
||||||
let transport = libp2p_tcp::TokioTcpConfig::new().nodelay(true);
|
let transport = libp2p::tcp::TokioTcpConfig::new().nodelay(true);
|
||||||
let transport = libp2p::dns::DnsConfig::new(transport)?;
|
let transport = libp2p::dns::DnsConfig::new(transport)?;
|
||||||
#[cfg(feature = "libp2p-websocket")]
|
#[cfg(feature = "libp2p-websocket")]
|
||||||
let transport = {
|
let transport = {
|
||||||
@ -378,18 +383,47 @@ fn build_transport(
|
|||||||
transport.or_transport(libp2p::websocket::WsConfig::new(trans_clone))
|
transport.or_transport(libp2p::websocket::WsConfig::new(trans_clone))
|
||||||
};
|
};
|
||||||
// Authentication
|
// Authentication
|
||||||
Ok(transport
|
let transport = transport
|
||||||
.upgrade(core::upgrade::Version::V1)
|
.and_then(move |stream, endpoint| {
|
||||||
.authenticate(generate_noise_config(&local_private_key))
|
let upgrade = core::upgrade::SelectUpgrade::new(
|
||||||
.multiplex(core::upgrade::SelectUpgrade::new(
|
libp2p::secio::SecioConfig::new(local_private_key.clone()),
|
||||||
libp2p::yamux::Config::default(),
|
generate_noise_config(&local_private_key),
|
||||||
|
);
|
||||||
|
core::upgrade::apply(stream, upgrade, endpoint, core::upgrade::Version::V1).and_then(
|
||||||
|
|out| async move {
|
||||||
|
match out {
|
||||||
|
// Secio was negotiated
|
||||||
|
core::either::EitherOutput::First((remote_id, out)) => {
|
||||||
|
Ok((core::either::EitherOutput::First(out), remote_id))
|
||||||
|
}
|
||||||
|
// Noise was negotiated
|
||||||
|
core::either::EitherOutput::Second((remote_id, out)) => {
|
||||||
|
Ok((core::either::EitherOutput::Second(out), remote_id))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.timeout(Duration::from_secs(20));
|
||||||
|
|
||||||
|
// Multiplexing
|
||||||
|
let transport = transport
|
||||||
|
.and_then(move |(stream, peer_id), endpoint| {
|
||||||
|
let peer_id2 = peer_id.clone();
|
||||||
|
let upgrade = core::upgrade::SelectUpgrade::new(
|
||||||
libp2p::mplex::MplexConfig::new(),
|
libp2p::mplex::MplexConfig::new(),
|
||||||
))
|
libp2p::yamux::Config::default(),
|
||||||
.map(|(peer, muxer), _| (peer, core::muxing::StreamMuxerBox::new(muxer)))
|
)
|
||||||
.timeout(Duration::from_secs(20))
|
.map_inbound(move |muxer| (peer_id, muxer))
|
||||||
|
.map_outbound(move |muxer| (peer_id2, muxer));
|
||||||
|
|
||||||
|
core::upgrade::apply(stream, upgrade, endpoint, core::upgrade::Version::V1)
|
||||||
|
.map_ok(|(id, muxer)| (id, core::muxing::StreamMuxerBox::new(muxer)))
|
||||||
|
})
|
||||||
.timeout(Duration::from_secs(20))
|
.timeout(Duration::from_secs(20))
|
||||||
.map_err(|err| Error::new(ErrorKind::Other, err))
|
.map_err(|err| Error::new(ErrorKind::Other, err))
|
||||||
.boxed())
|
.boxed();
|
||||||
|
Ok(transport)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Useful helper functions for debugging. Currently not used in the client.
|
// Useful helper functions for debugging. Currently not used in the client.
|
||||||
|
Loading…
Reference in New Issue
Block a user