Skip to content

feat(node): wire ADR 005 QUIC transport defaults (#328) - #491

Merged
thiras merged 2 commits into
mainfrom
feat/issue-328-quic-transport-defaults
May 8, 2026
Merged

thiras merged 2 commits into
mainfrom
feat/issue-328-quic-transport-defaults

Conversation

@thiras

@thiras thiras commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Apply ADR 005 §Connection lifecycle / §Concurrent stream limits at the iroh endpoint: 30s max_idle_timeout, 10s keep_alive_interval, 100 max_concurrent_bidi_streams (sized for cdn/client/v1, the largest ALPN).
  • QuicTransportConfig is per-endpoint, not per-ALPN — ProbeHandler's tighter 1-stream bound is enforced in-handler (single accept_bi() then close), now documented inline.
  • Refactors build_endpoint to take a QuicTransportConfig, threaded from the new production_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 Ok
    • probe_loopback::idle_timeout_closes_quiet_connection — behavioral test using a 300ms idle window so the suite doesn't slow down
  • cargo clippy -p decdn-node --tests -- -D warnings clean
  • cargo nextest run --workspace — 673/673 pass
  • No changes to crates/common/src/config/ (avoids collision with feat(cli): add decdn node top live metrics view (#275) #485)

Out of scope

  • Per-ALPN QUIC-level caps for cdn/client/v1 and cdn/dht/v1: defers until those handlers exist (the cap is sized for client today).
  • Config-driven tunability via [network] TOML keys: defers until feat(cli): add decdn node top live metrics view (#275) #485 merges to avoid a crates/common/src/config/mod.rs collision.
  • Behavioral coverage for keep-alive emission and the 100-stream cap: defers until the cdn/client/v1 handler that actually relies on the cap lands.

Closes #328.

🤖 Generated with Claude Code

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]>
Copilot AI review requested due to automatic review settings May 8, 2026 19:43
@github-actions

github-actions Bot commented May 8, 2026 •

Copy link
Copy Markdown

Coverage report

Total: 87.84% (was 87.90%, ▼ 0.07%) — 11863/13506 lines

File Coverage Lines Δ
crates/node/src/handlers/probe.rs 84.92% 107/126 ● 0.00%
crates/node/src/runtime/mod.rs 53.69% 386/719 ▲ +0.08%
History
Commit Total Δ vs base
c5e4358 87.84% ▼ 0.07%
ef237e9 (HEAD) 87.84% ▼ 0.07%

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_timeout can 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.

Comment thread crates/node/src/runtime/mod.rs Resolved
Comment thread crates/node/tests/probe_loopback.rs Resolved

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@thiras
thiras merged commit d7e8e71 into main May 8, 2026
10 checks passed
@thiras
thiras deleted the feat/issue-328-quic-transport-defaults branch May 8, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement per-ALPN stream limits, idle timeouts, and QUIC keep-alives

2 participants