# handoff: does a ~1MiB record make zlay choke? (2026-10-17) ## question jola (`did:plc:bvraa6gajy4tfr3eh2sisdkr`, PDS `https://pds.cove.town`) posted https://bsky.app/profile/jola.dev/post/3my3x25ldus2m: - data-validation guide recommends records up to **1 MiB** CBOR; sync 1.1 caps record blocks in commits at **1 MB**. a PDS can accept a record relays reject. - a large record on their PDS made `relay.fire.hose.cam` and `relay3.fr.hose.cam` error and instantly reconnect tens of thousands of times over ~1h, until they deleted the record. - garrison cc'd @zzstoatzz.io; jola replied "That one too!" — ambiguous. nothing in the thread says zlay failed. do not assume it did. answer with a real test, not a code reading: **write real records to a real PDS and observe real relays.** no mocks, no synthetic fixtures. ## what the code says (read, not tested) - `zat/src/internal/repo/car.zig:44-46` — CAR total 2 MiB, ≤10,000 blocks, **1 MiB per block** (`BlockTooLarge` above that). - `src/internal/validator.zig:527-528` — `#commit` blocks > 2,000,000 → `InvalidFrame`; `#sync` blocks > 10,000 (line ~321). - `src/internal/subscriber.zig:76`, `src/main.zig:483,584` — websocket `max_message_size` 5 MiB. - invalid commits are dropped, not disconnected: `subscriber.zig:925-926`, `frame_worker.zig:278-279` (`if (!result.valid) return;`). decode failures also return (`subscriber.zig:594,630`), counted in `decode_errors`. - reconnect backoff `subscriber.zig:275-313`: 1s doubling to 60s, **never reset** after a successful connect. worst case ≈ 1 reconnect/min, not a storm. - unverified hypothesis: a frame > 5 MiB fails the websocket read → reconnect → same frame replayed from cursor → stuck at 60s cadence on that host. so the predicted outcomes: ~990KB passes; ~1.04MB (between 1MB and 1MiB) **passes in zlay** (zlay is more lenient than the spec's 1MB); > 1MiB is dropped (`BlockTooLarge` → invalid) without reconnecting. verify all three. ## state observed today - zlay.waow.tech `getHostStatus?hostname=pds.cove.town` → `active`, seq 27403, 6 accounts. - prod zlay pod restarted ~25h before; current container logs had 0 lines for `cove.town`. previous-container logs were not read (blocked by permissions). - prod access: kubeconfig at `~/tangled.org/zzstoatzz.io/relay/zlay/kubeconfig.yaml`, namespace `zlay`, `deployment/zlay`. `just zlay-logs` in the relay repo. ## the test to run 1. **account**: use a throwaway/bot account, not nate's main. credentials come from the sops store at `~/tangled.org/zzstoatzz.io/secrets` (load the `secrets` skill; never print a value — `sops -d --extract` piped straight into the createSession call). candidates in `prod.yaml`: `prefect.blocks.gardener-handle/-password`, `atproto.agent_musicians.moss.{handle,pds,password}`, `prefect.blocks.atproto-handle/-password`, `operator-atproto-creds`. confirm with nate which one. 2. **baseline**: zlay `getHostStatus` for that account's PDS (seq, status); zlay `/metrics` values for `relay_validation_failed{reason="oversized_blocks"}`, `decode_errors`, per-host failures; `getLatestCommit` for the repo on zlay. 3. **write** three records via `com.atproto.repo.createRecord` (custom collection, e.g. `dev.zat.test.blob`, one big string field), sized so the **DAG-CBOR record block** is ~990,000 B, ~1,040,000 B, and ~1,050,000 B (>1,048,576). measure the CBOR block size, not the JSON size. note whether the PDS itself rejects any of them — that's a finding too. 4. **observe** for each write: did zlay advance the repo's rev (`com.atproto.sync.getLatestCommit` against zlay.waow.tech)? did the counters move? any reconnect lines for that host in zlay logs? subscribe to zlay's firehose filtered to the DID and confirm the commit was rebroadcast (or not). check across a window, not one sample. 5. **contrast**: check `getHostStatus` / repo rev on bsky's relay and the hose.cam relays for the same PDS. 6. **clean up**: delete the records; confirm deletes propagate through zlay. ## if something breaks - any reconnect loop or wedged host in zlay is a bug: fix it with a regression test (real commit CAR, real sizes), then commit → push → deploy → verify per zlay `AGENTS.md` (`just zlay publish-remote ReleaseSafe zio` from the relay repo). - if a >5 MiB frame wedges a host, the fix is to skip the oversized frame and advance the cursor instead of erroring the connection. ## done means a short result per record size (accepted/dropped/reconnected, with the evidence) and either "no change needed" or a deployed fix with a regression test. ## live test results (2026-10-17, 21:39–21:42 UTC) Tested production image `ReleaseSafe-zio-35fae9a` using the user-selected `bufo.uk` (`did:plc:b64lsctzqnzpv6vd4ry3qktw`) on `pds.zat.dev`. No records were written to gardener. Credentials stayed in process memory. The thread now contains a crucial clarification from Jola: https://bsky.app/profile/jola.dev/post/3my3zt23s422p — the problematic record was closer to **10 MB**, not 1 MB. The original two links were read directly: - https://atproto.com/guides/data-validation#recommended-data-limits recommends 1,048,576 bytes, explicitly informal and outside the specification. - https://atproto.com/specs/sync#commit-events imposes 1,000,000 bytes per record, 2,000,000 bytes for commit CAR bytes, and a 5 MB stream frame limit. | Actual DAG-CBOR record bytes | PDS | Production Zlay | | --- | --- | --- | | 990,000 | accepted, seq 15123 | rebroadcast, seq 3565229645 | | 1,040,000 | accepted, seq 15125 | rebroadcast, seq 3565239209 | | 1,050,000 | accepted, seq 15127 | not rebroadcast; repo rev stayed at previous write | | 10,000,000 (locally encoded) | HTTP 413, record write body is too large | never reached relay | First three sizes were independently measured from record blocks extracted from the real PDS firehose CARs. PDS frame sizes were 993,549, 1,043,719, and 1,053,125 bytes. Zlay logs showed no pds.zat.dev reconnects during the test; subsequent cleanup traffic passed. The commit_integrity counter increased 429 -> 430 during the third write; oversized_blocks stayed zero. These counters are global, so attribution from counters alone is not conclusive. The current validator counts BlockTooLarge under commit_integrity, while oversized_blocks is used for the sync path. Decode errors rose 6152 -> 6156 in the same window; they are also global and not attributable to this host. bsky.network and both hose.cam relays reported the new repo revisions for all three accepted writes. This establishes revision advancement, not a captured downstream record rebroadcast for those other relays. All three records were deleted (HTTP 200); listRecords returned an empty collection afterward. Zlay rebroadcast the first and third deletes and reached the final PDS revision `3my42kxsn5asv`. The second delete (PDS seq 15130) was absent from the captured Zlay stream, and a subsequent chain-break log confirms the gap. A global sync_1_1 failure increment coincided with cleanup. This is a separate unresolved validation anomaly, not evidence of a reconnect loop. Also, getLatestCommit CIDs differed between Zlay and PDS even when revisions matched; comparisons here deliberately use revisions. Conclusion: no reconnect storm reproduced at ~1 MB. Zlay accepts a record above the spec's decimal limit. The ~10 MB incident remains untested against Zlay because this PDS rejects the write first. No code changed or deployed; this does not establish that larger frames are safe. Temporary captures were used for verification and removed during cleanup. ## Final follow-up: 10 MB reproduction A throwaway ZDS build raised only its HTTP write-body cap to 20 MiB. A real 10,000,000-byte DAG-CBOR record reached an isolated relay running the exact production image `atcr.io/zzstoatzz.io/zlay:ReleaseSafe-zio-35fae9a`. The relay rejected the frame and retried from cursor 5, with backoff of 1, 2, 4, 8, 16, 32, then 60 seconds. The oversized event was sequence 7; later valid writes and deletions remained behind it. Deleting the record did not remove the event from replay. All three lab records were deleted. This reproduces repeated rejection/replay, **not Jola's rapid reconnect storm** (reported tens of thousands of reconnects, approximately 50/sec). Her later clarification was approximately 10 MB, so the 1 MB versus 1 MiB discrepancy does not explain that incident. Indigo's relay sets a 5,000,000-byte WebSocket read limit, disconnects on excess, and reconnects with its retained cursor (`cmd/relay/stream/consumer.go`, `cmd/relay/relay/slurper.go`). Hydrant's receive-error path backs off and stops after its failure threshold (`src/ingest/firehose.rs`, inspected at `fce50c7782152ac36dd12a4121f92c5eae819f0c`); Hydrant was source-inspected, not live-tested. The sync spec sets size limits; the event-stream spec explicitly requires disconnect for invalid framing/CBOR. We did not establish a requirement to drain oversized messages and advance their cursors. The experimental discard-and-advance patch was abandoned. No production code, configuration, or deployment changed, and no PR was opened. The separate skipped deletion (15130) was traced to an omitted MST proof node in ZDS's CAR: adding that exact node from an earlier captured event made the unchanged verifier accept it. This was not a relay recovery bug. References: [Jola's incident](https://bsky.app/profile/jola.dev/post/3my3zan73tc2p), [10 MB clarification](https://bsky.app/profile/jola.dev/post/3my3zt23s422p), [sync spec](https://atproto.com/specs/sync#commit-events), [event-stream spec](https://atproto.com/specs/event-stream#framing). Cleanup completed: destroyed the throwaway Fly PDS app and its resources, removed the isolated Kubernetes relay pod, stopped both port forwards, removed the three temporary ZDS/Zlay/WebSocket worktrees and experimental branch, and deleted temporary captures, scripts, and lab credentials.