Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data SDELEG
- data SDELEGS
- data DSState = DSState [(Slot, (VKeyGenesis, VKey))] (Set (Epoch, VKeyGenesis))
- _dSStateScheduledDelegations ∷ DSState → [(Slot, (VKeyGenesis, VKey))]
- _dSStateKeyEpochDelegations ∷ DSState → Set (Epoch, VKeyGenesis)
- data DCert = DCert VKeyGenesis VKey Epoch (Sig (VKey, Epoch))
- delegator ∷ DCert → VKeyGenesis
- delegate ∷ DCert → VKey
- depoch ∷ DCert → Epoch
- dwho ∷ DCert → (VKeyGenesis, VKey)
- mkDCert ∷ VKeyGenesis → Sig (VKey, Epoch) → VKey → Epoch → DCert
- signature ∷ DCert → Sig (VKey, Epoch)
- data ADELEG
- data ADELEGS
- data DSEnv = DSEnv {}
- allowedDelegators ∷ HasAllowedDelegators s a ⇒ Lens' s a
- data DState = DState {}
- data DELEG
- type DIEnv = DSEnv
- data DIState = DIState (Bimap VKeyGenesis VKey) (Map VKeyGenesis Slot) [(Slot, (VKeyGenesis, VKey))] (Set (Epoch, VKeyGenesis))
- _dIStateDelegationMap ∷ DIState → Bimap VKeyGenesis VKey
- _dIStateLastDelegation ∷ DIState → Map VKeyGenesis Slot
- _dIStateScheduledDelegations ∷ DIState → [(Slot, (VKeyGenesis, VKey))]
- _dIStateKeyEpochDelegations ∷ DIState → Set (Epoch, VKeyGenesis)
- liveAfter ∷ BlockCount → SlotCount
- data EpochDiff = EpochDiff {}
- slot ∷ HasSlot s a ⇒ Lens' s a
- epoch ∷ HasEpoch s a ⇒ Lens' s a
- delegationMap ∷ HasDelegationMap s a ⇒ Lens' s a
- class HasScheduledDelegations s a | s → a
- scheduledDelegations ∷ HasScheduledDelegations s a ⇒ Lens' s a
- dmsL ∷ HasDelegationMap a (Bimap VKeyGenesis VKey) ⇒ Lens' a (Bimap VKeyGenesis VKey)
- dcertGen ∷ DSEnv → Set (Epoch, VKeyGenesis) → Gen (Maybe DCert)
- dcertsGen ∷ DSEnv → DIState → Gen [DCert]
- initialEnvFromGenesisKeys ∷ Word8 → Word64 → Gen DSEnv
- randomDCertGen ∷ Environment DELEG → Gen DCert
- delegatorOf ∷ Bimap VKeyGenesis VKey → VKey → Maybe VKeyGenesis
- delegatorDelegate ∷ DCert → (VKeyGenesis, VKey)
- emptyDelegationPayloadRatio ∷ [[DCert]] → Double
- thisEpochDelegationsRatio ∷ [(Epoch, Epoch)] → Double
- nextEpochDelegationsRatio ∷ [(Epoch, Epoch)] → Double
- selfDelegationsRatio ∷ [DCert] → Double
- multipleDelegationsRatio ∷ [DCert] → Double
- maxDelegationsTo ∷ [DCert] → Int
- changedDelegationsRatio ∷ [DCert] → Double
- maxChangedDelegations ∷ [DCert] → Int
- repeatedDelegationsRatio ∷ [DCert] → Double
- maxRepeatedDelegations ∷ [DCert] → Int
- maxCertsPerBlock ∷ [[DCert]] → Int
- data AdelegPredicateFailure
- data AdelegsPredicateFailure = ADelegFailure (PredicateFailure ADELEG)
- data SdelegPredicateFailure
- data SdelegsPredicateFailure = SDelegFailure (PredicateFailure SDELEG)
- data MsdelegPredicateFailure = SDELEGFailure (PredicateFailure SDELEG)
- data DelegPredicateFailure
Delegation scheduling
Delegation scheduling rules
Instances
Delegation scheduling sequencing
Instances
Delegation scheduling state
DSState [(Slot, (VKeyGenesis, VKey))] (Set (Epoch, VKeyGenesis)) |
Instances
Generic DSState Source # | |
Show DSState Source # | |
Eq DSState Source # | |
NoThunks DSState Source # | |
HasScheduledDelegations DSState [(Slot, (VKeyGenesis, VKey))] Source # | |
Defined in Byron.Spec.Ledger.Delegation scheduledDelegations ∷ Lens' DSState [(Slot, (VKeyGenesis, VKey))] Source # | |
type Rep DSState Source # | |
Defined in Byron.Spec.Ledger.Delegation type Rep DSState = D1 ('MetaData "DSState" "Byron.Spec.Ledger.Delegation" "byron-spec-ledger-1.0.1.0-inplace" 'False) (C1 ('MetaCons "DSState" 'PrefixI 'True) (S1 ('MetaSel ('Just "_dSStateScheduledDelegations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(Slot, (VKeyGenesis, VKey))]) :*: S1 ('MetaSel ('Just "_dSStateKeyEpochDelegations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Set (Epoch, VKeyGenesis))))) |
_dSStateScheduledDelegations ∷ DSState → [(Slot, (VKeyGenesis, VKey))] Source #
A delegation certificate.
Instances
delegator ∷ DCert → VKeyGenesis Source #
Key that delegates
Delegation activation
Delegation rules
Instances
Delegation rules sequencing
Instances
Delegation scheduling environment
DSEnv | |
|
Instances
Generic DSEnv Source # | |
Show DSEnv Source # | |
Eq DSEnv Source # | |
NoThunks DSEnv Source # | |
type Rep DSEnv Source # | |
Defined in Byron.Spec.Ledger.Delegation type Rep DSEnv = D1 ('MetaData "DSEnv" "Byron.Spec.Ledger.Delegation" "byron-spec-ledger-1.0.1.0-inplace" 'False) (C1 ('MetaCons "DSEnv" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_dSEnvAllowedDelegators") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Set VKeyGenesis)) :*: S1 ('MetaSel ('Just "_dSEnvEpoch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Epoch)) :*: (S1 ('MetaSel ('Just "_dSEnvSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Slot) :*: S1 ('MetaSel ('Just "_dSEnvK") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BlockCount)))) |
allowedDelegators ∷ HasAllowedDelegators s a ⇒ Lens' s a Source #
Delegation state
DState | |
|
Instances
Generic DState Source # | |
Show DState Source # | |
Eq DState Source # | |
NoThunks DState Source # | |
type Rep DState Source # | |
Defined in Byron.Spec.Ledger.Delegation type Rep DState = D1 ('MetaData "DState" "Byron.Spec.Ledger.Delegation" "byron-spec-ledger-1.0.1.0-inplace" 'False) (C1 ('MetaCons "DState" 'PrefixI 'True) (S1 ('MetaSel ('Just "_dStateDelegationMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Bimap VKeyGenesis VKey)) :*: S1 ('MetaSel ('Just "_dStateLastDelegation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map VKeyGenesis Slot)))) |
Delegation interface
Delegation interface
Instances
DIState (Bimap VKeyGenesis VKey) (Map VKeyGenesis Slot) [(Slot, (VKeyGenesis, VKey))] (Set (Epoch, VKeyGenesis)) |
Instances
_dIStateScheduledDelegations ∷ DIState → [(Slot, (VKeyGenesis, VKey))] Source #
liveAfter ∷ BlockCount → SlotCount Source #
Compute after which slot the delegation certificate will become live, using the chain stability parameter.
Instances
State lens fields
delegationMap ∷ HasDelegationMap s a ⇒ Lens' s a Source #
State lens type classes
class HasScheduledDelegations s a | s → a Source #
Instances
HasScheduledDelegations DIState [(Slot, (VKeyGenesis, VKey))] Source # | |
Defined in Byron.Spec.Ledger.Delegation scheduledDelegations ∷ Lens' DIState [(Slot, (VKeyGenesis, VKey))] Source # | |
HasScheduledDelegations DSState [(Slot, (VKeyGenesis, VKey))] Source # | |
Defined in Byron.Spec.Ledger.Delegation scheduledDelegations ∷ Lens' DSState [(Slot, (VKeyGenesis, VKey))] Source # |
scheduledDelegations ∷ HasScheduledDelegations s a ⇒ Lens' s a Source #
dmsL ∷ HasDelegationMap a (Bimap VKeyGenesis VKey) ⇒ Lens' a (Bimap VKeyGenesis VKey) Source #
Generators
initialEnvFromGenesisKeys Source #
Generate an initial DELEG
environment from the given number of genesis
keys.
randomDCertGen ∷ Environment DELEG → Gen DCert Source #
Generate a random delegation certificate, which has a high probability of failing since we do not consider the current delegation state. So for instance, we could generate a delegation certificate for a genesis key that already delegated in this epoch.
Functions on delegation state
Support Functions for delegation properties
delegatorDelegate ∷ DCert → (VKeyGenesis, VKey) Source #
emptyDelegationPayloadRatio ∷ [[DCert]] → Double Source #
Ratio of certificate groups that are empty
thisEpochDelegationsRatio ∷ [(Epoch, Epoch)] → Double Source #
Ratio of certificates that delegate to _this_ epoch, where each certificate is represented by (current epoch,cert epoch)
nextEpochDelegationsRatio ∷ [(Epoch, Epoch)] → Double Source #
Ratio of certificates that delegate to the _next_ epoch, where each certificate is represented by (current epoch,cert epoch)
selfDelegationsRatio ∷ [DCert] → Double Source #
Ratio of certificates that "delegate to self", that is, where the delegator and delegate are the same
multipleDelegationsRatio ∷ [DCert] → Double Source #
Ratio of delegates that have multiple delegators that are delegating to them
maxDelegationsTo ∷ [DCert] → Int Source #
The maximum number of delegators to any particular delegate
changedDelegationsRatio ∷ [DCert] → Double Source #
Ratio of delegators that have changed their delegations
maxChangedDelegations ∷ [DCert] → Int Source #
The maximum number of change-of-delegate for any particular delegator
repeatedDelegationsRatio ∷ [DCert] → Double Source #
Ratio of repeated delegations to all delegations
maxRepeatedDelegations ∷ [DCert] → Int Source #
The maximum number of repeated delegations in the given certificates
maxCertsPerBlock ∷ [[DCert]] → Int Source #
Predicate failures
data AdelegPredicateFailure Source #
None of these PredicateFailure
s are actually "throwable". The
disjuction of the rules' preconditions is True
, which means that one of
them will pass. The PredicateFailure
just act as switches to direct
control flow to the successful one.
S_BeforeExistingDelegation | |
S_NoLastDelegation | |
S_AfterExistingDelegation | |
S_AlreadyADelegateOf VKey VKeyGenesis |
Instances
data AdelegsPredicateFailure Source #
Instances
data SdelegPredicateFailure Source #
These PredicateFailure
s are all "throwable". The disjunction of the
rules' preconditions is not True
- the PredicateFailure
s represent
False
cases.
IsNotGenesisKey | |
EpochInThePast EpochDiff | |
EpochPastNextEpoch EpochDiff | |
HasAlreadyDelegated | |
IsAlreadyScheduled | |
DoesNotVerify |
Instances
data SdelegsPredicateFailure Source #
Instances
data MsdelegPredicateFailure Source #
Instances
data DelegPredicateFailure Source #