mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-21 13:51:33 +00:00
feat(libp2p): deprecate mplex
`mplex` module (no flow control and no streams limit) is deprecated to encourage `yamux` usage. Resolves #3677. Pull-Request: #3689.
This commit is contained in:
3
Cargo.lock
generated
3
Cargo.lock
generated
@ -2081,6 +2081,7 @@ dependencies = [
|
||||
"env_logger 0.10.0",
|
||||
"futures",
|
||||
"libp2p",
|
||||
"libp2p-mplex",
|
||||
"libp2p-quic",
|
||||
"libp2p-webrtc",
|
||||
"log",
|
||||
@ -2228,7 +2229,7 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
|
||||
|
||||
[[package]]
|
||||
name = "libp2p"
|
||||
version = "0.51.2"
|
||||
version = "0.51.3"
|
||||
dependencies = [
|
||||
"async-std",
|
||||
"async-trait",
|
||||
|
@ -10,5 +10,5 @@ async-std = { version = "1.12", features = ["attributes"] }
|
||||
async-trait = "0.1"
|
||||
env_logger = "0.10.0"
|
||||
futures = "0.3.28"
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "mdns", "mplex", "noise", "macros", "tcp", "yamux"] }
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux"] }
|
||||
libp2p-quic = { path = "../../transports/quic", features = ["async-std"] }
|
||||
|
@ -10,5 +10,5 @@ clap = { version = "4.2.1", features = ["derive"] }
|
||||
env_logger = "0.10.0"
|
||||
futures = "0.3.28"
|
||||
futures-timer = "3.0"
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "mplex", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||
log = "0.4"
|
||||
|
@ -10,5 +10,5 @@ async-std = { version = "1.12", features = ["attributes"] }
|
||||
async-trait = "0.1"
|
||||
env_logger = "0.10"
|
||||
futures = "0.3.28"
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mdns", "mplex", "noise", "macros", "tcp", "websocket", "yamux"] }
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mdns", "noise", "macros", "tcp", "websocket", "yamux"] }
|
||||
multiaddr = { version = "0.17.0" }
|
||||
|
@ -12,5 +12,5 @@ clap = { version = "4.2.1", features = ["derive"] }
|
||||
either = "1.8"
|
||||
env_logger = "0.10"
|
||||
futures = "0.3.28"
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mplex", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] }
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] }
|
||||
multiaddr = { version = "0.17.0" }
|
||||
|
@ -9,4 +9,4 @@ license = "MIT"
|
||||
async-std = { version = "1.12", features = ["attributes"] }
|
||||
async-trait = "0.1"
|
||||
futures = "0.3.28"
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "mplex", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||
|
@ -10,4 +10,4 @@ async-std = { version = "1.12", features = ["attributes"] }
|
||||
async-trait = "0.1"
|
||||
env_logger = "0.10"
|
||||
futures = "0.3.28"
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mplex", "noise", "tcp", "websocket", "yamux"] }
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mplex", "noise", "tcp", "websocket", "yamux"] }
|
||||
|
@ -11,5 +11,5 @@ async-trait = "0.1"
|
||||
either = "1.8"
|
||||
env_logger = "0.10"
|
||||
futures = "0.3.28"
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "dns", "identify", "kad", "macros", "mplex", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] }
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "dns", "identify", "kad", "macros", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] }
|
||||
multiaddr = { version = "0.17.0" }
|
||||
|
@ -9,5 +9,5 @@ license = "MIT"
|
||||
async-std = { version = "1.12", features = ["attributes"] }
|
||||
async-trait = "0.1"
|
||||
futures = "0.3.28"
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "macros", "mplex", "noise", "ping", "tcp", "websocket", "yamux"] }
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "macros", "noise", "ping", "tcp", "websocket", "yamux"] }
|
||||
multiaddr = { version = "0.17.0" }
|
||||
|
@ -10,6 +10,6 @@ async-std = { version = "1.12", features = ["attributes"] }
|
||||
async-trait = "0.1"
|
||||
env_logger = "0.10.0"
|
||||
futures = "0.3.28"
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "identify", "macros", "mplex", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||
libp2p = { path = "../../libp2p", features = ["async-std", "identify", "macros", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||
log = "0.4"
|
||||
tokio = { version = "1.25", features = [ "rt-multi-thread", "macros", "time" ] }
|
||||
|
@ -10,9 +10,10 @@ anyhow = "1"
|
||||
either = "1.8.0"
|
||||
env_logger = "0.10.0"
|
||||
futures = "0.3.28"
|
||||
libp2p = { path = "../libp2p", features = ["websocket", "mplex", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros"] }
|
||||
libp2p = { path = "../libp2p", features = ["websocket", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros"] }
|
||||
libp2p-quic = { path = "../transports/quic", features = ["tokio"] }
|
||||
libp2p-webrtc = { path = "../transports/webrtc", features = ["tokio"] }
|
||||
libp2p-mplex = { path = "../muxers/mplex" }
|
||||
log = "0.4"
|
||||
rand = "0.8.5"
|
||||
redis = { version = "0.22.1", default-features = false, features = ["tokio-comp"] }
|
||||
|
@ -13,9 +13,10 @@ 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, noise, ping, swarm::SwarmBuilder, tcp, tls, yamux, InboundUpgradeExt, Multiaddr,
|
||||
OutboundUpgradeExt, PeerId, Transport as _,
|
||||
};
|
||||
use libp2p_mplex as mplex;
|
||||
use libp2p_quic as quic;
|
||||
use libp2p_webrtc as webrtc;
|
||||
use redis::AsyncCommands;
|
||||
|
@ -1,3 +1,11 @@
|
||||
## 0.51.3 - unreleased
|
||||
|
||||
- Deprecate the `mplex` feature.
|
||||
The recommended baseline stream multiplexer is `yamux`.
|
||||
See [PR 3689].
|
||||
|
||||
[PR 3689]: https://github.com/libp2p/rust-libp2p/pull/3689
|
||||
|
||||
## 0.51.2
|
||||
|
||||
- Introduce `libp2p::connection_limits` module.
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p"
|
||||
edition = "2021"
|
||||
rust-version = "1.65.0"
|
||||
description = "Peer-to-peer networking library"
|
||||
version = "0.51.2"
|
||||
version = "0.51.3"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
|
@ -83,8 +83,12 @@ pub use libp2p_mdns as mdns;
|
||||
#[doc(inline)]
|
||||
pub use libp2p_metrics as metrics;
|
||||
#[cfg(feature = "mplex")]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_mplex as mplex;
|
||||
#[deprecated(
|
||||
note = "`mplex` is not recommended anymore. Please use `yamux` instead or depend on `libp2p-mplex` directly if you need it for legacy use cases."
|
||||
)]
|
||||
pub mod mplex {
|
||||
pub use libp2p_mplex::*;
|
||||
}
|
||||
#[cfg(feature = "noise")]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_noise as noise;
|
||||
@ -228,6 +232,7 @@ pub async fn development_transport(
|
||||
.authenticate(noise::NoiseAuthenticated::xx(&keypair).unwrap())
|
||||
.multiplex(core::upgrade::SelectUpgrade::new(
|
||||
yamux::YamuxConfig::default(),
|
||||
#[allow(deprecated)]
|
||||
mplex::MplexConfig::default(),
|
||||
))
|
||||
.timeout(std::time::Duration::from_secs(20))
|
||||
@ -284,6 +289,7 @@ pub fn tokio_development_transport(
|
||||
.authenticate(noise::NoiseAuthenticated::xx(&keypair).unwrap())
|
||||
.multiplex(core::upgrade::SelectUpgrade::new(
|
||||
yamux::YamuxConfig::default(),
|
||||
#[allow(deprecated)]
|
||||
mplex::MplexConfig::default(),
|
||||
))
|
||||
.timeout(std::time::Duration::from_secs(20))
|
||||
|
Reference in New Issue
Block a user