Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data OVERLAY crypto
- type family PredicateFailure a
- data OverlayEnv crypto = OverlayEnv UnitInterval ( PoolDistr crypto) ( GenDelegs crypto) Nonce
-
data
OverlayPredicateFailure
crypto
- = VRFKeyUnknown !( KeyHash ' StakePool crypto)
- | VRFKeyWrongVRFKey !( KeyHash ' StakePool crypto) !( Hash crypto ( VerKeyVRF crypto)) !( Hash crypto ( VerKeyVRF crypto))
- | VRFKeyBadNonce ! Nonce ! SlotNo ! Nonce !( CertifiedVRF ( VRF crypto) Nonce )
- | VRFKeyBadLeaderValue ! Nonce ! SlotNo ! Nonce !( CertifiedVRF ( VRF crypto) Nonce )
- | VRFLeaderValueTooBig !( OutputVRF ( VRF crypto)) ! Rational ! ActiveSlotCoeff
- | NotActiveSlotOVERLAY ! SlotNo
- | WrongGenesisColdKeyOVERLAY !( KeyHash ' BlockIssuer crypto) !( KeyHash ' GenesisDelegate crypto)
- | WrongGenesisVRFKeyOVERLAY !( KeyHash ' BlockIssuer crypto) !( Hash crypto ( VerKeyVRF crypto)) !( Hash crypto ( VerKeyVRF crypto))
- | UnknownGenesisKeyOVERLAY !( KeyHash ' Genesis crypto)
- | OcertFailure ( PredicateFailure ( OCERT crypto))
-
data
OBftSlot
crypto
- = NonActiveSlot
- | ActiveSlot !( KeyHash ' Genesis crypto)
- classifyOverlaySlot :: SlotNo -> Set ( KeyHash ' Genesis crypto) -> UnitInterval -> ActiveSlotCoeff -> SlotNo -> OBftSlot crypto
- lookupInOverlaySchedule :: SlotNo -> Set ( KeyHash ' Genesis crypto) -> UnitInterval -> ActiveSlotCoeff -> SlotNo -> Maybe ( OBftSlot crypto)
- 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 crypto Source #
OverlayEnv UnitInterval ( PoolDistr crypto) ( GenDelegs crypto) Nonce |
Instances
data OverlayPredicateFailure crypto Source #
VRFKeyUnknown !( KeyHash ' StakePool crypto) | |
VRFKeyWrongVRFKey !( KeyHash ' StakePool crypto) !( Hash crypto ( VerKeyVRF crypto)) !( Hash crypto ( VerKeyVRF crypto)) | |
VRFKeyBadNonce ! Nonce ! SlotNo ! Nonce !( CertifiedVRF ( VRF crypto) Nonce ) | |
VRFKeyBadLeaderValue ! Nonce ! SlotNo ! Nonce !( CertifiedVRF ( VRF crypto) Nonce ) | |
VRFLeaderValueTooBig !( OutputVRF ( VRF crypto)) ! Rational ! ActiveSlotCoeff | |
NotActiveSlotOVERLAY ! SlotNo | |
WrongGenesisColdKeyOVERLAY !( KeyHash ' BlockIssuer crypto) !( KeyHash ' GenesisDelegate crypto) | |
WrongGenesisVRFKeyOVERLAY !( KeyHash ' BlockIssuer crypto) !( Hash crypto ( VerKeyVRF crypto)) !( Hash crypto ( VerKeyVRF crypto)) | |
UnknownGenesisKeyOVERLAY !( KeyHash ' Genesis crypto) | |
OcertFailure ( PredicateFailure ( OCERT crypto)) |
Instances
NonActiveSlot | |
ActiveSlot !( KeyHash ' Genesis crypto) |
Instances
classifyOverlaySlot :: SlotNo -> Set ( KeyHash ' Genesis crypto) -> UnitInterval -> ActiveSlotCoeff -> SlotNo -> OBftSlot crypto Source #
lookupInOverlaySchedule :: SlotNo -> Set ( KeyHash ' Genesis crypto) -> UnitInterval -> ActiveSlotCoeff -> SlotNo -> Maybe ( OBftSlot crypto) 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(x d) | x <- [0 .. (spe -1)], floor(x d) < spe] but we would need to make sure that this is equivalent.