| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.HardFork.History.EraParams
Synopsis
- data EraParams = EraParams {}
- data SafeZone
- data PerasEnabled a
- pattern PerasEnabled ∷ a → PerasEnabled a
- pattern NoPerasEnabled ∷ PerasEnabled a
- newtype PerasEnabledT (m ∷ Type → Type) a = PerasEnabledT {
- runPerasEnabledT ∷ m (PerasEnabled a)
- fromPerasEnabled ∷ a → PerasEnabled a → a
- perasEnabledToMaybe ∷ PerasEnabled a → Maybe a
- defaultEraParams ∷ SecurityParam → SlotLength → PerasEnabled () → EraParams
API
Parameters that can vary across hard forks
Constructors
| EraParams | |
Fields
| |
Instances
Zone in which it is guaranteed that no hard fork can take place
Constructors
| 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
| Eq SafeZone Source # | |||||
| Generic SafeZone Source # | |||||
Defined in Ouroboros.Consensus.HardFork.History.EraParams Associated Types
| |||||
| Show 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-4.0.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)) | |||||
data PerasEnabled a Source #
A marker for Peras-specific values that are not present in all eras
Instances
| Applicative PerasEnabled Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params Methods pure ∷ a → PerasEnabled a # (<*>) ∷ PerasEnabled (a → b) → PerasEnabled a → PerasEnabled b # liftA2 ∷ (a → b → c) → PerasEnabled a → PerasEnabled b → PerasEnabled c # (*>) ∷ PerasEnabled a → PerasEnabled b → PerasEnabled b # (<*) ∷ PerasEnabled a → PerasEnabled b → PerasEnabled a # | |||||
| Functor PerasEnabled Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params Methods fmap ∷ (a → b) → PerasEnabled a → PerasEnabled b # (<$) ∷ a → PerasEnabled b → PerasEnabled a # | |||||
| Monad PerasEnabled Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params Methods (>>=) ∷ PerasEnabled a → (a → PerasEnabled b) → PerasEnabled b # (>>) ∷ PerasEnabled a → PerasEnabled b → PerasEnabled b # return ∷ a → PerasEnabled a # | |||||
| FromCBOR a ⇒ FromCBOR (PerasEnabled a) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params | |||||
| ToCBOR a ⇒ ToCBOR (PerasEnabled a) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params Methods toCBOR ∷ PerasEnabled a → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (PerasEnabled a) → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PerasEnabled a] → Size Source # | |||||
| Eq a ⇒ Eq (PerasEnabled a) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params Methods (==) ∷ PerasEnabled a → PerasEnabled a → Bool # (/=) ∷ PerasEnabled a → PerasEnabled a → Bool # | |||||
| Ord a ⇒ Ord (PerasEnabled a) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params Methods compare ∷ PerasEnabled a → PerasEnabled a → Ordering # (<) ∷ PerasEnabled a → PerasEnabled a → Bool # (<=) ∷ PerasEnabled a → PerasEnabled a → Bool # (>) ∷ PerasEnabled a → PerasEnabled a → Bool # (>=) ∷ PerasEnabled a → PerasEnabled a → Bool # max ∷ PerasEnabled a → PerasEnabled a → PerasEnabled a # min ∷ PerasEnabled a → PerasEnabled a → PerasEnabled a # | |||||
| Generic (PerasEnabled a) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params Associated Types
Methods from ∷ PerasEnabled a → Rep (PerasEnabled a) x # to ∷ Rep (PerasEnabled a) x → PerasEnabled a # | |||||
| Show a ⇒ Show (PerasEnabled a) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params Methods showsPrec ∷ Int → PerasEnabled a → ShowS # show ∷ PerasEnabled a → String # showList ∷ [PerasEnabled a] → ShowS # | |||||
| NoThunks a ⇒ NoThunks (PerasEnabled a) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params | |||||
| type Rep (PerasEnabled a) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Params type Rep (PerasEnabled a) = D1 ('MetaData "PerasEnabled" "Ouroboros.Consensus.Peras.Params" "ouroboros-consensus-4.0.0.0-inplace" 'True) (C1 ('MetaCons "MkPerasEnabled" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe a)))) | |||||
pattern PerasEnabled ∷ a → PerasEnabled a Source #
pattern NoPerasEnabled ∷ PerasEnabled a Source #
newtype PerasEnabledT (m ∷ Type → Type) a Source #
A MaybeT-like monad transformer.
Used solely for the Peras-related hard fork combinator queries,
see Qry.
Constructors
| PerasEnabledT | |
Fields
| |
Instances
| MonadTrans PerasEnabledT Source # | |
Defined in Ouroboros.Consensus.Peras.Params Methods lift ∷ Monad m ⇒ m a → PerasEnabledT m a # | |
| (Functor m, Monad m) ⇒ Applicative (PerasEnabledT m) Source # | |
Defined in Ouroboros.Consensus.Peras.Params Methods pure ∷ a → PerasEnabledT m a # (<*>) ∷ PerasEnabledT m (a → b) → PerasEnabledT m a → PerasEnabledT m b # liftA2 ∷ (a → b → c) → PerasEnabledT m a → PerasEnabledT m b → PerasEnabledT m c # (*>) ∷ PerasEnabledT m a → PerasEnabledT m b → PerasEnabledT m b # (<*) ∷ PerasEnabledT m a → PerasEnabledT m b → PerasEnabledT m a # | |
| Functor m ⇒ Functor (PerasEnabledT m) Source # | |
Defined in Ouroboros.Consensus.Peras.Params Methods fmap ∷ (a → b) → PerasEnabledT m a → PerasEnabledT m b # (<$) ∷ a → PerasEnabledT m b → PerasEnabledT m a # | |
| Monad m ⇒ Monad (PerasEnabledT m) Source # | |
Defined in Ouroboros.Consensus.Peras.Params Methods (>>=) ∷ PerasEnabledT m a → (a → PerasEnabledT m b) → PerasEnabledT m b # (>>) ∷ PerasEnabledT m a → PerasEnabledT m b → PerasEnabledT m b # return ∷ a → PerasEnabledT m a # | |
fromPerasEnabled ∷ a → PerasEnabled a → a Source #
A fromMaybe-like eliminator for PerasEnabled
perasEnabledToMaybe ∷ PerasEnabled a → Maybe a Source #
Return the underlying Maybe of a PerasEnabled value.
Defaults
defaultEraParams ∷ SecurityParam → SlotLength → PerasEnabled () → EraParams Source #
Default EraParams
We set
- epoch size to
10*kslots - the safe zone to
2*kslots - the upper bound to
NoLowerBound - the Peras Round Length is set to
2*kslots if peras is enabled (because it must be a divisor of the epoch size)
This is primarily useful for tests.