Modulebyron-spec-ledger-1.1.0.1Haskell2010
Byron.Spec.Ledger.Core.Generators
Generators for the Ledger.Core values.
- 8 values
- Packagebyron-spec-ledger-1.1.0.1
- Exports8
- LanguageHaskell2010
- LicenceApache-2.0
- SourceGenerators.hs
Generates a slot within the given bound
Generates an epoch within the given bound
Generates a block count within the given bound
Generate a chain stability parameter value (k) using the given chain length and desired
number of epochs.
Given a chain length, determine the k value that will split the chain length into the desired
number of epochs.
We have that:
chainLength = slotsPerEpoch k * numberOfEpochs
= { algebra }
chainLength / numberOfEpochs = slotsPerEpoch k
= { 'slotsPerEpochtoK' is the inverse of 'slotsPerEpoch'; algebra }
slotsPerEpochToK (chainLength / numberOfEpochs) = kSo the resulting k value will be directly proportional to the chainLength and inversely
proportional to the chosen numberOfEpochs.
The minimum value for k will be 1. In particular, this will be the value
returned when the number of epochs is greater or equal than chainLength.