Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data OVERLAY c
- type family PredicateFailure a
- data OverlayEnv c = OverlayEnv UnitInterval (PoolDistr c) (GenDelegs c) Nonce
- data OverlayPredicateFailure c
- = VRFKeyUnknown !(KeyHash 'StakePool c)
- | VRFKeyWrongVRFKey !(KeyHash 'StakePool c) !(Hash c (VerKeyVRF c)) !(Hash c (VerKeyVRF c))
- | 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 c) !(KeyHash 'GenesisDelegate c)
- | WrongGenesisVRFKeyOVERLAY !(KeyHash 'BlockIssuer c) !(Hash c (VerKeyVRF c)) !(Hash c (VerKeyVRF c))
- | UnknownGenesisKeyOVERLAY !(KeyHash 'Genesis c)
- | OcertFailure (PredicateFailure (OCERT c))
- data OBftSlot c
- = NonActiveSlot
- | ActiveSlot !(KeyHash 'Genesis c)
- classifyOverlaySlot ∷ SlotNo → Set (KeyHash 'Genesis c) → UnitInterval → ActiveSlotCoeff → SlotNo → OBftSlot c
- lookupInOverlaySchedule ∷ SlotNo → Set (KeyHash 'Genesis c) → UnitInterval → ActiveSlotCoeff → SlotNo → Maybe (OBftSlot c)
- 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 c Source #
OverlayEnv UnitInterval (PoolDistr c) (GenDelegs c) Nonce |
Instances
data OverlayPredicateFailure c Source #
VRFKeyUnknown !(KeyHash 'StakePool c) | |
VRFKeyWrongVRFKey !(KeyHash 'StakePool c) !(Hash c (VerKeyVRF c)) !(Hash c (VerKeyVRF c)) | |
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 c) !(KeyHash 'GenesisDelegate c) | |
WrongGenesisVRFKeyOVERLAY !(KeyHash 'BlockIssuer c) !(Hash c (VerKeyVRF c)) !(Hash c (VerKeyVRF c)) | |
UnknownGenesisKeyOVERLAY !(KeyHash 'Genesis c) | |
OcertFailure (PredicateFailure (OCERT c)) |
Instances
Instances
Generic (OBftSlot c) Source # | |
Show (OBftSlot c) Source # | |
Crypto c ⇒ DecCBOR (OBftSlot c) Source # | |
Crypto c ⇒ EncCBOR (OBftSlot c) Source # | |
NFData (OBftSlot c) Source # | |
Defined in Cardano.Protocol.TPraos.Rules.Overlay | |
Eq (OBftSlot c) Source # | |
Ord (OBftSlot c) Source # | |
Defined in Cardano.Protocol.TPraos.Rules.Overlay | |
NoThunks (OBftSlot c) Source # | |
type Rep (OBftSlot c) Source # | |
Defined in Cardano.Protocol.TPraos.Rules.Overlay type Rep (OBftSlot c) = D1 ('MetaData "OBftSlot" "Cardano.Protocol.TPraos.Rules.Overlay" "cardano-protocol-tpraos-1.2.0.1-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 c)))) |
classifyOverlaySlot ∷ SlotNo → Set (KeyHash 'Genesis c) → UnitInterval → ActiveSlotCoeff → SlotNo → OBftSlot c Source #
lookupInOverlaySchedule ∷ SlotNo → Set (KeyHash 'Genesis c) → UnitInterval → ActiveSlotCoeff → SlotNo → Maybe (OBftSlot c) 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.