Repository navigation
Bound writes: a relay client writes only its own participant, as itself - #807
Merged
Merged
Conversation
The relay applied and forwarded whatever a client sent: another
participant's intent, the server holon's poses, the scene, mutations or
media naming another origin, even a snapshot pushed at it.
state_inbound_gate (cvc/state), installed with
state_transport::set_inbound_gate on gRPC and WS, governs what a
transport takes from the connections it accepts. Dialed connections,
the bridge and the relay's own writes are not gated.
- Identity: a connection speaks only as the node id of its first Hello.
One live connection holds a node id at a time. The first claim wins
until it closes, or until it has been silent for 6 s (three missed
link probes), when the next claim takes it over: a dropped network
leaves the old stream open. The relay's own ids (its transport's and
its shards') are never a client's.
- Origin: mutations, messages and media must name that id, and gRPC
heartbeats must name it as their node. A client's SnapshotResponse is
never applied, and a snapshot request is answered only for a
connection speaking as itself.
- Departure: a close is that peer leaving only when the connection
still held its id.
- Refused frames are not applied, forwarded or bridged; they are counted
in total_inbound_rejected().
room_write_gate is the room's rule:
- a participant writes only inside conf.rooms.<room>.participants.<pid>,
with value, touch or data ops;
- never the relay's keys there: pose, net.relay, and streams.<kind>.ready;
- only on canonical paths of at most 16 segments and 512 bytes (no empty
or padded segment, which the tree would trim onto another key);
- and only for a pid that is one identifier.
Every client write today fits this rule.
arisrv --bind-writes on|off (default on; not an S7 switch) installs one
gate on both transports, and logs refusals as their count grows. The
bench mirrors it. The gate's holder map is file-local, so cvc.dll grows
only 71 names (65,198 of 65,535).
Tests:
- InboundGate{TakesOnlyWhatAPeerMayWriteAsItself, BindsANodeIdTo*,
RefusesTheRelaysOwnId, HandsASilentHoldersIdOver} for gRPC and WS, and
InboundGateSpansBothTransports;
- RoomWriteGate.* (the rule, binding, takeover);
- RoomRelayLoopbackTest.ClientWritesOnlyItsOwnParticipant: what the
relay applies from a client that writes A's intent and pose, its own
pose by normalising paths, the scene and the AOI, and A's intent as A.
Mutants without the relay-id or canonical-path checks fail these.
- NoIntentOrUiDocsLeak now expects the echo refused by the write gate,
and ControlPlaneEgressDrops's pre-S7 baseline turns bound writes off.
transfix
added a commit
that referenced
this pull request
Oct 25, 2026
Bound writes (#807) is now squashed into feat/h1-admission; merged with its head as the base, so only this branch's own changes apply. The tree is unchanged.
transfix
added a commit
that referenced
this pull request
Oct 26, 2026
… field fixes, per-viewer video rungs and Opus mics (#796) The conference stack after #783, squashed through feat/h1-admission: - #796 admission hold: a late joiner's admit snapshot goes through its AOI filter (no other participant's intent, the outer peer by push). - #807 bound writes: a relay client writes only its own participant subtree, as itself. - #809 room token and a default device identity (section 5f); #816 device keys, TOFU-pinned by the relay. - #819 field fixes: a volume slider that holds still, a mover's own avatar that no longer jumps (the WS re-broadcast echoed its intent; the clock slews instead of seeking), and about 1/8 of the video bandwidth. - #821 per-viewer video rungs (the relay re-encodes each camera for each viewer's link: full / half / quarter / thumb / off, adapted from queueing, drops and budget), Opus mics (32 kbit/s instead of 1.5 Mbit/s), a camera-off flag, status dots, and libopus for the libcvc recipe (cvcpkg libopus cvc.8). - 05d0d60: the clock slews after any first sample, not only after a first seek (HolonTest.AClientInStepFromItsFirstSampleStillSlews), and two relay loopback tests bound wall-clock rates loosely enough for a Debug gRPC runner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #796 (
feat/h1-admission). This is §5e item 1 of the conference roadmap, connection-bound identity, without a credential yet.The problem
The relay applied and forwarded whatever a client sent. Any connected browser or native client could:
holon_sync.hcalled "sole writer" a convention.What this does
state_inbound_gate(new,cvc/state) is installed withstate_transport::set_inbound_gateon both relay transports. One gate is shared, so the binding spans gRPC and WebSocket. It governs only the connections the relay accepted. Connections it dialed, the WS<->gRPC bridge and the relay's own writes are not gated.total_inbound_rejected(). Over WS, the next broadcast also re-sends the relay's value to the client.room_write_gate(conference) is the room's rule:conf.rooms.<room>.participants.<pid>, and only value, touch ordata()ops;pose,net.relay, andstreams.<kind>.ready(SFU);bob..pose;An inventory of every client write (arigl, the browser client, the conference verbs, the bench) found nothing outside this rule.
arisrv:
--bind-writes on|off, on by default and not an S7 switch. It logsbound writes: refused N client frame(s)when the count grows. The bench mirrors the switch and records it in its JSON.cvc.dll: the gate's holder map is file-local, so the gate adds 73 names to
cvc.dll(65,200 of 65,535). It added 219 before that change.Review
An independent review of the first version found these, all fixed here:
..and padded path segments got past theposeexclusion;streams.<kind>.readybelongs to the relay.It also found that the first adversarial test couldn't catch a broken pose rule, because the server rewrites poses every tick. The test now checks what the relay applied from each client.
Testing
InboundGate{TakesOnlyWhatAPeerMayWriteAsItself, BindsANodeIdToOne*, RefusesTheRelaysOwnId, HandsASilentHoldersIdOver}. They cover another peer's path, spoofed origin on a mutation, message and media frame, a pushed snapshot, a duplicate claim, the departure rule, takeover through a real connection, and the relay's id.InboundGateSpansBothTransports.RoomWriteGate.{AParticipantWritesOnlyItsOwnSubtree, BindsOneConnectionPerNodeId, ASilentHolderIsTakenOver}.RoomRelayLoopbackTest.ClientWritesOnlyItsOwnParticipant: client M writes A's intent and pose, its own pose by normalising paths, the scene and the AOI, and sends A's intent as A. Nothing the relay applied from M lies outside M's participant or touches a pose, A never moves and never receives an intent, and M's own walk still works.NoIntentOrUiDocsLeaknow expects D'sui.docsecho to be refused by the write gate.ControlPlaneEgressDropsturns bound writes off for its "before S7" baseline. That relay had none, and bound writes would refuse the echo it measures.*Convergence*excluded as in CI.Known limits
These are also listed in the roadmap doc, §5h.1 ("Bound writes").
stream_relay, routed by stream id) isn't gated.