Skip to content

Commit ad9a1b2

Browse files
authored
fix(kad): Remove no longer constructed GetRecordError::QuorumFailed
It was left dangling after `Quorum` was removed on #2712. See also #6044 for more info on the context Pull-Request: #6106.
1 parent e6b0e34 commit ad9a1b2

File tree

6 files changed

+8
-15
lines changed

6 files changed

+8
-15
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ libp2p-floodsub = { version = "0.47.0", path = "protocols/floodsub" }
8585
libp2p-gossipsub = { version = "0.50.0", path = "protocols/gossipsub" }
8686
libp2p-identify = { version = "0.47.0", path = "protocols/identify" }
8787
libp2p-identity = { version = "0.2.12" }
88-
libp2p-kad = { version = "0.48.1", path = "protocols/kad" }
88+
libp2p-kad = { version = "0.49.0", path = "protocols/kad" }
8989
libp2p-mdns = { version = "0.48.0", path = "protocols/mdns" }
9090
libp2p-memory-connection-limits = { version = "0.5.0", path = "misc/memory-connection-limits" }
9191
libp2p-metrics = { version = "0.17.0", path = "misc/metrics" }

misc/metrics/src/kad.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ struct GetRecordResult {
318318
#[derive(EncodeLabelValue, Hash, Clone, Eq, PartialEq, Debug)]
319319
enum GetRecordError {
320320
NotFound,
321-
QuorumFailed,
322321
Timeout,
323322
}
324323

@@ -328,9 +327,6 @@ impl From<&libp2p_kad::GetRecordError> for GetRecordResult {
328327
libp2p_kad::GetRecordError::NotFound { .. } => GetRecordResult {
329328
error: GetRecordError::NotFound,
330329
},
331-
libp2p_kad::GetRecordError::QuorumFailed { .. } => GetRecordResult {
332-
error: GetRecordError::QuorumFailed,
333-
},
334330
libp2p_kad::GetRecordError::Timeout { .. } => GetRecordResult {
335331
error: GetRecordError::Timeout,
336332
},

protocols/kad/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.49.0
2+
3+
- Remove no longer constructed GetRecordError::QuorumFailed.
4+
See [PR 6106](https://github.com/libp2p/rust-libp2p/pull/6106)
5+
16
## 0.48.1
27

38
- Implement `Copy` for `QueryStats` and `ProgressStep`

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.workspace = true
44
rust-version = { workspace = true }
55
description = "Kademlia protocol for libp2p"
6-
version = "0.48.1"
6+
version = "0.49.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 & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,12 +2951,6 @@ pub enum GetRecordError {
29512951
key: record::Key,
29522952
closest_peers: Vec<PeerId>,
29532953
},
2954-
#[error("the quorum failed; needed {quorum} peers")]
2955-
QuorumFailed {
2956-
key: record::Key,
2957-
records: Vec<PeerRecord>,
2958-
quorum: NonZeroUsize,
2959-
},
29602954
#[error("the request timed out")]
29612955
Timeout { key: record::Key },
29622956
}
@@ -2965,7 +2959,6 @@ impl GetRecordError {
29652959
/// Gets the key of the record for which the operation failed.
29662960
pub fn key(&self) -> &record::Key {
29672961
match self {
2968-
GetRecordError::QuorumFailed { key, .. } => key,
29692962
GetRecordError::Timeout { key, .. } => key,
29702963
GetRecordError::NotFound { key, .. } => key,
29712964
}
@@ -2975,7 +2968,6 @@ impl GetRecordError {
29752968
/// consuming the error.
29762969
pub fn into_key(self) -> record::Key {
29772970
match self {
2978-
GetRecordError::QuorumFailed { key, .. } => key,
29792971
GetRecordError::Timeout { key, .. } => key,
29802972
GetRecordError::NotFound { key, .. } => key,
29812973
}

0 commit comments

Comments
 (0)