Repository navigation
feat(node): wire ADR 005 QUIC transport defaults (#328) - #491
Conversation
Apply ADR 005 §Connection lifecycle / §Concurrent stream limits at the iroh endpoint: 30s max idle timeout, 10s keep-alive PING interval, and a 100-stream bidirectional cap (sized for `cdn/client/v1`, the largest ALPN). `QuicTransportConfig` is per-endpoint, not per-ALPN, so probe's tighter 1-stream bound stays enforced inside the handler — documented inline. Add a constant-guard unit test for the three values plus a behavioral loopback test that uses a 300ms idle window to verify the wiring without slowing the suite. Defers per-ALPN QUIC caps for `cdn/client/v1` and `cdn/dht/v1` until those handlers exist, and config-driven tunability until #485 merges. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Coverage reportTotal: 87.84% (was 87.90%, ▼ 0.07%) — 11863/13506 lines
History
|
There was a problem hiding this comment.
Pull request overview
This PR wires ADR 005 QUIC transport defaults into the node’s iroh endpoint configuration, aiming to standardize connection lifecycle behavior (idle timeout, keep-alives) and concurrent bidirectional stream limits across protocols.
Changes:
- Introduces a centralized
production_transport_config()to set QUIC transport defaults (30s idle timeout, 10s keep-alive, 100 max concurrent bidi streams) and threads it into endpoint construction. - Adds an integration test to validate that
max_idle_timeoutcan close a silent connection (with a shortened timeout for test speed). - Documents probe’s tighter per-connection stream behavior inside the probe handler.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/node/src/runtime/mod.rs | Adds QUIC transport default constants + production_transport_config(), and applies it when building the runtime endpoint. |
| crates/node/tests/probe_loopback.rs | Adds a loopback integration test asserting idle-timeout behavior using a shortened idle window. |
| crates/node/src/handlers/probe.rs | Documents probe’s “1 bidi stream per connection” enforcement approach in the handler. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request implements QUIC transport configuration settings in accordance with ADR 005. Key changes include defining constants for a 30-second idle timeout, a 10-second keep-alive interval, and a limit of 100 concurrent bidirectional streams. The endpoint construction logic was updated to apply these configurations, and new unit and integration tests were added to verify the timeout behavior and constant values. I have no feedback to provide.
- Tighten QUIC_MAX_IDLE_TIMEOUT doc to call out the keep-alive interaction: 10s PINGs refresh the 30s timer, so the QUIC idle reaper is a defense-in-depth floor for silent paths; the "30s after last stream and no unacked vouchers" rule is application-layer and lives in the cdn/client/v1 handler (not yet implemented). - Propagate the accept_task join result in idle_timeout_closes_quiet_connection so a server-side panic or error fails the test deterministically, matching the probe_roundtrip pattern. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
max_idle_timeout, 10skeep_alive_interval, 100max_concurrent_bidi_streams(sized forcdn/client/v1, the largest ALPN).QuicTransportConfigis per-endpoint, not per-ALPN —ProbeHandler's tighter 1-stream bound is enforced in-handler (singleaccept_bi()then close), now documented inline.build_endpointto take aQuicTransportConfig, threaded from the newproduction_transport_config()helper.Test plan
cargo nextest run -p decdn-node— 83/83 pass, including:runtime::tests::adr_005_transport_defaults— constant-guard for the three values +production_transport_config()builds Okprobe_loopback::idle_timeout_closes_quiet_connection— behavioral test using a 300ms idle window so the suite doesn't slow downcargo clippy -p decdn-node --tests -- -D warningscleancargo nextest run --workspace— 673/673 passcrates/common/src/config/(avoids collision with feat(cli): adddecdn node toplive metrics view (#275) #485)Out of scope
cdn/client/v1andcdn/dht/v1: defers until those handlers exist (the cap is sized for client today).[network]TOML keys: defers until feat(cli): adddecdn node toplive metrics view (#275) #485 merges to avoid acrates/common/src/config/mod.rscollision.cdn/client/v1handler that actually relies on the cap lands.Closes #328.
🤖 Generated with Claude Code