From 4c8dccd569b6c411c9f41edfb70eee596d69ffac Mon Sep 17 00:00:00 2001 From: Darius Date: Wed, 29 Nov 2023 00:30:21 -0500 Subject: [PATCH 1/2] chore: Derive `PartialOrd` and `Ord` for {Outbound,Inbound}RequestId --- Cargo.lock | 2 +- Cargo.toml | 2 +- protocols/request-response/CHANGELOG.md | 4 ++++ protocols/request-response/Cargo.toml | 2 +- protocols/request-response/src/lib.rs | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 617d54e9b2b..1d7b271aacf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3057,7 +3057,7 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.26.0" +version = "0.26.1" dependencies = [ "anyhow", "async-std", diff --git a/Cargo.toml b/Cargo.toml index 346b316d4dc..e786bb9f907 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,7 +97,7 @@ libp2p-pnet = { version = "0.24.0", path = "transports/pnet" } libp2p-quic = { version = "0.10.1", path = "transports/quic" } libp2p-relay = { version = "0.17.1", path = "protocols/relay" } libp2p-rendezvous = { version = "0.14.0", path = "protocols/rendezvous" } -libp2p-request-response = { version = "0.26.0", path = "protocols/request-response" } +libp2p-request-response = { version = "0.26.1", path = "protocols/request-response" } libp2p-server = { version = "0.12.4", path = "misc/server" } libp2p-swarm = { version = "0.44.0", path = "swarm" } libp2p-swarm-derive = { version = "=0.34.0", path = "swarm-derive" } # `libp2p-swarm-derive` may not be compatible with different `libp2p-swarm` non-breaking releases. E.g. `libp2p-swarm` might introduce a new enum variant `FromSwarm` (which is `#[non-exhaustive]`) in a non-breaking release. Older versions of `libp2p-swarm-derive` would not forward this enum variant within the `NetworkBehaviour` hierarchy. Thus the version pinning is required. diff --git a/protocols/request-response/CHANGELOG.md b/protocols/request-response/CHANGELOG.md index 30fc700da3c..65effe366e2 100644 --- a/protocols/request-response/CHANGELOG.md +++ b/protocols/request-response/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.26.1 - unreleased +- Derive `PartialOrd` and `Ord` for {Outbound,Inbound}RequestId. + See [PR XXXX](https://github.com/libp2p/rust-libp2p/pull/XXXX). + ## 0.26.0 - Remove `request_response::Config::set_connection_keep_alive` in favor of `SwarmBuilder::idle_connection_timeout`. diff --git a/protocols/request-response/Cargo.toml b/protocols/request-response/Cargo.toml index 2c7692fb9b4..6da25e24862 100644 --- a/protocols/request-response/Cargo.toml +++ b/protocols/request-response/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-request-response" edition = "2021" rust-version = { workspace = true } description = "Generic Request/Response Protocols" -version = "0.26.0" +version = "0.26.1" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/protocols/request-response/src/lib.rs b/protocols/request-response/src/lib.rs index 824839ebac8..fc68bd6cf1f 100644 --- a/protocols/request-response/src/lib.rs +++ b/protocols/request-response/src/lib.rs @@ -274,7 +274,7 @@ impl ResponseChannel { /// /// Note: [`InboundRequestId`]'s uniqueness is only guaranteed between /// inbound requests of the same originating [`Behaviour`]. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct InboundRequestId(u64); impl fmt::Display for InboundRequestId { @@ -287,7 +287,7 @@ impl fmt::Display for InboundRequestId { /// /// Note: [`OutboundRequestId`]'s uniqueness is only guaranteed between /// outbound requests of the same originating [`Behaviour`]. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct OutboundRequestId(u64); impl fmt::Display for OutboundRequestId { From 84494f0f396b4b5491346a031d74e1422e95a427 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 30 Nov 2023 12:52:35 +1100 Subject: [PATCH 2/2] Update protocols/request-response/CHANGELOG.md --- protocols/request-response/CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/protocols/request-response/CHANGELOG.md b/protocols/request-response/CHANGELOG.md index 65effe366e2..d53ff479ee2 100644 --- a/protocols/request-response/CHANGELOG.md +++ b/protocols/request-response/CHANGELOG.md @@ -1,6 +1,7 @@ -## 0.26.1 - unreleased -- Derive `PartialOrd` and `Ord` for {Outbound,Inbound}RequestId. - See [PR XXXX](https://github.com/libp2p/rust-libp2p/pull/XXXX). +## 0.26.1 + +- Derive `PartialOrd` and `Ord` for `{Out,In}boundRequestId`. + See [PR 4956](https://github.com/libp2p/rust-libp2p/pull/4956). ## 0.26.0