Module sync

Module sync 

Source
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
OrderedReceiver
Receiver with history for out-of-order message handling
PendingAck
Tracks pending acknowledgments for a message
SyncEngine
Sync engine for bidirectional state synchronization
SyncMessage
Sync message format (inside encrypted payload)
SyncReceiver
Receiver for incoming sync messages
SyncSender
Sender state for managing outbound sync messages
SyncTracker
Sync tracker state (each endpoint maintains this)

Enums§

MessageError
Sync message encoding/decoding errors.
ProcessResult
Result of processing an incoming sync message
ReceiveResult
Result of receiving a sync message
SyncError
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)