Update to libp2p-0.36 (#8420)

* Update to libp2p-0.36

* Some more Cargo.lock updates.
This commit is contained in:
Roman Borschel
2021-03-24 19:29:35 +01:00
committed by GitHub
parent 9a72134188
commit e1570b9ab4
15 changed files with 246 additions and 75 deletions
+3 -3
View File
@@ -63,17 +63,17 @@ wasm-timer = "0.2"
zeroize = "1.2.0"
[dependencies.libp2p]
version = "0.35.1"
version = "0.36.0"
[target.'cfg(target_os = "unknown")'.dependencies.libp2p]
version = "0.35.1"
version = "0.36.0"
default-features = false
features = ["identify", "kad", "mdns", "mplex", "noise", "ping", "request-response", "tcp-async-io", "websocket", "yamux"]
[dev-dependencies]
assert_matches = "1.3"
libp2p = { version = "0.35.1", default-features = false }
libp2p = { version = "0.36.0", default-features = false }
quickcheck = "1.0.3"
rand = "0.7.2"
sp-keyring = { version = "3.0.0", path = "../../primitives/keyring" }
+2 -2
View File
@@ -61,7 +61,7 @@ use libp2p::kad::handler::KademliaHandlerProto;
use libp2p::kad::QueryId;
use libp2p::kad::record::{self, store::{MemoryStore, RecordStore}};
#[cfg(not(target_os = "unknown"))]
use libp2p::mdns::{Mdns, MdnsEvent};
use libp2p::mdns::{Mdns, MdnsConfig, MdnsEvent};
use libp2p::multiaddr::Protocol;
use log::{debug, info, trace, warn};
use std::{cmp, collections::{HashMap, HashSet, VecDeque}, io, num::NonZeroUsize, time::Duration};
@@ -220,7 +220,7 @@ impl DiscoveryConfig {
discovery_only_if_under_num,
#[cfg(not(target_os = "unknown"))]
mdns: if enable_mdns {
MdnsWrapper::Instantiating(Mdns::new().boxed())
MdnsWrapper::Instantiating(Mdns::new(MdnsConfig::default()).boxed())
} else {
MdnsWrapper::Disabled
},
+3 -2
View File
@@ -63,10 +63,11 @@ pub fn build_transport(
let desktop_trans = tcp::TcpConfig::new().nodelay(true);
let desktop_trans = websocket::WsConfig::new(desktop_trans.clone())
.or_transport(desktop_trans);
OptionalTransport::some(if let Ok(dns) = dns::DnsConfig::new(desktop_trans.clone()) {
let dns_init = futures::executor::block_on(dns::DnsConfig::system(desktop_trans.clone()));
OptionalTransport::some(if let Ok(dns) = dns_init {
EitherTransport::Left(dns)
} else {
EitherTransport::Right(desktop_trans.map_err(dns::DnsErr::Underlying))
EitherTransport::Right(desktop_trans.map_err(dns::DnsErr::Transport))
})
} else {
OptionalTransport::none()
+1 -1
View File
@@ -20,7 +20,7 @@ parking_lot = "0.11.1"
futures = "0.3.9"
futures-timer = "3.0.1"
rand = "0.7.2"
libp2p = { version = "0.35.1", default-features = false }
libp2p = { version = "0.36.0", default-features = false }
sp-consensus = { version = "0.9.0", path = "../../../primitives/consensus/common" }
sc-consensus = { version = "0.9.0", path = "../../consensus/common" }
sc-client-api = { version = "3.0.0", path = "../../api" }