ouroboros-consensus:diffusion
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Network.NodeToNode.LeiosNotify

Description

The node's LeiosNotify client and server, and what the node-to-node wiring needs to run them.

Synopsis

Documentation

leiosNotifyClient ∷ ∀ (m ∷ Type → Type) blk. (IOLike m, LedgerSupportsProtocol blk, ConvertRawHash blk, HasHardForkHistory blk) ⇒ Tracer m TraceLeiosNotifyClientEvent → TopLevelConfig blk → ChainDB m blk → AnnounceState m blk → VoteState m blk → BlockchainTime m → SystemTime m → SomeHeaderInFutureCheck m blk → ClockSkew → ControlMessageSTM m → StrictTVar m (LeiosNotifyPeerState blk) → LeiosNotifyClientPeerPipelined LeiosPoint (Header blk) LeiosVote m () Source #

The node's LeiosNotify client. It checks each reply against the peer's state, which it updates, and disconnects the peer if a check fails.

leiosNotifyMiniProtocol ∷ ∀ (mode ∷ Mode) addr b (m ∷ Type → Type) a c. RunMiniProtocolWithExpandedCtx mode addr PeerTrustable b m a c → MiniProtocolWithExpandedCtx mode addr PeerTrustable b m a c Source #

LeiosNotify as a node-to-node mini-protocol.

leiosNotifyPruner ∷ (IOLike m, GetTip (LedgerState blk), ConvertRawHash blk, GetHeader blk) ⇒ ChainDB m blk → AnnounceState m blk → StrictTVar m (Map peer (StrictTVar m (LeiosNotifyPeerState blk))) → m Void Source #

Prune every LeiosNotify client's state, and the node's AnnounceState, each time the immutable tip's slot advances.

leiosNotifyServer ∷ IOLike m ⇒ NotifyLog m blk → m (LeiosNotifyServerPeerLookahead LeiosPoint (Header blk) LeiosVote m) Source #

The node's LeiosNotify server, which relays the node's NotifyLog to one downstream peer, from the log's oldest notification on.

withLeiosNotifyClientState ∷ (IOLike m, Ord peer, NoThunks (Header blk)) ⇒ StrictTVar m (Map peer (StrictTVar m (LeiosNotifyPeerState blk))) → peer → (StrictTVar m (LeiosNotifyPeerState blk) → m a) → m a Source #

Run the given action with a fresh LeiosNotify client state, registered under the peer for as long as the action runs.