ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.MiniProtocol.LeiosNotify.Client

Description

The downstream side of LeiosNotify.

Synopsis

Documentation

type LeiosNotifyClientPeerPipelined point announcement vote (m ∷ Type → Type) a = PeerPipelined (LeiosNotify point announcement vote) 'AsClient ('StIdle ∷ LeiosNotify point announcement vote) m a Source #

awaitImmTipCanForecastNow Source #

Arguments

∷ ∀ (m ∷ Type → Type) blk (mk ∷ MapKind). (MonadSTM m, LedgerSupportsProtocol blk) 
⇒ TopLevelConfig blk 
→ STM m (ExtLedgerState blk mk)

the immutable tip's ledger state

→ STM m CurrentSlot 
→ STM m () 

Retry until the immutable tip's ledger state can forecast to the current slot.

A LeiosNotify client judges the replies it receives by forecasting from the immutable tip. Until that tip reaches approximately now, a fresh reply would be beyond the forecast horizon, and a reply the client cannot judge is no grounds to disconnect the peer. So a client sends no request until then.

The current slot comes from the volatile tip, whose horizon reaches further, so gating on it alone would send requests too soon.

leiosNotifyClientPeerHandlingReplies Source #

Arguments

∷ (PrimMonad m, MonadSTM m, MonadThrow m) 
⇒ Int 
→ STM m ()

blocks until the client may send requests

→ ControlMessageSTM m 
→ (Message (LeiosNotify point announcement vote) ('StBusy ∷ LeiosNotify point announcement vote) ('StIdle ∷ LeiosNotify point announcement vote) → m ())

throws to disconnect the peer

→ LeiosNotifyClientPeerPipelined point announcement vote m () 

A client that keeps depth requests outstanding until the control message says to terminate, passing each reply to handleReply. It sends no request while gate blocks; see awaitImmTipCanForecastNow. It disconnects a peer that cancels a request before the client has sent MsgQuit.

leiosNotifyClientPeerPipelined Source #

Arguments

∷ ∀ m point announcement vote a. (PrimMonad m, MonadSTM m) 
⇒ STM m (Either a Int)

either the return value or else the current max pipelining depth

→ m (Message (LeiosNotify point announcement vote) ('StBusy ∷ LeiosNotify point announcement vote) ('StIdle ∷ LeiosNotify point announcement vote) → m ())

INVARIANT: this will only be MsgCanceled if the peer sent that before we sent MsgQuit

→ Peer (LeiosNotify point announcement vote) 'AsClient ('Pipelined 'Z C ∷ IsPipelined (LeiosNotify point announcement vote)) ('StIdle ∷ LeiosNotify point announcement vote) m a 

toLeiosNotifyClientPeerPipelined ∷ ∀ point announcement vote (m ∷ Type → Type) a. Peer (LeiosNotify point announcement vote) 'AsClient ('Pipelined 'Z C ∷ IsPipelined (LeiosNotify point announcement vote)) ('StIdle ∷ LeiosNotify point announcement vote) m a → LeiosNotifyClientPeerPipelined point announcement vote m a Source #