Protocol guide
Running a server
What a Sloppy Voice server deployment runs, how to size it on any infrastructure, how call control talks to relays and SFUs, and the runbooks for DNS, keys, outages, upgrades and restores.
Specification: 21 Deployment and operations
This page is for people who build or operate a Sloppy Voice server. Document 21 covers deployment and operations. Most of it is informative (profiles, sizing figures, product mappings, runbooks), but three parts are normative, and this page marks them where they come up:
- the relay-control interface between call control and relays (21 §6);
- the SFU adapter requirements for SFU-capable servers (21 §7.1);
- the operator requirements marked "(normative)": the shared deployment rules, the first-admin binding, the security journal and the restore procedure, plus the MUSTs of the key runbooks (21 §8) and of operator actions (21 §11.2).
A deployment that meets every normative requirement of documents 00 to 20 conforms, however it is built. Document 21 never changes a rule of another document; the protocol itself starts at the Introduction.
What a server runs
Every Server runs discovery, the HTTPS API and event WebSocket, the home-server and hosting-server roles, the server side of secure mode, a relay, and federation in both directions, even before it has any secure context (21 §2.1). There is no insecure-only server class (D-066): any server can host a secure DM and any account can turn on encryption at any time. The secure-mode server side (MLS Delivery Service, Authentication Service, storage for sealed content, HistoryShares and VisibilityGrants, KeyPackages, KeyBackups and AccountVaults) is storage and structural checks; none of it needs content cryptography on the server.
An SFU-capable server adds an SFU behind an adapter and the sfu-rtp/1 feature; the relay stays mandatory (D-045). Push gateways are run by whoever publishes a mobile app build, not by server operators (Notifications).
Components
| Component | Required | Typical open-source choice |
|---|---|---|
| HTTPS API and event WebSocket | Yes | The server, behind Caddy, nginx, HAProxy or Traefik |
| Database | Yes | PostgreSQL; SQLite for one node |
| Blob storage | Yes | Local disk for one node; an S3-compatible store (MinIO, Ceph RGW, Garage, SeaweedFS) for several |
| Call control, federation outbox, push sender | Yes | Part of the server |
| Relay | Yes | A Go/Pion data-channel relay, or any WebRTC stack with SCTP data channels and ICE-lite |
| SFU and adapter | No | Pion-based SFU, mediasoup, or a hosted SFU (Janus and LiveKit need workarounds, see The SFU adapter) |
| Key custody | Yes | HSM or KMS (PKCS#11, Vault Transit, OpenBao, a cloud KMS), or at minimum files outside the database |
| Security journal | Yes (normative) | Write-once object storage, an append-only file on the key host, or the key service |
| Time sync, validating DNS resolver, monitoring | Time sync required; the others recommended | chrony; Unbound; Prometheus |
The full inventory is 21 §2.2.
Network endpoints
| Endpoint | Transport | Reached by |
|---|---|---|
{base}/meta, {base}/v1/… |
HTTPS on TCP 443 (and UDP 443 for HTTP/3, if offered) | Everyone, with open CORS |
{base}/v1/events |
WebSocket over HTTPS | Clients |
https://<domain>/.well-known/sloppyv |
HTTPS on the domain's web host (optional) | Everyone |
{relayUrl}/connect |
HTTPS | Clients |
| Relay media | ICE-lite on UDP, plus passive ICE-TCP | Clients |
| SFU media | Per the SFU, usually UDP | Clients |
| Relay-control link | WebSocket over TLS at an operator-chosen URL, never under {base}/v1/ |
Relay nodes only |
Outbound, the server needs DNS, HTTPS to federation peers, OIDC providers, push gateways and Web Push services, and NTP (21 §2.3).
Rules for every deployment
These are normative (21 §2.4):
- Clocks. Nodes that sign, verify or timestamp SHOULD keep UTC within 1 s. Parties tolerate ±60 s of skew, and a deployment that spends that internally leaves none for its peers.
- TLS 1.2 or later (1.3 recommended) on every endpoint except relay media. Certificates SHOULD come from ACME with automatic renewal. The control link MUST use TLS unless both ends are on one host over loopback or a Unix socket.
- One server, one key set. Servers on one deployment MUST NOT share private or public keys (02 §14).
- The secure flag is one-way. Configuration decides whether a server is created secure (09 §3.1); once secure, no configuration, tool or storage edit may make it insecure (SM-7, D-073, 09 §12).
Deployment profiles
The four profiles of 21 §3 run the same protocol on very different infrastructure. None is required, and each can be built entirely from self-hostable open-source components (D-009).
Profile S: one binary
For a family, club or small community (a few hundred accounts, a few dozen people in calls) on a VM with 2 vCPU, 4 GB RAM and 100 Mbit/s:
DNS: _sloppyv.example.org TXT "v=sv1 url=https://chat.example.org"
|
Caddy (TLS, ACME) :443/tcp ---> sloppyvoice-server
|- HTTPS API + WS
|- call control
|- relay (Pion) :3479/udp, :3479/tcp ICE-TCP
|- federation outbox, push sender
'- SQLite + ./blobs
keys: /etc/sloppyvoice/keys (0600, not in the database)Call control and relay talk in process but keep the semantics of the relay-control interface, so the binary can be split later. SQLite in WAL mode with continuous backup (for example Litestream) gives an RPO of seconds, and the security journal is an append-only file next to the keys. The relay uses one UDP port with ICE ufrag demultiplexing, which is one firewall rule. There is no SFU; video goes through the relay. 100 Mbit/s of upstream carries about 1,000 relayed secure voice streams (21 §3.1).
Profile M: multi-node
For tens of thousands of accounts and thousands of concurrent call participants (21 §3.2). Only a few things need a single owner; they are sharded and fenced, and everything else is stateless:
- Contexts. One sequencer per context (consistent hashing on
ctxplus a fenced ownership lease) allocatesseq, appends durable events, and runs the MLS epoch compare-and-set, each in one transaction. It publishes committed events to a bus (NATS, Redis Streams, Kafka, PostgreSQL LISTEN/NOTIFY) for the WebSocket gateways. - Calls. One call-control owner per call, by
callId. Each relay's control link ends at one call-control node, the link holder, which forwards owners' messages to the relay and routes the relay's reports back (21 §6.2.1). - Relays. A pool per region, each node with its own relay URL, dialling call control.
- Federation. Outbox rows written in the transaction of the change that causes them.
- Keys. Private keys stay in the key service; nodes ask it to sign.
Failover of a sequencer or call-control owner uses a fencing token, so a node that lost ownership can't write after its successor started (21 §10.4).
Profile E: edge or CDN
The spec maps the components onto Cloudflare as one example of an edge platform, each next to its self-hosted equivalent (21 §3.3): Workers for the API, one Durable Object per context as sequencer, Durable Objects with WebSocket hibernation for event sockets, one Durable Object per call (with a 1 s alarm) and one per relay node as link holder, R2 for blobs, Queues for federation, and the Realtime SFU behind an adapter. Nothing in the protocol depends on any of them. Constraints worth knowing:
- The relay is mandatory and can't run in a Worker isolate. It needs long-lived UDP sockets, ICE-lite, DTLS, SCTP and per-recipient lease enforcement, so an edge deployment always includes at least one relay on ordinary compute, reachable on UDP.
- Placement. A context object lives in one location; distant users see higher command latency, but ordering stays correct.
- CPU limits. MLS commit validation is structural parsing, and verifying a SealedMessage or HistoryShare signature is about 50–100 µs, so both fit short request budgets.
- Keys MUST NOT be visible to every Worker deployment; isolate signing in one service. The platform joins the hosting server's trust domain: in insecure contexts it can read content, and in secure contexts it sees what the hosting server sees (21 §13 item 10).
Profile H: a hosting provider
A provider runs many customers' servers on one deployment, each with its own base URL, ServerMetadata, canonical domain, keys, accounts and community (21 §3.4). Offer customers same-site delegation (a CNAME plus an ACME certificate for their hostname). A provider that hands out hostnames under one registrable domain to unrelated customers MUST first list that domain in the PSL PRIVATE section (02 §9.3). Each tenant's private keys MUST be separate. Relays MAY be shared, with one control link per tenant (see Shared relays). Limits advertised for each tenant MUST still respect every floor, and a tenant that leaves moves its server with a URL-bound KeyRotation, keeping its canonical domain and accounts (02 §15.6).
Vendor neutrality
A deployment is vendor-neutral when every component can be replaced by an open-source equivalent without any change visible to clients or peers, nothing in ServerMetadata, tokens, events or URLs names a vendor or requires a vendor's SDK (a relay URL on a vendor's network is just a URL), clients never call an SFU's or cloud provider's own API, push uses the open gateway API, and the operator can run the relay on their own hardware (21 §3.5).
Scaling
The figures in 21 §4 are planning estimates at the protocol defaults. Measure your own.
Events
One writer per context allocates seq and appends each event in one transaction; contexts shard freely by ctx (21 §4.1). A message to n subscribed sockets is one database write and n socket writes, so serialise once and write the same bytes to every socket.
- Ephemeral events (typing, presence, call events, ticks) are never stored and are the first to go under pressure. A queued call.tick that has waited more than 250 ms since its snapshot was produced MUST be discarded, not sent (15 §4.4).
- Keep the replay window (
maxReplayEvents, at least 1,000 events and 24 h) near the gateways, so reconnect storms don't hit the sequencers. - After a gateway restart, spread
retryAfterMsover 0–30 s, with at most 2 s for sockets of sessions participating in a call (03 §5.10). Size gateways for a full reconnect within about 60 s. - Close a socket whose send buffer stays full with the overflow rule of 03 §7.6; its client resumes from its last
seq.
Calls
Each active call costs one snapshot per second to its relay (and SFU adapter) and one call.tick per participating device per second: 2,000 calls with 20,000 seats is 2,000 snapshots/s and 20,000 ticks/s (21 §4.2). A call owner persists the call, its seats with pids and rejoin tokens, and the highest snapshot seq it may have used; a new owner continues with seq = max(last + 1, now in Unix ms). An owner that can't recover a call ends it with server_restart. Snapshots go out every 1,000 ms ± 100 ms. Revocation snapshots SHOULD leave within 100 ms and MUST within 500 ms of the decision, so never put them behind a batch timer.
A relay forwards each frame once per eligible recipient and never decodes, so its cost is packets and bytes (21 §4.3). A relayed Opus voice stream is about 74 kbit/s insecure and 85 kbit/s secure (93 kbit/s secure over IPv6). Egress for N seats with S people talking is about S × (N − 1) × 85 kbit/s:
N |
S |
Egress |
|---|---|---|
| 10 | 1 | 0.8 Mbit/s |
| 50 | 2 | 8.3 Mbit/s |
| 200 | 1 | 16.9 Mbit/s |
| 200 | 3 | 50.6 Mbit/s |
Video through the relay costs the sender's bitrate per viewer (a 2.5 Mbit/s share to 40 viewers is 100 Mbit/s), which is why 15 §7.2 recommends the SFU route above 8 seats with video. Packet rate matters more than bytes: a 200-seat call with one speaker is about 10,000 packets per second out, and a Go/Pion relay on one modern core handles on the order of 100,000 to 200,000 forwarded data-channel messages per second. Keep per-recipient queues bounded (drop at 8,000 buffered octets or 60 ms, 16 §8.1) so one slow listener never slows the others.
Storage and queues
- MLS (21 §4.5): GroupInfo is about 1.1–1.4 KiB per leaf; commits are 2–10 KiB, kept at least 30 days. Run the epoch fence as a compare-and-set on the primary. Set reverse-proxy body limits for
…/mls/commitsand…/mls/bootstraptomaxMlsUploadBytes(default 8 MiB), separately frommaxRequestBytes. More than 3 commits in flight for one group get 425 withretryAfterMs; treat that as back-pressure. - KeyPackage claims MUST be atomic and single use: deleted in the transaction that returns them.
- Attachments (21 §4.7): downloads MAY redirect to a presigned URL that expires within 10 minutes. Deleted blobs stop being served at once, are deleted within 24 h, and leave backups within the backup rotation (at most 30 days), so object-store versioning that keeps old versions for 90 days breaks the rule. A secure blob of a 25 MiB file is
svf1Size(maxAttachmentBytes)= 27,269,675 bytes, and proxy and object-store limits must allow it. Serve every blob withnosniff, a sandbox CSP andContent-Disposition: attachment. - Federation (21 §4.8): enqueue in the transaction of the causing change. Keep two lanes per destination,
high(revocations, deletions, call rings) andnormal, with at least 2 concurrent requests per destination per lane, and fan revocations out to at least max(32, ⌈P / 50⌉) destinations in parallel, where P is the account's number of audience peers. A down peer accumulates up to 24 h of events. Monitor the p95 of revocation fan-out against the 10 s target. - Push is its own queue, separate from federation. You need no gateway unless you publish an app build, and Web Push needs only a VAPID key.
gatewayPolicydefaults toany;listedstops background notifications for every app whose gateway isn't listed, including the official apps unless the official gateway is on the list (21 §4.9).
Where strong consistency is required
| Operation | Consistency |
|---|---|
seq per stream (context, me, community) |
Single writer, gap-free |
| MLS epoch | Compare-and-set on the group row |
| KeyPackage claim | Atomic remove-on-claim |
jti of HomeAssertions, S2S tokens and RelayTickets |
Single use across every node that accepts the token type |
IdentityState ver |
Strictly increasing, never reused, even across a restore |
| Idempotency keys and client-generated IDs | Unique per scope for at least 24 h |
Lease snapshot seq |
Strictly increasing per call |
| Pairing session attempts | One attempt per session |
| Channel and server security flags | Never go back to insecure |
Profiles, presence, read state and typing tolerate eventual consistency (21 §4.10).
Relay deployment
A relay terminates one RTCPeerConnection per participation, validates RelayTickets, applies LeaseSnapshots and re-emits them as call.tick, and forwards media per recipient. It never decodes, decrypts, mixes or stores media and holds no durable state (21 §5.1). The client side is on Calls.
Network requirements (21 §5.2):
- ICE-lite with public host candidates on UDP. Behind a 1:1 NAT, as on most cloud VMs, the relay MUST advertise the public address, or clients can't reach it.
- One UDP port per node with ufrag demultiplexing is recommended, to keep firewall rules simple.
- Offer passive ICE-TCP, preferably on TCP 443. Sharing 443 with the API needs a front end that tells TLS from RFC 4571 framing; otherwise use a separate IP.
- No TURN or STUN. Every call's media goes through the hosting server's relay or SFU (D-094), and relays have public addresses that clients reach by design, so a deployment runs no TURN or STUN service.
{relayUrl}/connectanswers CORS like a/v1/endpoint and MAY sit behind the API's reverse proxy, but the UDP and ICE-TCP media ports are reached directly.
Rejecting an invalid ticket costs one Ed25519 verification, and WebRTC resources are allocated only after a valid one. Rate-limit failed /connect attempts per IP (for example 30 per minute), and limit valid tickets per issuer and per (cid, pid). If you keep a per-IP cap on all /connect requests, size it for carrier-grade NAT, offices and schools (several hundred per minute, with bursts), because during a failover or drain everyone behind one address reconnects within seconds. Drop unsolicited UDP at the network edge where possible.
A relay SHOULD NOT log addresses, device IDs or IP addresses outside security logs kept at most 7 days, and MUST NOT log media payloads, SFrame KIDs or counters, or SDP bodies beyond what is needed to debug a failed negotiation (21 §5.4). Clients never send media or signalling to each other directly; every call path ends at the hosting server's relay or SFU, so no participant learns another's IP address from a call, and only the hosting server and the operator of its relay or SFU see it (21 §13 item 8). On a relay that serves several servers, every call is keyed by (issuer, callId) and queues, inbound caps and metrics are kept per session and per issuer (21 §5.3).
The relay-control interface
This section is normative. 15 says what call control decides and what relays enforce; 21 §6 says how they talk. The semantics bind every server, including a single binary. The wire binding sloppyv-relay-control.v1 is REQUIRED when call control and relay are separate programs that can be upgraded or replaced independently, and RECOMMENDED whenever the relay is a separate process (21 §6.1). A published binding lets you pair any server implementation with any relay.
Connection
The relay is the WebSocket client and dials the issuer's control URL, which you configure on the relay with the issuer's canonical domain (21 §6.2.1). Relays can then scale out and sit behind NAT without call control tracking their addresses.
- The control URL is
wss:,ws:on a loopback host, or a Unix socket. It MUST NOT be under{base}/v1/, isn't in ServerMetadata, and SHOULD be reachable only by relays. - The subprotocol is
sloppyv-relay-control.v1; without it, call control answers HTTP 400 core.unsupported_version. - The relay authenticates with
Authorization: Bearer <credential>(at least 128 random bits, one per relay node and issuer) or a TLS client certificate mapped to onerelayId. Call control stores only SHA-256 hashes, compares in constant time, and MUST accept at least two credentials per relay node at a time so you can rotate without downtime. Failure is HTTP 401 core.unauthenticated; the relay keeps retrying but alerts you after 3 consecutive authentication failures (21 §6.2.2). - The relay authenticates the issuer too. Its configuration binds each control URL to one issuer. It MUST verify the server's TLS certificate (except over loopback or a Unix socket), MUST close with 4003 if the welcome names another issuer, and MUST refuse a second link claiming the same issuer from a different control URL. A relay serving issuers run by different operators SHOULD also check the
signkeys it receives against the issuer's ServerMetadata. On a shared relay, an issuer taken on trust from call control would let one tenant mint tickets for another tenant's calls. - A relay node opens at most one link per issuer. With multi-node call control, the accepting node is the link holder, recorded in a fenced deployment-wide record.
Every message is one UTF-8 text frame holding one I-JSON RelayControlMessage of at most 1 MiB, with members v (1), t (type), id (UUIDv7), optional re (the id answered), ts (informative) and d (payload). A v other than 1 closes the link with 4026. Receivers ignore unknown members and messages of unknown t. Binary frames close the link with 1003 (21 §6.2.3). The relayctl.* types belong to this subprotocol only: they never appear on a client WebSocket, a relay data channel or a federation endpoint.
t |
Direction | Purpose |
|---|---|---|
| relayctl.hello / relayctl.welcome | relay → control / control → relay | Register and resynchronise |
relayctl.keys / relayctl.keys_ack |
control → relay / reply | Replace the issuer's sign key set |
relayctl.call_open |
control → relay | Create call state |
| relayctl.snapshot / relayctl.ack | control → relay / reply | Deliver and acknowledge LeaseSnapshots |
relayctl.session_close |
control → relay | Close one participant's session |
relayctl.call_drain, relayctl.call_close |
control → relay | Migrate a call away; free a call |
relayctl.session_up, relayctl.session_down |
relay → control | Drive the seat state machine |
relayctl.load, relayctl.call_stats |
relay → control | Load and video fan-out, every 5,000 ms (load also at once when its state changes) |
relayctl.ping / relayctl.pong |
control → relay / reply | Heartbeat every 1,000 ms |
relayctl.error |
Either | A problem object; never closes the link itself |
On close codes 1000, 1001, 1003 and 4008 the relay reconnects; on 4009 (replaced by a newer link) it doesn't; on 4001 (credential revoked), 4003 (forbidden or wrong issuer) and 4026 (unsupported version) it stops retrying and alerts you (21 §6.2.4).
Registration
From the transcript in 21 §6.13, a relay registers with b.com:
{ "v": 1, "t": "relayctl.hello", "id": "01938f3e-0001-7000-8000-000000000001", "ts": "2026-12-04T18:19:58.001Z",
"d": { "relayId": "fra-1", "protocol": "1.0", "urls": ["https://relay1.b.com/r"],
"software": "pion-relay/0.9.2", "region": "eu-central",
"capacity": { "maxSessions": 4000, "maxEgressKbps": 900000 },
"state": "accepting", "calls": [] } }{ "v": 1, "t": "relayctl.welcome", "id": "01938f3e-0002-7000-8000-000000000002",
"re": "01938f3e-0001-7000-8000-000000000001", "ts": "2026-12-04T18:19:58.010Z",
"d": { "issuer": "b.com", "protocol": "1.0", "linkId": "01938f3e-0003-7000-8000-000000000003",
"keysVersion": 7,
"keys": [ { "kty": "OKP", "crv": "Ed25519", "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo",
"kid": "b.com#2026-12a", "purpose": "sign", "status": "active",
"nbf": 1764720000, "exp": 1796256000 } ],
"revoked": [], "heartbeatMs": 1000, "maxInboundKbps": 10000 } }Each side gives the other 10,000 ms for the handshake before closing with 4008. Until the welcome, neither side sends anything else. The relay offers its binding version in protocol ("1.0" in this version) and call control answers with the highest minor of the shared major; if it can't speak the major version it sends core.unsupported_version and closes with 4026. keysVersion never decreases for an issuer, keys holds 1–16 sign ServerKeys, and revoked lists the RFC 7638 thumbprints of every sign key revoked in the last 400 days. Call control checks that every URL in urls is allowed for that relayId (otherwise core.forbidden and close 4003). After the welcome it sends relayctl.call_open and the newest snapshot for every call assigned to the relay, so a restarted relay (empty calls) gets its calls back. For each listed call not assigned to the relay it sends relayctl.call_close with reason migrated, lost or unknown (21 §6.4.1). Open-call state is per link, so the relay treats the repeated call_open for a call it still holds as an identical open and keeps its sessions.
Keys
The welcome's key set always replaces what the relay had; later relayctl.keys messages carry {keysVersion, keys, revoked}, are applied atomically only if keysVersion is higher than the one held, and are answered with relayctl.keys_ack {"keysVersion": n} naming the version the relay now holds (21 §6.4.2). Call control:
- MUST send
relayctl.keyson every link within 1,000 ms of anysignkey change; - MUST NOT sign a RelayTicket with a key until every
linkedrelay that may receive its calls has acknowledged a version in which the key is usable (active, ornextwith itsnbfpassed), or relays would reject the first tickets; - treats a relay that hasn't acknowledged within 2,000 ms as failed: it closes the link with 4008, stops assigning calls to it, and fails its calls over unless it links again within 1,000 ms. A new key therefore waits at most about 3 s, and revocation is never blocked;
- MUST persist
keysVersionso it never decreases. The Unix time in milliseconds of the change is a simple choice.
When revoked gains a thumbprint, the relay MUST close every session whose ticket that key signed, whatever the ticket's iat, with relay.closing reason drain and retryAfterMs: 0, reporting each as session_down reason key_revoked. Honest clients rejoin as a planned migration; a session opened with a forged ticket has no rejoin token and can't come back (21 §6.7). The relay also rejects with relay.ticket_invalid any ticket whose ctx or sec differs from the call's relayctl.call_open.
Calls and snapshots
relayctl.call_open carries callId, ctx, security, the assigned url, the allowed profiles and an optional maxInboundKbps. The relay forwards nothing for the call until a snapshot arrives. Repeating it with identical values is a no-op; changing security, ctx or url is refused with core.conflict, while profiles and maxInboundKbps MAY change and apply to new sessions. An unknown security value is refused with core.invalid_request (21 §6.4.3).
relayctl.snapshot carries 1–256 LeaseSnapshots. For each, the relay returns unknown_call if the call isn't open on this link, invalid if it breaks 15 §4.2, stale if its seq isn't above the held one and the held one is under 3,000 ms old, and otherwise applies it, emits it as call.tick (SHOULD within 50 ms) and returns applied. It acks within 100 ms (combining acks produced within 20 ms) with {"acks": [{callId, seq, result, heldSeq}, …]}. On unknown_call, call control sends relayctl.call_open and the newest snapshot; on invalid, it records an error and resends the newest snapshot with a higher seq; an unknown result counts as invalid (21 §6.4.4). Muting someone for everyone is an immediate snapshot without their pid in audio:
{ "v": 1, "t": "relayctl.snapshot", "id": "…", "ts": "2026-12-04T18:22:30.402Z",
"d": { "snapshots": [ { "callId": "01938f40-5a6b-7c8d-9e0f-102132435465", "seq": 1334, "validMs": 3000,
"audio": [3], "video": [3, 7], "listeners": [3, 7], "epoch": 42 } ] } }Delivery rules (21 §6.6):
- Never send a snapshot for a call before
relayctl.call_openfor it on that link. - Send each snapshot to every relay that has the call open, both of them during a migration.
- Write immediate snapshots unbatched, within 500 ms of the decision; periodic ones MAY be batched within 50 ms.
- Never write a snapshot more than 250 ms after it was produced; discard it. The relay measures age from arrival, so a queued snapshot would look fresh. Keep the link's send buffer small (for example at most 64 KiB), and close a link that hasn't accepted a write for 3,000 ms with 4008.
- Don't queue snapshots across a link loss; after resynchronisation send only the newest.
- A snapshot is acknowledged when call control has an ack with
appliedandseq≥ the snapshot's, orstalewithheldSeq≥ it. For Move voice here (15 §11), every relay that has the call open must acknowledge it, or 3,000 ms must pass since the last snapshot that listed the movedpidwas sent.
Sessions and call ends
The relay reports relayctl.session_up (with callId, pid, did, sub, relaySessionId) within 100 ms of welcoming a client. Call control checks that a seat with that pid exists and belongs to did; otherwise it closes the session with reason revoked and records a security diagnostic. When a new session replaces an older one for the same (callId, pid), the relay MUST send session_up for the new one before session_down reason replaced for the old one (21 §6.5.1). To remove someone, call control sends the snapshot that drops the pid, then relayctl.session_close within 500 ms with the relay.closing reason to pass on (21 §6.4.5).
session_down reasons client_gone, transport_closed, overloaded (also treat the relay as full), relay_shutdown and drain_deadline (unless the seat already moved to the new relay) move the seat to reconnecting; key_revoked follows the failover migration-window rule below; replaced and instructed change nothing; an unknown reason counts as transport_closed. Call control identifies a session by (relayId, relaySessionId) and ignores reports about a session that isn't the seat's current one (21 §6.5.2).
call_close reason |
When | Client receives relay.closing |
|---|---|---|
ended |
A terminal end | call_ended: the client leaves |
restarted |
Ended with security_upgraded or group_restarted |
call_restarted |
migrated |
Moved to another relay | drain, retryAfterMs: 0 |
lost, unknown |
Call control lost the call's state (server_restart) or has no record |
timeout: the client makes a fresh join |
The relay treats an unknown reason as unknown.
Warning
Never send ended for a call that ended with server_restart (use lost) or with security_upgraded or group_restarted (use restarted). call_ended makes clients leave for good, while an upgrade or restart is a planned migration into the replacement call and server_restart is repaired by a fresh join (21 §6.4.7).
Failure, drains and failover
Call control pings every 1,000 ms, and each side treats 3,000 ms of silence as link loss (21 §6.8). The relay keeps its sessions and retries at 250 ms, 500 ms, 1 s, 2 s, then every 2 s, each ±20 %; forwarding stops by itself 3 s after each call's last snapshot, and after 30 s in lost it closes that issuer's sessions without relay.closing and frees the calls. Call control moves the link to suspect; if the same relayId links again within 1,000 ms it resynchronises, otherwise it fails every call over. A crashed relay that resets its TCP connections is failed over about 1 s after the crash, before clients notice on their own at 5 s; a hung one at about 4 s.
- Drain (21 §6.9.1): the relay reports
state: "draining". Call control stops assigning it calls and migrates each one:relayctl.call_openand snapshots to the new relay, call.migrate reasondrainto participants, andrelayctl.call_drainto the old relay, pacing at no more than 20 calls per second (SHOULD). The old relay sendsrelay.closingreasondrainwithretryAfterMs: 0, keeps forwarding, and closes stragglers at 10,000 ms withsession_downreasondrain_deadline. After the window call control sendscall_close(migrated); once the relay has no calls it closes its links with 1001. Nobody hears a gap, and mic and push-to-talk state are kept. - Failover (21 §6.9.3): the same migration without waiting for the old relay's
session_down, paced no slower than 200 calls per second (SHOULD NOT be slower). Aconnectedseat whose session was on the failed relay staysconnectedfor the 10 s migration window; if the new relay hasn't reported it up by then, it becomesreconnectingwithlostAt= the failover time and is removed withtimeout30 s afterlostAt(test vector RC-6: failover at 1,005 ms,reconnectingat 11,005, removed at 31,005). With no relay available, connected seats go toreconnectingat once and rejoins get call.relay_unavailable (503,wait). Listeners hear a gap of about 1–4 s; clients treatcall.migrateas planned and keep mic and push-to-talk state. - Assignment is local policy (21 §6.10): for example the region nearest the first joiner, then the node with the lowest
max(sessionsTotal / maxSessions, egressKbps / maxEgressKbps), skipping nodes above 0.8. DM calls, 1:1 and group, are relayed exactly like channel calls, so plan relay capacity for DM call media as well.
Shared relays and cascading
A relay node MAY serve several hosting servers, with one link per issuer, each with its own credential, and every call keyed by (issuer, callId). A ticket opens a session only in a call of the link whose issuer equals its iss (21 §6.11). With no such call, the relay waits up to 2,000 ms and answers relay.call_unknown. A shared relay is inside each server's trust domain and hears everything in insecure calls, so operators should share only relays they control (21 §13 item 2). Cascading one relay URL over several nodes is OPTIONAL and NOT RECOMMENDED, because an SFU is the better tool for very large video calls; if you do it, every rule of 15 must hold for the cascade as a whole, with one anchor node per call holding the control link.
Relays and call control SHOULD export the metrics of 21 §6.12, under their recommended names (sv_relay_sessions, sv_relay_dropped_total, sv_relay_calls_stale, sv_callctl_snapshot_interval_seconds, …) so shared dashboards work. Labels MUST NOT identify a person: no addresses, device IDs, pids, callIds or IP addresses. issuer and the enumerated reason, result and channel labels are allowed.
The SFU adapter
The adapter is the part of call control that turns the operations of 15 §8.5 into calls on a particular SFU, through the SFU's native API (21 §7.2). Its requirements are normative for SFU-capable servers (21 §7.1):
- Hide the SFU. Clients exchange SDP only with call control and never need a vendor library.
- Apply every snapshot within 1,000 ms: forward a track only while its publisher is covered, and send nothing to a subscriber outside
listeners. If a change can't be confirmed in time, close that participant's SFU session. - Dead-man rule. With no snapshot for 3,000 ms, pause all forwarding for the call.
- The SFU can't outlive its adapter. It MUST stop forwarding within 3,000 ms of the adapter stopping, even after a crash: run the adapter in the SFU's process, make the SFU its child process, or use an SFU-side keepalive refreshed at least every 1,000 ms. Restarting a crashed adapter isn't enough, because only the SFU can stop a kicked listener from receiving.
- Pass secure media through untouched. No transcoding, no re-packetising across frame boundaries, no change to the encoded frame. The SFU may read the clear prefix and rewrite the RTP header fields it manages, the VP8 and VP9 payload descriptors and the Dependency Descriptor extension. An SFU that has to parse encrypted bytes for layer switching can't carry secure calls, and the adapter MUST then refuse
sfurouting for them, keepingvideoRouteatdc. - One SFU session per device per call, closed with the reasons of
sfu.closed; report session and track events so call control can emitsfu.tracks_changedandsfu.closed; carry no media keys and log no media payloads.
A Pion-based SFU is the closest fit and the recommended starting point; mediasoup works with an SDP-to-ORTC translation layer; Cloudflare's Realtime SFU is one hosted option that meets rule 4 only through a session time-to-live or a replicated adapter. Janus VideoRoom and LiveKit (in its default mode) use two PeerConnections per device, which 15 §8.1 doesn't allow today, and LiveKit would also need a bridge from its own client signalling to 15's SDP exchange. The mappings are in 21 §7.3 to 21 §7.6; check them against the version you deploy. Skip the SFU for small, mostly-voice communities or when you can't run UDP services beyond the relay; run one for regular screen shares to more than about 8 viewers or webcam grids, and for large secure video calls choose one that passes SFrame payloads through (21 §7.7).
DNS setup
How discovery works is on Discovery. As an operator:
Pick the canonical domain first. It can never change in v1 (D-032). Prefer a domain the organisation will keep, such as example.org, over a host name such as chat.example.org; host names can be added later as aliases (21 §11.1).
Publish the delegation at _sloppyv.<domain>:
_sloppyv.example.org. 3600 IN TXT "v=sv1 url=https://chat.example.org"Choose same-site delegation where you can. The evidence peers record decides whether a later move or key emergency suspends federation (02 §15.1):
| Setup | Evidence |
|---|---|
| Base URL on the domain or a subdomain of it, with a certificate for that host | same-site |
Hosted with your own hostname: voice.customer.org CNAME tenant8f2.voicehost.net. plus an ACME certificate for voice.customer.org |
same-site |
Provider hostname, plus https://<domain>/.well-known/sloppyv naming the same URL |
wellknown |
| Provider hostname in a DNSSEC-signed zone | dnssec |
| Provider hostname and nothing else | dns-only: works, but any later move or key emergency suspends federation until other admins accept it |
- Use a TTL of 3,600 s, lowered to 300 s a day before a planned move.
- Use a DNSSEC-validating resolver on the same host or over an authenticated channel (02 §15.2).
- Let the server self-check each of its
domainsat start-up and at least every 6 hours, and alert on a domain that doesn't resolve to its base URL, resolves withdns-onlyevidence, or is near certificate expiry (02 §15.3).
Aliases (21 §11.4): add the domain to domains before publishing its record, then run the self-check. To remove one, keep it listed and delegated for at least 365 days after the last link that used it, remove the record, wait at least 24 h, then remove it from domains, and keep the registration so nobody else can take it.
Moving to a new base URL (02 §15.6, 21 §11.9): bring up the new URL with the same database, rotate the sign key with a KeyRotation naming the new URL at least 25 h before switching, lower the TTL to 300 s, change the record, and keep the old URL serving for at least 24 h. Every later KeyRotation, of any purpose, names the new URL. Signed-in users stay signed in.
Key rotation runbooks
The runbooks of 21 §8 apply the key lifecycle of 02 §11, summarised on Discovery.
Custody
From 21 §8.1:
- Generate keys inside the HSM or KMS where possible, and never put private keys in the database or its backups.
- Keep one
signand onemls-external-senderkeyactive, plus a standbysignkey published asnext, its private part stored apart from the active key. - Keep the published key set, the full
keyChainand the highest KeyRotationnin the key service or the security journal, so a database restore can't roll them back. - Only the signing service holds key handles; API nodes ask it to sign.
- Every active key's
expmust stay later than now + 7 days + 25 h. Warn at 30 days and page at 8 days and 1 hour, the last moment a rotation can still start in time.
R1: routine sign rotation
Promote the standby K2 over the active K1 at time T (21 §8.2):
| When | Step |
|---|---|
≥ 25 h before T |
K2 is published as next with nbf ≤ T and a KeyRotation signed by K1. Check from outside that GET {base}/meta lists it. |
T − 5 min |
Confirm every linked relay has acknowledged a keysVersion listing K2 as next with nbf ≤ T; resend relayctl.keys to any that hasn't. If many relays fail to acknowledge, stop and investigate before T. |
T |
K2 active; K1 retired with retiredAt = T and exp ≥ T + 7 days. Sign everything with K2. Send relayctl.keys. Purge any cache in front of /meta, then send discovery.metadata_changed. |
T + 1 min |
Publish the next standby K3 as next with nbf ≥ now + 25 h and a KeyRotation n + 1 signed by K2, whose url is the base URL named by the highest element of keyChain. |
T + 7 days |
K1 passes exp. Remove it within 30 days and destroy it. |
Peers have pinned a standby for weeks, so even stale caches accept it, and each routine rotation exercises the emergency path. Users see nothing. R2, the mls-external-sender key, rotates the same way, except that its KeyRotation is signed by the active sign key, and at T the server sends, in every current secure group, a GroupContextExtensions proposal signed by the old key that names the new one. The proposals don't freeze groups; the next member commit takes them in. That is one commit per group, so rotate this key at most every few months (21 §8.3).
R3: the sign key is compromised
Aim to stop accepting the key everywhere within 1 h of detection (21 §8.4):
- Contain. Disable the key in the HSM or KMS. Set
rvtto the earliest possible exposure or, if that is unknown, the time of the oldest backup or host image that could have held it. - Replace. Make the standby
activeat once (the 25 h rule is waived). Without one, generate a new key; it has no KeyRotation, because a revoked key can't vouch for its successor. Neither this step nor step 4 waits on an unresponsive relay. - Publish the key as
revokedwithrvt, purge caches, and senddiscovery.metadata_changedwithurgent: trueto peers within 10 s and to every open socket. - Relays. Send
relayctl.keys; relays close every session opened with the key. - Re-sign every IdentityState with the new key. Unchanged content keeps its
ver. - Expect suspensions from peers that pinned you with
dns-onlyevidence and never saw the replacement key. If your delegation is cross-site, publishing/.well-known/sloppyvgiveswellknownevidence and lets them resume by themselves. Contact the admins of important peers through their ServerMetadatacontact. - Assess what the key could have forged since
rvt; 21 §8.4 gives the remedy per object. - If the host was compromised, also rotate the
mls-external-senderkey, relay credentials, the VAPID key, OIDC secrets and database credentials. - Record
server_key_incidentin the audit log with actor kindoperator.
Warning
A stolen sign key can forge RelayTickets and take over a participant's relay session. In insecure calls that means hearing, seeing and speaking as them until step 4. Secure calls stay protected by SFrame and MediaAttestation.
R4. A compromised mls-external-sender key is revoked, and a new key is activated with a KeyRotation signed by the active sign key. The old private key is kept for one job only: signing the replacement GroupContextExtensions proposals, and Remove proposals in groups that haven't committed the rotation. A group that hasn't committed it after 30 days is retired. R5. A lost sign key is handled like R3 steps 1 to 6, with rvt set to the loss time. A lost mls-external-sender key can't sign the replacement, so you retire the current generation of every secure group that names it (reason operator), and members move on without being asked (21 §8.5, 21 §8.6). Relay credentials rotate by adding the new one, reconfiguring the relay and removing the old one; a removed credential closes the link with 4001 (21 §8.7).
Peer suspensions
When a peer's base URL or key set changes without continuity, admins get discovery.peer_suspended. Read the pin with GET /v1/resolve/pins/{domain}. If the reason is base_url_changed or keys_changed and the peer announced the change, accept exactly what was observed with POST /v1/resolve/pins/{domain}/accept; otherwise wait, since many suspensions resolve once the peer adds strong evidence. key_unrevoked and secure_downgrade can't be accepted. Accept canonical_changed, chain_fork or chain_rollback only after talking to the peer's operator: a canonical domain can't change in v1, and a fork or rollback suggests a key compromise or a restored server (21 §8.8).
Outages
No outage produces a security warning (21 §9.1). The intended user experience is in the matrix; Client requirements and document 20 own the exact copy.
| Down | Still works | Stops | Recovery |
|---|---|---|---|
| Home server | Chat and calls on other servers where the user has a session, extended up to 24 h | Sign-in, new devices, DM requests and pushes to its users | Automatic; senders queue events for 24 h |
| Hosting server | Everything on other servers | Its contexts and calls | Clients retry sends with the same IDs and rejoin |
| One relay node | Calls on other nodes | Media through that node | Failover in about 1–4 s, as a planned migration |
| All relays | Everything but calls | Calls: joins get call.relay_unavailable |
Clients retry while the call screen is open |
| SFU | Voice, which never uses the SFU | sfu-rtp/1 video |
Call control SHOULD switch videoRoute to dc |
| Push gateway | Foreground apps, web, desktop | Background wake-ups for that app build | Devices fetch records when they next run |
| DNS | Cached resolutions (24 h fresh, 7 days stale) | First contact with new servers | Keep TTLs at 3,600 s |
| Database primary | Calls in progress | Every write | Fail over to the synchronous replica |
| Call-control node | Media for 3 s on the last snapshot | Snapshots for its calls | Fenced handover, or server_restart |
21 §9.2 suggests alerts (SHOULD) on at least:
/metaunreachable from outside (2 failed probes 1 minute apart), and any self-check failure;- active key expiry (warn below 30 days, page below 8 days and 1 hour) and TLS expiry under 14 days;
- revocation fan-out p95 over 10 s for 15 minutes, the oldest
high-lane federation event over 5 minutes, and any new peer suspension; sv_callctl_snapshot_interval_secondsp99 outside 0.9–1.1 s over 5 minutes,sv_callctl_revocation_push_secondsp99 over 0.5 s,sv_relay_calls_staleabove 0 for 10 s, andqueue_fullplustoo_latedrops above 2 % of forwarded;- sustained MLS 425 answers, reports waiting with no admin able to see them, and disk, replication lag and backup age;
- a sustained rise in
call_failurereports over the previous 7 days, often the first sign of a relay or network problem users can't describe.
Version skew and upgrades
Different minor versions interoperate by design: minor versions are additive, unknown members are ignored, and each side uses the intersection of advertised features. A new major version is served alongside /v1 for at least 12 months (21 §10.1, HTTP API).
During a rolling upgrade of one deployment (21 §10.2):
- Advertise last. Add a version, feature or raised limit to ServerMetadata only when every node supports it. Otherwise a client that learned it from
/metahits an old node and gets core.unsupported_feature. - Withdraw first. Before removing a feature or lowering a limit, update ServerMetadata and wait its
max-age(at most 86,400 s) plus 60 s. - Messages between nodes, the relay-control link included, change additively or are versioned.
- Schema changes follow expand, migrate, contract, and never rewrite
seq,veror epochs downwards.
Upgrade relays one at a time by draining them. Move SFU nodes' calls to videoRoute: dc, or close their SFU sessions with sfu.closed so clients recreate them elsewhere, before upgrading; voice is never on the SFU. Call control SHOULD support the previous minor version of the relay-control binding for at least 12 months. Ownership of contexts and calls moves with a fencing token checked on every write; the old call owner stops snapshots only after the new one has started. Gateways close sockets with code 1012 and are drained one at a time (21 §10.3, 21 §10.4).
Warning
Rolling back software is allowed when the older version reads the current schema, after withdrawing what the newer version advertised. Rolling back data is a restore. Never roll back a database to undo an operation, in particular a channel or server upgrade (21 §10.6).
Setting up a server
The checklist of 21 §11.1:
- Choose the canonical domain and base URL, and publish the delegation (DNS setup).
- Get ACME certificates for the base-URL host, the relay host and any
.well-knownhost. - Create an active
signkey, a standbysignkey and an activemls-external-senderkey in the key service. - Register as an OIDC client with each login provider and set registration to
open,inviteorclosed. - Decide whether the server starts secure. Starting secure is simpler than upgrading later, but every account homed there must then turn on encryption at sign-up. The setting defaults to
secure: false, and an implementation MUST NOT default it to secure. - Name the first admins (below).
- Set up at least one relay with a public UDP port and its credential. Every call's media, in channels and DMs alike, goes through it or an SFU. Clients send call-failure reports by default: decide which of the server's own admins read them (nobody else may, and for at most 30 days), and say in the privacy information that the server receives them.
- Keep
gatewayPolicyatanyunless you must control where wake-ups go; withlisted, include the official gateway's base URL if users of the official apps should get notifications. Generate a VAPID key for Web Push. - Set federation policy:
open, orallowlistfor private servers. - Set up backups and monitoring before the first user signs up, and publish ServerMetadata
contactso other operators can reach you during incidents. - Verify from outside: resolve the domain like a peer, fetch
/meta, sign up, make a test call through the relay, and DM an account on another server.
First admins (normative). Configuration names each first admin as a local part bound to one sign-in identity: a login provider identity (provider ID, issuer and subject), or a one-time setup token shown only to the operator, valid for 24 h and presented at sign-up as setupToken. The server MUST reserve the local part (a class A reservation) and let it be taken, and grant admin, only to that identity or token holder, never for the local part alone; otherwise whoever signed up first under that name would get every power, including the irreversible server upgrade. If the account already exists, the role is granted at its next sign-in with the bound identity, and the grant is audited with actor kind operator (21 §11.1 item 7, Roles and moderation).
Some actions have no protocol role and need operator tools, recorded in the audit log with actor kind operator where document 10 says so: naming first admins, removing another person's admin role, suspending and restoring a local account, assigning reserved local parts or releasing a quarantined one early, handling reports no admin may see, retiring a broken MLS group, and accepting or deleting peer pins. An operator MUST NOT use storage access to do anything the protocol forbids, such as making a secure context insecure; clients detect that as W9 (21 §11.2).
Enabling a secure server encrypts every channel, requires every local account to turn on encryption, and can't be undone (21 §11.3, Communities). The upgrade needs a local account holding the admin role (manage_community isn't enough), with encryption on, confirming from an enrolled device. Before confirming it through the W5 dialog: make sure every admin who will remain one has a secure account, an enrolled device and a saved recovery key, run PATCH /v1/community with dryRun: true and read the plan, tell the community, replace webhooks and insecure bots, take a backup and check the security journal is being written, and pick a quiet time, because calls in channels restart and insecure DMs close. The server applies the change atomically; allow up to 120 s.
Federation blocks stop everything with an abusive server within 60 s, DMs included, and cover every alias of the peer; a community ban keeps its accounts out while DMs and revocations still flow (21 §11.5, Federation). For 30 days after a block the server still sends identity.changed, device.revoked and account.deleted about its accounts that had sessions at the peer, so the peer can end them. Unblocking restores federation for new requests only. The spec's example, with PUT /v1/federation/blocks/{domain}:
PUT {base}/v1/federation/blocks/spam.example
{ "includeSubdomains": true, "note": "Bulk message requests from many subdomains, 2026-12-04" }Backups and restore
A restore must not undo a security transition, and the database's audit log can't prevent that because it is restored with everything else. So every server MUST keep a security journal outside the main database, as durable and separate as the server keys, and MUST make each append durable before acknowledging the change or sending any event about it (21 §11.6.1). It records:
- server and channel security upgrades, with
securedAtandupgradeSeq; - every IdentityState the server signs whose content changed, with its DeviceCertificates;
- account deletions and account-state changes;
- each context's MLS group-generation high-water mark;
- the server key state, unless the key service holds it.
It SHOULD also record bans, federation blocks and policy changes, and admin grants and removals. Keep journal entries at least as long as the oldest backup that might still be restored.
Back up the database with continuous archiving and point-in-time recovery plus a synchronous replica, the blob store with replication or versioned snapshots that respect deletion deadlines, and configuration without secrets. Keep the journal and the private keys separately, never in a database dump. Suggested targets: RPO 0 for failover to the replica, and RPO ≤ 5 minutes with RTO ≤ 4 h from archives. Encrypt backups at rest, test a restore at least every quarter, and keep the backup rotation at 30 days or less (SHOULD), because deleted content must leave backups within it (21 §11.6.3).
Failover to a synchronous replica loses nothing and isn't a restore. A restore to an earlier point P would repeat counters clients and peers have already seen, so before serving any request the server MUST, in order (21 §11.6.4):
- keep its current keys and key state from the key service or journal, never from the restored database; a server that can't establish the highest KeyRotation
nit has issued MUST NOT issue a KeyRotation until it has; - replay the security journal for everything after
P, before signing any IdentityState or sending any event; a server or channel that was secure at any time afterPis secure after the restore; - retire (reason
state_lost) the MLS generation of every secure group that may have changed afterP, or of every secure group if that can't be determined, and start the next one at the journaled high-water mark + 1, or the restored generation + 1,000 without it; - raise every account's IdentityState
verby at least 2^32, re-sign, and sendidentity.changedwhere identity content differs; - send session.resync_required with reason
server_reset; - for 360 s after serving resumes (the longest token lifetime, 300 s, plus 60 s of skew), refuse HomeAssertions, DeviceProofs, S2S tokens and RelayTickets whose
iatis earlier than the moment serving resumed, with the existing replay errors federation.assertion_replayed, federation.s2s_unauthenticated with reasonreplayed, and relay.ticket_replayed; - purge unclaimed regular KeyPackages, keeping last-resort ones, and send
mls.keypackages_lowto each device as it connects; - end every call with
server_restart, telling relayslostorunknown; - without a journal, the operator MUST re-apply the upgrades, revocations, resets and deletions made after
Pthat can be found outside the restored database (own notes, exported logs, what peers received); what can't be found stays lost; - discard pairing sessions, idempotency keys, rate-limit counters and S2S deliveries older than 24 h.
Secure contexts only
In secure contexts backups hold only ciphertext, metadata, MLS public state, and KeyBackups and AccountVaults the server can't open. After a restore, devices take any missing history keys from the key archive without a marker. HistoryShares made after P are lost with their VisibilityGrants until a member shares again (21 §11.6.2, 21 §11.6.4).
Limits
Every limit is advertised in ServerMetadata limits under its max<Thing><Unit> name, and a server MUST NOT advertise a value below the floor. The owning document is normative; 21 §12 has the full informative copy. The ones that most affect deployment:
| Limit | Default | Floor |
|---|---|---|
maxRequestBytes |
1 MiB | 256 KiB |
maxReplayEvents |
5,000 (window ≥ 24 h) | 1,000 |
maxMessageBytes |
16 KiB | 8 KiB |
maxAttachmentBytes |
25 MiB | 8 MiB |
maxSecureLeaves |
1,000 (at most 65,536) | 100 |
maxMlsUploadBytes |
8 MiB (≥ 2,048 × maxSecureLeaves + 65,536) |
3 MiB |
maxCallParticipants |
200 | 25 |
maxVaultBytes |
256 MiB | 32 MiB |
Raising maxSecureLeaves requires maxMlsUploadBytes ≥ 2,048 × maxSecureLeaves + 65,536 and matching proxy body limits. Raising maxAttachmentBytes requires proxy and object-store limits of at least svf1Size(maxAttachmentBytes). Lowering a limit affects new requests only and follows withdraw-first (21 §11.8).
The relay-control timers are owned by document 21: 1,000 ms heartbeat, 3,000 ms to declare a link lost, 1,000 ms failover grace, 30 s for a relay to keep sessions on a lost link, 250 ms maximum snapshot age on the link, 2,000 ms for a keys_ack, 10,000 ms drain deadline and migration window, and drains at no more than 20 calls/s against failovers at no fewer than 200 calls/s. The full table is at the end of 21 §12.
Open points in the spec
Document 21 leaves a few things unsettled or inconsistent. Follow the linked sections rather than either reading:
- 21 §6.1.1 lists the heartbeat as control ↔ relay, but 21 §6.3 and 21 §6.8 send
relayctl.pingonly from call control. - It isn't stated whether
session_close,call_drainorcall_closefor a call not open on the link getrelayctl.error(relay.call_unknown) or are ignored. 21 §6.2.4 lists the error, while 21 §6.4.5 and test vector RC-2 (21 §6.14) ignore the message. 03 §10.4 also registersrelayctlas using onlycore.*codes. - No
session_downreason covers sessions a relay closes after 30 s inlost(21 §6.8). - 15 §2.6 tells relays to close sessions with
call_endedfor any end other thansecurity_upgradedorgroup_restarted, which includesserver_restart; 21 §6.4.7 requireslostandtimeoutfor that case, and its test vector RC-7 (21 §6.14) shows why. - Janus VideoRoom and LiveKit don't fit 15 today; OQ-21-2 proposes two SFU sessions per device (21 §14).
- Nothing yet makes clients re-upload a KeyBackup or vault records lost in a restore, so a recovery key created after the backup point may stop working until a device uploads again (OQ-21-10, 21 §14).