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

LibP2P.Protocol.GossipSub.IDontWant

Description

GossipSub v1.2 IDONTWANT processing and bounded suppression state.

Synopsis

Documentation

announceIDontWant :: GossipSubRouter -> PeerId -> PubSubMessage -> IO () Source #

Immediately tell v1.2 mesh peers not to send a duplicate large message. The propagation source is excluded and older protocol versions never receive the v1.2 control field.

handleIDontWant :: GossipSubRouter -> PeerId -> [IDontWant] -> IO () Source #

Record bounded IDONTWANT state received from a peer.

peerRejectsMessage :: Map PeerId (Map ByteString Int) -> PeerId -> MessageId -> Bool Source #

Test whether a peer has rejected a message ID that is still live.

filterAllowedPeers :: Map PeerId (Map ByteString Int) -> MessageId -> Set PeerId -> Set PeerId Source #

Remove peers that have rejected the message ID from a target set.

expireIDontWantState :: GossipSubRouter -> IO () Source #

Reset the per-heartbeat receive budget and age suppression entries.