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).
GetCommitmentByPin
Request a retained commitment by its pin (commitment hash).
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).
PointerFetchRequest
Ask a peer for the pointer record it holds at an address.
PointerFetchResponse
Response to PointerFetchRequest.
PointerFreshOffer
A newly paid pointer state, with the proof that paid for it.
PointerHints
The pointer states the sender holds that the receiver should hold too.
PointerStateRequest
Ask a peer which state it holds at each of some addresses.
PointerStateResponse
Response to PointerStateRequest.
PointerStateSummary
A pointer state, as a hint or as an answer about what a node holds.
ReplicationMessage
Top-level replication message envelope.
SubtreeAuditChallenge
Gossip-triggered contiguous-subtree storage audit challenge (ADR-0002).
SubtreeSliceChallenge
Round 2 of the storage audit (ADR-0002 / V2-685): the surprise slice challenge.
SubtreeSliceOpening
A single block the round-2 slice challenge opens: which committed key, and which 1 KiB block within it.
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.
GetCommitmentByPinResponse
Response to GetCommitmentByPin.
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).
SubtreeSliceItem
One opened block in a SubtreeSliceResponse.
SubtreeSliceResponse
Response to a SubtreeSliceChallenge (round 2).

Constants§

ABSENT_KEY_DIGEST
Sentinel digest value indicating the challenged key is absent from storage.
MAX_POINTER_HINTS_PER_MESSAGE
Most hints one PointerHints message carries. A sender with more splits them across messages; a receiver ignores anything past this in one message.
MAX_POINTER_RECORDS_PER_ITEM
Most records one SubtreeSliceItem::PointerRecord may carry.
MAX_POINTER_STATE_REQUEST_ADDRESSES
Most addresses one PointerStateRequest asks about. A responder answers only this many, and the requester treats the rest as unanswered.

Functions§

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