Skip to content
This repository was archived by the owner on Jul 4, 2022. It is now read-only.

Commit 28ffe37

Browse files
authored
*: Update to libp2p v0.33.0 (#7759)
* *: Update to libp2p v0.33.0 * client/network: Consistently track request arrival time With libp2p/rust-libp2p#1886 one is guaranteed to receive either a `ResponseSent` or a `InboundFailure` event for each received inbound request via `RequestResponseEvent::Message`. Given this guarantee there is no need to track arrival times in a best-effort manner and thus there is no need to use a LRU cache for arrival times. * client/offchain: Adjust to PeerId API changes
1 parent d972eb1 commit 28ffe37

File tree

15 files changed

+88
-91
lines changed

15 files changed

+88
-91
lines changed

Cargo.lock

Lines changed: 55 additions & 48 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.32.2", default-features = false }
11+
libp2p = { version = "0.33.0", 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
@@ -23,7 +23,7 @@ derive_more = "0.99.2"
2323
either = "1.5.3"
2424
futures = "0.3.4"
2525
futures-timer = "3.0.1"
26-
libp2p = { version = "0.32.2", default-features = false, features = ["kad"] }
26+
libp2p = { version = "0.33.0", default-features = false, features = ["kad"] }
2727
log = "0.4.8"
2828
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.8.0"}
2929
prost = "0.6.1"

client/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ regex = "1.4.2"
1919
tokio = { version = "0.2.21", features = [ "signal", "rt-core", "rt-threaded", "blocking" ] }
2020
futures = "0.3.4"
2121
fdlimit = "0.2.1"
22-
libp2p = "0.32.2"
22+
libp2p = "0.33.0"
2323
parity-scale-codec = "1.3.0"
2424
hex = "0.4.2"
2525
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.32.2", default-features = false }
20+
libp2p = { version = "0.33.0", default-features = false }
2121
log = "0.4.8"
2222
lru = "0.6.1"
2323
sc-network = { version = "0.8.0", path = "../network" }

client/network/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ ip_network = "0.3.4"
3636
linked-hash-map = "0.5.2"
3737
linked_hash_set = "0.1.3"
3838
log = "0.4.8"
39-
lru = "0.6.1"
4039
nohash-hasher = "0.2.0"
4140
parking_lot = "0.11.1"
4241
pin-project = "0.4.6"
@@ -64,13 +63,13 @@ wasm-timer = "0.2"
6463
zeroize = "1.2.0"
6564

6665
[dependencies.libp2p]
67-
version = "0.32.2"
66+
version = "0.33.0"
6867
default-features = false
6968
features = ["identify", "kad", "mdns", "mplex", "noise", "ping", "request-response", "tcp-async-std", "websocket", "yamux"]
7069

7170
[dev-dependencies]
7271
assert_matches = "1.3"
73-
libp2p = { version = "0.32.2", default-features = false }
72+
libp2p = { version = "0.33.0", default-features = false }
7473
quickcheck = "0.9.0"
7574
rand = "0.7.2"
7675
sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" }

client/network/src/behaviour.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub enum BehaviourOut<B: BlockT> {
9090
protocol: Cow<'static, str>,
9191
/// If `Ok`, contains the time elapsed between when we received the request and when we
9292
/// sent back the response. If `Err`, the error that happened.
93-
result: Result<Option<Duration>, ResponseFailure>,
93+
result: Result<Duration, ResponseFailure>,
9494
},
9595

9696
/// A request initiated using [`Behaviour::send_request`] has succeeded or failed.
@@ -419,7 +419,7 @@ impl<B: BlockT, H: ExHashT> NetworkBehaviourEventProcess<block_requests::Event<B
419419
self.events.push_back(BehaviourOut::InboundRequest {
420420
peer,
421421
protocol: self.block_requests.protocol_name().to_owned().into(),
422-
result: Ok(Some(total_handling_time)),
422+
result: Ok(total_handling_time),
423423
});
424424
},
425425
block_requests::Event::Response { peer, response, request_duration } => {

0 commit comments

Comments
 (0)