From 7a2fa771e7a705cda8481f44e9b8fec18f2e6b98 Mon Sep 17 00:00:00 2001 From: Qiwei Yang Date: Mon, 30 Dec 2024 10:16:45 +0800 Subject: [PATCH] remove `yamux_window_size` --- .../client/cli/src/params/network_params.rs | 1 - substrate/client/network/src/config.rs | 22 ------------------- substrate/client/network/src/litep2p/mod.rs | 4 ---- 3 files changed, 27 deletions(-) diff --git a/substrate/client/cli/src/params/network_params.rs b/substrate/client/cli/src/params/network_params.rs index 748b84a50d2a..c9be0b48d344 100644 --- a/substrate/client/cli/src/params/network_params.rs +++ b/substrate/client/cli/src/params/network_params.rs @@ -275,7 +275,6 @@ impl NetworkParams { allow_non_globals_in_dht, kademlia_disjoint_query_paths: self.kademlia_disjoint_query_paths, kademlia_replication_factor: self.kademlia_replication_factor, - yamux_window_size: None, ipfs_server: self.ipfs_server, sync_mode: self.sync.into(), network_backend: self.network_backend.into(), diff --git a/substrate/client/network/src/config.rs b/substrate/client/network/src/config.rs index 327f79fe6c13..1a64f06e74c2 100644 --- a/substrate/client/network/src/config.rs +++ b/substrate/client/network/src/config.rs @@ -650,27 +650,6 @@ pub struct NetworkConfiguration { /// Enable serving block data over IPFS bitswap. pub ipfs_server: bool, - /// Size of Yamux receive window of all substreams. `None` for the default (256kiB). - /// Any value less than 256kiB is invalid. - /// - /// # Context - /// - /// By design, notifications substreams on top of Yamux connections only allow up to `N` bytes - /// to be transferred at a time, where `N` is the Yamux receive window size configurable here. - /// This means, in practice, that every `N` bytes must be acknowledged by the receiver before - /// the sender can send more data. The maximum bandwidth of each notifications substream is - /// therefore `N / round_trip_time`. - /// - /// It is recommended to leave this to `None`, and use a request-response protocol instead if - /// a large amount of data must be transferred. The reason why the value is configurable is - /// that some Substrate users mis-use notification protocols to send large amounts of data. - /// As such, this option isn't designed to stay and will likely get removed in the future. - /// - /// Note that configuring a value here isn't a modification of the Yamux protocol, but rather - /// a modification of the way the implementation works. Different nodes with different - /// configured values remain compatible with each other. - pub yamux_window_size: Option, - /// Networking backend used for P2P communication. pub network_backend: NetworkBackendType, } @@ -703,7 +682,6 @@ impl NetworkConfiguration { kademlia_disjoint_query_paths: false, kademlia_replication_factor: NonZeroUsize::new(DEFAULT_KADEMLIA_REPLICATION_FACTOR) .expect("value is a constant; constant is non-zero; qed."), - yamux_window_size: None, ipfs_server: false, network_backend: NetworkBackendType::Libp2p, } diff --git a/substrate/client/network/src/litep2p/mod.rs b/substrate/client/network/src/litep2p/mod.rs index 52b2970525df..dd6a22f6fba5 100644 --- a/substrate/client/network/src/litep2p/mod.rs +++ b/substrate/client/network/src/litep2p/mod.rs @@ -318,10 +318,6 @@ impl Litep2pNetworkBackend { yamux_config.set_window_update_mode(litep2p::yamux::WindowUpdateMode::OnRead); yamux_config.set_max_buffer_size(yamux_maximum_buffer_size); - if let Some(yamux_window_size) = config.network_config.yamux_window_size { - yamux_config.set_receive_window(yamux_window_size); - } - yamux_config };