ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.ChainDB.Impl.Leios

Description

What the ChainDB knows about Leios endorser blocks: which closures it has acquired, and so which blocks certifying an endorser block ChainSel may select; and which claims some valid certificate has established.

Synopsis

The Leios facts of a block

leiosBlockInfo ∷ BlockSupportsProtocol blk ⇒ BlockConfig blk → blk → LeiosBlockInfo Source #

What the block says about Leios endorser blocks, read off its header.

Acquired closures

data AcquiredLeiosEbs Source #

The endorser blocks whose closure the LeiosDB holds, each with the slot of its youngest focus (see LeiosEbNotification).

That slot is the youngest slot of any LeiosPoint in an AcquiredEbTxs notification for the endorser block, since the LeiosDB sends that notification at every focus not older than the ImmutableDB tip.

UnsafeAcquiredLeiosEbs does not ensure that aleBySlot is the inverse of aleYoungestSlot; build one with mkAcquiredLeiosEbs instead.

Instances

Instances details
Generic AcquiredLeiosEbs Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Leios

Associated Types

type Rep AcquiredLeiosEbs 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Leios

type Rep AcquiredLeiosEbs = D1 ('MetaData "AcquiredLeiosEbs" "Ouroboros.Consensus.Storage.ChainDB.Impl.Leios" "ouroboros-consensus-5.0.0.0-inplace" 'False) (C1 ('MetaCons "UnsafeAcquiredLeiosEbs" 'PrefixI 'True) (S1 ('MetaSel ('Just "aleYoungestSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map EndorserBlockHash SlotNo)) :*: S1 ('MetaSel ('Just "aleBySlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map SlotNo (NESet EndorserBlockHash)))))
NoThunks AcquiredLeiosEbs Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Leios

type Rep AcquiredLeiosEbs Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Leios

type Rep AcquiredLeiosEbs = D1 ('MetaData "AcquiredLeiosEbs" "Ouroboros.Consensus.Storage.ChainDB.Impl.Leios" "ouroboros-consensus-5.0.0.0-inplace" 'False) (C1 ('MetaCons "UnsafeAcquiredLeiosEbs" 'PrefixI 'True) (S1 ('MetaSel ('Just "aleYoungestSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map EndorserBlockHash SlotNo)) :*: S1 ('MetaSel ('Just "aleBySlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map SlotNo (NESet EndorserBlockHash)))))

insertAcquiredLeiosEb ∷ LeiosPoint → AcquiredLeiosEbs → AcquiredLeiosEbs Source #

Record that the endorser block's closure is acquired, and that the given point announces it.

pruneAcquiredLeiosEbs ∷ SlotNo → AcquiredLeiosEbs → AcquiredLeiosEbs Source #

Forget every endorser block all of whose foci are older than the slot. A block that ChainSel has yet to select can then certify it only at another announcement, and verifying that certificate makes the announcement a focus, which records the endorser block here again.

See AcquiredLeiosEbs for why its slots are the youngest foci.

Parking

ignoreParkedCertRB ∷ AcquiredLeiosEbs → (HeaderHash blk → Maybe (BlockInfo blk)) → HeaderHash blk → Maybe (BlockInfo blk) Source #

Hide parked blocks (isParkedCertRB) from a getBlockInfo. The given one must be the VolatileDB's own, so that it still finds every predecessor.

ignoreParkedCertRBSuc ∷ AcquiredLeiosEbs → (HeaderHash blk → Maybe (BlockInfo blk)) → (ChainHash blk → Set (HeaderHash blk)) → ChainHash blk → Set (HeaderHash blk) Source #

Hide parked blocks (isParkedCertRB) from a filterByPredecessor. The given getBlockInfo must be the VolatileDB's own.

Valid claims

data LeiosValidClaims Source #

The blocks known to announce an endorser block that some valid certificate certifies, each with its slot.

A block containing a certificate claims that the endorser block its predecessor announced is certified. The claims that valid certificates have established are how LeiosFetch will learn which endorser blocks are certified, for its Recovery Path; that part is not ported yet. Meanwhile, a block making an already established claim need not have its certificate verified.

Instances

Instances details
Generic LeiosValidClaims Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Leios

Associated Types

type Rep LeiosValidClaims 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Leios

type Rep LeiosValidClaims = D1 ('MetaData "LeiosValidClaims" "Ouroboros.Consensus.Storage.ChainDB.Impl.Leios" "ouroboros-consensus-5.0.0.0-inplace" 'False) (C1 ('MetaCons "LeiosValidClaims" 'PrefixI 'True) (S1 ('MetaSel ('Just "lvcSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map RankingBlockHash SlotNo)) :*: S1 ('MetaSel ('Just "lvcBySlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map SlotNo (NESet RankingBlockHash)))))
NoThunks LeiosValidClaims Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Leios

type Rep LeiosValidClaims Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Leios

type Rep LeiosValidClaims = D1 ('MetaData "LeiosValidClaims" "Ouroboros.Consensus.Storage.ChainDB.Impl.Leios" "ouroboros-consensus-5.0.0.0-inplace" 'False) (C1 ('MetaCons "LeiosValidClaims" 'PrefixI 'True) (S1 ('MetaSel ('Just "lvcSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map RankingBlockHash SlotNo)) :*: S1 ('MetaSel ('Just "lvcBySlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map SlotNo (NESet RankingBlockHash)))))

insertLeiosValidClaim ∷ LeiosClaim → LeiosValidClaims → LeiosValidClaims Source #

Record that some valid certificate established the claim.

pruneLeiosValidClaims ∷ SlotNo → LeiosValidClaims → LeiosValidClaims Source #

Forget every claim whose announcing block is older than the slot: once the immutable tip has passed it, no block that ChainSel has yet to select can make the claim.