diff --git a/Cargo.lock b/Cargo.lock index a054df9fb35..3d49f0c51e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.10.2" +version = "0.10.3" dependencies = [ "async-std", "bytes", diff --git a/Cargo.toml b/Cargo.toml index ec38ffb72fd..f6a4f72df3d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,7 +95,7 @@ libp2p-perf = { version = "0.3.0", path = "protocols/perf" } libp2p-ping = { version = "0.44.1", path = "protocols/ping" } libp2p-plaintext = { version = "0.41.0", path = "transports/plaintext" } libp2p-pnet = { version = "0.24.0", path = "transports/pnet" } -libp2p-quic = { version = "0.10.2", path = "transports/quic" } +libp2p-quic = { version = "0.10.3", path = "transports/quic" } libp2p-relay = { version = "0.17.2", path = "protocols/relay" } libp2p-rendezvous = { version = "0.14.0", path = "protocols/rendezvous" } libp2p-request-response = { version = "0.26.2", path = "protocols/request-response" } diff --git a/transports/quic/CHANGELOG.md b/transports/quic/CHANGELOG.md index 3c34a1989f9..cd0146afbb2 100644 --- a/transports/quic/CHANGELOG.md +++ b/transports/quic/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.3 +- Allow configuring MTU discovery upper bound. + See [PR 5386](https://github.com/libp2p/rust-libp2p/pull/5386). + ## 0.10.2 - Change `max_idle_timeout`to 10s. diff --git a/transports/quic/Cargo.toml b/transports/quic/Cargo.toml index 1bbac27d67f..5a7e79441db 100644 --- a/transports/quic/Cargo.toml +++ b/transports/quic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libp2p-quic" -version = "0.10.2" +version = "0.10.3" authors = ["Parity Technologies "] edition = "2021" rust-version = { workspace = true } diff --git a/transports/quic/src/config.rs b/transports/quic/src/config.rs index 540f13e726b..c5189ce36cd 100644 --- a/transports/quic/src/config.rs +++ b/transports/quic/src/config.rs @@ -40,10 +40,10 @@ pub struct Config { /// concurrently by the remote peer. pub max_concurrent_stream_limit: u32, - /// Max unacknowledged data in bytes that may be send on a single stream. + /// Max unacknowledged data in bytes that may be sent on a single stream. pub max_stream_data: u32, - /// Max unacknowledged data in bytes that may be send in total on all streams + /// Max unacknowledged data in bytes that may be sent in total on all streams /// of a connection. pub max_connection_data: u32, @@ -90,6 +90,14 @@ impl Config { } } + /// Set the upper bound to the max UDP payload size that MTU discovery will search for. + pub fn mtu_upper_bound(mut self, value: u16) -> Self { + self.mtu_discovery_config + .get_or_insert_with(Default::default) + .upper_bound(value); + self + } + /// Disable MTU path discovery (it is enabled by default). pub fn disable_path_mtu_discovery(mut self) -> Self { self.mtu_discovery_config = None;