Skip to content

Commit

Permalink
Merge pull request #2195 from subspace/quic-buffer-fix
Browse files Browse the repository at this point in the history
Fix QUIC buffer warning for DSN.
  • Loading branch information
shamil-gadelshin authored Nov 6, 2023
2 parents 599b767 + c0bb729 commit 0309f7b
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 100 deletions.
81 changes: 28 additions & 53 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions crates/subspace-networking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ unsigned-varint = { version = "0.7.1", features = ["futures", "asynchronous_code
void = "1.0.2"

[dependencies.libp2p]
version = "0.52.3"
git = "https://github.com/subspace/rust-libp2p"
rev = "7a9328fc0a5f9e28575192d5f4f8663fde6752af"
default-features = false
features = [
"autonat",
Expand All @@ -72,4 +73,4 @@ features = [

[dev-dependencies]
rand = "0.8.5"
libp2p-swarm-test = "0.2.0"
libp2p-swarm-test = { git = "https://github.com/subspace/rust-libp2p", rev = "7a9328fc0a5f9e28575192d5f4f8663fde6752af" }
5 changes: 5 additions & 0 deletions crates/subspace-networking/src/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ const TEMPORARY_BANS_DEFAULT_BACKOFF_RANDOMIZATION_FACTOR: f64 = 0.1;
const TEMPORARY_BANS_DEFAULT_BACKOFF_MULTIPLIER: f64 = 1.5;
const TEMPORARY_BANS_DEFAULT_MAX_INTERVAL: Duration = Duration::from_secs(30 * 60);

/// We pause between reserved peers dialing otherwise we could do multiple dials to offline peers
/// wasting resources and producing a ton of log records.
const DIALING_INTERVAL_IN_SECS: Duration = Duration::from_secs(1);

/// Specific YAMUX settings for Subspace applications: additional buffer space for pieces and
/// substream's limit.
///
Expand Down Expand Up @@ -479,6 +483,7 @@ where
reserved_peers: ReservedPeersConfig {
reserved_peers: reserved_peers.clone(),
protocol_name: RESERVED_PEERS_PROTOCOL_NAME,
dialing_interval: DIALING_INTERVAL_IN_SECS,
},
peer_info_config: PeerInfoConfig::new(PEER_INFO_PROTOCOL_NAME),
peer_info_provider,
Expand Down
7 changes: 6 additions & 1 deletion crates/subspace-networking/src/constructor/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ pub(super) fn build_transport(
.boxed()
};

let quic = QuicTransport::new(QuicConfig::new(keypair))
#[cfg(not(windows))]
let quic_config = QuicConfig::new(keypair);
#[cfg(windows)]
let quic_config = QuicConfig::new(keypair).path_mtu_discovery_config(None);

let quic = QuicTransport::new(quic_config)
.map(|(peer_id, muxer), _| (peer_id, StreamMuxerBox::new(muxer)));

let wrapped_quic =
Expand Down
Loading

0 comments on commit 0309f7b

Please sign in to comment.