| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Leios.Protocol
Description
What a consensus protocol says about the Leios announcement a header may carry.
Synopsis
- data LeiosAnnouncement = MkLeiosAnnouncement {}
- decodeLeiosAnnouncement ∷ Decoder s LeiosAnnouncement
- encodeLeiosAnnouncement ∷ LeiosAnnouncement → Encoding
- data LeiosLedgerView = MkLeiosLedgerView {}
- class ConsensusProtocol p ⇒ LeiosProtocol p where
- getLeiosAnnouncement ∷ proxy p → ValidateView p → Maybe LeiosAnnouncement
- validateLeiosAnnouncement ∷ ConsensusConfig p → ValidateView p → SlotNo → Ticked (ChainDepState p) → Except (ValidationErr p) OCINStaleness
- getLeiosLedgerView ∷ proxy p → LedgerView p → Maybe LeiosLedgerView
- data OCINStaleness
- defaultGetLeiosLedgerView ∷ proxy p → LedgerView p → Maybe LeiosLedgerView
- defaultValidateLeiosAnnouncement ∷ ConsensusConfig p → ValidateView p → SlotNo → Ticked (ChainDepState p) → Except (ValidationErr p) OCINStaleness
- defaultGetLeiosAnnouncement ∷ proxy p → ValidateView p → Maybe LeiosAnnouncement
Documentation
data LeiosAnnouncement Source #
The announcement a header carries, as its protocol view gives it.
Constructors
| MkLeiosAnnouncement | |
Fields
| |
Instances
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
| Eq LeiosLedgerView Source # | |||||
Defined in Ouroboros.Consensus.Leios.Protocol Methods (==) ∷ LeiosLedgerView → LeiosLedgerView → Bool # (/=) ∷ LeiosLedgerView → LeiosLedgerView → Bool # | |||||
| Generic LeiosLedgerView Source # | |||||
Defined in Ouroboros.Consensus.Leios.Protocol Associated Types
Methods from ∷ LeiosLedgerView → Rep LeiosLedgerView x # to ∷ Rep LeiosLedgerView x → LeiosLedgerView # | |||||
| Show LeiosLedgerView Source # | |||||
Defined in Ouroboros.Consensus.Leios.Protocol Methods showsPrec ∷ Int → LeiosLedgerView → ShowS # show ∷ LeiosLedgerView → String # showList ∷ [LeiosLedgerView] → ShowS # | |||||
| NoThunks LeiosLedgerView Source # | |||||
Defined in Ouroboros.Consensus.Leios.Protocol | |||||
| type Rep LeiosLedgerView Source # | |||||
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.
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
| (CanHardFork xs, All SingleEraBlockAndLeiosProtocol xs) ⇒ LeiosProtocol (HardForkProtocol xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol Methods getLeiosAnnouncement ∷ proxy (HardForkProtocol xs) → ValidateView (HardForkProtocol xs) → Maybe LeiosAnnouncement Source # validateLeiosAnnouncement ∷ ConsensusConfig (HardForkProtocol xs) → ValidateView (HardForkProtocol xs) → SlotNo → Ticked (ChainDepState (HardForkProtocol xs)) → Except (ValidationErr (HardForkProtocol xs)) OCINStaleness Source # getLeiosLedgerView ∷ proxy (HardForkProtocol xs) → LedgerView (HardForkProtocol xs) → Maybe LeiosLedgerView Source # | |
| BftCrypto c ⇒ LeiosProtocol (Bft c) Source # | |
Defined in Ouroboros.Consensus.Protocol.BFT Methods getLeiosAnnouncement ∷ proxy (Bft c) → ValidateView (Bft c) → Maybe LeiosAnnouncement Source # validateLeiosAnnouncement ∷ ConsensusConfig (Bft c) → ValidateView (Bft c) → SlotNo → Ticked (ChainDepState (Bft c)) → Except (ValidationErr (Bft c)) OCINStaleness Source # getLeiosLedgerView ∷ proxy (Bft c) → LedgerView (Bft c) → Maybe LeiosLedgerView Source # | |
| PBftCrypto c ⇒ LeiosProtocol (PBft c) Source # | |
Defined in Ouroboros.Consensus.Protocol.PBFT Methods getLeiosAnnouncement ∷ proxy (PBft c) → ValidateView (PBft c) → Maybe LeiosAnnouncement Source # validateLeiosAnnouncement ∷ ConsensusConfig (PBft c) → ValidateView (PBft c) → SlotNo → Ticked (ChainDepState (PBft c)) → Except (ValidationErr (PBft c)) OCINStaleness Source # getLeiosLedgerView ∷ proxy (PBft c) → LedgerView (PBft c) → Maybe LeiosLedgerView Source # | |
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.
Instances
| Eq OCINStaleness Source # | |
Defined in Ouroboros.Consensus.Leios.Protocol | |
| Show OCINStaleness Source # | |
Defined in Ouroboros.Consensus.Leios.Protocol Methods showsPrec ∷ Int → OCINStaleness → ShowS # show ∷ OCINStaleness → String # showList ∷ [OCINStaleness] → ShowS # | |
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.