Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data EraParams = EraParams {}
- data SafeZone
- defaultEraParams ∷ SecurityParam → SlotLength → EraParams
- data EraParamsFormat
API
Parameters that can vary across hard forks
Instances
Generic EraParams Source # | |
Show EraParams Source # | |
Eq EraParams Source # | |
NoThunks EraParams Source # | |
Given EraParamsFormat ⇒ Serialise EraParams Source # | |
type Rep EraParams Source # | |
Defined in Ouroboros.Consensus.HardFork.History.EraParams type Rep EraParams = D1 ('MetaData "EraParams" "Ouroboros.Consensus.HardFork.History.EraParams" "ouroboros-consensus-0.21.0.0-inplace" 'False) (C1 ('MetaCons "EraParams" 'PrefixI 'True) ((S1 ('MetaSel ('Just "eraEpochSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochSize) :*: S1 ('MetaSel ('Just "eraSlotLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotLength)) :*: (S1 ('MetaSel ('Just "eraSafeZone") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SafeZone) :*: S1 ('MetaSel ('Just "eraGenesisWin") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GenesisWindow)))) |
Zone in which it is guaranteed that no hard fork can take place
StandardSafeZone !Word64 | Standard safe zone We record
|
UnsafeIndefiniteSafeZone | Pretend the transition to the next era will not take place. This constructor is marked as unsafe because it effectively extends the safe zone of this era indefinitely into the future. This means that we might reach invalid conclusions when doing
This is safe when the code is simply not yet ready to transition to the next era, because in that case, we can be sure that blocks that come in are still from this era. It also means that we can always produce a block, no matter how far ahead of the current ledger we are. If the code is ready for the transition, just awaiting an update
proposal, then This constructor can be regarded as an " extreme " version of
|
Instances
Generic SafeZone Source # | |
Show SafeZone Source # | |
Eq SafeZone Source # | |
NoThunks SafeZone Source # | |
Serialise SafeZone Source # | |
type Rep SafeZone Source # | |
Defined in Ouroboros.Consensus.HardFork.History.EraParams type Rep SafeZone = D1 ('MetaData "SafeZone" "Ouroboros.Consensus.HardFork.History.EraParams" "ouroboros-consensus-0.21.0.0-inplace" 'False) (C1 ('MetaCons "StandardSafeZone" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :+: C1 ('MetaCons "UnsafeIndefiniteSafeZone" 'PrefixI 'False) (U1 ∷ Type → Type)) |
Defaults
defaultEraParams ∷ SecurityParam → SlotLength → EraParams Source #
Default EraParams
We set
- epoch size to
10k
slots - the safe zone to
2k
slots - the upper bound to
NoLowerBound
This is primarily useful for tests.
Serialisation
data EraParamsFormat Source #
Older versions are not aware of the Genesis window as part of EraParams
,
so we need to stay backwards-compatible for now. This type can be removed
once mainnet is in Conway (as we can then always use the behavior of
EraParamsWithGenesisWindow
).
Instances
Show EraParamsFormat Source # | |
Defined in Ouroboros.Consensus.HardFork.History.EraParams showsPrec ∷ Int → EraParamsFormat → ShowS # show ∷ EraParamsFormat → String # showList ∷ [EraParamsFormat] → ShowS # | |
Eq EraParamsFormat Source # | |
Defined in Ouroboros.Consensus.HardFork.History.EraParams (==) ∷ EraParamsFormat → EraParamsFormat → Bool # (/=) ∷ EraParamsFormat → EraParamsFormat → Bool # |