Skip to content

moq-net: map MoQ versions to required qmux versions#1513

Open
kixelated wants to merge 2 commits into
mainfrom
claude/gifted-mcnulty-7eb608
Open

moq-net: map MoQ versions to required qmux versions#1513
kixelated wants to merge 2 commits into
mainfrom
claude/gifted-mcnulty-7eb608

Conversation

@kixelated
Copy link
Copy Markdown
Collaborator

Summary

  • The MoQ WG decided qmux's draft version is tied to the moq-transport version: moq-transport-18 must ride on qmux-01, moq-transport-14..17 on qmux-00. moq-lite is unconstrained.
  • Add the spec mapping to moq-net: QmuxVersion enum, Version::qmux_versions, Version::accepts_qmux, and Versions::qmux_alpns (ordered dedup'd (qmux_version, app_alpn) pairs for building the Sec-WebSocket-Protocol list).
  • Existing moq-lite versions (Lite01..Lite04) advertise both qmux-01 and qmux-00 for back-compat. Future moq-lite versions should pin to a single qmux version like moq-transport. The match arms are listed by variant rather than wildcard so any new Lite variant fails to compile until a deliberate choice is made.

Why this lives in moq-net

The composition of (qmux_version, app_alpn) pairs is policy that depends on the moq-transport spec, not on qmux. qmux today (0.0.7) and after moq-dev/web-transport#226 cross-products qmux versions × app protocols internally, which would advertise illegal pairs like qmux-00.moqt-18 or qmux-01.moqt-17. Keeping the mapping here means moq-native can build exactly the right pairs and feed them through whatever opaque-protocol path qmux exposes (or, if needed, prompt a small with_raw_protocols addition upstream).

What's not in this PR

  • Wiring through moq-native's websocket client/server and moq-relay's sub-protocol list. That's blocked on the qmux 0.0.8 release that ships PR 226 with an API for explicit pairs.
  • Bumping the qmux workspace dep from 0.0.7.

Test plan

  • cargo test -p moq-net --lib version:: — 7 new tests pinning the table and per-version mappings, plus the unchanged 327 existing tests, all pass.
  • cargo clippy -p moq-net --all-targets -- -D warnings clean.
  • cargo fmt -p moq-net -- --check clean.
  • cargo build -p moq-native -p moq-relay -p moq-cli — downstream crates still compile against the new surface (it's purely additive).

(Written by Claude)

The MoQ WG decided qmux's draft version is tied to the moq-transport
version. moq-transport-18 requires qmux-01; moq-transport-14..17 stay
on qmux-00. moq-lite is unconstrained: existing Lite01..Lite04 advertise
both for back-compat, and future moq-lite versions should pin to a
single qmux version like moq-transport does.

Add a local QmuxVersion enum, Version::qmux_versions (the spec mapping),
Version::accepts_qmux (server-side validation), and Versions::qmux_alpns
(ordered, dedup'd (qmux_version, app_alpn) pairs for building the
Sec-WebSocket-Protocol list).

Lite arms are listed by variant rather than wildcard so adding a new
Lite variant fails to compile until someone makes a deliberate choice.

Wiring through moq-native (and the qmux 0.0.8 bump) follows in a
separate change once upstream PR moq-dev/web-transport#226 lands and
exposes an API for explicit (version, protocol) pairs instead of the
default cross-product.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0881a5ab-fda5-4cf8-8f38-dcf97059ae51

📥 Commits

Reviewing files that changed from the base of the PR and between d202b31 and 8999f96.

📒 Files selected for processing (1)
  • rs/moq-net/src/version.rs

Walkthrough

This PR introduces qmux version support to the MoQ protocol library. A new QmuxVersion enum represents qmux draft versions (00 and 01). Version gains qmux_versions() and accepts_qmux() to enumerate and validate allowed qmux drafts per MoQ version. Versions::qmux_alpns() builds deduplicated (QmuxVersion, app_alpn) advertisement pairs for WebSocket/TLS fronting. Unit tests validate the mappings, acceptance checks, exact ALPN pair tables, and QmuxVersion ALPN strings.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: mapping MoQ versions to required qmux versions, which is the core functionality added in this PR.
Description check ✅ Passed The description is well-detailed and directly related to the changeset, explaining the spec mapping, implementation rationale, and what's not included in this PR.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/gifted-mcnulty-7eb608

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 and usage tips.

CI's rustfmt collapses single-expr match arms; local fmt didn't flag it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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