| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.MiniProtocol.LeiosNotify.Client
Description
The downstream side of LeiosNotify.
Synopsis
- data ExnLeiosNotifyUnexpectedCancel = ExnLeiosNotifyUnexpectedCancel
- type LeiosNotifyClientPeerPipelined point announcement vote (m ∷ Type → Type) a = PeerPipelined (LeiosNotify point announcement vote) 'AsClient ('StIdle ∷ LeiosNotify point announcement vote) m a
- awaitImmTipCanForecastNow ∷ ∀ (m ∷ Type → Type) blk (mk ∷ MapKind). (MonadSTM m, LedgerSupportsProtocol blk) ⇒ TopLevelConfig blk → STM m (ExtLedgerState blk mk) → STM m CurrentSlot → STM m ()
- leiosNotifyClientPeerHandlingReplies ∷ (PrimMonad m, MonadSTM m, MonadThrow m) ⇒ Int → STM m () → ControlMessageSTM m → (Message (LeiosNotify point announcement vote) ('StBusy ∷ LeiosNotify point announcement vote) ('StIdle ∷ LeiosNotify point announcement vote) → m ()) → LeiosNotifyClientPeerPipelined point announcement vote m ()
- leiosNotifyClientPeerPipelined ∷ ∀ m point announcement vote a. (PrimMonad m, MonadSTM m) ⇒ STM m (Either a Int) → m (Message (LeiosNotify point announcement vote) ('StBusy ∷ LeiosNotify point announcement vote) ('StIdle ∷ LeiosNotify point announcement vote) → m ()) → 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
Documentation
data ExnLeiosNotifyUnexpectedCancel Source #
The peer sent MsgCanceled although the client had not sent MsgQuit.
Constructors
| ExnLeiosNotifyUnexpectedCancel |
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 |
| → 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 #