| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Protocol.TPraos.Rules.Overlay
Synopsis
- data OVERLAY c
- type family PredicateFailure a
- data OverlayEnv = OverlayEnv UnitInterval PoolDistr GenDelegs Nonce
- data OverlayPredicateFailure c
- = VRFKeyUnknown (KeyHash 'StakePool)
- | VRFKeyWrongVRFKey (KeyHash 'StakePool) (VRFVerKeyHash 'StakePoolVRF) (VRFVerKeyHash 'BlockIssuerVRF)
- | VRFKeyBadNonce Nonce SlotNo Nonce (CertifiedVRF (VRF c) Nonce)
- | VRFKeyBadLeaderValue Nonce SlotNo Nonce (CertifiedVRF (VRF c) Nonce)
- | VRFLeaderValueTooBig (OutputVRF (VRF c)) Rational ActiveSlotCoeff
- | NotActiveSlotOVERLAY SlotNo
- | WrongGenesisColdKeyOVERLAY (KeyHash 'BlockIssuer) (KeyHash 'GenesisDelegate)
- | WrongGenesisVRFKeyOVERLAY (KeyHash 'BlockIssuer) (VRFVerKeyHash 'GenDelegVRF) (VRFVerKeyHash 'BlockIssuerVRF)
- | UnknownGenesisKeyOVERLAY (KeyHash 'GenesisRole)
- | OcertFailure (PredicateFailure (OCERT c))
- data OBftSlot
- classifyOverlaySlot ∷ SlotNo → Set (KeyHash 'GenesisRole) → UnitInterval → ActiveSlotCoeff → SlotNo → OBftSlot
- lookupInOverlaySchedule ∷ SlotNo → Set (KeyHash 'GenesisRole) → UnitInterval → ActiveSlotCoeff → SlotNo → Maybe OBftSlot
- overlaySlots ∷ SlotNo → UnitInterval → EpochSize → [SlotNo]
Documentation
Instances
type family PredicateFailure a Source #
Descriptive type for the possible failures which might cause a transition to fail.
As a convention, PredicateFailures which are "structural" (meaning that
they are not "throwable" in practice, and are used to pass control from
one transition rule to another) are prefixed with S_.
Structural PredicateFailures represent conditions between rules where
the disjunction of all rules' preconditions is equal to True. That is,
either one rule will throw a structural PredicateFailure and the other
will succeed, or vice-versa.
Instances
| type PredicateFailure TICKN Source # | |
Defined in Cardano.Protocol.TPraos.Rules.Tickn | |
| type PredicateFailure (AllegraUTXO era) | |
Defined in Cardano.Ledger.Allegra.Rules.Utxo | |
| type PredicateFailure (AllegraUTXOW era) | |
Defined in Cardano.Ledger.Allegra.Rules.Utxow | |
| type PredicateFailure (AlonzoBBODY era) | |
Defined in Cardano.Ledger.Alonzo.Rules.Bbody | |
| type PredicateFailure (AlonzoLEDGER era) | |
Defined in Cardano.Ledger.Alonzo.Rules.Ledger | |
| type PredicateFailure (AlonzoUTXO era) | |
Defined in Cardano.Ledger.Alonzo.Rules.Utxo | |
| type PredicateFailure (AlonzoUTXOS era) | |
Defined in Cardano.Ledger.Alonzo.Rules.Utxos | |
| type PredicateFailure (AlonzoUTXOW era) | |
Defined in Cardano.Ledger.Alonzo.Rules.Utxow | |
| type PredicateFailure (BabbageLEDGER era) | |
Defined in Cardano.Ledger.Babbage.Rules.Ledger | |
| type PredicateFailure (BabbageUTXO era) | |
Defined in Cardano.Ledger.Babbage.Rules.Utxo | |
| type PredicateFailure (BabbageUTXOS era) | |
Defined in Cardano.Ledger.Babbage.Rules.Utxos | |
| type PredicateFailure (BabbageUTXOW era) | |
Defined in Cardano.Ledger.Babbage.Rules.Utxow | |
| type PredicateFailure (ConwayBBODY era) | |
Defined in Cardano.Ledger.Conway.Rules.Bbody | |
| type PredicateFailure (ConwayCERT era) | |
Defined in Cardano.Ledger.Conway.Rules.Cert | |
| type PredicateFailure (ConwayCERTS era) | |
Defined in Cardano.Ledger.Conway.Rules.Certs | |
| type PredicateFailure (ConwayDELEG era) | |
Defined in Cardano.Ledger.Conway.Rules.Deleg | |
| type PredicateFailure (ConwayENACT era) | |
Defined in Cardano.Ledger.Conway.Rules.Enact | |
| type PredicateFailure (ConwayEPOCH era) | |
Defined in Cardano.Ledger.Conway.Rules.Epoch | |
| type PredicateFailure (ConwayGOV era) | |
Defined in Cardano.Ledger.Conway.Rules.Gov | |
| type PredicateFailure (ConwayGOVCERT era) | |
Defined in Cardano.Ledger.Conway.Rules.GovCert | |
| type PredicateFailure (ConwayHARDFORK era) | |
Defined in Cardano.Ledger.Conway.Rules.HardFork | |
| type PredicateFailure (ConwayLEDGER era) | |
Defined in Cardano.Ledger.Conway.Rules.Ledger | |
| type PredicateFailure (ConwayMEMPOOL era) | |
Defined in Cardano.Ledger.Conway.Rules.Mempool | |
| type PredicateFailure (ConwayNEWEPOCH era) | |
Defined in Cardano.Ledger.Conway.Rules.NewEpoch | |
| type PredicateFailure (ConwayRATIFY era) | |
Defined in Cardano.Ledger.Conway.Rules.Ratify | |
| type PredicateFailure (ConwayTICKF era) | |
Defined in Cardano.Ledger.Conway.Rules.Tickf | |
| type PredicateFailure (ConwayUTXO era) | |
Defined in Cardano.Ledger.Conway.Rules.Utxo | |
| type PredicateFailure (ConwayUTXOS era) | |
Defined in Cardano.Ledger.Conway.Rules.Utxos | |
| type PredicateFailure (ConwayUTXOW era) | |
Defined in Cardano.Ledger.Conway.Rules.Utxow | |
| type PredicateFailure (DijkstraCERT era) | |
Defined in Cardano.Ledger.Dijkstra.Rules.Cert | |
| type PredicateFailure (ShelleyBBODY era) | |
Defined in Cardano.Ledger.Shelley.Rules.Bbody | |
| type PredicateFailure (ShelleyDELEG era) | |
Defined in Cardano.Ledger.Shelley.Rules.Deleg | |
| type PredicateFailure (ShelleyDELEGS era) | |
Defined in Cardano.Ledger.Shelley.Rules.Delegs | |
| type PredicateFailure (ShelleyDELPL era) | |
Defined in Cardano.Ledger.Shelley.Rules.Delpl | |
| type PredicateFailure (ShelleyEPOCH era) | |
Defined in Cardano.Ledger.Shelley.Rules.Epoch | |
| type PredicateFailure (ShelleyLEDGER era) | |
Defined in Cardano.Ledger.Shelley.Rules.Ledger | |
| type PredicateFailure (ShelleyLEDGERS era) | |
Defined in Cardano.Ledger.Shelley.Rules.Ledgers | |
| type PredicateFailure (ShelleyMIR era) | |
Defined in Cardano.Ledger.Shelley.Rules.Mir | |
| type PredicateFailure (ShelleyNEWEPOCH era) | |
Defined in Cardano.Ledger.Shelley.Rules.NewEpoch | |
| type PredicateFailure (ShelleyNEWPP era) | |
Defined in Cardano.Ledger.Shelley.Rules.Newpp | |
| type PredicateFailure (ShelleyPOOL era) | |
Defined in Cardano.Ledger.Shelley.Rules.Pool | |
| type PredicateFailure (ShelleyPOOLREAP era) | |
Defined in Cardano.Ledger.Shelley.Rules.PoolReap | |
| type PredicateFailure (ShelleyPPUP era) | |
Defined in Cardano.Ledger.Shelley.Rules.Ppup | |
| type PredicateFailure (ShelleyRUPD era) | |
Defined in Cardano.Ledger.Shelley.Rules.Rupd | |
| type PredicateFailure (ShelleySNAP era) | |
Defined in Cardano.Ledger.Shelley.Rules.Snap | |
| type PredicateFailure (ShelleyTICK era) | |
Defined in Cardano.Ledger.Shelley.Rules.Tick | |
| type PredicateFailure (ShelleyTICKF era) | |
Defined in Cardano.Ledger.Shelley.Rules.Tick | |
| type PredicateFailure (ShelleyUPEC era) | |
Defined in Cardano.Ledger.Shelley.Rules.Upec | |
| type PredicateFailure (ShelleyUTXO era) | |
Defined in Cardano.Ledger.Shelley.Rules.Utxo | |
| type PredicateFailure (ShelleyUTXOW era) | |
Defined in Cardano.Ledger.Shelley.Rules.Utxow | |
| type PredicateFailure (OCERT c) Source # | |
Defined in Cardano.Protocol.TPraos.Rules.OCert | |
| type PredicateFailure (OVERLAY c) Source # | |
Defined in Cardano.Protocol.TPraos.Rules.Overlay | |
| type PredicateFailure (PRTCL c) Source # | |
Defined in Cardano.Protocol.TPraos.Rules.Prtcl | |
| type PredicateFailure (UPDN c) Source # | |
Defined in Cardano.Protocol.TPraos.Rules.Updn | |
| type PredicateFailure (STUB e st si f m) | |
Defined in Control.State.Transition.Extended | |
data OverlayEnv Source #
Constructors
| OverlayEnv UnitInterval PoolDistr GenDelegs Nonce |
Instances
| Generic OverlayEnv Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay Associated Types
| |||||
| NoThunks OverlayEnv Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay | |||||
| type Rep OverlayEnv Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay type Rep OverlayEnv = D1 ('MetaData "OverlayEnv" "Cardano.Protocol.TPraos.Rules.Overlay" "cardano-protocol-tpraos-1.5.0.0-inplace" 'False) (C1 ('MetaCons "OverlayEnv" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UnitInterval) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PoolDistr)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GenDelegs) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Nonce)))) | |||||
data OverlayPredicateFailure c Source #
Constructors
| VRFKeyUnknown (KeyHash 'StakePool) | |
| VRFKeyWrongVRFKey (KeyHash 'StakePool) (VRFVerKeyHash 'StakePoolVRF) (VRFVerKeyHash 'BlockIssuerVRF) | |
| VRFKeyBadNonce Nonce SlotNo Nonce (CertifiedVRF (VRF c) Nonce) | |
| VRFKeyBadLeaderValue Nonce SlotNo Nonce (CertifiedVRF (VRF c) Nonce) | |
| VRFLeaderValueTooBig (OutputVRF (VRF c)) Rational ActiveSlotCoeff | |
| NotActiveSlotOVERLAY SlotNo | |
| WrongGenesisColdKeyOVERLAY (KeyHash 'BlockIssuer) (KeyHash 'GenesisDelegate) | |
| WrongGenesisVRFKeyOVERLAY (KeyHash 'BlockIssuer) (VRFVerKeyHash 'GenDelegVRF) (VRFVerKeyHash 'BlockIssuerVRF) | |
| UnknownGenesisKeyOVERLAY (KeyHash 'GenesisRole) | |
| OcertFailure (PredicateFailure (OCERT c)) |
Instances
| Generic (OverlayPredicateFailure c) Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay Associated Types
Methods from ∷ OverlayPredicateFailure c → Rep (OverlayPredicateFailure c) x # to ∷ Rep (OverlayPredicateFailure c) x → OverlayPredicateFailure c # | |||||
| VRFAlgorithm (VRF c) ⇒ Show (OverlayPredicateFailure c) Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay Methods showsPrec ∷ Int → OverlayPredicateFailure c → ShowS # show ∷ OverlayPredicateFailure c → String # showList ∷ [OverlayPredicateFailure c] → ShowS # | |||||
| VRFAlgorithm (VRF c) ⇒ Eq (OverlayPredicateFailure c) Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay Methods (==) ∷ OverlayPredicateFailure c → OverlayPredicateFailure c → Bool # (/=) ∷ OverlayPredicateFailure c → OverlayPredicateFailure c → Bool # | |||||
| VRFAlgorithm (VRF c) ⇒ NoThunks (OverlayPredicateFailure c) Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay | |||||
| type Rep (OverlayPredicateFailure c) Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay type Rep (OverlayPredicateFailure c) = D1 ('MetaData "OverlayPredicateFailure" "Cardano.Protocol.TPraos.Rules.Overlay" "cardano-protocol-tpraos-1.5.0.0-inplace" 'False) (((C1 ('MetaCons "VRFKeyUnknown" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (KeyHash 'StakePool))) :+: C1 ('MetaCons "VRFKeyWrongVRFKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (KeyHash 'StakePool)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VRFVerKeyHash 'StakePoolVRF)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VRFVerKeyHash 'BlockIssuerVRF))))) :+: (C1 ('MetaCons "VRFKeyBadNonce" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Nonce) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlotNo)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Nonce) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CertifiedVRF (VRF c) Nonce)))) :+: (C1 ('MetaCons "VRFKeyBadLeaderValue" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Nonce) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlotNo)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Nonce) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CertifiedVRF (VRF c) Nonce)))) :+: C1 ('MetaCons "VRFLeaderValueTooBig" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OutputVRF (VRF c))) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ActiveSlotCoeff)))))) :+: ((C1 ('MetaCons "NotActiveSlotOVERLAY" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlotNo)) :+: C1 ('MetaCons "WrongGenesisColdKeyOVERLAY" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (KeyHash 'BlockIssuer)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (KeyHash 'GenesisDelegate)))) :+: (C1 ('MetaCons "WrongGenesisVRFKeyOVERLAY" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (KeyHash 'BlockIssuer)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VRFVerKeyHash 'GenDelegVRF)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VRFVerKeyHash 'BlockIssuerVRF)))) :+: (C1 ('MetaCons "UnknownGenesisKeyOVERLAY" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (KeyHash 'GenesisRole))) :+: C1 ('MetaCons "OcertFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PredicateFailure (OCERT c)))))))) | |||||
Constructors
| NonActiveSlot | |
| ActiveSlot !(KeyHash 'GenesisRole) |
Instances
| DecCBOR OBftSlot Source # | |||||
| EncCBOR OBftSlot Source # | |||||
| NFData OBftSlot Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay | |||||
| Generic OBftSlot Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay Associated Types
| |||||
| Show OBftSlot Source # | |||||
| Eq OBftSlot Source # | |||||
| Ord OBftSlot Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay | |||||
| NoThunks OBftSlot Source # | |||||
| type Rep OBftSlot Source # | |||||
Defined in Cardano.Protocol.TPraos.Rules.Overlay type Rep OBftSlot = D1 ('MetaData "OBftSlot" "Cardano.Protocol.TPraos.Rules.Overlay" "cardano-protocol-tpraos-1.5.0.0-inplace" 'False) (C1 ('MetaCons "NonActiveSlot" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "ActiveSlot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'GenesisRole)))) | |||||
classifyOverlaySlot ∷ SlotNo → Set (KeyHash 'GenesisRole) → UnitInterval → ActiveSlotCoeff → SlotNo → OBftSlot Source #
lookupInOverlaySchedule ∷ SlotNo → Set (KeyHash 'GenesisRole) → UnitInterval → ActiveSlotCoeff → SlotNo → Maybe OBftSlot Source #
overlaySlots ∷ SlotNo → UnitInterval → EpochSize → [SlotNo] Source #
Return the list of overlaySlots for a given epoch. Note that this linear in the size of the epoch, and should probably only be used for testing. If something more performant is needed, we could probably use [start + floor(xd) | x <- [0 .. (spe -1)], floor(xd) < spe] but we would need to make sure that this is equivalent.