Skip to main content

Module gossip_protocol_engine

Module gossip_protocol_engine 

Source
Expand description

Gossip Dissemination Protocol Engine

A production-quality gossip protocol engine implementing epidemic broadcast with pluggable fanout strategies, message deduplication, hop-count TTL, and per-peer delivery scoring. All state is synchronous and Send + Sync-compatible (the public API takes &mut self for mutable operations).

§Design notes

  • No external PRNG: xorshift64 is used where randomness is required.
  • No rand crate: coin-flip / shuffle are done inline.
  • FNV-1a 64-bit is used for deterministic message-ID generation.
  • Dedup cache: bounded VecDeque providing O(1) push / O(n) lookup, sufficient for typical gossip workloads where the window is small (≤ 4096 messages).

Structs§

GossipConfig
Configuration for a GossipProtocolEngine.
GossipMessage
A gossip message travelling through the overlay.
GossipPeer
An active or recently-seen gossip peer.
GossipProtocolEngine
Production-quality gossip dissemination protocol engine.
GossipStats
Aggregate statistics produced by a GossipProtocolEngine.

Enums§

EngineError
Errors returned by GossipProtocolEngine operations.
FanoutStrategy
Peer-selection strategy used when forwarding messages.
GossipEvent
Events emitted by a GossipProtocolEngine.

Functions§

fnv1a_64
FNV-1a 64-bit hash.
xorshift64
Xorshift64 PRNG – mutates state in-place and returns the next value.