Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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 'Genesis)
- | OcertFailure (PredicateFailure (OCERT c))
- data OBftSlot
- = NonActiveSlot
- | ActiveSlot !(KeyHash 'Genesis)
- classifyOverlaySlot ∷ SlotNo → Set (KeyHash 'Genesis) → UnitInterval → ActiveSlotCoeff → SlotNo → OBftSlot
- lookupInOverlaySchedule ∷ SlotNo → Set (KeyHash 'Genesis) → 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, PredicateFailure
s 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 PredicateFailure
s 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
data OverlayEnv Source #
Instances
Generic OverlayEnv Source # | |
Defined in Cardano.Protocol.TPraos.Rules.Overlay from ∷ OverlayEnv → Rep OverlayEnv x Source # to ∷ Rep OverlayEnv x → OverlayEnv Source # | |
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.4.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 #
Instances
Instances
Generic OBftSlot Source # | |
Show OBftSlot Source # | |
DecCBOR OBftSlot Source # | |
EncCBOR OBftSlot Source # | |
NFData OBftSlot Source # | |
Defined in Cardano.Protocol.TPraos.Rules.Overlay | |
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.4.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 'Genesis)))) |
classifyOverlaySlot ∷ SlotNo → Set (KeyHash 'Genesis) → UnitInterval → ActiveSlotCoeff → SlotNo → OBftSlot Source #
lookupInOverlaySchedule ∷ SlotNo → Set (KeyHash 'Genesis) → 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.