ouroboros-consensus-1.0.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.HardFork.History.EraParams

Contents

Synopsis

API

data EraParams Source #

Parameters that can vary across hard forks

Constructors

EraParams 

Fields

Instances

Instances details
Generic EraParams Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Associated Types

type Rep EraParams 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

type Rep EraParams = D1 ('MetaData "EraParams" "Ouroboros.Consensus.HardFork.History.EraParams" "ouroboros-consensus-1.0.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) :*: S1 ('MetaSel ('Just "eraPerasRoundLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PerasEnabled PerasRoundLength))))))

Methods

fromEraParamsRep EraParams x #

toRep EraParams x → EraParams #

Show EraParams Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Methods

showsPrecIntEraParamsShowS #

showEraParamsString #

showList ∷ [EraParams] → ShowS #

Eq EraParams Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Methods

(==)EraParamsEraParamsBool #

(/=)EraParamsEraParamsBool #

NoThunks EraParams Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Serialise EraParams Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

type Rep EraParams Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

type Rep EraParams = D1 ('MetaData "EraParams" "Ouroboros.Consensus.HardFork.History.EraParams" "ouroboros-consensus-1.0.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) :*: S1 ('MetaSel ('Just "eraPerasRoundLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PerasEnabled PerasRoundLength))))))

data SafeZone Source #

Zone in which it is guaranteed that no hard fork can take place

Constructors

StandardSafeZone !Word64

Standard safe zone

We record

  • Number of slots from the tip of the ledger. This should be (at least) the number of slots in which we are guaranteed to have k blocks.
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

  • slot to time conversions for blocks that are past the actual safe zone
  • time to slot conversions for the current time, when behind in syncing

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 LowerBound can be used instead.

This constructor can be regarded as an " extreme " version of LowerBound, and can be used for similar reasons.

Instances

Instances details
Generic SafeZone Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Associated Types

type Rep SafeZone 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

type Rep SafeZone = D1 ('MetaData "SafeZone" "Ouroboros.Consensus.HardFork.History.EraParams" "ouroboros-consensus-1.0.0.0-inplace" 'False) (C1 ('MetaCons "StandardSafeZone" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :+: C1 ('MetaCons "UnsafeIndefiniteSafeZone" 'PrefixI 'False) (U1TypeType))

Methods

fromSafeZoneRep SafeZone x #

toRep SafeZone x → SafeZone #

Show SafeZone Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Methods

showsPrecIntSafeZoneShowS #

showSafeZoneString #

showList ∷ [SafeZone] → ShowS #

Eq SafeZone Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Methods

(==)SafeZoneSafeZoneBool #

(/=)SafeZoneSafeZoneBool #

NoThunks SafeZone Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Serialise SafeZone Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

type Rep SafeZone Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

type Rep SafeZone = D1 ('MetaData "SafeZone" "Ouroboros.Consensus.HardFork.History.EraParams" "ouroboros-consensus-1.0.0.0-inplace" 'False) (C1 ('MetaCons "StandardSafeZone" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :+: C1 ('MetaCons "UnsafeIndefiniteSafeZone" 'PrefixI 'False) (U1TypeType))

data PerasEnabled a Source #

A marker for era parameters that are Peras-specific and are not present in pre-Peras eras

Instances

Instances details
Applicative PerasEnabled Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

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 # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Methods

fmap ∷ (a → b) → PerasEnabled a → PerasEnabled b #

(<$) ∷ a → PerasEnabled b → PerasEnabled a #

Monad PerasEnabled Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Methods

(>>=)PerasEnabled a → (a → PerasEnabled b) → PerasEnabled b #

(>>)PerasEnabled a → PerasEnabled b → PerasEnabled b #

return ∷ a → PerasEnabled a #

Generic (PerasEnabled a) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Associated Types

type Rep (PerasEnabled a) 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

type Rep (PerasEnabled a) = D1 ('MetaData "PerasEnabled" "Ouroboros.Consensus.HardFork.History.EraParams" "ouroboros-consensus-1.0.0.0-inplace" 'True) (C1 ('MetaCons "MkPerasEnabled" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe a))))

Methods

fromPerasEnabled a → Rep (PerasEnabled a) x #

toRep (PerasEnabled a) x → PerasEnabled a #

Show a ⇒ Show (PerasEnabled a) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Methods

showsPrecIntPerasEnabled a → ShowS #

showPerasEnabled a → String #

showList ∷ [PerasEnabled a] → ShowS #

Eq a ⇒ Eq (PerasEnabled a) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Methods

(==)PerasEnabled a → PerasEnabled a → Bool #

(/=)PerasEnabled a → PerasEnabled a → Bool #

Ord a ⇒ Ord (PerasEnabled a) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

NoThunks a ⇒ NoThunks (PerasEnabled a) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

type Rep (PerasEnabled a) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

type Rep (PerasEnabled a) = D1 ('MetaData "PerasEnabled" "Ouroboros.Consensus.HardFork.History.EraParams" "ouroboros-consensus-1.0.0.0-inplace" 'True) (C1 ('MetaCons "MkPerasEnabled" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe a))))

pattern PerasEnabled ∷ a → PerasEnabled a Source #

newtype PerasEnabledT (m ∷ TypeType) a Source #

A MaybeT-like monad transformer.

Used solely for the Peras-related hard fork combinator queries, see Qry.

Constructors

PerasEnabledT 

Fields

Instances

Instances details
MonadTrans PerasEnabledT Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Methods

liftMonad m ⇒ m a → PerasEnabledT m a #

(Functor m, Monad m) ⇒ Applicative (PerasEnabledT m) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

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 # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

Methods

fmap ∷ (a → b) → PerasEnabledT m a → PerasEnabledT m b #

(<$) ∷ a → PerasEnabledT m b → PerasEnabledT m a #

Monad m ⇒ Monad (PerasEnabledT m) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.History.EraParams

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

Defaults

defaultEraParamsSecurityParamSlotLengthEraParams Source #

Default EraParams

We set

  • epoch size to 10k slots
  • the safe zone to 2k slots
  • the upper bound to NoLowerBound
  • the Peras Round Length is unset

This is primarily useful for tests.