Skip to main content

Module buffered

Module buffered 

Source
Expand description

Broadcast messages to and cache messages from untrusted peers.

§Overview

The core of the module is the Engine. It is responsible for:

  • Accepting and caching messages from other participants
  • Broadcasting messages to all peers
  • Serving cached messages on-demand

§Message Caching

The engine receives messages from other peers and caches them. The cache is a bounded queue of messages per peer. When the cache is full, the oldest message is removed to make room for the new one.

Messages referenced by multiple senders stay cached until the last per-sender deque that contains them is evicted (meaning redundant messages are only stored once).

§Peer Management

Only peers in latest.primary may buffer messages (see commonware_p2p::Provider). When a peer is no longer in latest.primary, its buffered messages are evicted unless buffered by any other primary peer.

Structs§

Config
Configuration for the super::Engine.
Engine
Instance of the main engine for the module.
Mailbox
Ingress mailbox for super::Engine.