From f11291cd9a89cc1799815e675d817d85fe561aec Mon Sep 17 00:00:00 2001 From: Pierre Krieger <pierre.krieger1708@gmail.com> Date: Wed, 7 Aug 2019 21:08:21 +0200 Subject: [PATCH] Remove support for mplex (#3312) --- substrate/core/network/src/lib.rs | 2 -- substrate/core/network/src/transport.rs | 9 +++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/substrate/core/network/src/lib.rs b/substrate/core/network/src/lib.rs index 28437901e21..bbb1f085566 100644 --- a/substrate/core/network/src/lib.rs +++ b/substrate/core/network/src/lib.rs @@ -89,8 +89,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 diff --git a/substrate/core/network/src/transport.rs b/substrate/core/network/src/transport.rs index 901ec18581e..389a6626610 100644 --- a/substrate/core/network/src/transport.rs +++ b/substrate/core/network/src/transport.rs @@ -17,14 +17,14 @@ use futures::prelude::*; use libp2p::{ InboundUpgradeExt, OutboundUpgradeExt, PeerId, Transport, - mplex, identity, secio, yamux, bandwidth, wasm_ext + identity, secio, yamux, bandwidth, wasm_ext }; #[cfg(not(target_os = "unknown"))] use libp2p::{tcp, dns, websocket, noise}; #[cfg(not(target_os = "unknown"))] use libp2p::core::{upgrade, either::EitherError, either::EitherOutput}; use libp2p::core::{self, transport::boxed::Boxed, transport::OptionalTransport, muxing::StreamMuxerBox}; -use std::{io, sync::Arc, time::Duration, usize}; +use std::{io, sync::Arc, time::Duration}; pub use self::bandwidth::BandwidthSinks; @@ -55,9 +55,6 @@ pub fn build_transport( let secio_config = secio::SecioConfig::new(keypair); // Build configuration objects for multiplexing mechanisms. - let mut mplex_config = mplex::MplexConfig::new(); - mplex_config.max_buffer_len_behaviour(mplex::MaxBufferBehaviour::Block); - mplex_config.max_buffer_len(usize::MAX); let yamux_config = yamux::Config::default(); // Build the base layer of the transport. @@ -116,7 +113,7 @@ pub fn build_transport( // Multiplexing let transport = transport.and_then(move |(stream, peer_id), endpoint| { let peer_id2 = peer_id.clone(); - let upgrade = core::upgrade::SelectUpgrade::new(yamux_config, mplex_config) + let upgrade = yamux_config .map_inbound(move |muxer| (peer_id, muxer)) .map_outbound(move |muxer| (peer_id2, muxer)); -- GitLab