From 830528bf1590dd880cfb8e61ea9bbdc89c3dae8c Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sat, 11 Mar 2023 11:12:43 +0100 Subject: [PATCH 1/8] Deprecate features instead of removing them --- Cargo.lock | 2 ++ interop-tests/Cargo.toml | 4 +++- interop-tests/src/bin/ping.rs | 4 +++- libp2p/CHANGELOG.md | 6 ++++++ libp2p/src/lib.rs | 12 ++++++++---- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce1fd20a73b..f43fd713d60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1992,6 +1992,8 @@ dependencies = [ "env_logger 0.10.0", "futures", "libp2p", + "libp2p-quic", + "libp2p-webrtc", "log", "rand 0.8.5", "redis", diff --git a/interop-tests/Cargo.toml b/interop-tests/Cargo.toml index 62efe2cf54e..19c6d936f22 100644 --- a/interop-tests/Cargo.toml +++ b/interop-tests/Cargo.toml @@ -10,7 +10,9 @@ anyhow = "1" either = "1.8.0" env_logger = "0.10.0" futures = "0.3.26" -libp2p = { path = "../libp2p", features = ["websocket", "quic", "mplex", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros", "webrtc"] } +libp2p = { path = "../libp2p", features = ["websocket", "mplex", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros"] } +libp2p-quic = { path = "../transports/quic" } +libp2p-webrtc = { path = "../transports/webrtc" } log = "0.4" rand = "0.8.5" redis = { version = "0.22.1", default-features = false, features = ["tokio-comp"] } diff --git a/interop-tests/src/bin/ping.rs b/interop-tests/src/bin/ping.rs index 113f3bea50f..e53e8ce0609 100644 --- a/interop-tests/src/bin/ping.rs +++ b/interop-tests/src/bin/ping.rs @@ -13,9 +13,11 @@ use libp2p::swarm::{keep_alive, NetworkBehaviour, SwarmEvent}; use libp2p::tls::TlsStream; use libp2p::websocket::WsConfig; use libp2p::{ - identity, mplex, noise, ping, quic, tcp, tls, webrtc, yamux, InboundUpgradeExt, Multiaddr, + identity, mplex, noise, ping, tcp, tls, yamux, InboundUpgradeExt, Multiaddr, OutboundUpgradeExt, PeerId, Swarm, Transport as _, }; +use libp2p_webrtc as webrtc; +use libp2p_quic as quic; use redis::AsyncCommands; #[tokio::main] diff --git a/libp2p/CHANGELOG.md b/libp2p/CHANGELOG.md index 49c4f1f5574..a563442dc70 100644 --- a/libp2p/CHANGELOG.md +++ b/libp2p/CHANGELOG.md @@ -1,6 +1,12 @@ # 0.51.1 [unreleased] - Depend on `libp2p-tls` `v0.1.0`. +- Deprecate the `quic` and `webrtc` feature. + These two crates are only in alpha state. + To properly communicate this to users, we want them to add the dependency directly which makes the `alpha` version visible. + See [PR 3580]. + +[PR 3580]: https://github.com/libp2p/rust-libp2p/pull/3580 # 0.51.0 diff --git a/libp2p/src/lib.rs b/libp2p/src/lib.rs index 1055a726cea..acf2579ac31 100644 --- a/libp2p/src/lib.rs +++ b/libp2p/src/lib.rs @@ -95,8 +95,10 @@ pub use libp2p_plaintext as plaintext; pub use libp2p_pnet as pnet; #[cfg(feature = "quic")] #[cfg(not(target_arch = "wasm32"))] -#[doc(inline)] -pub use libp2p_quic as quic; +#[deprecated(note = "`quic` is only in alpha status. Please depend on `libp2p-quic` directly and don't ues the `quic` feature of `libp2p`.")] +pub mod quic { + pub use libp2p_quic::*; +} #[cfg(feature = "relay")] #[doc(inline)] pub use libp2p_relay as relay; @@ -129,8 +131,10 @@ pub use libp2p_wasm_ext as wasm_ext; #[cfg(feature = "webrtc")] #[cfg_attr(docsrs, doc(cfg(feature = "webrtc")))] #[cfg(not(target_arch = "wasm32"))] -#[doc(inline)] -pub use libp2p_webrtc as webrtc; +#[deprecated(note = "`webrtc` is only in alpha status. Please depend on `libp2p-webrtc` directly and don't ues the `webrtc` feature of `libp2p`.")] +pub mod webrtc { + pub use libp2p_webrtc::*; +} #[cfg(feature = "websocket")] #[cfg(not(target_arch = "wasm32"))] #[doc(inline)] From 54585d33d1bdaa714fb201e80a6fda9d8f5a6153 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sat, 11 Mar 2023 11:14:23 +0100 Subject: [PATCH 2/8] Fmt --- interop-tests/src/bin/ping.rs | 2 +- libp2p/src/lib.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/interop-tests/src/bin/ping.rs b/interop-tests/src/bin/ping.rs index e53e8ce0609..4abbe48aa95 100644 --- a/interop-tests/src/bin/ping.rs +++ b/interop-tests/src/bin/ping.rs @@ -16,8 +16,8 @@ use libp2p::{ identity, mplex, noise, ping, tcp, tls, yamux, InboundUpgradeExt, Multiaddr, OutboundUpgradeExt, PeerId, Swarm, Transport as _, }; -use libp2p_webrtc as webrtc; use libp2p_quic as quic; +use libp2p_webrtc as webrtc; use redis::AsyncCommands; #[tokio::main] diff --git a/libp2p/src/lib.rs b/libp2p/src/lib.rs index acf2579ac31..ec7d875ad5e 100644 --- a/libp2p/src/lib.rs +++ b/libp2p/src/lib.rs @@ -95,7 +95,9 @@ pub use libp2p_plaintext as plaintext; pub use libp2p_pnet as pnet; #[cfg(feature = "quic")] #[cfg(not(target_arch = "wasm32"))] -#[deprecated(note = "`quic` is only in alpha status. Please depend on `libp2p-quic` directly and don't ues the `quic` feature of `libp2p`.")] +#[deprecated( + note = "`quic` is only in alpha status. Please depend on `libp2p-quic` directly and don't ues the `quic` feature of `libp2p`." +)] pub mod quic { pub use libp2p_quic::*; } @@ -131,7 +133,9 @@ pub use libp2p_wasm_ext as wasm_ext; #[cfg(feature = "webrtc")] #[cfg_attr(docsrs, doc(cfg(feature = "webrtc")))] #[cfg(not(target_arch = "wasm32"))] -#[deprecated(note = "`webrtc` is only in alpha status. Please depend on `libp2p-webrtc` directly and don't ues the `webrtc` feature of `libp2p`.")] +#[deprecated( + note = "`webrtc` is only in alpha status. Please depend on `libp2p-webrtc` directly and don't ues the `webrtc` feature of `libp2p`." +)] pub mod webrtc { pub use libp2p_webrtc::*; } From fab4c69cf49f2f25c8fcf52215264d76b161531b Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sat, 11 Mar 2023 11:15:27 +0100 Subject: [PATCH 3/8] Add pinning recommendation --- libp2p/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/libp2p/CHANGELOG.md b/libp2p/CHANGELOG.md index a563442dc70..f04f8cf479c 100644 --- a/libp2p/CHANGELOG.md +++ b/libp2p/CHANGELOG.md @@ -4,6 +4,7 @@ - Deprecate the `quic` and `webrtc` feature. These two crates are only in alpha state. To properly communicate this to users, we want them to add the dependency directly which makes the `alpha` version visible. + It is recommended to pin the versions of `libp2p-quic` and `libp2p-webrtc` using `=`. See [PR 3580]. [PR 3580]: https://github.com/libp2p/rust-libp2p/pull/3580 From fcbf1445e8a826d8c151bac33e4d71cdff8d5e6c Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sat, 11 Mar 2023 17:05:14 +0100 Subject: [PATCH 4/8] Activate tokio features --- interop-tests/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interop-tests/Cargo.toml b/interop-tests/Cargo.toml index 19c6d936f22..d4ac4305f75 100644 --- a/interop-tests/Cargo.toml +++ b/interop-tests/Cargo.toml @@ -11,8 +11,8 @@ either = "1.8.0" env_logger = "0.10.0" futures = "0.3.26" libp2p = { path = "../libp2p", features = ["websocket", "mplex", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros"] } -libp2p-quic = { path = "../transports/quic" } -libp2p-webrtc = { path = "../transports/webrtc" } +libp2p-quic = { path = "../transports/quic", features = ["tokio"] } +libp2p-webrtc = { path = "../transports/webrtc", features = ["tokio"] } log = "0.4" rand = "0.8.5" redis = { version = "0.22.1", default-features = false, features = ["tokio-comp"] } From dae8e99e829481fb0760a5b0227b8200bb3c58e0 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 15 Mar 2023 04:05:27 +1100 Subject: [PATCH 5/8] Update libp2p/CHANGELOG.md Co-authored-by: Max Inden --- libp2p/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/libp2p/CHANGELOG.md b/libp2p/CHANGELOG.md index 3adbf5851c1..6dd0b56e628 100644 --- a/libp2p/CHANGELOG.md +++ b/libp2p/CHANGELOG.md @@ -4,7 +4,6 @@ - Deprecate the `quic` and `webrtc` feature. These two crates are only in alpha state. To properly communicate this to users, we want them to add the dependency directly which makes the `alpha` version visible. - It is recommended to pin the versions of `libp2p-quic` and `libp2p-webrtc` using `=`. See [PR 3580]. [PR 3580]: https://github.com/libp2p/rust-libp2p/pull/3580 From 3191b6d6da5ebabb588b41fa017f7cdcb1f9c06f Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 15 Mar 2023 22:35:58 +0100 Subject: [PATCH 6/8] Fix fmt --- interop-tests/src/bin/ping.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interop-tests/src/bin/ping.rs b/interop-tests/src/bin/ping.rs index 05576d7501a..25d4459d0fa 100644 --- a/interop-tests/src/bin/ping.rs +++ b/interop-tests/src/bin/ping.rs @@ -13,8 +13,8 @@ use libp2p::swarm::{keep_alive, NetworkBehaviour, SwarmEvent}; use libp2p::tls::TlsStream; use libp2p::websocket::WsConfig; use libp2p::{ - identity, mplex, noise, ping, swarm::SwarmBuilder, tcp, tls, yamux, - InboundUpgradeExt, Multiaddr, OutboundUpgradeExt, PeerId, Transport as _, + identity, mplex, noise, ping, swarm::SwarmBuilder, tcp, tls, yamux, InboundUpgradeExt, + Multiaddr, OutboundUpgradeExt, PeerId, Transport as _, }; use libp2p_quic as quic; use libp2p_webrtc as webrtc; From 058f04c173dcd906cb7067b580cc22718cd6e016 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 15 Mar 2023 22:37:10 +0100 Subject: [PATCH 7/8] Bump version and move changelog entry --- libp2p/CHANGELOG.md | 7 +++++-- libp2p/Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libp2p/CHANGELOG.md b/libp2p/CHANGELOG.md index 6dd0b56e628..dd739f7e0b0 100644 --- a/libp2p/CHANGELOG.md +++ b/libp2p/CHANGELOG.md @@ -1,6 +1,5 @@ -# 0.51.1 +# 0.52.2 - unreleased -- Depend on `libp2p-tls` `v0.1.0`. - Deprecate the `quic` and `webrtc` feature. These two crates are only in alpha state. To properly communicate this to users, we want them to add the dependency directly which makes the `alpha` version visible. @@ -8,6 +7,10 @@ [PR 3580]: https://github.com/libp2p/rust-libp2p/pull/3580 +# 0.51.1 + +- Depend on `libp2p-tls` `v0.1.0`. + - Introduce `ed25519` feature. For backwards-compatibility, the `ed25519` identity keys are still available without activating this feature. However, going forward, you should explicitly activate it to avoid compile errors going forward. diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index 83e97d1dbd2..6d6f8180b6a 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p" edition = "2021" rust-version = "1.65.0" description = "Peer-to-peer networking library" -version = "0.51.1" +version = "0.51.2" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" From 3e63e4a1c82b223dfa94ffdebda9a6bebd04159f Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 21 Mar 2023 15:10:32 +0100 Subject: [PATCH 8/8] Update lockfile --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 28e0639d493..7f19e2d9a46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2145,7 +2145,7 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "libp2p" -version = "0.51.1" +version = "0.51.2" dependencies = [ "async-std", "async-trait",