Skip to content

Commit 276ce84

Browse files
feat(request-response): Add connection id to behaviour events
Closes #5716. Added connection id to the events emitted by a request-response Behaviour and adapted the code accordingly. Pull-Request: #5719.
1 parent 78e6f08 commit 276ce84

File tree

14 files changed

+100
-31
lines changed

14 files changed

+100
-31
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ rust-version = "1.75.0"
7474
[workspace.dependencies]
7575
libp2p = { version = "0.54.2", path = "libp2p" }
7676
libp2p-allow-block-list = { version = "0.4.2", path = "misc/allow-block-list" }
77-
libp2p-autonat = { version = "0.13.1", path = "protocols/autonat" }
77+
libp2p-autonat = { version = "0.13.2", path = "protocols/autonat" }
7878
libp2p-connection-limits = { version = "0.4.1", path = "misc/connection-limits" }
7979
libp2p-core = { version = "0.42.1", path = "core" }
8080
libp2p-dcutr = { version = "0.12.1", path = "protocols/dcutr" }
@@ -95,8 +95,8 @@ libp2p-plaintext = { version = "0.42.0", path = "transports/plaintext" }
9595
libp2p-pnet = { version = "0.25.0", path = "transports/pnet" }
9696
libp2p-quic = { version = "0.11.2", path = "transports/quic" }
9797
libp2p-relay = { version = "0.18.1", path = "protocols/relay" }
98-
libp2p-rendezvous = { version = "0.15.0", path = "protocols/rendezvous" }
99-
libp2p-request-response = { version = "0.27.1", path = "protocols/request-response" }
98+
libp2p-rendezvous = { version = "0.15.1", path = "protocols/rendezvous" }
99+
libp2p-request-response = { version = "0.28.0", path = "protocols/request-response" }
100100
libp2p-server = { version = "0.12.8", path = "misc/server" }
101101
libp2p-stream = { version = "0.2.0-alpha.1", path = "protocols/stream" }
102102
libp2p-swarm = { version = "0.45.2", path = "swarm" }

protocols/autonat/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.13.2
2+
3+
- Update to `libp2p-request-response` `v0.28.0`.
4+
15
## 0.13.1
26

37
- Verify that an incoming AutoNAT dial comes from a connected peer. See [PR 5597](https://github.com/libp2p/rust-libp2p/pull/5597).

protocols/autonat/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-autonat"
33
edition = "2021"
44
rust-version = { workspace = true }
55
description = "NAT and firewall detection for libp2p"
6-
version = "0.13.1"
6+
version = "0.13.2"
77
authors = [
88
"David Craven <[email protected]>",
99
"Elena Frank <[email protected]>",

protocols/autonat/src/v1/behaviour/as_client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ impl HandleInnerEvent for AsClient<'_> {
112112
request_id,
113113
response,
114114
},
115+
..
115116
} => {
116117
tracing::debug!(?response, "Outbound dial-back request returned response");
117118

@@ -154,6 +155,7 @@ impl HandleInnerEvent for AsClient<'_> {
154155
peer,
155156
error,
156157
request_id,
158+
..
157159
} => {
158160
tracing::debug!(
159161
%peer,

protocols/autonat/src/v1/behaviour/as_server.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ impl HandleInnerEvent for AsServer<'_> {
107107
request,
108108
channel,
109109
},
110+
..
110111
} => {
111112
let probe_id = self.probe_id.next();
112113
if !self.connected.contains_key(&peer) {
@@ -183,6 +184,7 @@ impl HandleInnerEvent for AsServer<'_> {
183184
peer,
184185
error,
185186
request_id,
187+
..
186188
} => {
187189
tracing::debug!(
188190
%peer,

protocols/rendezvous/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.15.1
2+
3+
- Update to `libp2p-request-response` `v0.28.0`.
4+
15
## 0.15.0
26

37
<!-- Update to libp2p-swarm v0.45.0 -->

protocols/rendezvous/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-rendezvous"
33
edition = "2021"
44
rust-version = { workspace = true }
55
description = "Rendezvous protocol for libp2p"
6-
version = "0.15.0"
6+
version = "0.15.1"
77
authors = ["The COMIT guys <[email protected]>"]
88
license = "MIT"
99
repository = "https://github.com/libp2p/rust-libp2p"

protocols/rendezvous/src/server.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ impl NetworkBehaviour for Behaviour {
183183
libp2p_request_response::Message::Request {
184184
request, channel, ..
185185
},
186+
..
186187
}) => {
187188
if let Some((event, response)) =
188189
handle_request(peer_id, request, &mut self.registrations)
@@ -202,6 +203,7 @@ impl NetworkBehaviour for Behaviour {
202203
peer,
203204
request_id,
204205
error,
206+
..
205207
}) => {
206208
tracing::warn!(
207209
%peer,
@@ -217,6 +219,7 @@ impl NetworkBehaviour for Behaviour {
217219
| ToSwarm::GenerateEvent(libp2p_request_response::Event::Message {
218220
peer: _,
219221
message: libp2p_request_response::Message::Response { .. },
222+
..
220223
})
221224
| ToSwarm::GenerateEvent(libp2p_request_response::Event::OutboundFailure {
222225
..

protocols/request-response/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.28.0
2+
3+
- Add connection id to the events emitted by a request-response `Behaviour`.
4+
See [PR 5719](https://github.com/libp2p/rust-libp2p/pull/5719).
5+
16
## 0.27.1
27

38
- Deprecate `void` crate.

0 commit comments

Comments
 (0)