Skip to content

Commit

Permalink
remove yamux_window_size
Browse files Browse the repository at this point in the history
  • Loading branch information
qiweiii committed Dec 30, 2024
1 parent cdf3a2d commit 7a2fa77
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
1 change: 0 additions & 1 deletion substrate/client/cli/src/params/network_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
22 changes: 0 additions & 22 deletions substrate/client/network/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32>,

/// Networking backend used for P2P communication.
pub network_backend: NetworkBackendType,
}
Expand Down Expand Up @@ -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,
}
Expand Down
4 changes: 0 additions & 4 deletions substrate/client/network/src/litep2p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit 7a2fa77

Please sign in to comment.