Skip to content

Commit d6dd318

Browse files
committed
refactor: update quinn and add QlogFileFactory
1 parent f095c6b commit d6dd318

File tree

9 files changed

+70
-96
lines changed

9 files changed

+70
-96
lines changed

Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ unused-async = "warn"
4343

4444

4545
[patch.crates-io]
46-
iroh-quinn = { git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-latest-multipath" }
47-
iroh-quinn-proto = { git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-latest-multipath" }
48-
iroh-quinn-udp = { git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-latest-multipath" }
46+
iroh-quinn = { git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-timers" }
47+
iroh-quinn-proto = { git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-timers" }
48+
iroh-quinn-udp = { git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-timers" }
4949

5050
netwatch = { git = "https://github.com/n0-computer/net-tools", branch = "main" }
5151

iroh-relay/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ postcard = { version = "1", default-features = false, features = [
4242
"use-std",
4343
"experimental-derive",
4444
] }
45-
quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-latest-multipath", default-features = false, features = ["rustls-ring"] }
46-
quinn-proto = { package = "iroh-quinn-proto", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-latest-multipath" }
45+
quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-timers", default-features = false, features = ["rustls-ring"] }
46+
quinn-proto = { package = "iroh-quinn-proto", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-timers" }
4747
rand = "0.9.2"
4848
reqwest = { version = "0.12", default-features = false, features = [
4949
"rustls-tls",

iroh/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ n0-watcher = "0.6"
3535
netwatch = { version = "0.12" }
3636
pin-project = "1"
3737
pkarr = { version = "5", default-features = false, features = ["relays"] }
38-
quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-latest-multipath", default-features = false, features = ["rustls-ring"] }
39-
quinn-proto = { package = "iroh-quinn-proto", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-latest-multipath" }
40-
quinn-udp = { package = "iroh-quinn-udp", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-latest-multipath" }
38+
quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-timers", default-features = false, features = ["rustls-ring"] }
39+
quinn-proto = { package = "iroh-quinn-proto", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-timers" }
40+
quinn-udp = { package = "iroh-quinn-udp", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-timers" }
4141
rand = "0.9.2"
4242
reqwest = { version = "0.12", default-features = false, features = [
4343
"rustls-tls",
@@ -82,7 +82,7 @@ hickory-resolver = "0.25.1"
8282
igd-next = { version = "0.16", features = ["aio_tokio"] }
8383
netdev = { version = "0.39.0" }
8484
portmapper = { version = "0.12", default-features = false }
85-
quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-latest-multipath", default-features = false, features = ["runtime-tokio", "rustls-ring"] }
85+
quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-timers", default-features = false, features = ["runtime-tokio", "rustls-ring"] }
8686
tokio = { version = "1", features = [
8787
"io-util",
8888
"macros",

iroh/bench/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ iroh = { path = "..", default-features = false }
1212
iroh-metrics = { version = "0.37", optional = true }
1313
n0-future = "0.3.0"
1414
n0-error = "0.1.0"
15-
quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-latest-multipath" }
15+
quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "Frando/qlog-timers" }
1616
rand = "0.9.2"
1717
rcgen = "0.14"
1818
rustls = { version = "0.23.33", default-features = false, features = ["ring"] }
@@ -33,3 +33,4 @@ metrics = ["iroh/metrics", "iroh-metrics"]
3333
local-relay = ["iroh/test-utils"]
3434
# Use private Apple APIs to send multiple packets in a single syscall.
3535
fast-apple-datapath = ["iroh/fast-apple-datapath", "quinn/fast-apple-datapath"]
36+
qlog = ["iroh/qlog", "quinn/qlog"]

iroh/bench/src/iroh.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
#[cfg(feature = "qlog")]
2+
use std::sync::Arc;
13
use std::{
24
net::SocketAddr,
35
time::{Duration, Instant},
46
};
57

68
use bytes::Bytes;
9+
#[cfg(feature = "qlog")]
10+
use iroh::endpoint::QlogFileFactory;
711
use iroh::{
812
Endpoint, EndpointAddr, RelayMode, RelayUrl,
913
endpoint::{Connection, ConnectionError, QuinnTransportConfig, RecvStream, SendStream},
@@ -133,6 +137,11 @@ pub fn transport_config(max_streams: usize, initial_mtu: u16) -> QuinnTransportC
133137
acks.ack_eliciting_threshold(10u32.into());
134138
config.ack_frequency_config(Some(acks));
135139

140+
#[cfg(feature = "qlog")]
141+
config.qlog_factory(Arc::new(
142+
QlogFileFactory::from_env().with_prefix(format!("bench-iroh")),
143+
));
144+
136145
config
137146
}
138147

iroh/bench/src/quinn.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use std::{
55
};
66

77
use bytes::Bytes;
8+
#[cfg(feature = "qlog")]
9+
use iroh::endpoint::QlogFileFactory;
810
use n0_error::{Result, StdResultExt};
911
use quinn::{
1012
Connection, Endpoint, RecvStream, SendStream, TransportConfig, crypto::rustls::QuicClientConfig,
@@ -116,6 +118,11 @@ pub fn transport_config(max_streams: usize, initial_mtu: u16) -> TransportConfig
116118
acks.ack_eliciting_threshold(10u32.into());
117119
config.ack_frequency_config(Some(acks));
118120

121+
#[cfg(feature = "qlog")]
122+
config.qlog_factory(Arc::new(
123+
QlogFileFactory::from_env().with_prefix(format!("bench-quinn")),
124+
));
125+
119126
config
120127
}
121128

iroh/src/endpoint.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ use crate::{
4848
mod connection;
4949
pub(crate) mod hooks;
5050
pub mod presets;
51+
#[cfg(feature = "qlog")]
52+
mod qlog;
5153

5254
pub use hooks::{AfterHandshakeOutcome, BeforeConnectOutcome, EndpointHooks};
5355
// Missing still: SendDatagram and ConnectionClose::frame_type's Type.
@@ -58,6 +60,8 @@ pub use quinn::{
5860
RetryError, SendDatagramError, SendStream, ServerConfig, StoppedError, StreamId,
5961
TransportConfig as QuinnTransportConfig, VarInt, WeakConnectionHandle, WriteError,
6062
};
63+
#[cfg(feature = "qlog")]
64+
pub use quinn::{QlogConfig, QlogFactory};
6165
pub use quinn_proto::{
6266
FrameStats, TransportError, TransportErrorCode, UdpStats, Written,
6367
congestion::{Controller, ControllerFactory},
@@ -73,6 +77,8 @@ pub use self::connection::{
7377
IncomingZeroRttConnection, OutgoingZeroRtt, OutgoingZeroRttConnection, RemoteEndpointIdError,
7478
ZeroRttStatus,
7579
};
80+
#[cfg(feature = "qlog")]
81+
pub use self::qlog::QlogFileFactory;
7682
pub use crate::magicsock::transports::TransportConfig;
7783

7884
/// Builder for [`Endpoint`].
@@ -1371,7 +1377,7 @@ mod tests {
13711377
// Wait for the endpoint to be started to make sure it's up before clients try to connect
13721378
let ep = Endpoint::empty_builder(RelayMode::Custom(relay_map.clone()))
13731379
.secret_key(server_secret_key)
1374-
.transport_config(qlog.server("server")?)
1380+
.transport_config(qlog.create("server")?)
13751381
.alpns(vec![TEST_ALPN.to_vec()])
13761382
.insecure_skip_relay_cert_verify(true)
13771383
.bind()
@@ -1412,7 +1418,7 @@ mod tests {
14121418
let ep = Endpoint::empty_builder(RelayMode::Custom(relay_map))
14131419
.alpns(vec![TEST_ALPN.to_vec()])
14141420
.insecure_skip_relay_cert_verify(true)
1415-
.transport_config(qlog.client("client")?)
1421+
.transport_config(qlog.create("client")?)
14161422
.bind()
14171423
.await?;
14181424
info!("client connecting");
@@ -1695,7 +1701,7 @@ mod tests {
16951701
.alpns(vec![TEST_ALPN.to_vec()])
16961702
.insecure_skip_relay_cert_verify(true)
16971703
.relay_mode(RelayMode::Custom(relay_map))
1698-
.transport_config(qlog.client("client")?)
1704+
.transport_config(qlog.create("client")?)
16991705
.bind()
17001706
.await?;
17011707
info!(me = %ep.id().fmt_short(), "client starting");
@@ -1731,7 +1737,7 @@ mod tests {
17311737
.secret_key(secret)
17321738
.alpns(vec![TEST_ALPN.to_vec()])
17331739
.insecure_skip_relay_cert_verify(true)
1734-
.transport_config(qlog.server("server")?)
1740+
.transport_config(qlog.create("server")?)
17351741
.relay_mode(RelayMode::Custom(relay_map))
17361742
.bind()
17371743
.await?;

0 commit comments

Comments
 (0)