Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator
Description
The hard fork combinator
Intended for unqualified import
Synopsis
- data family TxId tx ∷ Type
- data family Header blk ∷ Type
- data EpochInfo (m ∷ Type → Type) = EpochInfo {}
- data Mismatch (f ∷ k → Type) (g ∷ k → Type) (xs ∷ [k]) where
- ML ∷ ∀ {k} (f ∷ k → Type) (x ∷ k) (g ∷ k → Type) (xs1 ∷ [k]). f x → NS g xs1 → Mismatch f g (x ': xs1)
- MR ∷ ∀ {k} (f ∷ k → Type) (xs1 ∷ [k]) (g ∷ k → Type) (x ∷ k). NS f xs1 → g x → Mismatch f g (x ': xs1)
- MS ∷ ∀ {k} (f ∷ k → Type) (g ∷ k → Type) (xs1 ∷ [k]) (x ∷ k). Mismatch f g xs1 → Mismatch f g (x ': xs1)
- type Except e = ExceptT e Identity
- data Product2 (f ∷ Type → Type → Type) (g ∷ Type → Type → Type) x y = Pair2 (f x y) (g x y)
- class IsNonEmpty (xs ∷ [a]) where
- isNonEmpty ∷ proxy xs → ProofNonEmpty xs
- data ProofNonEmpty (xs ∷ [a]) where
- ProofNonEmpty ∷ ∀ {a} (x ∷ a) (xs1 ∷ [a]). Proxy x → Proxy xs1 → ProofNonEmpty (x ': xs1)
- data InPairs (f ∷ k → k → Type) (xs ∷ [k]) where
- data Telescope (g ∷ k → Type) (f ∷ k → Type) (xs ∷ [k]) where
- data family BlockConfig blk ∷ Type
- data family CodecConfig blk ∷ Type
- data family StorageConfig blk ∷ Type
- data family Ticked st ∷ Type
- data family NestedCtxt_ blk ∷ (Type → Type) → Type → Type
- data PastHorizonException
- data family Validated x ∷ Type
- newtype MismatchEraInfo xs = MismatchEraInfo {}
- newtype OneEraApplyTxErr xs = OneEraApplyTxErr {}
- newtype OneEraBlock xs = OneEraBlock {
- getOneEraBlock ∷ NS I xs
- newtype OneEraGenTx xs = OneEraGenTx {
- getOneEraGenTx ∷ NS GenTx xs
- newtype OneEraGenTxId xs = OneEraGenTxId {}
- newtype OneEraHash (xs ∷ [k]) = OneEraHash {}
- newtype OneEraHeader xs = OneEraHeader {
- getOneEraHeader ∷ NS Header xs
- newtype OneEraTipInfo xs = OneEraTipInfo {}
- newtype PerEraBlockConfig xs = PerEraBlockConfig {}
- newtype PerEraCodecConfig xs = PerEraCodecConfig {}
- newtype PerEraConsensusConfig xs = PerEraConsensusConfig {}
- newtype PerEraLedgerConfig xs = PerEraLedgerConfig {}
- newtype PerEraStorageConfig xs = PerEraStorageConfig {}
- data HardForkForgeStateInfo xs where
- CurrentEraLacksBlockForging ∷ EraIndex (x ': (y ': xs)) → HardForkForgeStateInfo (x ': (y ': xs))
- CurrentEraForgeStateUpdated ∷ OneEraForgeStateInfo xs → HardForkForgeStateInfo xs
- type InjectTx = InjectPolyTx GenTx
- type InjectValidatedTx = InjectPolyTx WrapValidatedGenTx
- newtype HardForkState f xs = HardForkState {
- getHardForkState ∷ Telescope (K Past) (Current f) xs
- class (All SingleEraBlock xs, Typeable xs, IsNonEmpty xs, Measure (HardForkTxMeasure xs), HasByteSize (HardForkTxMeasure xs), NoThunks (HardForkTxMeasure xs), Show (HardForkTxMeasure xs)) ⇒ CanHardFork xs where
- class SingleEraBlock blk ⇒ NoHardForks blk where
- getEraParams ∷ TopLevelConfig blk → EraParams
- toPartialLedgerConfig ∷ proxy blk → LedgerConfig blk → PartialLedgerConfig blk
- class (LedgerSupportsProtocol blk, InspectLedger blk, LedgerSupportsMempool blk, ConvertRawTxId (GenTx blk), BlockSupportsLedgerQuery blk, HasPartialConsensusConfig (BlockProtocol blk), HasPartialLedgerConfig blk, ConvertRawHash blk, ReconstructNestedCtxt Header blk, CommonProtocolParams blk, LedgerSupportsPeerSelection blk, ConfigSupportsNode blk, NodeInitStorage blk, BlockSupportsDiffusionPipelining blk, BlockSupportsMetrics blk, Eq (GenTx blk), Eq (Validated (GenTx blk)), Eq (ApplyTxErr blk), Show blk, Show (Header blk), Show (CannotForge blk), Show (ForgeStateInfo blk), Show (ForgeStateUpdateError blk), Show (LedgerState blk), Eq (LedgerState blk), NoThunks (LedgerState blk)) ⇒ SingleEraBlock blk where
- singleEraTransition ∷ PartialLedgerConfig blk → EraParams → Bound → LedgerState blk → Maybe EpochNo
- singleEraInfo ∷ proxy blk → SingleEraInfo blk
- newtype EraIndex xs = EraIndex {
- getEraIndex ∷ NS (K ()) xs
- newtype HardForkBlock xs = HardForkBlock {}
- data HardForkProtocol (xs ∷ [Type])
- data family LedgerState blk ∷ Type
- data family ConsensusConfig p ∷ Type
- data HardForkLedgerConfig xs = HardForkLedgerConfig {}
- data family GenTx blk ∷ Type
- data family BlockQuery blk ∷ Type → Type
- data HardForkApplyTxErr xs
- data HardForkEnvelopeErr xs
- data HardForkLedgerError xs
- newtype LedgerEraInfo blk = LedgerEraInfo {}
- data SingleEraInfo blk = SingleEraInfo {}
- data HardForkLedgerUpdate xs
- = HardForkUpdateInEra (OneEraLedgerUpdate xs)
- | HardForkUpdateTransitionConfirmed (EraIndex xs) (EraIndex xs) EpochNo
- | HardForkUpdateTransitionDone (EraIndex xs) (EraIndex xs) EpochNo
- | HardForkUpdateTransitionRolledBack (EraIndex xs) (EraIndex xs)
- data HardForkLedgerWarning xs
- = HardForkWarningInEra (OneEraLedgerWarning xs)
- | HardForkWarningTransitionMismatch (EraIndex xs) EraParams EpochNo
- | HardForkWarningTransitionInFinalEra (EraIndex xs) EpochNo
- | HardForkWarningTransitionUnconfirmed (EraIndex xs)
- | HardForkWarningTransitionReconfirmed (EraIndex xs) (EraIndex xs) EpochNo EpochNo
- data AnnForecast state view blk = AnnForecast {
- annForecast ∷ Forecast (view blk)
- annForecastState ∷ state blk
- annForecastTip ∷ WithOrigin SlotNo
- annForecastEnd ∷ Maybe Bound
- type HardForkQueryResult xs = Either (MismatchEraInfo xs)
- data QueryAnytime result where
- data QueryHardFork xs result where
- GetInterpreter ∷ QueryHardFork xs (Interpreter xs)
- GetCurrentEra ∷ QueryHardFork xs (EraIndex xs)
- data QueryIfCurrent ∷ [Type] → Type → Type where
- QZ ∷ BlockQuery x result → QueryIfCurrent (x ': xs) result
- QS ∷ QueryIfCurrent xs result → QueryIfCurrent (x ': xs) result
- newtype WrapPartialLedgerConfig blk = WrapPartialLedgerConfig {}
- class (ConsensusProtocol p, NoThunks (PartialConsensusConfig p)) ⇒ HasPartialConsensusConfig p where
- type PartialConsensusConfig p ∷ Type
- completeConsensusConfig ∷ proxy p → EpochInfo (Except PastHorizonException) → PartialConsensusConfig p → ConsensusConfig p
- toPartialConsensusConfig ∷ proxy p → ConsensusConfig p → PartialConsensusConfig p
- class (UpdateLedger blk, NoThunks (PartialLedgerConfig blk)) ⇒ HasPartialLedgerConfig blk where
- type PartialLedgerConfig blk ∷ Type
- completeLedgerConfig ∷ proxy blk → EpochInfo (Except PastHorizonException) → PartialLedgerConfig blk → LedgerConfig blk
- newtype WrapPartialConsensusConfig blk = WrapPartialConsensusConfig {}
- newtype HardForkSelectView xs = HardForkSelectView {}
- type HardForkCanBeLeader xs = SomeErasCanBeLeader xs
- type HardForkChainDepState xs = HardForkState WrapChainDepState xs
- type HardForkIsLeader xs = OneEraIsLeader xs
- data HardForkValidationErr xs
- type HardForkLedgerView = HardForkLedgerView_ WrapLedgerView
- data HardForkLedgerView_ f xs = HardForkLedgerView {}
- data AcrossEraMode cfg a where
- data AcrossEraSelection ∷ Type → Type → Type where
- data WithBlockNo (f ∷ k → Type) (a ∷ k) = WithBlockNo {
- getBlockNo ∷ BlockNo
- dropBlockNo ∷ f a
- data EraTranslation xs = EraTranslation {
- translateLedgerState ∷ InPairs (RequiringBoth WrapLedgerConfig (Translate LedgerState)) xs
- translateChainDepState ∷ InPairs (RequiringBoth WrapConsensusConfig (Translate WrapChainDepState)) xs
- crossEraForecast ∷ InPairs (RequiringBoth WrapLedgerConfig (CrossEraForecaster LedgerState WrapLedgerView)) xs
- pattern InjectTx ∷ (GenTx blk → Maybe (GenTx blk')) → InjectTx blk blk'
- pattern InjectValidatedTx ∷ (WrapValidatedGenTx blk → Maybe (WrapValidatedGenTx blk')) → InjectValidatedTx blk blk'
- hardForkBlockForging ∷ ∀ m xs. (CanHardFork xs, Monad m) ⇒ Text → NonEmptyOptNP (BlockForging m) xs → BlockForging m (HardForkBlock xs)
- cannotInjectTx ∷ InjectTx blk blk'
- cannotInjectValidatedTx ∷ InjectValidatedTx blk blk'
- initHardForkState ∷ f x → HardForkState f (x ': xs)
- noHardForksEpochInfo ∷ (Monad m, NoHardForks blk) ⇒ TopLevelConfig blk → EpochInfo m
- proxySingle ∷ Proxy SingleEraBlock
- singleEraTransition' ∷ SingleEraBlock blk ⇒ WrapPartialLedgerConfig blk → EraParams → Bound → LedgerState blk → Maybe EpochNo
- eraIndexEmpty ∷ EraIndex '[] → Void
- eraIndexFromIndex ∷ Index xs blk → EraIndex xs
- eraIndexFromNS ∷ SListI xs ⇒ NS f xs → EraIndex xs
- eraIndexSucc ∷ EraIndex xs → EraIndex (x ': xs)
- eraIndexToInt ∷ EraIndex xs → Int
- eraIndexZero ∷ EraIndex (x ': xs)
- completeConsensusConfig' ∷ ∀ blk. HasPartialConsensusConfig (BlockProtocol blk) ⇒ EpochInfo (Except PastHorizonException) → WrapPartialConsensusConfig blk → ConsensusConfig (BlockProtocol blk)
- completeConsensusConfig'' ∷ ∀ blk. HasPartialConsensusConfig (BlockProtocol blk) ⇒ EpochInfo (Except PastHorizonException) → WrapPartialConsensusConfig blk → WrapConsensusConfig blk
- completeLedgerConfig' ∷ ∀ blk. HasPartialLedgerConfig blk ⇒ EpochInfo (Except PastHorizonException) → WrapPartialLedgerConfig blk → LedgerConfig blk
- completeLedgerConfig'' ∷ ∀ blk. HasPartialLedgerConfig blk ⇒ EpochInfo (Except PastHorizonException) → WrapPartialLedgerConfig blk → WrapLedgerConfig blk
- distribLedgerConfig ∷ CanHardFork xs ⇒ EpochInfo (Except PastHorizonException) → LedgerConfig (HardForkBlock xs) → NP WrapLedgerConfig xs
- distribTopLevelConfig ∷ All SingleEraBlock xs ⇒ EpochInfo (Except PastHorizonException) → TopLevelConfig (HardForkBlock xs) → NP TopLevelConfig xs
- distribAnnTip ∷ SListI xs ⇒ AnnTip (HardForkBlock xs) → NS AnnTip xs
- undistribAnnTip ∷ SListI xs ⇒ NS AnnTip xs → AnnTip (HardForkBlock xs)
- mkHardForkForecast ∷ ∀ state view xs. SListI xs ⇒ InPairs (CrossEraForecaster state view) xs → HardForkState (AnnForecast state view) xs → Forecast (HardForkLedgerView_ view xs)
- decodeQueryAnytimeResult ∷ QueryAnytime result → ∀ s. Decoder s result
- decodeQueryHardForkResult ∷ SListI xs ⇒ QueryHardFork xs result → ∀ s. Decoder s result
- encodeQueryAnytimeResult ∷ QueryAnytime result → result → Encoding
- encodeQueryHardForkResult ∷ SListI xs ⇒ QueryHardFork xs result → result → Encoding
- getHardForkQuery ∷ BlockQuery (HardForkBlock xs) result → (∀ result'. (result :~: HardForkQueryResult xs result') → QueryIfCurrent xs result' → r) → (∀ x' xs'. (xs :~: (x' ': xs')) → ProofNonEmpty xs' → QueryAnytime result → EraIndex xs → r) → (∀ x' xs'. (xs :~: (x' ': xs')) → ProofNonEmpty xs' → QueryHardFork xs result → r) → r
- hardForkQueryInfo ∷ All SingleEraBlock xs ⇒ QueryIfCurrent xs result → NS SingleEraInfo xs
- hardForkApplyTxErrFromEither ∷ Either (MismatchEraInfo xs) (OneEraApplyTxErr xs) → HardForkApplyTxErr xs
- hardForkApplyTxErrToEither ∷ HardForkApplyTxErr xs → Either (MismatchEraInfo xs) (OneEraApplyTxErr xs)
- acrossEraSelection ∷ ∀ xs cfg a. All SingleEraBlock xs ⇒ AcrossEraMode cfg a → NP cfg xs → Tails AcrossEraSelection xs → WithBlockNo (NS WrapSelectView) xs → WithBlockNo (NS WrapSelectView) xs → a
- mapWithBlockNo ∷ (f x → g y) → WithBlockNo f x → WithBlockNo g y
- trivialEraTranslation ∷ EraTranslation '[blk]
Documentation
data family TxId tx ∷ Type Source #
A generalized transaction, GenTx
, identifier.
Instances
data family Header blk ∷ Type Source #
Instances
data EpochInfo (m ∷ Type → Type) Source #
Information about epochs
Different epochs may have different sizes and different slot lengths. This
information is encapsulated by EpochInfo
. It is parameterized over a monad
m
because the information about how long each epoch is may depend on
information derived from the blockchain itself. It ultimately requires acess
to state, and so either uses the monad for that or uses the monad to reify
failure due to cached state information being too stale for the current
query.
Constructors
EpochInfo | |
Fields
|
data Mismatch (f ∷ k → Type) (g ∷ k → Type) (xs ∷ [k]) where Source #
We have a mismatch in the index between two NS
Constructors
ML ∷ ∀ {k} (f ∷ k → Type) (x ∷ k) (g ∷ k → Type) (xs1 ∷ [k]). f x → NS g xs1 → Mismatch f g (x ': xs1) | The left is at the current |
MR ∷ ∀ {k} (f ∷ k → Type) (xs1 ∷ [k]) (g ∷ k → Type) (x ∷ k). NS f xs1 → g x → Mismatch f g (x ': xs1) | The right is at the current |
MS ∷ ∀ {k} (f ∷ k → Type) (g ∷ k → Type) (xs1 ∷ [k]) (x ∷ k). Mismatch f g xs1 → Mismatch f g (x ': xs1) | There is a mismatch later on in the |
Instances
(∀ (x ∷ k2) (y ∷ k2). LiftedCoercible p p x y) ⇒ HTrans (Mismatch p ∷ (k2 → Type) → [k2] → Type) (Mismatch p ∷ (k2 → Type) → [k2] → Type) | |
Defined in Data.SOP.Match Methods htrans ∷ ∀ c (xs ∷ l1) (ys ∷ l2) proxy f g. AllZipN (Prod (Mismatch p)) c xs ys ⇒ proxy c → (∀ (x ∷ k1) (y ∷ k20). c x y ⇒ f x → g y) → Mismatch p f xs → Mismatch p g ys Source # hcoerce ∷ ∀ (f ∷ k1 → Type) (g ∷ k20 → Type) (xs ∷ l1) (ys ∷ l2). AllZipN (Prod (Mismatch p)) (LiftedCoercible f g) xs ys ⇒ Mismatch p f xs → Mismatch p g ys Source # | |
HAp (Mismatch f ∷ (k → Type) → [k] → Type) | |
(All (Compose Show f) xs, All (Compose Show g) xs) ⇒ Show (Mismatch f g xs) | |
(All (Compose Eq f) xs, All (Compose Eq g) xs) ⇒ Eq (Mismatch f g xs) | |
(All (Compose Eq f) xs, All (Compose Ord f) xs, All (Compose Eq g) xs, All (Compose Ord g) xs) ⇒ Ord (Mismatch f g xs) | |
Defined in Data.SOP.Match Methods compare ∷ Mismatch f g xs → Mismatch f g xs → Ordering # (<) ∷ Mismatch f g xs → Mismatch f g xs → Bool # (<=) ∷ Mismatch f g xs → Mismatch f g xs → Bool # (>) ∷ Mismatch f g xs → Mismatch f g xs → Bool # (>=) ∷ Mismatch f g xs → Mismatch f g xs → Bool # | |
(All (Compose NoThunks f) xs, All (Compose NoThunks g) xs) ⇒ NoThunks (Mismatch f g xs) | |
type Same (Mismatch f ∷ (k2 → Type) → [k2] → Type) | |
type Prod (Mismatch f ∷ (k → Type) → [k] → Type) | |
type SListIN (Mismatch f ∷ (k → Type) → [k] → Type) | |
Defined in Data.SOP.Match | |
type AllN (Mismatch f ∷ (k → Type) → [k] → Type) (c ∷ k → Constraint) | |
Defined in Data.SOP.Match |
data Product2 (f ∷ Type → Type → Type) (g ∷ Type → Type → Type) x y Source #
Constructors
Pair2 (f x y) (g x y) |
Instances
Generic (Product2 f g x y) | |
(Show (f x y), Show (g x y)) ⇒ Show (Product2 f g x y) | |
(Eq (f x y), Eq (g x y)) ⇒ Eq (Product2 f g x y) | |
type Rep (Product2 f g x y) | |
Defined in Data.SOP.Functors type Rep (Product2 f g x y) = D1 ('MetaData "Product2" "Data.SOP.Functors" "sop-extras-0.2.1.0-inplace" 'False) (C1 ('MetaCons "Pair2" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f x y)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g x y)))) |
class IsNonEmpty (xs ∷ [a]) where Source #
Methods
isNonEmpty ∷ proxy xs → ProofNonEmpty xs Source #
Instances
IsNonEmpty (x ': xs ∷ [a]) | |
Defined in Data.SOP.NonEmpty Methods isNonEmpty ∷ proxy (x ': xs) → ProofNonEmpty (x ': xs) Source # |
data ProofNonEmpty (xs ∷ [a]) where Source #
Constructors
ProofNonEmpty ∷ ∀ {a} (x ∷ a) (xs1 ∷ [a]). Proxy x → Proxy xs1 → ProofNonEmpty (x ': xs1) |
data InPairs (f ∷ k → k → Type) (xs ∷ [k]) where Source #
We have an f x y
for each pair (x, y)
of successive list elements
data Telescope (g ∷ k → Type) (f ∷ k → Type) (xs ∷ [k]) where Source #
Telescope
A telescope is an extension of an NS
, where every time we "go right" in the
sum we have an additional value.
The Telescope
API mostly follows sop-core
conventions, supporting
functor (hmap
, hcmap
), applicative (hap
, hpure
), foldable
(hcollapse
) and traversable (hsequence'
). However, since Telescope
is a bi-functor, it cannot reuse the sop-core
classes. The naming scheme
of the functions is adopted from sop-core
though; for example:
bi h (c) zipWith | | | | | | | \ zipWith: the name from base | | | | | \ constrained: version of the function with a constraint parameter | | | \ higher order: 'Telescope' (like 'NS'/'NP') is a /higher order/ functor | \ bifunctor: 'Telescope' (unlike 'NS'/'NP') is a higher order /bifunctor/
In addition to the standard SOP operators, the new operators that make
a Telescope
a telescope are extend
, retract
and align
; see their
documentation for details.
Constructors
TZ ∷ ∀ {k} (f ∷ k → Type) (x ∷ k) (g ∷ k → Type) (xs1 ∷ [k]). !(f x) → Telescope g f (x ': xs1) | |
TS ∷ ∀ {k} (g ∷ k → Type) (x ∷ k) (f ∷ k → Type) (xs1 ∷ [k]). !(g x) → !(Telescope g f xs1) → Telescope g f (x ': xs1) |
Instances
(∀ (x ∷ k2) (y ∷ k2). LiftedCoercible g g x y) ⇒ HTrans (Telescope g ∷ (k2 → Type) → [k2] → Type) (Telescope g ∷ (k2 → Type) → [k2] → Type) | |
Defined in Data.SOP.Telescope Methods htrans ∷ ∀ c (xs ∷ l1) (ys ∷ l2) proxy f g0. AllZipN (Prod (Telescope g)) c xs ys ⇒ proxy c → (∀ (x ∷ k1) (y ∷ k20). c x y ⇒ f x → g0 y) → Telescope g f xs → Telescope g g0 ys Source # hcoerce ∷ ∀ (f ∷ k1 → Type) (g0 ∷ k20 → Type) (xs ∷ l1) (ys ∷ l2). AllZipN (Prod (Telescope g)) (LiftedCoercible f g0) xs ys ⇒ Telescope g f xs → Telescope g g0 ys Source # | |
HAp (Telescope g ∷ (k → Type) → [k] → Type) | |
HSequence (Telescope g ∷ (k → Type) → [k] → Type) | |
Defined in Data.SOP.Telescope Methods hsequence' ∷ ∀ (xs ∷ l) f (g0 ∷ k0 → Type). (SListIN (Telescope g) xs, Applicative f) ⇒ Telescope g (f :.: g0) xs → f (Telescope g g0 xs) Source # hctraverse' ∷ ∀ c (xs ∷ l) g0 proxy f f'. (AllN (Telescope g) c xs, Applicative g0) ⇒ proxy c → (∀ (a ∷ k0). c a ⇒ f a → g0 (f' a)) → Telescope g f xs → g0 (Telescope g f' xs) Source # htraverse' ∷ ∀ (xs ∷ l) g0 f f'. (SListIN (Telescope g) xs, Applicative g0) ⇒ (∀ (a ∷ k0). f a → g0 (f' a)) → Telescope g f xs → g0 (Telescope g f' xs) Source # | |
HTraverse_ (Telescope g ∷ (k → Type) → [k] → Type) | |
Defined in Data.SOP.Telescope Methods hctraverse_ ∷ ∀ c (xs ∷ l) g0 proxy f. (AllN (Telescope g) c xs, Applicative g0) ⇒ proxy c → (∀ (a ∷ k0). c a ⇒ f a → g0 ()) → Telescope g f xs → g0 () Source # htraverse_ ∷ ∀ (xs ∷ l) g0 f. (SListIN (Telescope g) xs, Applicative g0) ⇒ (∀ (a ∷ k0). f a → g0 ()) → Telescope g f xs → g0 () Source # | |
(All (Compose Show g) xs, All (Compose Show f) xs) ⇒ Show (Telescope g f xs) | |
(All (Compose Eq g) xs, All (Compose Eq f) xs) ⇒ Eq (Telescope g f xs) | |
(All (Compose Eq g) xs, All (Compose Ord g) xs, All (Compose Eq f) xs, All (Compose Ord f) xs) ⇒ Ord (Telescope g f xs) | |
Defined in Data.SOP.Telescope Methods compare ∷ Telescope g f xs → Telescope g f xs → Ordering # (<) ∷ Telescope g f xs → Telescope g f xs → Bool # (<=) ∷ Telescope g f xs → Telescope g f xs → Bool # (>) ∷ Telescope g f xs → Telescope g f xs → Bool # (>=) ∷ Telescope g f xs → Telescope g f xs → Bool # max ∷ Telescope g f xs → Telescope g f xs → Telescope g f xs # min ∷ Telescope g f xs → Telescope g f xs → Telescope g f xs # | |
(All (Compose NoThunks g) xs, All (Compose NoThunks f) xs) ⇒ NoThunks (Telescope g f xs) | |
type Same (Telescope g ∷ (k2 → Type) → [k2] → Type) | |
type Prod (Telescope g ∷ (k → Type) → [k] → Type) | |
type SListIN (Telescope g ∷ (k → Type) → [k] → Type) | |
Defined in Data.SOP.Telescope | |
type AllN (Telescope g ∷ (k → Type) → [k] → Type) (c ∷ k → Constraint) | |
Defined in Data.SOP.Telescope |
data family BlockConfig blk ∷ Type Source #
Static configuration required to work with this type of blocks
Instances
data family CodecConfig blk ∷ Type Source #
Static configuration required for serialisation and deserialisation of types pertaining to this type of block.
Data family instead of type family to get better type inference.
Instances
data family StorageConfig blk ∷ Type Source #
Config needed for the
NodeInitStorage
class. Defined here to
avoid circular dependencies.
Instances
data family Ticked st ∷ Type Source #
" Ticked " piece of state, either LedgerState
or ChainDepState
Ticking refers to the passage of time (the ticking of the clock). When a
piece of state is marked as ticked, it means that time-related changes have
been applied to the state. There are exactly two methods in the interface
that do that: tickChainDepState
and
applyChainTickLedgerResult
.
Also note that a successful forecast
must equal
forecastFor
(ledgerViewForecastAt
cfg st)
slot
. Thus a
protocolLedgerView
cfg
(applyChainTick
cfg slot st)LedgerView
can only be projected
from a Ticked
state, but cannot itself be ticked.
Some examples of time related changes:
- Scheduled delegations might have been applied in Byron
- New leader schedule computed for Shelley
- Transition from Byron to Shelley activated in the hard fork combinator.
- Nonces switched out at the start of a new epoch.
Instances
data family NestedCtxt_ blk ∷ (Type → Type) → Type → Type Source #
Context identifying what kind of block we have
In almost all places we will use NestedCtxt
rather than NestedCtxt_
.
Instances
data PastHorizonException Source #
We tried to convert something that is past the horizon
That is, we tried to convert something that is past the point in time beyond which we lack information due to uncertainty about the next hard fork.
Instances
Exception PastHorizonException Source # | |
Show PastHorizonException Source # | |
Defined in Ouroboros.Consensus.HardFork.History.Qry Methods showsPrec ∷ Int → PastHorizonException → ShowS # show ∷ PastHorizonException → String # showList ∷ [PastHorizonException] → ShowS # |
data family Validated x ∷ Type Source #
" Validated " transaction or block
The ledger defines how to validate transactions and blocks. It's possible the type before and after validation may be distinct (eg Alonzo transactions), which originally motivated this family.
We also gain the related benefit that certain interface functions, such as those that reapply blocks, can have a more precise type now. TODO
Similarly, the Node-to-Client mini protocols can explicitly indicate that the
client trusts the blocks from the local server, by having the server send
Validated
blocks to the client. TODO
Note that validation has different implications for a transaction than for a block. In particular, a validated transaction can be " reapplied " to different ledger states, whereas a validated block must only be " reapplied " to the exact same ledger state (eg as part of rebuilding from an on-disk ledger snapshot).
Since the ledger defines validation, see the ledger details for concrete
examples of what determines the validity (wrt to a LedgerState
) of a
transaction and/or block. Example properties include: a transaction's claimed
inputs exist and are still unspent, a block carries a sufficient
cryptographic signature, etc.
Instances
newtype MismatchEraInfo xs Source #
Constructors
MismatchEraInfo | |
Fields
|
Instances
All SingleEraBlock xs ⇒ Show (MismatchEraInfo xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods showsPrec ∷ Int → MismatchEraInfo xs → ShowS # show ∷ MismatchEraInfo xs → String # showList ∷ [MismatchEraInfo xs] → ShowS # | |
All SingleEraBlock xs ⇒ Eq (MismatchEraInfo xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods (==) ∷ MismatchEraInfo xs → MismatchEraInfo xs → Bool # (/=) ∷ MismatchEraInfo xs → MismatchEraInfo xs → Bool # | |
CanHardFork xs ⇒ NoThunks (MismatchEraInfo xs) Source # | |
newtype OneEraApplyTxErr xs Source #
Constructors
OneEraApplyTxErr | |
Fields |
Instances
CanHardFork xs ⇒ Show (OneEraApplyTxErr xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods showsPrec ∷ Int → OneEraApplyTxErr xs → ShowS # show ∷ OneEraApplyTxErr xs → String # showList ∷ [OneEraApplyTxErr xs] → ShowS # | |
CanHardFork xs ⇒ Eq (OneEraApplyTxErr xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods (==) ∷ OneEraApplyTxErr xs → OneEraApplyTxErr xs → Bool # (/=) ∷ OneEraApplyTxErr xs → OneEraApplyTxErr xs → Bool # |
newtype OneEraBlock xs Source #
Constructors
OneEraBlock | |
Fields
|
Instances
CanHardFork xs ⇒ Show (OneEraBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods showsPrec ∷ Int → OneEraBlock xs → ShowS # show ∷ OneEraBlock xs → String # showList ∷ [OneEraBlock xs] → ShowS # |
newtype OneEraGenTx xs Source #
Constructors
OneEraGenTx | |
Fields
|
Instances
CanHardFork xs ⇒ Show (OneEraGenTx xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods showsPrec ∷ Int → OneEraGenTx xs → ShowS # show ∷ OneEraGenTx xs → String # showList ∷ [OneEraGenTx xs] → ShowS # | |
CanHardFork xs ⇒ Eq (OneEraGenTx xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods (==) ∷ OneEraGenTx xs → OneEraGenTx xs → Bool # (/=) ∷ OneEraGenTx xs → OneEraGenTx xs → Bool # | |
CanHardFork xs ⇒ NoThunks (OneEraGenTx xs) Source # | |
newtype OneEraGenTxId xs Source #
Constructors
OneEraGenTxId | |
Fields |
Instances
newtype OneEraHash (xs ∷ [k]) Source #
The hash for an era
This type is special: we don't use an NS here, because the hash by itself
should not allow us to differentiate between eras. If it did, the size
of the hash would necessarily have to increase, and that leads to trouble.
So, the type parameter xs
here is merely a phantom one, and we just store
the underlying raw hash.
Constructors
OneEraHash | |
Fields |
Instances
newtype OneEraHeader xs Source #
Constructors
OneEraHeader | |
Fields
|
Instances
CanHardFork xs ⇒ Show (OneEraHeader xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods showsPrec ∷ Int → OneEraHeader xs → ShowS # show ∷ OneEraHeader xs → String # showList ∷ [OneEraHeader xs] → ShowS # | |
CanHardFork xs ⇒ NoThunks (OneEraHeader xs) Source # | |
newtype OneEraTipInfo xs Source #
Constructors
OneEraTipInfo | |
Fields |
Instances
CanHardFork xs ⇒ Show (OneEraTipInfo xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods showsPrec ∷ Int → OneEraTipInfo xs → ShowS # show ∷ OneEraTipInfo xs → String # showList ∷ [OneEraTipInfo xs] → ShowS # | |
CanHardFork xs ⇒ Eq (OneEraTipInfo xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods (==) ∷ OneEraTipInfo xs → OneEraTipInfo xs → Bool # (/=) ∷ OneEraTipInfo xs → OneEraTipInfo xs → Bool # | |
CanHardFork xs ⇒ NoThunks (OneEraTipInfo xs) Source # | |
newtype PerEraBlockConfig xs Source #
Constructors
PerEraBlockConfig | |
Fields |
Instances
CanHardFork xs ⇒ NoThunks (PerEraBlockConfig xs) Source # | |
newtype PerEraCodecConfig xs Source #
Constructors
PerEraCodecConfig | |
Fields |
Instances
CanHardFork xs ⇒ NoThunks (PerEraCodecConfig xs) Source # | |
newtype PerEraConsensusConfig xs Source #
Constructors
PerEraConsensusConfig | |
Fields |
Instances
CanHardFork xs ⇒ NoThunks (PerEraConsensusConfig xs) Source # | |
newtype PerEraLedgerConfig xs Source #
Constructors
PerEraLedgerConfig | |
Fields |
Instances
CanHardFork xs ⇒ NoThunks (PerEraLedgerConfig xs) Source # | |
newtype PerEraStorageConfig xs Source #
Constructors
PerEraStorageConfig | |
Fields |
Instances
CanHardFork xs ⇒ NoThunks (PerEraStorageConfig xs) Source # | |
data HardForkForgeStateInfo xs where Source #
For each era in which we want to forge blocks, we have a BlockForging
,
and thus ForgeStateInfo
.
When we update the hard fork forge state, we only update the forge state of
the current era. However, the current era might not have a forge state as
it lacks a BlockForging
.
TODO #2766: expire past ForgeState
Constructors
CurrentEraLacksBlockForging ∷ EraIndex (x ': (y ': xs)) → HardForkForgeStateInfo (x ': (y ': xs)) | There is no |
CurrentEraForgeStateUpdated ∷ OneEraForgeStateInfo xs → HardForkForgeStateInfo xs | The |
Instances
CanHardFork xs ⇒ Show (HardForkForgeStateInfo xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Forging Methods showsPrec ∷ Int → HardForkForgeStateInfo xs → ShowS # show ∷ HardForkForgeStateInfo xs → String # showList ∷ [HardForkForgeStateInfo xs] → ShowS # |
type InjectTx = InjectPolyTx GenTx Source #
newtype HardForkState f xs Source #
Generic hard fork state
This is used both for the consensus state and the ledger state.
By using a telescope with f ~ LedgerState
, we will keep track of Past
information for eras before the current one:
TZ currentByronState TZ pastByronState $ TZ currentShelleyState TZ pastByronState $ TS pastShelleyState $ TZ currentAllegraState ...
These are some intuitions on how the Telescope operations behave for this type:
extend
Suppose we have a telescope containing the ledger state. The "how to extend" argument would take, say, the final Byron state to the initial Shelley state; and "where to extend from" argument would indicate when we want to extend: when the current slot number has gone past the end of the Byron era.
retract
Suppose we have a telescope containing the consensus state. When we rewind
the consensus state, we might cross a hard fork transition point. So we first
retract the telescope to the era containing the slot number that we want
to rewind to, and only then call rewindChainDepState
on that era. Of course,
retraction may fail (we might not have past consensus state to rewind to
anymore); this failure would require a choice for a particular monad m
.
align
Suppose we have one telescope containing the already-ticked ledger state, and
another telescope containing the consensus state. Since the ledger state has
already been ticked, it might have been advanced to the next era. If this
happens, we should then align the consensus state with the ledger state,
moving it also to the next era, before we can do the consensus header
validation check. Note that in this particular example, the ledger state will
always be ahead of the consensus state, never behind; alignExtend
can be
used in this case.
Constructors
HardForkState | |
Fields
|
Instances
class (All SingleEraBlock xs, Typeable xs, IsNonEmpty xs, Measure (HardForkTxMeasure xs), HasByteSize (HardForkTxMeasure xs), NoThunks (HardForkTxMeasure xs), Show (HardForkTxMeasure xs)) ⇒ CanHardFork xs where Source #
Associated Types
type HardForkTxMeasure xs Source #
Methods
hardForkEraTranslation ∷ EraTranslation xs Source #
hardForkChainSel ∷ Tails AcrossEraSelection xs Source #
hardForkInjectTxs ∷ InPairs (RequiringBoth WrapLedgerConfig (Product2 InjectTx InjectValidatedTx)) xs Source #
hardForkInjTxMeasure ∷ NS WrapTxMeasure xs → HardForkTxMeasure xs Source #
This is ideally exact.
If that's not possible, the result must not be too small, since this is relied upon to determine which prefix of the mempool's txs will fit in a valid block.
Instances
SingleEraBlock blk ⇒ CanHardFork '[blk] Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Abstract.CanHardFork Associated Types type HardForkTxMeasure '[blk] Source # Methods hardForkEraTranslation ∷ EraTranslation '[blk] Source # hardForkChainSel ∷ Tails AcrossEraSelection '[blk] Source # hardForkInjectTxs ∷ InPairs (RequiringBoth WrapLedgerConfig (Product2 InjectTx InjectValidatedTx)) '[blk] Source # hardForkInjTxMeasure ∷ NS WrapTxMeasure '[blk] → HardForkTxMeasure '[blk] Source # |
class SingleEraBlock blk ⇒ NoHardForks blk where Source #
Methods
getEraParams ∷ TopLevelConfig blk → EraParams Source #
Extract EraParams
from the top-level config
The HFC itself does not care about this, as it must be given the full shape across all eras.
toPartialLedgerConfig ∷ proxy blk → LedgerConfig blk → PartialLedgerConfig blk Source #
Construct partial ledger config from full ledger config
See also toPartialConsensusConfig
class (LedgerSupportsProtocol blk, InspectLedger blk, LedgerSupportsMempool blk, ConvertRawTxId (GenTx blk), BlockSupportsLedgerQuery blk, HasPartialConsensusConfig (BlockProtocol blk), HasPartialLedgerConfig blk, ConvertRawHash blk, ReconstructNestedCtxt Header blk, CommonProtocolParams blk, LedgerSupportsPeerSelection blk, ConfigSupportsNode blk, NodeInitStorage blk, BlockSupportsDiffusionPipelining blk, BlockSupportsMetrics blk, Eq (GenTx blk), Eq (Validated (GenTx blk)), Eq (ApplyTxErr blk), Show blk, Show (Header blk), Show (CannotForge blk), Show (ForgeStateInfo blk), Show (ForgeStateUpdateError blk), Show (LedgerState blk), Eq (LedgerState blk), NoThunks (LedgerState blk)) ⇒ SingleEraBlock blk where Source #
Blocks from which we can assemble a hard fork
Methods
Arguments
∷ PartialLedgerConfig blk | |
→ EraParams | Current era parameters |
→ Bound | Start of this era |
→ LedgerState blk | |
→ Maybe EpochNo |
Era transition
This should only report the transition point once it is stable (rollback cannot affect it anymore).
Since we need this to construct the HardForkSummary
(and hence the
EpochInfo
), this takes the partial config, not the full config
(or we'd end up with a catch-22).
singleEraInfo ∷ proxy blk → SingleEraInfo blk Source #
Era information (for use in error messages)
Constructors
EraIndex | |
Fields
|
newtype HardForkBlock xs Source #
Constructors
HardForkBlock | |
Fields |
Instances
data HardForkProtocol (xs ∷ [Type]) Source #
Instances
data family LedgerState blk ∷ Type Source #
Ledger state associated with a block
This is the Consensus notion of a ledger state. Each block type is
associated with one of the Ledger types for the ledger state. Virtually
every concept in this codebase revolves around this type, or the referenced
blk
. Whenever we use the type variable l
, we intend to denote that the
expected instantiation is either a LedgerState
or some wrapper over it
(like the ExtLedgerState
).
The main operations we can do with a LedgerState
are ticking (defined in
IsLedger
), and applying a block (defined in
ApplyBlock
).
Instances
data family ConsensusConfig p ∷ Type Source #
Static configuration required to run the consensus protocol
Every method in the ConsensusProtocol
class takes the consensus
configuration as a parameter, so having this as a data family rather than a
type family resolves most ambiguity.
Defined out of the class so that protocols can define this type without having to define the entire protocol at the same time (or indeed in the same module).
Instances
data HardForkLedgerConfig xs Source #
Constructors
HardForkLedgerConfig | |
Fields
|
Instances
Generic (HardForkLedgerConfig xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Basics Associated Types type Rep (HardForkLedgerConfig xs) ∷ Type → Type # Methods from ∷ HardForkLedgerConfig xs → Rep (HardForkLedgerConfig xs) x # to ∷ Rep (HardForkLedgerConfig xs) x → HardForkLedgerConfig xs # | |
CanHardFork xs ⇒ NoThunks (HardForkLedgerConfig xs) Source # | |
type Rep (HardForkLedgerConfig xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Basics type Rep (HardForkLedgerConfig xs) = D1 ('MetaData "HardForkLedgerConfig" "Ouroboros.Consensus.HardFork.Combinator.Basics" "ouroboros-consensus-0.22.0.0-inplace" 'False) (C1 ('MetaCons "HardForkLedgerConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "hardForkLedgerConfigShape") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Shape xs)) :*: S1 ('MetaSel ('Just "hardForkLedgerConfigPerEra") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PerEraLedgerConfig xs)))) |
data family GenTx blk ∷ Type Source #
Generalized transaction
The mempool (and, accordingly, blocks) consist of "generalized transactions"; this could be "proper" transactions (transferring funds) but also other kinds of things such as update proposals, delegations, etc.
Instances
data family BlockQuery blk ∷ Type → Type Source #
Different queries supported by the ledger, indexed by the result type.
Instances
data HardForkApplyTxErr xs Source #
Constructors
HardForkApplyTxErrFromEra !(OneEraApplyTxErr xs) | Validation error from one of the eras |
HardForkApplyTxErrWrongEra !(MismatchEraInfo xs) | We tried to apply a block from the wrong era |
Instances
data HardForkEnvelopeErr xs Source #
Constructors
HardForkEnvelopeErrFromEra (OneEraEnvelopeErr xs) | Validation error from one of the eras |
HardForkEnvelopeErrWrongEra (MismatchEraInfo xs) | We tried to apply a block from the wrong era |
Instances
data HardForkLedgerError xs Source #
Constructors
HardForkLedgerErrorFromEra (OneEraLedgerError xs) | Validation error from one of the eras |
HardForkLedgerErrorWrongEra (MismatchEraInfo xs) | We tried to apply a block from the wrong era |
Instances
newtype LedgerEraInfo blk Source #
Additional newtype wrapper around SingleEraInfo
This is primarily useful for use in error messages: it marks which era info came from the ledger, and which came from a txblockheader/etc.
Constructors
LedgerEraInfo | |
Fields |
Instances
Show (LedgerEraInfo blk) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Info Methods showsPrec ∷ Int → LedgerEraInfo blk → ShowS # show ∷ LedgerEraInfo blk → String # showList ∷ [LedgerEraInfo blk] → ShowS # | |
Eq (LedgerEraInfo blk) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Info Methods (==) ∷ LedgerEraInfo blk → LedgerEraInfo blk → Bool # (/=) ∷ LedgerEraInfo blk → LedgerEraInfo blk → Bool # | |
NoThunks (LedgerEraInfo blk) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Info | |
Serialise (LedgerEraInfo blk) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Info Methods encode ∷ LedgerEraInfo blk → Encoding Source # decode ∷ Decoder s (LedgerEraInfo blk) Source # encodeList ∷ [LedgerEraInfo blk] → Encoding Source # decodeList ∷ Decoder s [LedgerEraInfo blk] Source # |
data SingleEraInfo blk Source #
Information about an era (mostly for type errors)
Constructors
SingleEraInfo | |
Fields |
Instances
data HardForkLedgerUpdate xs Source #
Constructors
HardForkUpdateInEra (OneEraLedgerUpdate xs) | |
HardForkUpdateTransitionConfirmed (EraIndex xs) (EraIndex xs) EpochNo | Hard fork transition got confirmed |
HardForkUpdateTransitionDone (EraIndex xs) (EraIndex xs) EpochNo | Hard fork transition happened We record the |
HardForkUpdateTransitionRolledBack (EraIndex xs) (EraIndex xs) | The hard fork transition rolled back |
Instances
CanHardFork xs ⇒ Show (HardForkLedgerUpdate xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods showsPrec ∷ Int → HardForkLedgerUpdate xs → ShowS # show ∷ HardForkLedgerUpdate xs → String # showList ∷ [HardForkLedgerUpdate xs] → ShowS # | |
CanHardFork xs ⇒ Eq (HardForkLedgerUpdate xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods (==) ∷ HardForkLedgerUpdate xs → HardForkLedgerUpdate xs → Bool # (/=) ∷ HardForkLedgerUpdate xs → HardForkLedgerUpdate xs → Bool # | |
CanHardFork xs ⇒ Condense (HardForkLedgerUpdate xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods condense ∷ HardForkLedgerUpdate xs → String Source # |
data HardForkLedgerWarning xs Source #
Constructors
HardForkWarningInEra (OneEraLedgerWarning xs) | Warning from the underlying era |
HardForkWarningTransitionMismatch (EraIndex xs) EraParams EpochNo | The transition to the next era does not match the The |
HardForkWarningTransitionInFinalEra (EraIndex xs) EpochNo | Transition in the final era The final era should never confirm any transitions. For clarity, we also record the index of that final era. |
HardForkWarningTransitionUnconfirmed (EraIndex xs) | An already-confirmed transition got un-confirmed |
HardForkWarningTransitionReconfirmed (EraIndex xs) (EraIndex xs) EpochNo EpochNo | An already-confirmed transition got changed We record the indices of the era we are transitioning from and to,
as well as the old and new |
Instances
CanHardFork xs ⇒ Show (HardForkLedgerWarning xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods showsPrec ∷ Int → HardForkLedgerWarning xs → ShowS # show ∷ HardForkLedgerWarning xs → String # showList ∷ [HardForkLedgerWarning xs] → ShowS # | |
CanHardFork xs ⇒ Eq (HardForkLedgerWarning xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods (==) ∷ HardForkLedgerWarning xs → HardForkLedgerWarning xs → Bool # (/=) ∷ HardForkLedgerWarning xs → HardForkLedgerWarning xs → Bool # |
data AnnForecast state view blk Source #
Forecast annotated with details about the ledger it was derived from
Constructors
AnnForecast | |
Fields
|
type HardForkQueryResult xs = Either (MismatchEraInfo xs) Source #
data QueryAnytime result where Source #
Constructors
GetEraStart ∷ QueryAnytime (Maybe Bound) |
Instances
SameDepIndex QueryAnytime Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods sameDepIndex ∷ QueryAnytime a → QueryAnytime b → Maybe (a :~: b) Source # | |
ShowQuery QueryAnytime Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showResult ∷ QueryAnytime result → result → String Source # | |
Show (QueryAnytime result) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showsPrec ∷ Int → QueryAnytime result → ShowS # show ∷ QueryAnytime result → String # showList ∷ [QueryAnytime result] → ShowS # | |
Serialise (Some QueryAnytime) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods encode ∷ Some QueryAnytime → Encoding Source # decode ∷ Decoder s (Some QueryAnytime) Source # encodeList ∷ [Some QueryAnytime] → Encoding Source # decodeList ∷ Decoder s [Some QueryAnytime] Source # |
data QueryHardFork xs result where Source #
Constructors
GetInterpreter ∷ QueryHardFork xs (Interpreter xs) | |
GetCurrentEra ∷ QueryHardFork xs (EraIndex xs) |
Instances
SameDepIndex (QueryHardFork xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods sameDepIndex ∷ QueryHardFork xs a → QueryHardFork xs b → Maybe (a :~: b) Source # | |
All SingleEraBlock xs ⇒ ShowQuery (QueryHardFork xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showResult ∷ QueryHardFork xs result → result → String Source # | |
Show (QueryHardFork xs result) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showsPrec ∷ Int → QueryHardFork xs result → ShowS # show ∷ QueryHardFork xs result → String # showList ∷ [QueryHardFork xs result] → ShowS # |
data QueryIfCurrent ∷ [Type] → Type → Type where Source #
Constructors
QZ ∷ BlockQuery x result → QueryIfCurrent (x ': xs) result | |
QS ∷ QueryIfCurrent xs result → QueryIfCurrent (x ': xs) result |
Instances
All SingleEraBlock xs ⇒ SameDepIndex (QueryIfCurrent xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods sameDepIndex ∷ QueryIfCurrent xs a → QueryIfCurrent xs b → Maybe (a :~: b) Source # | |
All SingleEraBlock xs ⇒ ShowQuery (QueryIfCurrent xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showResult ∷ QueryIfCurrent xs result → result → String Source # | |
All SingleEraBlock xs ⇒ Show (QueryIfCurrent xs result) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showsPrec ∷ Int → QueryIfCurrent xs result → ShowS # show ∷ QueryIfCurrent xs result → String # showList ∷ [QueryIfCurrent xs result] → ShowS # |
newtype WrapPartialLedgerConfig blk Source #
Constructors
WrapPartialLedgerConfig | |
Fields |
Instances
NoThunks (PartialLedgerConfig blk) ⇒ NoThunks (WrapPartialLedgerConfig blk) Source # | |
class (ConsensusProtocol p, NoThunks (PartialConsensusConfig p)) ⇒ HasPartialConsensusConfig p where Source #
Partial consensus config
Minimal complete definition
Nothing
Associated Types
type PartialConsensusConfig p ∷ Type Source #
type PartialConsensusConfig p = ConsensusConfig p
Methods
completeConsensusConfig ∷ proxy p → EpochInfo (Except PastHorizonException) → PartialConsensusConfig p → ConsensusConfig p Source #
Construct ConsensusConfig
from PartialConsensusConfig
See comments for completeLedgerConfig
for some details about the
EpochInfo
.
default completeConsensusConfig ∷ PartialConsensusConfig p ~ ConsensusConfig p ⇒ proxy p → EpochInfo (Except PastHorizonException) → PartialConsensusConfig p → ConsensusConfig p Source #
toPartialConsensusConfig ∷ proxy p → ConsensusConfig p → PartialConsensusConfig p Source #
Construct partial consensus config from full consensus config
NOTE: This is basically just losing EpochInfo
, but that is constant
anyway when we are dealing with a single era.
default toPartialConsensusConfig ∷ PartialConsensusConfig p ~ ConsensusConfig p ⇒ proxy p → ConsensusConfig p → PartialConsensusConfig p Source #
class (UpdateLedger blk, NoThunks (PartialLedgerConfig blk)) ⇒ HasPartialLedgerConfig blk where Source #
Partial ledger config
Minimal complete definition
Nothing
Associated Types
type PartialLedgerConfig blk ∷ Type Source #
type PartialLedgerConfig blk = LedgerConfig blk
Methods
completeLedgerConfig ∷ proxy blk → EpochInfo (Except PastHorizonException) → PartialLedgerConfig blk → LedgerConfig blk Source #
Construct LedgerConfig
from PartialLedgerCfg
NOTE: The EpochInfo
provided will have limited range, any attempt to
look past its horizon will result in a pure PastHorizonException
.
The horizon is determined by the tip of the ledger state (not view)
from which the EpochInfo
is derived.
default completeLedgerConfig ∷ PartialLedgerConfig blk ~ LedgerConfig blk ⇒ proxy blk → EpochInfo (Except PastHorizonException) → PartialLedgerConfig blk → LedgerConfig blk Source #
newtype WrapPartialConsensusConfig blk Source #
Constructors
WrapPartialConsensusConfig | |
Fields |
Instances
newtype HardForkSelectView xs Source #
Constructors
HardForkSelectView | |
Fields |
Instances
type HardForkCanBeLeader xs = SomeErasCanBeLeader xs Source #
We have one or more BlockForging
s, and thus CanBeLeader
proofs, for
each era in which we can forge blocks.
type HardForkChainDepState xs = HardForkState WrapChainDepState xs Source #
type HardForkIsLeader xs = OneEraIsLeader xs Source #
We are a leader if we have a proof from one of the eras
data HardForkValidationErr xs Source #
Constructors
HardForkValidationErrFromEra (OneEraValidationErr xs) | Validation error from one of the eras |
HardForkValidationErrWrongEra (MismatchEraInfo xs) | We tried to apply a block from the wrong era |
Instances
data HardForkLedgerView_ f xs Source #
Constructors
HardForkLedgerView | |
Fields
|
Instances
CanHardFork xs ⇒ Show (HardForkLedgerView_ WrapLedgerView xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol.LedgerView Methods showsPrec ∷ Int → HardForkLedgerView_ WrapLedgerView xs → ShowS # show ∷ HardForkLedgerView_ WrapLedgerView xs → String # showList ∷ [HardForkLedgerView_ WrapLedgerView xs] → ShowS # | |
(SListI xs, Show a) ⇒ Show (HardForkLedgerView_ (K a ∷ Type → Type) xs) Source # | |
data AcrossEraMode cfg a where Source #
GADT indicating whether we are lifting compare
or preferCandidate
to
the HFC, together with the type of configuration we need for that and the
result type.
data AcrossEraSelection ∷ Type → Type → Type where Source #
Constructors
CompareBlockNo ∷ AcrossEraSelection x y | Just compare block numbers This is a useful default when two eras run totally different consensus protocols, and we just want to choose the longer chain. |
CompareSameSelectView ∷ SelectView (BlockProtocol x) ~ SelectView (BlockProtocol y) ⇒ AcrossEraSelection x y | Two eras using the same We use the |
data WithBlockNo (f ∷ k → Type) (a ∷ k) Source #
Constructors
WithBlockNo | |
Fields
|
Instances
data EraTranslation xs Source #
Constructors
Instances
NoThunks (EraTranslation xs) Source # | |
pattern InjectTx ∷ (GenTx blk → Maybe (GenTx blk')) → InjectTx blk blk' Source #
InjectPolyTx
at type InjectTx
pattern InjectValidatedTx ∷ (WrapValidatedGenTx blk → Maybe (WrapValidatedGenTx blk')) → InjectValidatedTx blk blk' Source #
InjectPolyTx
at type InjectValidatedTx
Arguments
∷ ∀ m xs. (CanHardFork xs, Monad m) | |
⇒ Text | Used as the |
→ NonEmptyOptNP (BlockForging m) xs | |
→ BlockForging m (HardForkBlock xs) |
cannotInjectTx ∷ InjectTx blk blk' Source #
cannotInjectPolyTx
at type InjectTx
cannotInjectValidatedTx ∷ InjectValidatedTx blk blk' Source #
cannotInjectPolyTx
at type InjectValidatedTx
initHardForkState ∷ f x → HardForkState f (x ': xs) Source #
noHardForksEpochInfo ∷ (Monad m, NoHardForks blk) ⇒ TopLevelConfig blk → EpochInfo m Source #
singleEraTransition' ∷ SingleEraBlock blk ⇒ WrapPartialLedgerConfig blk → EraParams → Bound → LedgerState blk → Maybe EpochNo Source #
eraIndexEmpty ∷ EraIndex '[] → Void Source #
eraIndexFromIndex ∷ Index xs blk → EraIndex xs Source #
eraIndexSucc ∷ EraIndex xs → EraIndex (x ': xs) Source #
eraIndexToInt ∷ EraIndex xs → Int Source #
eraIndexZero ∷ EraIndex (x ': xs) Source #
completeConsensusConfig' ∷ ∀ blk. HasPartialConsensusConfig (BlockProtocol blk) ⇒ EpochInfo (Except PastHorizonException) → WrapPartialConsensusConfig blk → ConsensusConfig (BlockProtocol blk) Source #
completeConsensusConfig'' ∷ ∀ blk. HasPartialConsensusConfig (BlockProtocol blk) ⇒ EpochInfo (Except PastHorizonException) → WrapPartialConsensusConfig blk → WrapConsensusConfig blk Source #
completeLedgerConfig' ∷ ∀ blk. HasPartialLedgerConfig blk ⇒ EpochInfo (Except PastHorizonException) → WrapPartialLedgerConfig blk → LedgerConfig blk Source #
completeLedgerConfig'' ∷ ∀ blk. HasPartialLedgerConfig blk ⇒ EpochInfo (Except PastHorizonException) → WrapPartialLedgerConfig blk → WrapLedgerConfig blk Source #
distribLedgerConfig ∷ CanHardFork xs ⇒ EpochInfo (Except PastHorizonException) → LedgerConfig (HardForkBlock xs) → NP WrapLedgerConfig xs Source #
distribTopLevelConfig ∷ All SingleEraBlock xs ⇒ EpochInfo (Except PastHorizonException) → TopLevelConfig (HardForkBlock xs) → NP TopLevelConfig xs Source #
distribAnnTip ∷ SListI xs ⇒ AnnTip (HardForkBlock xs) → NS AnnTip xs Source #
undistribAnnTip ∷ SListI xs ⇒ NS AnnTip xs → AnnTip (HardForkBlock xs) Source #
mkHardForkForecast ∷ ∀ state view xs. SListI xs ⇒ InPairs (CrossEraForecaster state view) xs → HardForkState (AnnForecast state view) xs → Forecast (HardForkLedgerView_ view xs) Source #
Change a telescope of a forecast into a forecast of a telescope
decodeQueryAnytimeResult ∷ QueryAnytime result → ∀ s. Decoder s result Source #
decodeQueryHardForkResult ∷ SListI xs ⇒ QueryHardFork xs result → ∀ s. Decoder s result Source #
encodeQueryAnytimeResult ∷ QueryAnytime result → result → Encoding Source #
encodeQueryHardForkResult ∷ SListI xs ⇒ QueryHardFork xs result → result → Encoding Source #
getHardForkQuery ∷ BlockQuery (HardForkBlock xs) result → (∀ result'. (result :~: HardForkQueryResult xs result') → QueryIfCurrent xs result' → r) → (∀ x' xs'. (xs :~: (x' ': xs')) → ProofNonEmpty xs' → QueryAnytime result → EraIndex xs → r) → (∀ x' xs'. (xs :~: (x' ': xs')) → ProofNonEmpty xs' → QueryHardFork xs result → r) → r Source #
hardForkQueryInfo ∷ All SingleEraBlock xs ⇒ QueryIfCurrent xs result → NS SingleEraInfo xs Source #
hardForkApplyTxErrFromEither ∷ Either (MismatchEraInfo xs) (OneEraApplyTxErr xs) → HardForkApplyTxErr xs Source #
hardForkApplyTxErrToEither ∷ HardForkApplyTxErr xs → Either (MismatchEraInfo xs) (OneEraApplyTxErr xs) Source #
acrossEraSelection ∷ ∀ xs cfg a. All SingleEraBlock xs ⇒ AcrossEraMode cfg a → NP cfg xs → Tails AcrossEraSelection xs → WithBlockNo (NS WrapSelectView) xs → WithBlockNo (NS WrapSelectView) xs → a Source #
mapWithBlockNo ∷ (f x → g y) → WithBlockNo f x → WithBlockNo g y Source #
trivialEraTranslation ∷ EraTranslation '[blk] Source #