feat(sync): Sync 1.1 inductive firehose verification and a Tap client #134

Closed
opened 2026-09-24 12:39:09 +00:00 by Grandiras · 0 comments
Owner

Part of the v0.7.0 update cycle (wave 6). Sync 1.1 inductive firehose verification and a Tap client. The owner opted in. The CHANGELOG has claimed "Sync v1.1 support" since #21, but only the fields exist.

Sync 1.1 (https://atproto.com/specs/sync, rewritten 2026-02-27)

  • IRepoSyncStateStore (per DID: rev, data CID, status), with in-memory and EF implementations.

  • A RepoSyncVerifier implementing the spec's validation checklist:

    • commit signature (refresh identity once on failure);
    • event fields vs the signed commit;
    • invert the ops against the CAR's partial MST and compare with prevData;
    • rev strictly increasing and not in the future;
    • since/prevData chain;
    • commit version 3;
    • the size limits (≤200 ops, ≤2 MB blocks);
    • #sync events resetting state.

    It emits Desynchronized with a reason.

  • Resync hooks: fetch getRepo, from the upstream relay first as the spec's "thundering herd" guidance says, and reconcile.

  • Wire it into the typed firehose consumer as an opt-in verification mode.

  • Test against captured real-network frames and hand-built edge cases.

Tap client

Tap is Bluesky's reference Sync 1.1 consumer and backfill service (indigo cmd/tap; TS client @atproto/tap).

  • TapClient: the ack-based WebSocket /channel as an IAsyncEnumerable with explicit acks.
  • The admin endpoints (/repos/add, /repos/remove, /info/:did, /resolve/:did, Basic auth).
  • An ASP.NET Core webhook receiver in ATProtoNet.Server.

Docs

  • docs/firehose.md "Verifying the firehose" and a new docs/tap.md.
  • Correct the CHANGELOG claim in [Unreleased].

CHANGELOG Added.

Part of the v0.7.0 update cycle (wave 6). **Sync 1.1** inductive firehose verification and a **Tap** client. The owner opted in. The CHANGELOG has claimed "Sync v1.1 support" since #21, but only the fields exist. ## Sync 1.1 (https://atproto.com/specs/sync, rewritten 2026-02-27) - [ ] `IRepoSyncStateStore` (per DID: `rev`, `data` CID, status), with in-memory and EF implementations. - [ ] A `RepoSyncVerifier` implementing the spec's validation checklist: - commit signature (refresh identity once on failure); - event fields vs the signed commit; - **invert the ops against the CAR's partial MST and compare with `prevData`**; - `rev` strictly increasing and not in the future; - `since`/`prevData` chain; - commit version 3; - the size limits (≤200 ops, ≤2 MB blocks); - `#sync` events resetting state. It emits `Desynchronized` with a reason. - [ ] Resync hooks: fetch `getRepo`, from the upstream relay first as the spec's "thundering herd" guidance says, and reconcile. - [ ] Wire it into the typed firehose consumer as an opt-in verification mode. - [ ] Test against captured real-network frames and hand-built edge cases. ## Tap client Tap is Bluesky's reference Sync 1.1 consumer and backfill service (indigo `cmd/tap`; TS client `@atproto/tap`). - [ ] `TapClient`: the ack-based WebSocket `/channel` as an `IAsyncEnumerable` with explicit acks. - [ ] The admin endpoints (`/repos/add`, `/repos/remove`, `/info/:did`, `/resolve/:did`, Basic auth). - [ ] An ASP.NET Core webhook receiver in `ATProtoNet.Server`. ## Docs - [ ] `docs/firehose.md` "Verifying the firehose" and a new `docs/tap.md`. - [ ] Correct the CHANGELOG claim in `[Unreleased]`. CHANGELOG `Added`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Grandiras/ATProto.NET#134
No description provided.