| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- heartbeatOnce :: GossipSubRouter -> IO ()
- runHeartbeat :: GossipSubRouter -> IO (Async ())
Documentation
heartbeatOnce :: GossipSubRouter -> IO () Source #
Run a single heartbeat cycle. Exported for testing.
runHeartbeat :: GossipSubRouter -> IO (Async ()) Source #
Start the heartbeat background thread.