Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 08b217a

Browse files
authored
*: Update to libp2p v0.30.0 (#7508)
* *: Update to libp2p v0.30.0 * Cargo.lock: Update * *: Update to libp2p v0.30.1
1 parent 99602cd commit 08b217a

File tree

16 files changed

+148
-129
lines changed

16 files changed

+148
-129
lines changed

Cargo.lock

Lines changed: 121 additions & 102 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/node/browser-testing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "Apache-2.0"
88

99
[dependencies]
1010
futures-timer = "3.0.2"
11-
libp2p = { version = "0.29.1", default-features = false }
11+
libp2p = { version = "0.30.1", default-features = false }
1212
jsonrpc-core = "15.0.0"
1313
serde = "1.0.106"
1414
serde_json = "1.0.48"

client/authority-discovery/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ derive_more = "0.99.2"
2424
either = "1.5.3"
2525
futures = "0.3.4"
2626
futures-timer = "3.0.1"
27-
libp2p = { version = "0.29.1", default-features = false, features = ["kad"] }
27+
libp2p = { version = "0.30.1", default-features = false, features = ["kad"] }
2828
log = "0.4.8"
2929
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.8.0"}
3030
prost = "0.6.1"

client/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ansi_term = "0.12.1"
2121
tokio = { version = "0.2.21", features = [ "signal", "rt-core", "rt-threaded", "blocking" ] }
2222
futures = "0.3.4"
2323
fdlimit = "0.2.1"
24-
libp2p = "0.29.1"
24+
libp2p = "0.30.1"
2525
parity-scale-codec = "1.3.0"
2626
hex = "0.4.2"
2727
rand = "0.7.3"

client/network-gossip/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"]
1717
[dependencies]
1818
futures = "0.3.4"
1919
futures-timer = "3.0.1"
20-
libp2p = { version = "0.29.1", default-features = false }
20+
libp2p = { version = "0.30.1", default-features = false }
2121
log = "0.4.8"
2222
lru = "0.4.3"
2323
sc-network = { version = "0.8.0", path = "../network" }

client/network/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ wasm-timer = "0.2"
6464
zeroize = "1.0.0"
6565

6666
[dependencies.libp2p]
67-
version = "0.29.1"
67+
version = "0.30.1"
6868
default-features = false
6969
features = ["identify", "kad", "mdns-async-std", "mplex", "noise", "ping", "request-response", "tcp-async-std", "websocket", "yamux"]
7070

7171
[dev-dependencies]
7272
assert_matches = "1.3"
73-
libp2p = { version = "0.29.1", default-features = false }
73+
libp2p = { version = "0.30.1", default-features = false }
7474
quickcheck = "0.9.0"
7575
rand = "0.7.2"
7676
sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" }

client/network/src/discovery.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ use futures::prelude::*;
5151
use futures_timer::Delay;
5252
use ip_network::IpNetwork;
5353
use libp2p::core::{connection::{ConnectionId, ListenerId}, ConnectedPoint, Multiaddr, PeerId, PublicKey};
54-
use libp2p::swarm::{NetworkBehaviour, NetworkBehaviourAction, PollParameters, ProtocolsHandler};
55-
use libp2p::swarm::protocols_handler::multi::MultiHandler;
54+
use libp2p::swarm::{NetworkBehaviour, NetworkBehaviourAction, PollParameters, ProtocolsHandler, IntoProtocolsHandler};
55+
use libp2p::swarm::protocols_handler::multi::IntoMultiHandler;
5656
use libp2p::kad::{Kademlia, KademliaBucketInserts, KademliaConfig, KademliaEvent, QueryResult, Quorum, Record};
5757
use libp2p::kad::GetClosestPeersError;
58-
use libp2p::kad::handler::KademliaHandler;
58+
use libp2p::kad::handler::KademliaHandlerProto;
5959
use libp2p::kad::QueryId;
6060
use libp2p::kad::record::{self, store::{MemoryStore, RecordStore}};
6161
#[cfg(not(target_os = "unknown"))]
@@ -444,14 +444,14 @@ pub enum DiscoveryOut {
444444
}
445445

446446
impl NetworkBehaviour for DiscoveryBehaviour {
447-
type ProtocolsHandler = MultiHandler<ProtocolId, KademliaHandler<QueryId>>;
447+
type ProtocolsHandler = IntoMultiHandler<ProtocolId, KademliaHandlerProto<QueryId>>;
448448
type OutEvent = DiscoveryOut;
449449

450450
fn new_handler(&mut self) -> Self::ProtocolsHandler {
451451
let iter = self.kademlias.iter_mut()
452452
.map(|(p, k)| (p.clone(), NetworkBehaviour::new_handler(k)));
453453

454-
MultiHandler::try_from_iter(iter)
454+
IntoMultiHandler::try_from_iter(iter)
455455
.expect("There can be at most one handler per `ProtocolId` and \
456456
protocol names contain the `ProtocolId` so no two protocol \
457457
names in `self.kademlias` can be equal which is the only error \
@@ -534,7 +534,7 @@ impl NetworkBehaviour for DiscoveryBehaviour {
534534
&mut self,
535535
peer_id: PeerId,
536536
connection: ConnectionId,
537-
(pid, event): <Self::ProtocolsHandler as ProtocolsHandler>::OutEvent,
537+
(pid, event): <<Self::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutEvent,
538538
) {
539539
if let Some(kad) = self.kademlias.get_mut(&pid) {
540540
return kad.inject_event(peer_id, connection, event)
@@ -598,7 +598,7 @@ impl NetworkBehaviour for DiscoveryBehaviour {
598598
params: &mut impl PollParameters,
599599
) -> Poll<
600600
NetworkBehaviourAction<
601-
<Self::ProtocolsHandler as ProtocolsHandler>::InEvent,
601+
<<Self::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::InEvent,
602602
Self::OutEvent,
603603
>,
604604
> {
@@ -816,7 +816,7 @@ mod tests {
816816
let transport = MemoryTransport
817817
.upgrade(upgrade::Version::V1)
818818
.authenticate(noise::NoiseConfig::xx(noise_keys).into_authenticated())
819-
.multiplex(yamux::Config::default())
819+
.multiplex(yamux::YamuxConfig::default())
820820
.boxed();
821821

822822
let behaviour = {

client/network/src/light_client_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ mod tests {
13551355
let transport = MemoryTransport::default()
13561356
.upgrade(upgrade::Version::V1)
13571357
.authenticate(NoiseConfig::xx(dh_key).into_authenticated())
1358-
.multiplex(yamux::Config::default())
1358+
.multiplex(yamux::YamuxConfig::default())
13591359
.boxed();
13601360
Swarm::new(transport, LightClientHandler::new(cf, client, checker, ps), local_peer)
13611361
}

client/network/src/protocol/generic_proto/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn build_nodes() -> (Swarm<CustomProtoWithAddr>, Swarm<CustomProtoWithAddr>) {
5454
let transport = MemoryTransport
5555
.upgrade(upgrade::Version::V1)
5656
.authenticate(noise::NoiseConfig::xx(noise_keys).into_authenticated())
57-
.multiplex(yamux::Config::default())
57+
.multiplex(yamux::YamuxConfig::default())
5858
.timeout(Duration::from_secs(20))
5959
.boxed();
6060

client/network/src/request_responses.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ mod tests {
680680
let transport = MemoryTransport
681681
.upgrade(upgrade::Version::V1)
682682
.authenticate(noise::NoiseConfig::xx(noise_keys).into_authenticated())
683-
.multiplex(libp2p::yamux::Config::default())
683+
.multiplex(libp2p::yamux::YamuxConfig::default())
684684
.boxed();
685685

686686
let behaviour = {
@@ -783,7 +783,7 @@ mod tests {
783783
let transport = MemoryTransport
784784
.upgrade(upgrade::Version::V1)
785785
.authenticate(noise::NoiseConfig::xx(noise_keys).into_authenticated())
786-
.multiplex(libp2p::yamux::Config::default())
786+
.multiplex(libp2p::yamux::YamuxConfig::default())
787787
.boxed();
788788

789789
let behaviour = {

0 commit comments

Comments
 (0)