Skip to content

feat(moq-native): add quic::Client/quic::Server transport config#2161

Merged
kixelated merged 1 commit into
mainfrom
claude/moq-native-quic-config-b8706b
Jul 11, 2026
Merged

feat(moq-native): add quic::Client/quic::Server transport config#2161
kixelated merged 1 commit into
mainfrom
claude/moq-native-quic-config-b8706b

Conversation

@kixelated

@kixelated kixelated commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds role-split QUIC transport tuning: quic::Client (--client-quic-*) and quic::Server (--server-quic-*), each flattened directly onto ClientConfig / ServerConfig. Knobs: max_streams, gso, idle_timeout, keep_alive, mtu_discovery — the last three were previously hardcoded in the quinn/noq backends.

Because the args parse straight into the role config the endpoint is built from, there's no separate section to remember to pipe through: --client-quic-* lands in ClientConfig::quic and --server-quic-* in ServerConfig::quic automatically.

The split is meaningful, not cosmetic: the server owns accept-only knobs the client has no use for. The QUIC preferred address and QUIC-LB connection-ID fields move off ServerConfig's top level into quic::Server, so all of a server's QUIC tuning lives in one place. Their CLI flags/env vars are unchanged (--server-preferred-v4, --server-quic-lb-id, ...); only the TOML path moves under [server.quic].

Backend support

Knob quinn noq quiche iroh
max streams ✅ (newly wired)
idle timeout
keep-alive ignored ignored
MTU discovery
disable GSO init error init error
preferred addr / QUIC-LB
  • GSO can only be turned off on quinn/noq (TransportConfig::enable_segmentation_offload). quiche and iroh probe GSO from the socket with no public setter, so --*-quic-gso=false returns a backend GsoUnsupported error at init rather than silently ignoring the flag.
  • iroh previously ignored transport config entirely (endpoint presets only). It now applies max_streams (plus idle timeout and MTU) via its endpoint transport config — MoQ opens a stream per group and iroh's default of ~100 is far too low. iroh uses the client-side quic knobs (single P2P endpoint, per-connection knobs are symmetric).

Notes for reviewers

  • Public API (moq-native):
    • --client-max-streams / --server-max-streams are folded into the new --client-quic-max-streams / --server-quic-max-streams, with the old spellings kept as hidden clap aliases (no breakage).
    • ServerConfig::preferred_v4/v6 and quic_lb_id/nonce move to ServerConfig::quic (a quic::Server). CLI/env unchanged; TOML moves from [server] to [server.quic].
    • Targets main (moq-native is not in the dev breaking-change list).
  • iroh::EndpointConfig::bind now takes the resolved quic knobs; callers (relay, cli) pass the client-side section.
  • No /doc or demo/ files referenced the old flags, so nothing to sync there.

Test plan

  • cargo test for moq-native, moq-relay, moq-bench, moq-cli (incl. new tests: --client-quic-* vs --server-quic-* distinctness, server-only knobs, deprecated aliases, TOML round-trip, GSO gating; relay [server.quic] clobber regression updated)
  • Builds across all backends: quinn, noq, quiche, iroh, and combos (quiche+iroh+quinn via nix)
  • clippy --all-targets clean; RUSTDOCFLAGS=-D warnings cargo doc clean; formatted via nix
  • moq-relay --help shows --client-quic-*, --server-quic-*, and the server-only --server-preferred-* / --server-quic-lb-*

🤖 Generated with Claude Code

@sourcery-ai sourcery-ai 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.

Sorry @kixelated, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Introduces shared client and server QUIC configuration types with resolution, defaults, CLI/TOML parsing, and validation tests. Native noq, quinn, quiche, and iroh backends now consume resolved QUIC settings for transport configuration. Client and server configuration fields are nested under QUIC-specific structures. CLI and relay startup paths pass resolved settings to iroh and initialize stream defaults through the new fields. Integration and configuration regression tests were updated for the new binding and TOML layouts.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding role-specific QUIC transport config in moq-native.
Description check ✅ Passed The description accurately covers the role-split QUIC config, backend support, and related CLI/TOML changes in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/moq-native-quic-config-b8706b

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kixelated
kixelated force-pushed the claude/moq-native-quic-config-b8706b branch from 7c3b147 to 3a642e8 Compare July 11, 2026 02:04
@kixelated kixelated changed the title feat(moq-native): add shared quic::Config transport section feat(moq-native): add quic::Client/quic::Server transport config Jul 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
rs/moq-native/src/quic.rs (1)

27-106: 📐 Maintainability & Code Quality | 🔵 Trivial

Consider reducing duplication of per-connection knobs between Client and Server.

The five per-connection fields (max_streams, gso, idle_timeout, keep_alive, mtu_discovery) and their #[serde] attributes are duplicated between Client and Server, and both resolve() implementations are identical. The #[arg] ids/envs differ by prefix (client- vs server-), so a shared embedded struct won't work, but a macro or a shared trait for resolve() could reduce the maintenance surface.

Also applies to: 108-227

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rs/moq-native/src/quic.rs` around lines 27 - 106, Reduce duplication between
the `Client` and `Server` QUIC configuration types by introducing a shared
abstraction for the five per-connection knobs and their serde behavior, while
retaining distinct clap `#[arg]` identifiers and environment-variable prefixes.
Use a suitable macro or shared helper to generate the repeated fields and
attributes, and factor the identical `resolve()` logic into a shared trait or
helper used by both implementations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rs/moq-native/src/noq.rs`:
- Line 12: Add a concise rustdoc comment directly above the public re-export
`pub use web_transport_noq;`, describing what the re-export provides and why
consumers may use it.

In `@rs/moq-native/src/quinn.rs`:
- Line 10: Add a rustdoc comment directly above the public re-export `pub use
web_transport_quinn;`, briefly describing what the re-export provides, so every
public Rust item is documented.

---

Nitpick comments:
In `@rs/moq-native/src/quic.rs`:
- Around line 27-106: Reduce duplication between the `Client` and `Server` QUIC
configuration types by introducing a shared abstraction for the five
per-connection knobs and their serde behavior, while retaining distinct clap
`#[arg]` identifiers and environment-variable prefixes. Use a suitable macro or
shared helper to generate the repeated fields and attributes, and factor the
identical `resolve()` logic into a shared trait or helper used by both
implementations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cbf991df-a299-43d5-9e75-fc593f887aac

📥 Commits

Reviewing files that changed from the base of the PR and between 8295e2f and 3a642e8.

📒 Files selected for processing (12)
  • rs/moq-cli/src/main.rs
  • rs/moq-native/src/client.rs
  • rs/moq-native/src/iroh.rs
  • rs/moq-native/src/lib.rs
  • rs/moq-native/src/noq.rs
  • rs/moq-native/src/quic.rs
  • rs/moq-native/src/quiche.rs
  • rs/moq-native/src/quinn.rs
  • rs/moq-native/src/server.rs
  • rs/moq-native/tests/backend.rs
  • rs/moq-relay/src/config.rs
  • rs/moq-relay/src/main.rs

Comment thread rs/moq-native/src/noq.rs

use web_transport_noq::noq;

pub use web_transport_noq;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document this public re-export.

pub use web_transport_noq; is a public Rust item without rustdoc.

Proposed fix
+/// WebTransport implementation backed by NOQ.
 pub use web_transport_noq;

As per coding guidelines, “every pub Rust item” must have a doc comment.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pub use web_transport_noq;
/// WebTransport implementation backed by NOQ.
pub use web_transport_noq;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rs/moq-native/src/noq.rs` at line 12, Add a concise rustdoc comment directly
above the public re-export `pub use web_transport_noq;`, describing what the
re-export provides and why consumers may use it.

Source: Coding guidelines

use std::{net, time};
use url::Url;

pub use web_transport_quinn;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document this public re-export.

pub use web_transport_quinn; is a public Rust item without rustdoc.

Proposed fix
+/// WebTransport implementation backed by Quinn.
 pub use web_transport_quinn;

As per coding guidelines, “every pub Rust item” must have a doc comment.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pub use web_transport_quinn;
/// WebTransport implementation backed by Quinn.
pub use web_transport_quinn;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rs/moq-native/src/quinn.rs` at line 10, Add a rustdoc comment directly above
the public re-export `pub use web_transport_quinn;`, briefly describing what the
re-export provides, so every public Rust item is documented.

Source: Coding guidelines

Add role-split QUIC transport tuning sections: `quic::Client`
(`--client-quic-*`) and `quic::Server` (`--server-quic-*`), each
flattened directly onto ClientConfig / ServerConfig. Knobs: max streams,
GSO, idle timeout, keep-alive, MTU discovery. The previously-hardcoded
idle timeout / keep-alive / MTU discovery are now configurable.

Because the args parse straight into the role config the endpoint is
built from, there is no separate section to remember to pipe through:
`--client-quic-*` lands in `ClientConfig::quic`, `--server-quic-*` in
`ServerConfig::quic`, automatically.

The split is meaningful (not just cosmetic) because the server owns
accept-only knobs the client has no use for. The QUIC preferred address
and QUIC-LB connection-ID fields move off ServerConfig's top level into
`quic::Server`, so all of a server's QUIC tuning lives in one place.
Their CLI flags and env vars are unchanged (`--server-preferred-v4`,
`--server-quic-lb-id`, ...); only the TOML path moves under
`[server.quic]`.

Backend support for disabling GSO is uneven: quinn and noq honor every
knob; quiche and iroh cannot force GSO off (it is socket-probed with no
public setter), so `--*-quic-gso=false` errors at init on those backends.
iroh previously ignored transport config entirely; it now applies
max_streams (plus idle timeout and MTU) via its endpoint transport
config, which matters because MoQ opens a stream per group and iroh's
default of ~100 is far too low.

The old `--client-max-streams` / `--server-max-streams` spellings are
kept as hidden clap aliases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kixelated
kixelated force-pushed the claude/moq-native-quic-config-b8706b branch from 3a642e8 to 06dfe20 Compare July 11, 2026 22:33

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rs/moq-native/src/iroh.rs`:
- Around line 68-70: Update the GsoUnsupported error message to mention both
supported alternatives, the noq and quinn backends, and replace the inaccurate
--quic-gso=false reference with the actual client/server-specific flags
--client-quic-gso and --server-quic-gso.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 614455ae-ac40-45fc-8cfa-9be5f13d5692

📥 Commits

Reviewing files that changed from the base of the PR and between 3a642e8 and 06dfe20.

📒 Files selected for processing (12)
  • rs/moq-cli/src/main.rs
  • rs/moq-native/src/client.rs
  • rs/moq-native/src/iroh.rs
  • rs/moq-native/src/lib.rs
  • rs/moq-native/src/noq.rs
  • rs/moq-native/src/quic.rs
  • rs/moq-native/src/quiche.rs
  • rs/moq-native/src/quinn.rs
  • rs/moq-native/src/server.rs
  • rs/moq-native/tests/backend.rs
  • rs/moq-relay/src/config.rs
  • rs/moq-relay/src/main.rs
🚧 Files skipped from review as they are similar to previous changes (10)
  • rs/moq-native/tests/backend.rs
  • rs/moq-relay/src/main.rs
  • rs/moq-relay/src/config.rs
  • rs/moq-native/src/client.rs
  • rs/moq-native/src/quiche.rs
  • rs/moq-native/src/lib.rs
  • rs/moq-native/src/noq.rs
  • rs/moq-native/src/quic.rs
  • rs/moq-native/src/server.rs
  • rs/moq-native/src/quinn.rs

Comment thread rs/moq-native/src/iroh.rs
Comment on lines +68 to +70

#[error("the iroh backend cannot disable GSO; drop --quic-gso=false or use the quinn backend")]
GsoUnsupported,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Error message only mentions quinn and uses an imprecise flag name.

The message says "use the quinn backend" but per the quic::Client docs, noq also supports disabling GSO. Additionally, --quic-gso=false doesn't match the actual CLI flags (--client-quic-gso / --server-quic-gso), which could confuse users troubleshooting the error.

📝 Suggested error message fix
-	#[error("the iroh backend cannot disable GSO; drop --quic-gso=false or use the quinn backend")]
+	#[error("the iroh backend cannot disable GSO; drop --client-quic-gso=false / --server-quic-gso=false or use the quinn or noq backend")]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#[error("the iroh backend cannot disable GSO; drop --quic-gso=false or use the quinn backend")]
GsoUnsupported,
#[error("the iroh backend cannot disable GSO; drop --client-quic-gso=false / --server-quic-gso=false or use the quinn or noq backend")]
GsoUnsupported,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rs/moq-native/src/iroh.rs` around lines 68 - 70, Update the GsoUnsupported
error message to mention both supported alternatives, the noq and quinn
backends, and replace the inaccurate --quic-gso=false reference with the actual
client/server-specific flags --client-quic-gso and --server-quic-gso.

@kixelated
kixelated enabled auto-merge (squash) July 11, 2026 22:49
@kixelated
kixelated merged commit 92d6960 into main Jul 11, 2026
3 checks passed
@kixelated
kixelated deleted the claude/moq-native-quic-config-b8706b branch July 11, 2026 22:51
This was referenced Jul 11, 2026
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.

1 participant