libp2p-hs-0.1.0.0: Haskell implementation of the libp2p networking stack
Safe HaskellNone
LanguageGHC2021

Network.LibP2P.Protocol.GossipSub.Heartbeat

Description

GossipSub heartbeat procedure (docs/11-pubsub.md).

The heartbeat runs periodically and performs: 1. Mesh maintenance: prune negative-score, fill undersubscribed, trim oversubscribed 2. Fanout maintenance: expire old, fill undersubscribed 3. Gossip emission: send IHAVE to non-mesh peers, rotate cache 4. Score decay: decay all counters for all peers 5. Seen cache cleanup: remove expired entries 6. Heartbeat counter increment (for opportunistic graft timing)

Synopsis

Documentation

heartbeatOnce :: GossipSubRouter -> IO () Source #

Run a single heartbeat cycle. Exported for testing.

runHeartbeat :: GossipSubRouter -> IO (Async ()) Source #

Start the heartbeat background thread.