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, LeiosProtocol (BlockProtocol blk), ConvertRawHash blk, HasHardForkHistory blk) ⇒ TopLevelConfig blk → ChainDB 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.

leiosNotifyProtocols ∷ ∀ (mode ∷ Mode) addr b (m ∷ Type → Type) a c. NodeToNodeVersion → RunMiniProtocolWithExpandedCtx mode addr PeerTrustable b m a c → OuroborosBundleWithExpandedCtx mode addr PeerTrustable b m a c Source #

LeiosNotify, to add to a node-to-node bundle, if the version has it.

TODO remove once NodeToNodeProtocols has fields for the Leios mini-protocols.

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

Prune every LeiosNotify client's state each time the immutable tip's slot advances.

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

The node's LeiosNotify server.

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.