Skip to main content

Module protocol

Module protocol 

Source
Expand description

Wire protocol messages for the replication subsystem.

All messages use postcard serialization for compact, fast encoding. Peer IDs are transmitted as raw [u8; 32] byte arrays.

Re-exports§

pub use super::config::MAX_REPLICATION_MESSAGE_SIZE;

Structs§

AuditChallenge
Per-key audit challenge.
FetchRequest
Request to fetch a specific record by key.
FreshReplicationOffer
Fresh replication offer (includes record + PoP).
KeyVerificationResult
Per-key verification result from a peer.
NeighborSyncRequest
Neighbor sync request carrying hint sets (Section 6.2).
NeighborSyncResponse
Neighbor sync response carrying own hint sets.
PaidNotify
Paid-list notification carrying key + PoP (Section 7.3).
ReplicationMessage
Top-level replication message envelope.
SubtreeAuditChallenge
Gossip-triggered contiguous-subtree storage audit challenge (ADR-0002).
SubtreeByteChallenge
Round 2 of the storage audit (ADR-0002): the surprise byte challenge.
VerificationRequest
Batched verification request for multiple keys (Section 9).
VerificationResponse
Batched verification response with per-key results.

Enums§

AuditResponse
Response to a per-key audit challenge.
FetchResponse
Response to a fetch request.
FreshReplicationResponse
Response to a fresh replication offer.
RejectKind
Why a responder rejected an audit challenge, in a form the auditor can act on without string-matching.
ReplicationMessageBody
All replication protocol message types.
ReplicationProtocolError
Errors from replication protocol encode/decode operations.
SubtreeAuditResponse
Response to a contiguous-subtree storage audit challenge (ADR-0002).
SubtreeByteItem
One requested chunk in a SubtreeByteResponse.
SubtreeByteResponse
Response to a SubtreeByteChallenge (round 2). One item per requested key, in the requested order.

Constants§

ABSENT_KEY_DIGEST
Sentinel digest value indicating the challenged key is absent from storage.

Functions§

compute_audit_digest
Compute AuditKeyDigest(K_i) = BLAKE3(nonce || challenged_peer_id || K_i || record_bytes_i).