Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
deprecate mplex
Browse files Browse the repository at this point in the history
  • Loading branch information
melekes committed May 4, 2023
1 parent 6544dd4 commit 9e25820
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 31 deletions.
19 changes: 0 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fnv = "1.0.6"
futures = "0.3.21"
futures-timer = "3.0.2"
ip_network = "0.4.1"
libp2p = { version = "0.51.3", features = ["dns", "identify", "kad", "macros", "mdns", "mplex", "noise", "ping", "tcp", "tokio", "yamux", "websocket", "request-response"] }
libp2p = { version = "0.51.3", features = ["dns", "identify", "kad", "macros", "mdns", "noise", "ping", "tcp", "tokio", "yamux", "websocket", "request-response"] }
linked_hash_set = "0.1.3"
log = "0.4.17"
lru = "0.8.1"
Expand Down
2 changes: 0 additions & 2 deletions client/network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ negotiated and applied. The exact handshake protocol is experimental and is subj

The following multiplexing protocols are supported:

- [Mplex](https://github.com/libp2p/specs/tree/master/mplex). Support for mplex will likely
be deprecated in the future.
- [Yamux](https://github.com/hashicorp/yamux/blob/master/spec.md).

## Substreams
Expand Down
2 changes: 0 additions & 2 deletions client/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@
//!
//! The following multiplexing protocols are supported:
//!
//! - [Mplex](https://github.com/libp2p/specs/tree/master/mplex). Support for mplex will likely
//! be deprecated in the future.
//! - [Yamux](https://github.com/hashicorp/yamux/blob/master/spec.md).
//!
//! ## Substreams
Expand Down
9 changes: 2 additions & 7 deletions client/network/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
use either::Either;
use libp2p::{
core::{
self,
muxing::StreamMuxerBox,
transport::{Boxed, OptionalTransport},
upgrade,
},
dns, identity, mplex, noise, tcp, websocket, PeerId, Transport, TransportExt,
dns, identity, noise, tcp, websocket, PeerId, Transport, TransportExt,
};
use std::{sync::Arc, time::Duration};

Expand Down Expand Up @@ -100,10 +99,6 @@ pub fn build_transport(
};

let multiplexing_config = {
let mut mplex_config = mplex::MplexConfig::new();
mplex_config.set_max_buffer_behaviour(mplex::MaxBufferBehaviour::Block);
mplex_config.set_max_buffer_size(usize::MAX);

let mut yamux_config = libp2p::yamux::YamuxConfig::default();
// Enable proper flow-control: window updates are only sent when
// buffered data has been consumed.
Expand All @@ -114,7 +109,7 @@ pub fn build_transport(
yamux_config.set_receive_window_size(yamux_window_size);
}

core::upgrade::SelectUpgrade::new(yamux_config, mplex_config)
yamux_config
};

let transport = transport
Expand Down

0 comments on commit 9e25820

Please sign in to comment.