Expand description
Synchronization protocol for P2P state coordination
This module defines the protocol messages and types for peer-to-peer state synchronization using geometric deltas and vector clocks.
§Protocol Overview
The sync protocol operates in three phases:
- Discovery: Peers announce themselves and exchange clock information
- Sync: Peers exchange deltas to converge on consistent state
- Maintenance: Periodic heartbeats and partition recovery
§Example
use cliffy_protocols::sync::{SyncMessage, SyncState, PeerInfo};
use cliffy_protocols::VectorClock;
use uuid::Uuid;
// Create sync state for a node
let node_id = Uuid::new_v4();
let mut sync_state = SyncState::new(node_id);
// Register a peer
let peer_id = Uuid::new_v4();
sync_state.register_peer(peer_id, VectorClock::new());Structs§
- Peer
Capabilities - Capabilities a peer may support.
- Peer
Info - Information about a peer node.
- Peer
State - Tracked state for a connected peer.
- Sync
Config - Configuration for sync behavior.
- Sync
Message - A message in the sync protocol.
- Sync
State - The synchronization state for a node.
Enums§
- Peer
Connection State - Connection state with a peer.
- Sync
Payload - The payload of a sync message.