diff --git a/Cargo.lock b/Cargo.lock index dcd4a381cac..f29cac489ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -660,7 +660,6 @@ dependencies = [ "env_logger 0.10.0", "futures", "libp2p", - "libp2p-mplex", "libp2p-quic", ] @@ -1143,7 +1142,6 @@ dependencies = [ "futures", "futures-timer", "libp2p", - "libp2p-mplex", "log", ] @@ -1257,7 +1255,6 @@ dependencies = [ "env_logger 0.10.0", "futures", "libp2p", - "libp2p-mplex", "multiaddr", ] @@ -1440,7 +1437,6 @@ dependencies = [ "env_logger 0.10.0", "futures", "libp2p", - "libp2p-mplex", "multiaddr", ] @@ -1902,7 +1898,6 @@ dependencies = [ "async-trait", "futures", "libp2p", - "libp2p-mplex", ] [[package]] @@ -2055,7 +2050,6 @@ dependencies = [ "env_logger 0.10.0", "futures", "libp2p", - "libp2p-mplex", ] [[package]] @@ -2068,7 +2062,6 @@ dependencies = [ "env_logger 0.10.0", "futures", "libp2p", - "libp2p-mplex", "multiaddr", ] @@ -3608,7 +3601,6 @@ dependencies = [ "async-trait", "futures", "libp2p", - "libp2p-mplex", "multiaddr", ] @@ -4081,7 +4073,6 @@ dependencies = [ "env_logger 0.10.0", "futures", "libp2p", - "libp2p-mplex", "log", "tokio", ] diff --git a/examples/chat-example/Cargo.toml b/examples/chat-example/Cargo.toml index 363c59fc05f..530e52c6fb4 100644 --- a/examples/chat-example/Cargo.toml +++ b/examples/chat-example/Cargo.toml @@ -10,14 +10,5 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10.0" futures = "0.3.27" -libp2p = { path = "../../libp2p", features = [ - "async-std", - "gossipsub", - "mdns", - "noise", - "macros", - "tcp", - "yamux" -] } -libp2p-quic = { path = "../../transports/quic", features = ["async-std"] } -libp2p-mplex = { path = "../../muxers/mplex" } +libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux"] } +libp2p-quic = { path = "../../transports/quic", features = ["async-std"] } \ No newline at end of file diff --git a/examples/dcutr/Cargo.toml b/examples/dcutr/Cargo.toml index 723552da994..f475960b8ef 100644 --- a/examples/dcutr/Cargo.toml +++ b/examples/dcutr/Cargo.toml @@ -10,19 +10,5 @@ clap = { version = "4.1.11", features = ["derive"] } env_logger = "0.10.0" futures = "0.3.27" futures-timer = "3.0" -libp2p = { path = "../../libp2p", features = [ - "async-std", - "dns", - "dcutr", - "identify", - "macros", - "noise", - "ping", - "relay", - "rendezvous", - "tcp", - "tokio", - "yamux" -] } -libp2p-mplex = { path = "../../muxers/mplex" } -log = "0.4" +libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] } +log = "0.4" \ No newline at end of file diff --git a/examples/distributed-key-value-store/Cargo.toml b/examples/distributed-key-value-store/Cargo.toml index b867768e22f..b239175d5d9 100644 --- a/examples/distributed-key-value-store/Cargo.toml +++ b/examples/distributed-key-value-store/Cargo.toml @@ -10,16 +10,5 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10" futures = "0.3.27" -libp2p = { path = "../../libp2p", features = [ - "async-std", - "dns", - "kad", - "mdns", - "noise", - "macros", - "tcp", - "websocket", - "yamux" -] } -libp2p-mplex = { path = "../../muxers/mplex" } -multiaddr = { version = "0.17.0" } +libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mdns", "noise", "macros", "tcp", "websocket", "yamux"] } +multiaddr = { version = "0.17.0" } \ No newline at end of file diff --git a/examples/file-sharing/Cargo.toml b/examples/file-sharing/Cargo.toml index 6e82837ecab..7511500a90e 100644 --- a/examples/file-sharing/Cargo.toml +++ b/examples/file-sharing/Cargo.toml @@ -12,16 +12,5 @@ clap = { version = "4.1.11", features = ["derive"] } either = "1.8" env_logger = "0.10" futures = "0.3.27" -libp2p = { path = "../../libp2p", features = [ - "async-std", - "dns", - "kad", - "noise", - "macros", - "request-response", - "tcp", - "websocket", - "yamux" -] } -libp2p-mplex = { path = "../../muxers/mplex" } -multiaddr = { version = "0.17.0" } +libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] } +multiaddr = { version = "0.17.0" } \ No newline at end of file diff --git a/examples/identify/Cargo.toml b/examples/identify/Cargo.toml index f9795b95a81..d962db90018 100644 --- a/examples/identify/Cargo.toml +++ b/examples/identify/Cargo.toml @@ -9,18 +9,4 @@ license = "MIT" async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" futures = "0.3.27" -libp2p = { path = "../../libp2p", features = [ - "async-std", - "dns", - "dcutr", - "identify", - "macros", - "noise", - "ping", - "relay", - "rendezvous", - "tcp", - "tokio", - "yamux" -] } -libp2p-mplex = { path = "../../muxers/mplex" } +libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] } \ No newline at end of file diff --git a/examples/ipfs-kad/Cargo.toml b/examples/ipfs-kad/Cargo.toml index b02970b4a66..ccbd1061d13 100644 --- a/examples/ipfs-kad/Cargo.toml +++ b/examples/ipfs-kad/Cargo.toml @@ -10,13 +10,4 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10" futures = "0.3.27" -libp2p = { path = "../../libp2p", features = [ - "async-std", - "dns", - "kad", - "noise", - "tcp", - "websocket", - "yamux" -] } -libp2p-mplex = { path = "../../muxers/mplex" } +libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "noise", "tcp", "websocket", "yamux"] } \ No newline at end of file diff --git a/examples/ipfs-private/Cargo.toml b/examples/ipfs-private/Cargo.toml index 6a98bcfba0b..b30f4e443c5 100644 --- a/examples/ipfs-private/Cargo.toml +++ b/examples/ipfs-private/Cargo.toml @@ -11,19 +11,5 @@ async-trait = "0.1" either = "1.8" env_logger = "0.10" futures = "0.3.27" -libp2p = { path = "../../libp2p", features = [ - "async-std", - "gossipsub", - "dns", - "identify", - "kad", - "macros", - "noise", - "ping", - "pnet", - "tcp", - "websocket", - "yamux" -] } -libp2p-mplex = { path = "../../muxers/mplex" } -multiaddr = { version = "0.17.0" } +libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "dns", "identify", "kad", "macros", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] } +multiaddr = { version = "0.17.0" } \ No newline at end of file diff --git a/examples/ping-example/Cargo.toml b/examples/ping-example/Cargo.toml index 1a18b24c74f..ffa1635f37c 100644 --- a/examples/ping-example/Cargo.toml +++ b/examples/ping-example/Cargo.toml @@ -9,15 +9,5 @@ license = "MIT" async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" futures = "0.3.27" -libp2p = { path = "../../libp2p", features = [ - "async-std", - "dns", - "macros", - "noise", - "ping", - "tcp", - "websocket", - "yamux" -] } -libp2p-mplex = { path = "../../muxers/mplex" } -multiaddr = { version = "0.17.0" } +libp2p = { path = "../../libp2p", features = ["async-std", "dns", "macros", "noise", "ping", "tcp", "websocket", "yamux"] } +multiaddr = { version = "0.17.0" } \ No newline at end of file diff --git a/examples/relay-server/Cargo.toml b/examples/relay-server/Cargo.toml index f42753ad977..792c92847f0 100644 --- a/examples/relay-server/Cargo.toml +++ b/examples/relay-server/Cargo.toml @@ -11,4 +11,4 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10.0" futures = "0.3.27" -libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay"] } +libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay"] } \ No newline at end of file diff --git a/examples/rendezvous/Cargo.toml b/examples/rendezvous/Cargo.toml index 25ee1094cfc..a9c38ba5960 100644 --- a/examples/rendezvous/Cargo.toml +++ b/examples/rendezvous/Cargo.toml @@ -10,17 +10,6 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10.0" futures = "0.3.27" -libp2p = { path = "../../libp2p", features = [ - "async-std", - "identify", - "macros", - "noise", - "ping", - "rendezvous", - "tcp", - "tokio", - "yamux" -] } -libp2p-mplex = { path = "../../muxers/mplex" } +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"] } +tokio = { version = "1.25", features = [ "rt-multi-thread", "macros", "time" ] } \ No newline at end of file diff --git a/interop-tests/Cargo.toml b/interop-tests/Cargo.toml index 74cfb84f77e..f787dff0bce 100644 --- a/interop-tests/Cargo.toml +++ b/interop-tests/Cargo.toml @@ -10,24 +10,12 @@ anyhow = "1" either = "1.8.0" env_logger = "0.10.0" futures = "0.3.27" -libp2p = { path = "../libp2p", features = [ - "websocket", - "yamux", - "tcp", - "tokio", - "ping", - "noise", - "tls", - "dns", - "rsa", - "macros" -] } +libp2p = { path = "../libp2p", features = ["websocket", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros"] } +# libp2p = { path = "../libp2p", features = ["websocket", "mplex", "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" -] } -tokio = { version = "1.24.1", features = ["full"] } +redis = { version = "0.22.1", default-features = false, features = ["tokio-comp"] } +tokio = { version = "1.24.1", features = ["full"] } \ No newline at end of file diff --git a/libp2p/CHANGELOG.md b/libp2p/CHANGELOG.md index 3774477dda0..5c1099b4e12 100644 --- a/libp2p/CHANGELOG.md +++ b/libp2p/CHANGELOG.md @@ -5,6 +5,7 @@ - Deprecate the `mplex` feature. The recommended baseline stream multiplexer is `yamux`. +See [PR 3689]. - Deprecate the `quic` and `webrtc` feature. These two crates are only in alpha state. @@ -14,6 +15,7 @@ The recommended baseline stream multiplexer is `yamux`. - Introduce `libp2p::allow_block_list` module and deprecate `libp2p::Swarm::ban_peer_id`. See [PR 3590]. +[PR 3689]: https://github.com/libp2p/rust-libp2p/pull/3689 [PR 3386]: https://github.com/libp2p/rust-libp2p/pull/3386 [PR 3580]: https://github.com/libp2p/rust-libp2p/pull/3580 [PR 3590]: https://github.com/libp2p/rust-libp2p/pull/3590 diff --git a/libp2p/src/lib.rs b/libp2p/src/lib.rs index 298dae427de..a6e46cb5bdf 100644 --- a/libp2p/src/lib.rs +++ b/libp2p/src/lib.rs @@ -83,7 +83,10 @@ pub use libp2p_mdns as mdns; #[doc(inline)] pub use libp2p_metrics as metrics; #[cfg(feature = "mplex")] -#[deprecated(note = "`mplex` is not recommended anymore. Please use `yamux` instead.")] +// 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::*; } @@ -190,7 +193,8 @@ pub use libp2p_identity::PeerId; ), feature = "websocket", feature = "noise", - feature = "yamux", + feature = "mplex", + feature = "yamux" ))] #[cfg_attr( all( @@ -224,7 +228,7 @@ pub async fn development_transport( .authenticate(noise::NoiseAuthenticated::xx(&keypair).unwrap()) .multiplex(core::upgrade::SelectUpgrade::new( yamux::YamuxConfig::default(), - yamux::YamuxConfig::default(), + mplex::MplexConfig::default(), )) .timeout(std::time::Duration::from_secs(20)) .boxed()) @@ -249,6 +253,7 @@ pub async fn development_transport( ), feature = "websocket", feature = "noise", + feature = "mplex", feature = "yamux" ))] #[cfg_attr( @@ -279,7 +284,7 @@ pub fn tokio_development_transport( .authenticate(noise::NoiseAuthenticated::xx(&keypair).unwrap()) .multiplex(core::upgrade::SelectUpgrade::new( yamux::YamuxConfig::default(), - yamux::YamuxConfig::default(), + mplex::MplexConfig::default(), )) .timeout(std::time::Duration::from_secs(20)) .boxed())