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.
This commit is contained in:
arsenron 2023-07-31 17:23:45 +03:00 committed by GitHub
parent 8ff2cf3a37
commit 23d7d1a247
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 4 deletions

2
Cargo.lock generated
View File

@ -2812,7 +2812,7 @@ dependencies = [
[[package]]
name = "libp2p-kad"
version = "0.44.3"
version = "0.44.4"
dependencies = [
"arrayvec",
"async-std",

View File

@ -73,7 +73,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" }

View File

@ -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].

View File

@ -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 <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"

View File

@ -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.