Skip to main content

Module sync_ops

Module sync_ops 

Source
Expand description

libp2p op-transfer sync (T3.1 p2p backend) — the wire protocol + reference relay that actually carries synchronisation operations peer-to-peer over the existing libp2p request-response swarm.

Distinct from super::protocol’s QualiaRequest::Sync, which is only an authorisation handshake (hop-count / gatekeeper / target-shapes) and transfers no operations. This module adds the missing piece: Publish / PullSince frames that move opaque, already-signed operation bytes, plus a SyncOpRelay responder store. Operations travel as opaque Vec<u8> frames (the sync layer that owns the SyncOperation type serialises/deserialises them), so this stays a dumb pipe: it never validates or trusts — all trust remains in the consuming node’s fail-closed inbox, exactly as the HTTP relay transport does. Encryption + auth come from libp2p’s noise handshake on the connection.

Native-only (libp2p). The swarm-driving SyncTransport bridge that maps the blocking publish/pull trait onto this protocol is the next step; this is the tested wire + store foundation.

Structs§

SyncOpCodec
The libp2p request-response wire codec for op transfer: length-prefixed plain-CBOR (ciborium). Mirrors super::protocol::QualiaSyncCodec’s framing (4-byte big-endian length + body), without the Q42 CBOR-LD term-compaction (the payload is opaque operation bytes, so there is nothing to term-compact).
SyncOpRelay
A reference op relay/store — append-only, dedup by frame content, cursor = position. The responder side of the protocol. A dumb pipe: it stores and serves opaque frames and trusts nothing. Cloning yields another handle onto the same store (so a node can both serve and be queried).

Enums§

SyncOpRequest
A request in the op-transfer protocol. op_frames are opaque, already-signed operation bytes.
SyncOpResponse
A response in the op-transfer protocol.

Constants§

SYNC_OP_PROTOCOL
The request-response stream protocol id for op transfer (distinct from /qualia/crdt-sync/1.0.0).