Skip to content

Commit 5906140

Browse files
protocols/kad: Remove deprecated set_protocol_name() (#2866)
1 parent 72bade1 commit 5906140

File tree

8 files changed

+20
-22
lines changed

8 files changed

+20
-22
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747

4848
- Update to [`libp2p-tcp` `v0.37.0`](transports/tcp/CHANGELOG.md#0370).
4949

50+
- Update to [`libp2p-metrics` `v0.10.0`](misc/metrics/CHANGELOG.md#0100).
51+
52+
- Update to [`libp2p-kad` `v0.41.0`](protocols/kad/CHANGELOG.md#0410).
53+
5054
# 0.48.0
5155

5256
- Update to [`libp2p-core` `v0.36.0`](core/CHANGELOG.md#0360).

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ libp2p-core = { version = "0.36.0", path = "core", default-features = false }
8585
libp2p-dcutr = { version = "0.6.0", path = "protocols/dcutr", optional = true }
8686
libp2p-floodsub = { version = "0.39.0", path = "protocols/floodsub", optional = true }
8787
libp2p-identify = { version = "0.39.0", path = "protocols/identify", optional = true }
88-
libp2p-kad = { version = "0.40.0", path = "protocols/kad", optional = true }
89-
libp2p-metrics = { version = "0.9.0", path = "misc/metrics", optional = true }
88+
libp2p-kad = { version = "0.41.0", path = "protocols/kad", optional = true }
89+
libp2p-metrics = { version = "0.10.0", path = "misc/metrics", optional = true }
9090
libp2p-mplex = { version = "0.36.0", path = "muxers/mplex", optional = true }
9191
libp2p-noise = { version = "0.39.0", path = "transports/noise", optional = true }
9292
libp2p-ping = { version = "0.39.0", path = "protocols/ping", optional = true }

misc/metrics/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.10.0 [unreleased]
2+
3+
- Update to `libp2p-kad` `v0.41.0`.
4+
15
# 0.9.0
26

37
- Update to `libp2p-swarm` `v0.39.0`.

misc/metrics/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-metrics"
33
edition = "2021"
44
rust-version = "1.56.1"
55
description = "Metrics for libp2p"
6-
version = "0.9.0"
6+
version = "0.10.0"
77
authors = ["Max Inden <[email protected]>"]
88
license = "MIT"
99
repository = "https://github.com/libp2p/rust-libp2p"
@@ -22,7 +22,7 @@ dcutr = ["libp2p-dcutr"]
2222
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
2323
libp2p-dcutr = { version = "0.6.0", path = "../../protocols/dcutr", optional = true }
2424
libp2p-identify = { version = "0.39.0", path = "../../protocols/identify", optional = true }
25-
libp2p-kad = { version = "0.40.0", path = "../../protocols/kad", optional = true }
25+
libp2p-kad = { version = "0.41.0", path = "../../protocols/kad", optional = true }
2626
libp2p-ping = { version = "0.39.0", path = "../../protocols/ping", optional = true }
2727
libp2p-relay = { version = "0.12.0", path = "../../protocols/relay", optional = true }
2828
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }

protocols/kad/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 0.41.0 [unreleased]
2+
3+
- Remove deprecated `set_protocol_name()` from `KademliaConfig` & `KademliaProtocolConfig`.
4+
Use `set_protocol_names()` instead. See [PR 2866].
5+
6+
[PR 2866]: https://github.com/libp2p/rust-libp2p/pull/2866
7+
18
# 0.40.0
29

310
- Add support for multiple protocol names. Update `Kademlia`, `KademliaConfig`,

protocols/kad/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-kad"
33
edition = "2021"
44
rust-version = "1.56.1"
55
description = "Kademlia protocol for libp2p"
6-
version = "0.40.0"
6+
version = "0.41.0"
77
authors = ["Parity Technologies <[email protected]>"]
88
license = "MIT"
99
repository = "https://github.com/libp2p/rust-libp2p"

protocols/kad/src/behaviour.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,6 @@ impl KademliaConfig {
228228
self
229229
}
230230

231-
/// Sets a custom protocol name.
232-
///
233-
/// Kademlia nodes only communicate with other nodes using the same protocol
234-
/// name. Using a custom name therefore allows to segregate the DHT from
235-
/// others, if that is desired.
236-
#[deprecated(since = "0.40.0", note = "use `set_protocol_names()` instead")]
237-
pub fn set_protocol_name(&mut self, name: impl Into<Cow<'static, [u8]>>) -> &mut Self {
238-
self.set_protocol_names(std::iter::once(name.into()).collect())
239-
}
240-
241231
/// Sets the timeout for a single query.
242232
///
243233
/// > **Note**: A single query usually comprises at least as many requests

protocols/kad/src/protocol.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,6 @@ impl KademliaProtocolConfig {
159159
self.protocol_names = names;
160160
}
161161

162-
/// Sets single protocol name used on the wire. Can be used to create incompatibilities
163-
/// between networks on purpose.
164-
#[deprecated(since = "0.40.0", note = "use `set_protocol_names()` instead")]
165-
pub fn set_protocol_name(&mut self, name: impl Into<Cow<'static, [u8]>>) {
166-
self.set_protocol_names(std::iter::once(name.into()).collect());
167-
}
168-
169162
/// Modifies the maximum allowed size of a single Kademlia packet.
170163
pub fn set_max_packet_size(&mut self, size: usize) {
171164
self.max_packet_size = size;

0 commit comments

Comments
 (0)