ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Leios.Protocol

Description

What a consensus protocol says about the Leios announcement a header may carry.

Synopsis

Documentation

data LeiosAnnouncement Source #

The announcement a header carries, as its protocol view gives it.

Constructors

MkLeiosAnnouncement 

Fields

Instances

Instances details
Eq LeiosAnnouncement Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

Generic LeiosAnnouncement Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

Associated Types

type Rep LeiosAnnouncement 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

type Rep LeiosAnnouncement = D1 ('MetaData "LeiosAnnouncement" "Ouroboros.Consensus.Leios.Protocol" "ouroboros-consensus-5.0.0.0-inplace" 'False) (C1 ('MetaCons "MkLeiosAnnouncement" 'PrefixI 'True) (S1 ('MetaSel ('Just "announcementElectee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'BlockIssuer)) :*: (S1 ('MetaSel ('Just "announcementEbHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EndorserBlockHash) :*: S1 ('MetaSel ('Just "announcementEbSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BytesSize))))
Show LeiosAnnouncement Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

NoThunks LeiosAnnouncement Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

type Rep LeiosAnnouncement Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

type Rep LeiosAnnouncement = D1 ('MetaData "LeiosAnnouncement" "Ouroboros.Consensus.Leios.Protocol" "ouroboros-consensus-5.0.0.0-inplace" 'False) (C1 ('MetaCons "MkLeiosAnnouncement" 'PrefixI 'True) (S1 ('MetaSel ('Just "announcementElectee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'BlockIssuer)) :*: (S1 ('MetaSel ('Just "announcementEbHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EndorserBlockHash) :*: S1 ('MetaSel ('Just "announcementEbSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BytesSize))))

data LeiosLedgerView Source #

The Leios parameters a ledger view carries.

The periods are durations, as the protocol parameters define them; they need not be whole numbers of slots.

Constructors

MkLeiosLedgerView 

Fields

Instances

Instances details
Eq LeiosLedgerView Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

Generic LeiosLedgerView Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

Associated Types

type Rep LeiosLedgerView 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

type Rep LeiosLedgerView = D1 ('MetaData "LeiosLedgerView" "Ouroboros.Consensus.Leios.Protocol" "ouroboros-consensus-5.0.0.0-inplace" 'False) (C1 ('MetaCons "MkLeiosLedgerView" 'PrefixI 'True) ((S1 ('MetaSel ('Just "llvCommittee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 LeiosCommittee) :*: (S1 ('MetaSel ('Just "llvQuorumStakeThreshold") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UnitInterval) :*: S1 ('MetaSel ('Just "llvAnnouncementPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Milliseconds32))) :*: ((S1 ('MetaSel ('Just "llvVotePeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Milliseconds32) :*: S1 ('MetaSel ('Just "llvDiffusionPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Milliseconds32)) :*: (S1 ('MetaSel ('Just "llvMaxEbBodySize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BytesSize) :*: S1 ('MetaSel ('Just "llvMaxEbTxsSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BytesSize)))))
Show LeiosLedgerView Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

NoThunks LeiosLedgerView Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

type Rep LeiosLedgerView Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

type Rep LeiosLedgerView = D1 ('MetaData "LeiosLedgerView" "Ouroboros.Consensus.Leios.Protocol" "ouroboros-consensus-5.0.0.0-inplace" 'False) (C1 ('MetaCons "MkLeiosLedgerView" 'PrefixI 'True) ((S1 ('MetaSel ('Just "llvCommittee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 LeiosCommittee) :*: (S1 ('MetaSel ('Just "llvQuorumStakeThreshold") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UnitInterval) :*: S1 ('MetaSel ('Just "llvAnnouncementPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Milliseconds32))) :*: ((S1 ('MetaSel ('Just "llvVotePeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Milliseconds32) :*: S1 ('MetaSel ('Just "llvDiffusionPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Milliseconds32)) :*: (S1 ('MetaSel ('Just "llvMaxEbBodySize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BytesSize) :*: S1 ('MetaSel ('Just "llvMaxEbTxsSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BytesSize)))))

class ConsensusProtocol p ⇒ LeiosProtocol p where Source #

Methods

getLeiosAnnouncement ∷ proxy p → ValidateView p → Maybe LeiosAnnouncement Source #

The announcement carried by the header with this view, if any.

getContainsLeiosCert ∷ proxy p → ValidateView p → Bool Source #

Whether the block whose header has this view contains a Leios certificate, which certifies the endorser block its predecessor announced.

validateLeiosAnnouncement ∷ ConsensusConfig p → ValidateView p → SlotNo → Ticked (ChainDepState p) → Except (ValidationErr p) OCINStaleness Source #

The protocol-level validation of a relayed announcement's header, done out of context: against the immutable tip's chain-dependent state ticked to the header's slot, rather than against the header's predecessor.

Since that state may lag, a check our lag could spuriously fail must not reject; a counter that is merely behind instead yields StaleOCIN.

Only called for a view that carries an announcement.

getLeiosLedgerView ∷ proxy p → LedgerView p → Maybe LeiosLedgerView Source #

The Leios parameters this ledger view carries, or Nothing if the protocol has no Leios.

Instances

Instances details
CanHardFork xs ⇒ LeiosProtocol (HardForkProtocol xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol

BftCrypto c ⇒ LeiosProtocol (Bft c) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

PBftCrypto c ⇒ LeiosProtocol (PBft c) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

(LeiosProtocol p, ChainOrder t, Show t, Typeable t, NoThunks t) ⇒ LeiosProtocol (ModChainSel p t) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.ModChainSel

data OCINStaleness Source #

Whether an announcement's operational certificate issue number (OCIN) is at least the one our immutable tip records for its issuer.

A stale one is accepted from the peer but neither processed nor relayed; see validateLeiosAnnouncement.

Constructors

FreshOCIN 
StaleOCIN 

Instances

Instances details
Eq OCINStaleness Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

Show OCINStaleness Source # 
Instance details

Defined in Ouroboros.Consensus.Leios.Protocol

defaultGetContainsLeiosCert ∷ proxy p → ValidateView p → Bool Source #

getContainsLeiosCert for a protocol whose blocks never contain a Leios certificate.

defaultGetLeiosLedgerView ∷ proxy p → LedgerView p → Maybe LeiosLedgerView Source #

getLeiosLedgerView for a protocol that has no Leios.

defaultValidateLeiosAnnouncement ∷ ConsensusConfig p → ValidateView p → SlotNo → Ticked (ChainDepState p) → Except (ValidationErr p) OCINStaleness Source #

validateLeiosAnnouncement for a protocol whose headers never carry an announcement, which is therefore never called.

defaultGetLeiosAnnouncement ∷ proxy p → ValidateView p → Maybe LeiosAnnouncement Source #

getLeiosAnnouncement for a protocol whose headers never carry an announcement.

trivialLeiosLedgerView ∷ (LeiosProtocol (BlockProtocol blk), LedgerView (BlockProtocol blk) ~ ()) ⇒ proxy blk → StrictMaybe LeiosLedgerView Source #

The Leios part of the ledger view of a block whose ledger view is trivial, and so the same at every slot

A trivial ledger view does not rule out Leios: the protocol may fix its Leios parameters, which getLeiosLedgerView would give.