From 4fbae8bc416990f6460a8f127b545367bb50092e Mon Sep 17 00:00:00 2001 From: arsenron <33022971+arsenron@users.noreply.github.com> Date: Mon, 31 Jul 2023 17:23:45 +0300 Subject: [PATCH] feat(kad): implement common traits on `RoutingUpdate` A few weeks ago when I was debugging my wrong setup with kademlia, I could not conveniently debug `RoutingUpdate` after adding an address to the DHT. It would be nice to have a few derivable traits on a public enum. Pull-Request: #4270. --- Cargo.lock | 2 +- Cargo.toml | 2 +- protocols/kad/CHANGELOG.md | 9 ++++++++- protocols/kad/Cargo.toml | 2 +- protocols/kad/src/behaviour.rs | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77423fe28a0..73de9f1a314 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2825,7 +2825,7 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.44.3" +version = "0.44.4" dependencies = [ "arrayvec", "async-std", diff --git a/Cargo.toml b/Cargo.toml index d2d8b63552f..cd31cfd4ab4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,7 +74,7 @@ libp2p-floodsub = { version = "0.43.0", path = "protocols/floodsub" } libp2p-gossipsub = { version = "0.45.0", path = "protocols/gossipsub" } libp2p-identify = { version = "0.43.0", path = "protocols/identify" } libp2p-identity = { version = "0.2.2" } -libp2p-kad = { version = "0.44.3", path = "protocols/kad" } +libp2p-kad = { version = "0.44.4", path = "protocols/kad" } libp2p-mdns = { version = "0.44.0", path = "protocols/mdns" } libp2p-metrics = { version = "0.13.1", path = "misc/metrics" } libp2p-mplex = { version = "0.40.0", path = "muxers/mplex" } diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md index 5389bda4592..c729e5ea0f9 100644 --- a/protocols/kad/CHANGELOG.md +++ b/protocols/kad/CHANGELOG.md @@ -1,4 +1,11 @@ -## 0.44.3 - unreleased +## 0.44.4 - unreleased + +- Implement common traits on `RoutingUpdate`. + See [PR 4270]. + +[PR 4270]: https://github.com/libp2p/rust-libp2p/pull/4270 + +## 0.44.3 - Prevent simultaneous dials to peers. See [PR 4224]. diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index 52a5ba4e188..80e8946f871 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-kad" edition = "2021" rust-version = "1.65.0" description = "Kademlia protocol for libp2p" -version = "0.44.3" +version = "0.44.4" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/protocols/kad/src/behaviour.rs b/protocols/kad/src/behaviour.rs index e3651fa2b3d..c0a11a100ec 100644 --- a/protocols/kad/src/behaviour.rs +++ b/protocols/kad/src/behaviour.rs @@ -3289,6 +3289,7 @@ impl fmt::Display for NoKnownPeers { impl std::error::Error for NoKnownPeers {} /// The possible outcomes of [`Kademlia::add_address`]. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum RoutingUpdate { /// The given peer and address has been added to the routing /// table.