Available on crate feature
sync only.Expand description
NOMAD Protocol - Sync Layer
Implements:
- State versioning with monotonic version numbers
- Idempotent diff generation and application
- Acknowledgment tracking
- Eventual consistency guarantees
Structs§
- AckTracker
- Acknowledgment tracker
- Ordered
Receiver - Receiver with history for out-of-order message handling
- Pending
Ack - Tracks pending acknowledgments for a message
- Sync
Engine - Sync engine for bidirectional state synchronization
- Sync
Message - Sync message format (inside encrypted payload)
- Sync
Receiver - Receiver for incoming sync messages
- Sync
Sender - Sender state for managing outbound sync messages
- Sync
Tracker - Sync tracker state (each endpoint maintains this)
Enums§
- Message
Error - Sync message encoding/decoding errors.
- Process
Result - Result of processing an incoming sync message
- Receive
Result - Result of receiving a sync message
- Sync
Error - Errors from the sync engine.
Constants§
- DEFAULT_
BACKOFF_ MULTIPLIER - Default exponential backoff multiplier for RTO (2x). Applied after each retransmission timeout.
- DEFAULT_
COLLECTION_ INTERVAL - Default collection interval for batching rapid state changes
- DEFAULT_
DELAYED_ ACK_ TIMEOUT - Default delayed ack timeout
- DEFAULT_
INITIAL_ RTO - Default initial retransmission timeout (1 second).
- DEFAULT_
MAX_ RETRANSMITS - Default maximum number of retransmission attempts (10). After this many failures, the sync is considered failed.
- DEFAULT_
MAX_ RTO - Default maximum retransmission timeout (60 seconds). Caps RTO growth during sustained packet loss.
- DEFAULT_
MIN_ RTO - Default minimum retransmission timeout (100ms). Prevents RTO from becoming too aggressive on low-latency networks.
- SYNC_
MESSAGE_ HEADER_ SIZE - Header size in bytes (3 x u64 + u32 = 28)