Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protocols/kad: Remove deprecated set_protocol_name() #2866

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -47,6 +47,10 @@

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

- Update to [`libp2p-metrics` `v0.10.0`](misc/metrics/CHANGELOG.md#0100).

- Update to [`libp2p-kad` `v0.41.0`](protocols/kad/CHANGELOG.md#0410).

# 0.48.0

- Update to [`libp2p-core` `v0.36.0`](core/CHANGELOG.md#0360).
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Expand Up @@ -85,8 +85,8 @@ libp2p-core = { version = "0.36.0", path = "core", default-features = false }
libp2p-dcutr = { version = "0.6.0", path = "protocols/dcutr", optional = true }
libp2p-floodsub = { version = "0.39.0", path = "protocols/floodsub", optional = true }
libp2p-identify = { version = "0.39.0", path = "protocols/identify", optional = true }
libp2p-kad = { version = "0.40.0", path = "protocols/kad", optional = true }
libp2p-metrics = { version = "0.9.0", path = "misc/metrics", optional = true }
libp2p-kad = { version = "0.41.0", path = "protocols/kad", optional = true }
libp2p-metrics = { version = "0.10.0", path = "misc/metrics", optional = true }
libp2p-mplex = { version = "0.36.0", path = "muxers/mplex", optional = true }
libp2p-noise = { version = "0.39.0", path = "transports/noise", optional = true }
libp2p-ping = { version = "0.39.0", path = "protocols/ping", optional = true }
Expand Down
4 changes: 4 additions & 0 deletions misc/metrics/CHANGELOG.md
@@ -1,3 +1,7 @@
# 0.10.0 [unreleased]

- Update to `libp2p-kad` `v0.41.0`.

# 0.9.0

- Update to `libp2p-swarm` `v0.39.0`.
Expand Down
4 changes: 2 additions & 2 deletions misc/metrics/Cargo.toml
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-metrics"
edition = "2021"
rust-version = "1.56.1"
description = "Metrics for libp2p"
version = "0.9.0"
version = "0.10.0"
authors = ["Max Inden <mail@max-inden.de>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -22,7 +22,7 @@ dcutr = ["libp2p-dcutr"]
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
libp2p-dcutr = { version = "0.6.0", path = "../../protocols/dcutr", optional = true }
libp2p-identify = { version = "0.39.0", path = "../../protocols/identify", optional = true }
libp2p-kad = { version = "0.40.0", path = "../../protocols/kad", optional = true }
libp2p-kad = { version = "0.41.0", path = "../../protocols/kad", optional = true }
libp2p-ping = { version = "0.39.0", path = "../../protocols/ping", optional = true }
libp2p-relay = { version = "0.12.0", path = "../../protocols/relay", optional = true }
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
Expand Down
7 changes: 7 additions & 0 deletions protocols/kad/CHANGELOG.md
@@ -1,3 +1,10 @@
# 0.41.0 [unreleased]

- Remove deprecated `set_protocol_name()` from `KademliaConfig` & `KademliaProtocolConfig`.
Use `set_protocol_names()` instead. See [PR 2866].

[PR 2866]: https://github.com/libp2p/rust-libp2p/pull/2866

# 0.40.0

- Add support for multiple protocol names. Update `Kademlia`, `KademliaConfig`,
Expand Down
2 changes: 1 addition & 1 deletion protocols/kad/Cargo.toml
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-kad"
edition = "2021"
rust-version = "1.56.1"
description = "Kademlia protocol for libp2p"
version = "0.40.0"
version = "0.41.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
10 changes: 0 additions & 10 deletions protocols/kad/src/behaviour.rs
Expand Up @@ -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<Cow<'static, [u8]>>) -> &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
Expand Down
7 changes: 0 additions & 7 deletions protocols/kad/src/protocol.rs
Expand Up @@ -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<Cow<'static, [u8]>>) {
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;
Expand Down