Expand description
Sync transport (T3.1) — moves SyncOperations between this node and a peer/relay.
The transport is a dumb pipe: it neither validates nor trusts operations. All trust lives in
the inbox’s fail-closed validate_operation —
a hostile relay or peer can therefore only ever cause rejections at admission, never the
admission of bad data. Convergence is guaranteed by
merge_operations (add-wins by operation id), so
duplicate / reordered / replayed frames converge to the same validated set.
Two backends:
InMemoryRelay— a shared, in-process op store (dedup by operation id). Clone it to get a second handle onto the same relay; two nodes sharing one relay exchange ops. This is the reference transport and the one the convergence / hostile-peer tests run over.HttpRelayTransport(native) — areqwest::blockingclient that POSTs to"{base}/sync/publish"and GETs"{base}/sync/pull?since={cursor}". Its server counterpart issuper::sync_relay_server::SyncRelayServer.
Structs§
- Http
Relay Transport - An HTTP relay transport (native). POSTs a
SyncOpsBodyto"{base}/sync/publish"and GETs"{base}/sync/pull?since={cursor}". Mirrors the crate’sreqwest::blockingchat-relay pattern. - InMemory
Relay - A shared in-memory relay — a dumb op store (append-only, dedup by operation id). Cloning yields another handle onto the same underlying store, so two nodes can rendezvous through one relay.
- Libp2p
Sync Transport - A libp2p
SyncTransport(native) — a noise-encrypted request-response pipe to a single peer or relay. It wraps the core-dbBlockingSyncClient: eachSyncOperationis serialized to a CBOR op frame on publish and decoded back on pull, so the wire carries only opaque signed-op bytes. A dumb pipe like the in-memory and HTTP backends — it never validates or trusts. Undecodable inbound frames are skipped (they could never be admitted anyway; the fail-closed inbox is the trust boundary), so a hostile peer injecting junk cannot break sync for well-formed operations. - Sync
OpsBody - The wire body for
/sync/publishand the response body for/sync/pull.
Traits§
- Sync
Transport - Moves operations to/from a peer or relay. A dumb pipe — validation is the inbox’s job.