Repository navigation
fix(net): pass lite-05/06 timestamps through #6996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c5859f1
906b405
ff71132
b8b7b35
25a39a2
731d9a6
d093972
c7db73b
24ffd7f
ef4f230
a2a7097
91c72e0
7488fc5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,7 +190,7 @@ A Track without a `Timescale` is untimed: its frames and datagrams carry no time | |
| A timestamp MUST be less than 2^61, so every version can carry it; a receiver treats a larger one as a malformed Track. | ||
| Unless a negotiated extension specifies otherwise, a publisher MUST NOT start a timed Group's frame 0 earlier than that of any lower-sequence Group it publishes. | ||
| A receiver MAY check a received Group against this rule, refusing a violating Group's stream (STOP_SENDING) with TIMESTAMP_MISMATCH. | ||
| A relay that cannot vouch for a Track's timestamps, such as ones received over another protocol, MUST serve the Track untimed unless a negotiated extension identifies their unchecked provenance. | ||
| A relay serves a Track's timestamps on as it received them, including ones it did not check, unless a negotiated extension specifies otherwise. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reconcile relay forwarding with the publisher rewind rule. If a Lite05/06 peer fetches an older group later, that group's send-time timestamp can exceed a higher-sequence group's timestamp. Line 193 requires a relay to forward both timestamps unchanged. Without a negotiated extension, Line 191 prohibits the relay, as publisher, from publishing that timed sequence. State the relay exception in the publisher rule so an implementation can satisfy both requirements.
|
||
|
|
||
| ## Positions {#positions} | ||
| A Position is a (Group Sequence, Frame Index) pair identifying one frame within a Track. | ||
|
|
@@ -1832,7 +1832,7 @@ The `Message Length` describes the payload size on the wire. | |
|
|
||
| - Replaced ANNOUNCE_OK Active Count with an ordered, empty SYNCED event (0x4), marking the initial set without retaining routes that end before delivery. | ||
|
|
||
| - A publisher must not start a timed Group's frame 0 earlier than a lower-sequence Group's, and a receiver may refuse a Group that does. A relay serves a Track whose timestamps it cannot vouch for untimed unless a negotiated extension identifies their unchecked provenance. | ||
| - A publisher must not start a timed Group's frame 0 earlier than a lower-sequence Group's, and a receiver may refuse a Group that does. A relay serves every Track's timestamps on as received. | ||
|
|
||
| - Bounded every timestamp below 2^61. A larger one is a malformed Track. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,14 +81,12 @@ export interface WireFrame extends netGroup.Frame { | |
| export interface FrameFormat { | ||
| /** The wire timescale; non-zero means every frame carries a zigzag-delta timestamp. */ | ||
| scale: number; | ||
| /** Whether a carried timestamp is kept; false drops it where it may be a send time. */ | ||
| timed?: boolean; | ||
| /** Whether every frame declares its plain size ahead of a stored slice. */ | ||
| compress?: boolean; | ||
| } | ||
|
|
||
| /** Decode one frame, with timestamp deltas when scaled and declared plain sizes when compressed. */ | ||
| export function frameDecoder({ scale, timed = true, compress = false }: FrameFormat): (c: Cursor) => WireFrame { | ||
| export function frameDecoder({ scale, compress = false }: FrameFormat): (c: Cursor) => WireFrame { | ||
| const timescale = scale === 0 ? undefined : Time.Timescale(scale); | ||
| let prevTs = 0n; | ||
| return (c) => { | ||
|
|
@@ -100,8 +98,7 @@ export function frameDecoder({ scale, timed = true, compress = false }: FrameFor | |
| const payload = c.read(size); | ||
| // Commit the delta only after the last read: an incomplete decode gets retried. | ||
| prevTs += delta; | ||
| // Read to stay in step, but dropped where it may be a send time. | ||
| const timestamp = timescale === undefined || !timed ? undefined : new Time.Timestamp(Number(prevTs), timescale); | ||
| const timestamp = timescale === undefined ? undefined : new Time.Timestamp(Number(prevTs), timescale); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Accept the full wire timestamp range. A valid Lite-05/06 timestamp can exceed
|
||
| return { payload, inflated, timestamp }; | ||
| }; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limit the relay claim to versions that carry timestamps.
Lite01–04 cannot carry track timestamps. The version gates in
js/net/src/lite/version.ts:599-611andrs/moq-net/src/lite/version.rs:374-385omit them. A reader using one of those versions will not receive the timestamps promised here. Qualify this claim and the matching claims injs/net/MIGRATE.md:156andrs/moq-net/MIGRATE.md:372. As per coding guidelines, “State a claim's conditions with it: opt-in or experimental versions, and the paths it does not cover.”Source: Coding guidelines