Core Concepts
P2P Sync
Peer sync protocol and convergence workflow.
Peer-to-Peer Sync
SyncEngine lets nodes exchange signed events without a central coordinator.
File-based protocol
Each peer pair uses:
outbound_dirinbound_dir
In production, these directories are usually mounted from shared transport or exchange channels.
SyncBatchFile structure
A batch file includes:
- sender metadata (
node_id, cursor) - list of proof envelopes
- watermark or cursor metadata for resume
Publish flow
- Query unsynced ledger events.
- Build deterministic sync batch.
- Write sync batch file to peer inbound path.
- Mark publish attempt in runtime metrics.
Receive flow
- Read inbound batch file.
- Verify each event signature.
- Re-apply replay and dedupe checks.
- Append new events to ledger.
- Advance peer watermark on success.
Peer state tracking
Watermarks are stored so each peer can resume from last confirmed sync position.
Operational guidance
- Keep peer clocks synchronized to reduce replay false positives.
- Monitor
sync_publishedvssync_receiveddrift. - Alert when watermark staleness exceeds SLA.
- Rotate stuck inbound files to quarantine for manual inspection.