From 4d70aec05a807c3fe54b1387a221f47e4c3ad8d1 Mon Sep 17 00:00:00 2001 From: Dmitry Markin Date: Sat, 3 Sep 2022 10:38:17 +0300 Subject: [PATCH 1/2] protocols/kad: Remove deprecated `set_protocol_name()` --- protocols/kad/CHANGELOG.md | 7 ++++++- protocols/kad/src/behaviour.rs | 10 ---------- protocols/kad/src/protocol.rs | 7 ------- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md index 01778047583..a83f20bcc6a 100644 --- a/protocols/kad/CHANGELOG.md +++ b/protocols/kad/CHANGELOG.md @@ -1,4 +1,9 @@ -# 0.40.0 [unreleased] +# 0.41.0 [unreleased] + +- Remove deprecated `set_protocol_name()` from `KademliaConfig` & `KademliaProtocolConfig`. + Use `set_protocol_names()` instead. + +# 0.40.0 - Add support for multiple protocol names. Update `Kademlia`, `KademliaConfig`, and `KademliaProtocolConfig` accordingly. See [Issue 2837]. See [PR 2846]. diff --git a/protocols/kad/src/behaviour.rs b/protocols/kad/src/behaviour.rs index feba94f550e..b267f87d386 100644 --- a/protocols/kad/src/behaviour.rs +++ b/protocols/kad/src/behaviour.rs @@ -228,16 +228,6 @@ impl KademliaConfig { self } - /// Sets a custom protocol name. - /// - /// Kademlia nodes only communicate with other nodes using the same protocol - /// name. Using a custom name therefore allows to segregate the DHT from - /// others, if that is desired. - #[deprecated(since = "0.40.0", note = "use `set_protocol_names()` instead")] - pub fn set_protocol_name(&mut self, name: impl Into>) -> &mut Self { - self.set_protocol_names(std::iter::once(name.into()).collect()) - } - /// Sets the timeout for a single query. /// /// > **Note**: A single query usually comprises at least as many requests diff --git a/protocols/kad/src/protocol.rs b/protocols/kad/src/protocol.rs index 3c00a5059f2..707edd8fe02 100644 --- a/protocols/kad/src/protocol.rs +++ b/protocols/kad/src/protocol.rs @@ -159,13 +159,6 @@ impl KademliaProtocolConfig { self.protocol_names = names; } - /// Sets single protocol name used on the wire. Can be used to create incompatibilities - /// between networks on purpose. - #[deprecated(since = "0.40.0", note = "use `set_protocol_names()` instead")] - pub fn set_protocol_name(&mut self, name: impl Into>) { - self.set_protocol_names(std::iter::once(name.into()).collect()); - } - /// Modifies the maximum allowed size of a single Kademlia packet. pub fn set_max_packet_size(&mut self, size: usize) { self.max_packet_size = size; From 6c9333ac0bbc4679e45b88cde75cb707b25b3b00 Mon Sep 17 00:00:00 2001 From: Dmitry Markin Date: Sat, 3 Sep 2022 10:46:08 +0300 Subject: [PATCH 2/2] Add PR link --- protocols/kad/CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md index a83f20bcc6a..092b46c4c16 100644 --- a/protocols/kad/CHANGELOG.md +++ b/protocols/kad/CHANGELOG.md @@ -1,7 +1,9 @@ # 0.41.0 [unreleased] - Remove deprecated `set_protocol_name()` from `KademliaConfig` & `KademliaProtocolConfig`. - Use `set_protocol_names()` instead. + Use `set_protocol_names()` instead. See [PR 2866]. + +[PR 2866]: https://github.com/libp2p/rust-libp2p/pull/2866 # 0.40.0