| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Leios.Acquisitions
Description
Where the node emits each endorser block and closure it acquires.
LeiosFetch emits them once the LeiosDB holds them; see
LeiosAcquisition for at which points. The ChainDB subscribes, so
that ChainSel can select a block certifying an endorser block once the node
holds that endorser block's closure.
Synopsis
- data LeiosAcquisition
- data LeiosAcquisitions (m ∷ Type → Type) = MkLeiosAcquisitions {
- emitLeiosAcquisition ∷ LeiosAcquisition → STM m ()
- subscribeLeiosAcquisitions ∷ m (STM m LeiosAcquisition)
- newLeiosAcquisitions ∷ MonadSTM m ⇒ m (LeiosAcquisitions m)
- noLeiosAcquisitions ∷ MonadSTM m ⇒ m (STM m LeiosAcquisition)
Documentation
data LeiosAcquisition Source #
Something LeiosFetch acquired at a LeiosPoint.
LeiosFetch emits each at most once per point: AcquiredEb once the LeiosDB
holds the point's body, and AcquiredEbTxs once it holds its closure. It
emits neither for a point whose closure the LeiosDB already held when the
node started. So a subscriber that subscribes before it scans the LeiosDB at
start-up, as the ChainDB does, hears of each point once at most, and only of
one its scan did not find.
An acquisition may name a point whose writes the LeiosDB dropped, for being older than its promoted slot; the LeiosDB then does not hold what it names.
Constructors
| AcquiredEb | The node holds the EB's body. |
Fields
| |
| AcquiredEbTxs | The node holds the EB's body and every tx it lists. |
Fields
| |
data LeiosAcquisitions (m ∷ Type → Type) Source #
A broadcast of the node's acquisitions.
Only the code that wires up a node holds the whole broadcast. Whatever only
emits takes just emitLeiosAcquisition, and whatever only reads takes just
subscribeLeiosAcquisitions or the STM action it returns, so that its
type shows which side it is on. The ChainDB takes subscribeLeiosAcquisitions
itself, since it must subscribe before it scans the LeiosDB at start-up.
Constructors
| MkLeiosAcquisitions | |
Fields
| |
newLeiosAcquisitions ∷ MonadSTM m ⇒ m (LeiosAcquisitions m) Source #
A new broadcast, with no subscriber yet.
Its channel is unbounded: each subscriber holds every acquisition emitted since it subscribed that it has yet to read. That stays small, as long as each subscriber reads its next acquisition as soon as it has handled the previous one, and handles one without waiting long; the ChainDB's waits at most on ChainSel's queue, which ChainSel drains. The node emits at most two acquisitions per point, and acquires only the points it focuses its elections on: the first announcement it accepts in each, or a certified one. So acquisitions arrive at the rate of elections, whatever its peers do.
noLeiosAcquisitions ∷ MonadSTM m ⇒ m (STM m LeiosAcquisition) Source #
In place of subscribeLeiosAcquisitions, for what opens a ChainDB but
fetches nothing, such as a tool replaying its own databases: nothing is ever
emitted.