Skip to content

moq-lite-04: explicit hop IDs and exclude hop filter#21

Open
kixelated wants to merge 2 commits intomainfrom
moq-lite-04
Open

moq-lite-04: explicit hop IDs and exclude hop filter#21
kixelated wants to merge 2 commits intomainfrom
moq-lite-04

Conversation

@kixelated
Copy link
Copy Markdown
Collaborator

Summary

  • Replace ANNOUNCE Hops count with explicit Hop Count + Hop ID list for relay loop detection
  • Add Exclude Hop field to ANNOUNCE_PLEASE so relays can filter out announces that passed through themselves
  • Hop ID 0 reserved for unknown hops (bridging from older versions)

Implementation

Corresponding code changes: https://github.com/moq-dev/moq/tree/explicit-hops

🤖 Generated with Claude Code

- Replace ANNOUNCE `Hops` count with explicit `Hop Count` + `Hop ID` list
  for relay loop detection.
- Add `Exclude Hop` field to ANNOUNCE_PLEASE so relays can filter out
  announces that passed through themselves.
- Hop ID 0 reserved for unknown hops (bridging from older versions).

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

coderabbitai bot commented Mar 31, 2026

Walkthrough

The draft updates MOQ-Lite protocol text (clarifying Track contains Groups and Group contains Frames and fixing a Flow reference) and changes discovery/announce messaging. ANNOUNCE_PLEASE gains an Exclude Hop (i) field. ANNOUNCE replaces Hops (i) with Hop Count (i) followed by Hop ID (i) ...; receivers must validate Hop Count equals the number of Hop ID entries (close with PROTOCOL_VIOLATION on mismatch). Relay forwarding must append a Hop ID and increment Hop Count; Hop Count = 0 means no Hop ID entries. A moq-lite-04 changelog entry documents these edits.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: explicit hop IDs and exclude hop filter for the moq-lite-04 protocol specification update.
Description check ✅ Passed The description is directly related to the changeset, covering the three main objectives: replacing ANNOUNCE Hops with Hop Count and Hop ID list, adding Exclude Hop to ANNOUNCE_PLEASE, and reserving Hop ID 0.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch moq-lite-04
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch moq-lite-04

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
draft-lcurley-moq-lite.md (1)

388-394: 🛠️ Refactor suggestion | 🟠 Major

Specify validation requirement for Hop Count.

The wire format shows Hop Count (i) followed by Hop ID (i) ..., but the specification doesn't explicitly state that an implementation MUST validate that the Hop Count matches the actual number of Hop ID values received. This could lead to protocol ambiguity.

🛡️ Suggested validation requirement

Add after line 394 or in line 407's description:

A receiver MUST close the stream with a PROTOCOL_VIOLATION if the number of Hop ID values does not match the Hop Count.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@draft-lcurley-moq-lite.md` around lines 388 - 394, Add a MUST-level
validation that the numeric field "Hop Count (i)" in the ANNOUNCE Message
exactly matches the number of subsequent "Hop ID (i)" entries; if they differ
the receiver MUST close the stream with a PROTOCOL_VIOLATION. Update the
ANNOUNCE Message description (or insert after the current wire-format block) to
state this requirement and reference the fields "Hop Count" and "Hop ID" so
implementers know to count Hop ID entries and enforce the check.
🧹 Nitpick comments (1)
draft-lcurley-moq-lite.md (1)

371-373: Minor terminology inconsistency.

The description uses "hop list" but the wire format defines Hop Count (i) followed by Hop ID (i) .... Consider using more precise terminology like "broadcasts whose Hop IDs include this value" to align with the wire format field names.

📝 Suggested clarification
 **Exclude Hop**:
-If non-zero, the publisher SHOULD skip ANNOUNCE messages for broadcasts whose hop list contains this value.
+If non-zero, the publisher SHOULD skip ANNOUNCE messages for broadcasts whose Hop ID list contains this value.
 This is used by relays to avoid routing loops in a cluster.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@draft-lcurley-moq-lite.md` around lines 371 - 373, The terminology in
"Exclude Hop" is inconsistent with the wire format: replace "hop list" with the
precise field names used in the wire format (e.g., refer to "Hop ID (i)" or "Hop
IDs") so the sentence reads that the publisher SHOULD skip ANNOUNCE messages for
broadcasts whose Hop IDs include this value; reference the related fields "Hop
Count (i)" and "Hop ID (i)" to make the mapping explicit and ensure the wording
aligns with the defined wire format.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@draft-lcurley-moq-lite.md`:
- Around line 406-413: Clarify that when a relay forwards an announcement it
MUST append its own Hop ID and increment the Hop Count field (i.e., Hop Count is
the numeric count of Hop ID entries present); explicitly state that "Hop Count"
refers to the value in the Hop Count field (the number of Hop ID entries) and
may differ from non-zero Hop ID values if unknown hops are represented; define
that a Hop ID value of 0 indicates an unknown/bridged relay hop (not that the
Hop Count is unknown), and that a Hop Count value of 0 means there are no Hop ID
entries present (fully unknown path), plus note expected behavior when receiving
messages from older protocol peers (relay SHOULD append a new Hop ID and
increment Hop Count even if prior IDs are absent).

---

Outside diff comments:
In `@draft-lcurley-moq-lite.md`:
- Around line 388-394: Add a MUST-level validation that the numeric field "Hop
Count (i)" in the ANNOUNCE Message exactly matches the number of subsequent "Hop
ID (i)" entries; if they differ the receiver MUST close the stream with a
PROTOCOL_VIOLATION. Update the ANNOUNCE Message description (or insert after the
current wire-format block) to state this requirement and reference the fields
"Hop Count" and "Hop ID" so implementers know to count Hop ID entries and
enforce the check.

---

Nitpick comments:
In `@draft-lcurley-moq-lite.md`:
- Around line 371-373: The terminology in "Exclude Hop" is inconsistent with the
wire format: replace "hop list" with the precise field names used in the wire
format (e.g., refer to "Hop ID (i)" or "Hop IDs") so the sentence reads that the
publisher SHOULD skip ANNOUNCE messages for broadcasts whose Hop IDs include
this value; reference the related fields "Hop Count (i)" and "Hop ID (i)" to
make the mapping explicit and ensure the wording aligns with the defined wire
format.
🪄 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: 65e24dc8-09e7-42f0-bc36-199e2f015524

📥 Commits

Reviewing files that changed from the base of the PR and between 9aa095e and 29696a6.

📒 Files selected for processing (1)
  • draft-lcurley-moq-lite.md

Strengthen ANNOUNCE hop tracking: add MUST-level validation for Hop Count
matching Hop ID entries, require relays to append Hop IDs when forwarding,
and clarify Hop ID value 0 vs Hop Count value 0 semantics. Also fix
grammar ("An series" → "A series"), a duplicate "section" word, and
invalid BCP 14 keyword "SHOULD BE".

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

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@draft-lcurley-moq-lite.md`:
- Line 623: The heading "moq-lite-04" currently uses ATX style ("##
moq-lite-04") which violates markdownlint MD003; replace the ATX line with a
setext-style heading by removing the leading "##" and adding a setext underline
on the following line (for an H2 use a line of three or more hyphens, e.g. place
"moq-lite-04" on one line and "---" on the next). Ensure no extra trailing
spaces so the new setext heading (moq-lite-04 + ---) replaces the original ATX
heading.
🪄 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: 0486fb5a-8459-4f6a-8cdd-a0f1ad9b6ff0

📥 Commits

Reviewing files that changed from the base of the PR and between 29696a6 and 7716cf1.

📒 Files selected for processing (1)
  • draft-lcurley-moq-lite.md


# Appendix A: Changelog

## moq-lite-04
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix heading style at Line 623 to satisfy markdownlint MD003.

## moq-lite-04 is ATX style, but the configured rule expects setext style. Please convert this heading to setext (or align rule config if ATX is intended globally).

🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 623-623: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@draft-lcurley-moq-lite.md` at line 623, The heading "moq-lite-04" currently
uses ATX style ("## moq-lite-04") which violates markdownlint MD003; replace the
ATX line with a setext-style heading by removing the leading "##" and adding a
setext underline on the following line (for an H2 use a line of three or more
hyphens, e.g. place "moq-lite-04" on one line and "---" on the next). Ensure no
extra trailing spaces so the new setext heading (moq-lite-04 + ---) replaces the
original ATX heading.

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