| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator
Description
The hard fork combinator
Intended for unqualified import
Synopsis
- newtype Identity a = Identity {
- runIdentity :: a
- data EpochInfo (m :: Type -> Type) = EpochInfo {
- epochInfoSize_ :: HasCallStack => EpochNo -> m EpochSize
- epochInfoFirst_ :: HasCallStack => EpochNo -> m SlotNo
- epochInfoEpoch_ :: HasCallStack => SlotNo -> m EpochNo
- newtype LedgerEraInfo blk = LedgerEraInfo {
- getLedgerEraInfo :: SingleEraInfo blk
- data SingleEraInfo blk = SingleEraInfo {
- singleEraName :: !Text
- data family Ticked st :: Type
- data family NestedCtxt_ blk :: (Type -> Type) -> Type -> Type
- data family Header blk :: Type
- data family StorageConfig blk :: Type
- data family CodecConfig blk :: Type
- data family BlockConfig blk :: Type
- data family ConsensusConfig p :: Type
- data family LedgerState blk :: Type
- data family TxId tx :: Type
- data family GenTx blk :: Type
- newtype WrapPartialConsensusConfig blk = WrapPartialConsensusConfig {}
- newtype WrapPartialLedgerConfig blk = WrapPartialLedgerConfig {}
- class (UpdateLedger blk, NoThunks (PartialLedgerConfig blk)) => HasPartialLedgerConfig blk where
- type PartialLedgerConfig blk :: Type
- completeLedgerConfig :: proxy blk -> EpochInfo Identity -> PartialLedgerConfig blk -> LedgerConfig blk
- class (ConsensusProtocol p, NoThunks (PartialConsensusConfig p)) => HasPartialConsensusConfig p where
- type PartialConsensusConfig p :: Type
- completeConsensusConfig :: proxy p -> EpochInfo Identity -> PartialConsensusConfig p -> ConsensusConfig p
- partialChainSelConfig :: proxy p -> PartialConsensusConfig p -> ChainSelConfig p
- data family Query blk :: Type -> Type
- class IsNonEmpty xs where
- isNonEmpty :: proxy xs -> ProofNonEmpty xs
- data ProofNonEmpty :: [Type] -> Type where
- ProofNonEmpty :: Proxy x -> Proxy xs -> ProofNonEmpty (x ': xs)
- data InPairs (f :: k -> k -> Type) (xs :: [k]) where
- data Telescope (g :: k -> Type) (f :: k -> Type) (xs :: [k]) where
- data Mismatch :: (k -> Type) -> (k -> Type) -> [k] -> Type where
- newtype HardForkState f xs = HardForkState {
- getHardForkState :: Telescope (K Past) (Current f) xs
- data EraTranslation xs = EraTranslation {
- translateLedgerState :: InPairs (RequiringBoth WrapLedgerConfig (Translate LedgerState)) xs
- translateChainDepState :: InPairs (RequiringBoth WrapConsensusConfig (Translate WrapChainDepState)) xs
- translateLedgerView :: InPairs (RequiringBoth WrapLedgerConfig (TranslateForecast LedgerState WrapLedgerView)) xs
- trivialEraTranslation :: EraTranslation '[blk]
- data InjectTx blk blk' = InjectTx {
- injectTxWith :: GenTx blk -> Maybe (GenTx blk')
- cannotInjectTx :: InjectTx blk blk'
- newtype EraIndex xs = EraIndex {
- getEraIndex :: NS (K ()) xs
- class (LedgerSupportsProtocol blk, InspectLedger blk, LedgerSupportsMempool blk, HasTxId (GenTx blk), QueryLedger blk, HasPartialConsensusConfig (BlockProtocol blk), HasPartialLedgerConfig blk, ConvertRawHash blk, ReconstructNestedCtxt Header blk, CommonProtocolParams blk, ConfigSupportsNode blk, NodeInitStorage blk, Eq (GenTx blk), Eq (ApplyTxErr blk), Show blk, Show (Header blk), Show (CannotForge blk), Show (ForgeStateInfo blk), Show (ForgeStateUpdateError blk)) => SingleEraBlock blk where
- singleEraTransition :: PartialLedgerConfig blk -> EraParams -> Bound -> LedgerState blk -> Maybe EpochNo
- singleEraInfo :: proxy blk -> SingleEraInfo blk
- proxySingle :: Proxy SingleEraBlock
- singleEraTransition' :: SingleEraBlock blk => WrapPartialLedgerConfig blk -> EraParams -> Bound -> LedgerState blk -> Maybe EpochNo
- eraIndexEmpty :: EraIndex '[] -> Void
- eraIndexFromNS :: SListI xs => NS f xs -> EraIndex xs
- eraIndexZero :: EraIndex (x ': xs)
- eraIndexSucc :: EraIndex xs -> EraIndex (x ': xs)
- eraIndexToInt :: EraIndex xs -> Int
- initHardForkState :: f x -> HardForkState f (x ': xs)
- data WithBlockNo (f :: k -> Type) (a :: k) = WithBlockNo {
- getBlockNo :: BlockNo
- dropBlockNo :: f a
- data AcrossEraSelection :: Type -> Type -> Type where
- CompareBlockNo :: AcrossEraSelection x y
- SelectSameProtocol :: BlockProtocol x ~ BlockProtocol y => AcrossEraSelection x y
- CustomChainSel :: (ChainSelConfig (BlockProtocol x) -> ChainSelConfig (BlockProtocol y) -> SelectView (BlockProtocol x) -> SelectView (BlockProtocol y) -> Ordering) -> AcrossEraSelection x y
- acrossEraSelection :: All SingleEraBlock xs => NP WrapChainSelConfig xs -> Tails AcrossEraSelection xs -> WithBlockNo (NS WrapSelectView) xs -> WithBlockNo (NS WrapSelectView) xs -> Ordering
- mapWithBlockNo :: (f x -> g y) -> WithBlockNo f x -> WithBlockNo g y
- class SingleEraBlock blk => NoHardForks blk where
- getEraParams :: TopLevelConfig blk -> EraParams
- toPartialConsensusConfig :: proxy blk -> ConsensusConfig (BlockProtocol blk) -> PartialConsensusConfig (BlockProtocol blk)
- toPartialLedgerConfig :: proxy blk -> LedgerConfig blk -> PartialLedgerConfig blk
- noHardForksEpochInfo :: NoHardForks blk => TopLevelConfig blk -> EpochInfo Identity
- class (All SingleEraBlock xs, Typeable xs, IsNonEmpty xs) => CanHardFork xs where
- type HardForkLedgerView = HardForkLedgerView_ WrapLedgerView
- data HardForkLedgerView_ f xs = HardForkLedgerView {}
- newtype MismatchEraInfo xs = MismatchEraInfo {}
- newtype OneEraHash (xs :: [k]) = OneEraHash {}
- newtype OneEraTipInfo xs = OneEraTipInfo {
- getOneEraTipInfo :: NS WrapTipInfo xs
- newtype OneEraHeader xs = OneEraHeader {
- getOneEraHeader :: NS Header xs
- newtype OneEraGenTxId xs = OneEraGenTxId {
- getOneEraGenTxId :: NS WrapGenTxId xs
- newtype OneEraGenTx xs = OneEraGenTx {
- getOneEraGenTx :: NS GenTx xs
- newtype OneEraBlock xs = OneEraBlock {
- getOneEraBlock :: NS I xs
- newtype OneEraApplyTxErr xs = OneEraApplyTxErr {}
- newtype PerEraStorageConfig xs = PerEraStorageConfig {}
- newtype PerEraLedgerConfig xs = PerEraLedgerConfig {}
- newtype PerEraConsensusConfig xs = PerEraConsensusConfig {}
- newtype PerEraCodecConfig xs = PerEraCodecConfig {}
- newtype PerEraBlockConfig xs = PerEraBlockConfig {}
- data HardForkLedgerConfig xs = HardForkLedgerConfig {
- hardForkLedgerConfigShape :: !(Shape xs)
- hardForkLedgerConfigPerEra :: !(PerEraLedgerConfig xs)
- newtype HardForkBlock xs = HardForkBlock {
- getHardForkBlock :: OneEraBlock xs
- data HardForkProtocol (xs :: [Type])
- completeLedgerConfig' :: forall blk. HasPartialLedgerConfig blk => EpochInfo Identity -> WrapPartialLedgerConfig blk -> LedgerConfig blk
- completeLedgerConfig'' :: forall blk. HasPartialLedgerConfig blk => EpochInfo Identity -> WrapPartialLedgerConfig blk -> WrapLedgerConfig blk
- completeConsensusConfig' :: forall blk. HasPartialConsensusConfig (BlockProtocol blk) => EpochInfo Identity -> WrapPartialConsensusConfig blk -> ConsensusConfig (BlockProtocol blk)
- completeConsensusConfig'' :: forall blk. HasPartialConsensusConfig (BlockProtocol blk) => EpochInfo Identity -> WrapPartialConsensusConfig blk -> WrapConsensusConfig blk
- distribLedgerConfig :: CanHardFork xs => EpochInfo Identity -> LedgerConfig (HardForkBlock xs) -> NP WrapLedgerConfig xs
- distribTopLevelConfig :: All SingleEraBlock xs => EpochInfo Identity -> TopLevelConfig (HardForkBlock xs) -> NP TopLevelConfig xs
- distribAnnTip :: SListI xs => AnnTip (HardForkBlock xs) -> NS AnnTip xs
- undistribAnnTip :: SListI xs => NS AnnTip xs -> AnnTip (HardForkBlock xs)
- data HardForkValidationErr xs
- type HardForkCanBeLeader xs = OneEraCanBeLeader xs
- type HardForkIsLeader xs = OneEraIsLeader xs
- type HardForkChainDepState xs = HardForkState WrapChainDepState xs
- 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
- data HardForkEnvelopeErr xs
- data HardForkLedgerError xs
- mkHardForkForecast :: forall state view xs. SListI xs => InPairs (TranslateForecast state view) xs -> HardForkState (AnnForecast state view) xs -> Forecast (HardForkLedgerView_ view xs)
- data HardForkApplyTxErr xs
- hardForkApplyTxErrToEither :: HardForkApplyTxErr xs -> Either (MismatchEraInfo xs) (OneEraApplyTxErr xs)
- hardForkApplyTxErrFromEither :: Either (MismatchEraInfo xs) (OneEraApplyTxErr xs) -> HardForkApplyTxErr xs
- data QueryHardFork xs result where
- GetInterpreter :: QueryHardFork xs (Interpreter xs)
- GetCurrentEra :: QueryHardFork xs (EraIndex xs)
- data QueryAnytime result where
- data QueryIfCurrent :: [Type] -> Type -> Type where
- QZ :: Query x result -> QueryIfCurrent (x ': xs) result
- QS :: QueryIfCurrent xs result -> QueryIfCurrent (x ': xs) result
- type HardForkQueryResult xs = Either (MismatchEraInfo xs)
- getHardForkQuery :: Query (HardForkBlock xs) result -> (forall result'. (result :~: HardForkQueryResult xs result') -> QueryIfCurrent xs result' -> r) -> (forall x' xs'. (xs :~: (x' ': xs')) -> ProofNonEmpty xs' -> QueryAnytime result -> EraIndex xs -> r) -> (forall x' xs'. (xs :~: (x' ': xs')) -> ProofNonEmpty xs' -> QueryHardFork xs result -> r) -> r
- encodeQueryAnytimeResult :: QueryAnytime result -> result -> Encoding
- decodeQueryAnytimeResult :: QueryAnytime result -> forall s. Decoder s result
- encodeQueryHardForkResult :: SListI xs => QueryHardFork xs result -> result -> Encoding
- decodeQueryHardForkResult :: SListI xs => QueryHardFork xs result -> forall s. Decoder s result
- hardForkQueryInfo :: All SingleEraBlock xs => QueryIfCurrent xs result -> NS SingleEraInfo xs
- type HardForkForgeStateInfo xs = OneEraForgeStateInfo xs
- hardForkBlockForging :: forall m xs. (CanHardFork xs, Monad m) => NS (BlockForging m) xs -> BlockForging m (HardForkBlock xs)
Documentation
Identity functor and monad. (a non-strict monad)
Since: base-4.8.0.0
Constructors
| Identity | |
Fields
| |
Instances
data EpochInfo (m :: Type -> Type) Source #
Information about epochs
Epochs may have different sizes at different times during the lifetime of the
blockchain. 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, and
hence requires access to state.
The other functions provide some derived information from epoch sizes. In the
default implementation all of these functions query and update an internal
cache maintaining cumulative epoch sizes; for that reason, all of these
functions live in a monad m.
Constructors
| EpochInfo | |
Fields
| |
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
| Eq (LedgerEraInfo blk) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Info Methods (==) :: LedgerEraInfo blk -> LedgerEraInfo blk -> Bool # (/=) :: LedgerEraInfo blk -> LedgerEraInfo blk -> Bool # | |
| 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 # | |
| 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 family Ticked st :: Type Source #
" Ticked " piece of state (LedgerState, LedgerView, ChainIndepState)
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 (or forecast).
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 family Header blk :: Type Source #
Instances
data family StorageConfig blk :: Type Source #
Config needed for the
NodeInitStorage class. Defined here to
avoid circular dependencies.
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 BlockConfig blk :: Type Source #
Static configuration required to work with this type of blocks
Instances
| Isomorphic BlockConfig Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Unary Methods project :: NoHardForks blk => BlockConfig (HardForkBlock '[blk]) -> BlockConfig blk Source # inject :: NoHardForks blk => BlockConfig blk -> BlockConfig (HardForkBlock '[blk]) Source # | |
| NoThunks (BlockConfig (DualBlock m a)) Source # | |
| CanHardFork xs => NoThunks (BlockConfig (HardForkBlock xs)) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Basics Methods noThunks :: Context -> BlockConfig (HardForkBlock xs) -> IO (Maybe ThunkInfo) Source # wNoThunks :: Context -> BlockConfig (HardForkBlock xs) -> IO (Maybe ThunkInfo) Source # showTypeOf :: Proxy (BlockConfig (HardForkBlock xs)) -> String Source # | |
| newtype BlockConfig (HardForkBlock xs) Source # | |
| data BlockConfig (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
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 family LedgerState blk :: Type Source #
Ledger state associated with a block
Instances
data family TxId tx :: Type Source #
A generalized transaction, GenTx, identifier.
Instances
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
newtype WrapPartialConsensusConfig blk Source #
Constructors
| WrapPartialConsensusConfig | |
Fields | |
Instances
| NoThunks (PartialConsensusConfig (BlockProtocol blk)) => NoThunks (WrapPartialConsensusConfig blk) Source # | |
newtype WrapPartialLedgerConfig blk Source #
Constructors
| WrapPartialLedgerConfig | |
Fields | |
Instances
| NoThunks (PartialLedgerConfig blk) => NoThunks (WrapPartialLedgerConfig blk) 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 Identity -> 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.
TODO: This should not be Identity; see https://github.com/input-output-hk/ouroboros-network/issues/2126
default completeLedgerConfig :: PartialLedgerConfig blk ~ LedgerConfig blk => proxy blk -> EpochInfo Identity -> PartialLedgerConfig blk -> LedgerConfig 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 Identity -> 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 Identity -> PartialConsensusConfig p -> ConsensusConfig p Source #
partialChainSelConfig :: proxy p -> PartialConsensusConfig p -> ChainSelConfig p Source #
The ChainSelConfig must be derivable from the partial config
default partialChainSelConfig :: PartialConsensusConfig p ~ ConsensusConfig p => proxy p -> PartialConsensusConfig p -> ChainSelConfig p Source #
data family Query blk :: Type -> Type Source #
Different queries supported by the ledger, indexed by the result type.
Instances
class IsNonEmpty xs where Source #
Methods
isNonEmpty :: proxy xs -> ProofNonEmpty xs Source #
Instances
| IsNonEmpty (x ': xs) Source # | |
Defined in Ouroboros.Consensus.Util.SOP Methods isNonEmpty :: proxy (x ': xs) -> ProofNonEmpty (x ': xs) Source # | |
data ProofNonEmpty :: [Type] -> Type where Source #
Constructors
| ProofNonEmpty :: Proxy x -> Proxy xs -> ProofNonEmpty (x ': xs) |
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.
Blockchain intuition: think of g as representing some kind of past state,
and f some kind of current state. Then depending on how many hard fork
transitions we have had, we might either have, say
TZ currentByronState TS pastByronState $ TZ currentShelleyState TS pastByronState $ TS pastShelleyState $ TZ currentGoguenState
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 :: !(f x) -> Telescope g f (x ': xs) | |
| TS :: !(g x) -> !(Telescope g f xs) -> Telescope g f (x ': xs) |
Instances
| HAp (Telescope g :: (k -> Type) -> [k] -> Type) Source # | |
| HTraverse_ (Telescope g :: (k -> Type) -> [k] -> Type) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Util.Telescope Methods hctraverse_ :: forall c (xs :: l) g0 proxy f. (AllN (Telescope g) c xs, Applicative g0) => proxy c -> (forall (a :: k0). c a => f a -> g0 ()) -> Telescope g f xs -> g0 () Source # htraverse_ :: forall (xs :: l) g0 f. (SListIN (Telescope g) xs, Applicative g0) => (forall (a :: k0). f a -> g0 ()) -> Telescope g f xs -> g0 () Source # | |
| HSequence (Telescope g :: (k -> Type) -> [k] -> Type) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Util.Telescope Methods hsequence' :: forall (xs :: l) f (g0 :: k0 -> Type). (SListIN (Telescope g) xs, Applicative f) => Telescope g (f :.: g0) xs -> f (Telescope g g0 xs) Source # hctraverse' :: forall c (xs :: l) g0 proxy f f'. (AllN (Telescope g) c xs, Applicative g0) => proxy c -> (forall (a :: k0). c a => f a -> g0 (f' a)) -> Telescope g f xs -> g0 (Telescope g f' xs) Source # htraverse' :: forall (xs :: l) g0 f f'. (SListIN (Telescope g) xs, Applicative g0) => (forall (a :: k0). f a -> g0 (f' a)) -> Telescope g f xs -> g0 (Telescope g f' xs) Source # | |
| (All (Compose Eq g) xs, All (Compose Eq f) xs) => Eq (Telescope g f xs) Source # | |
| (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) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Util.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 Show g) xs, All (Compose Show f) xs) => Show (Telescope g f xs) Source # | |
| (All (Compose NoThunks g) xs, All (Compose NoThunks f) xs) => NoThunks (Telescope g f xs) Source # | |
| type Prod (Telescope g :: (k -> Type) -> [k] -> Type) Source # | |
| type SListIN (Telescope g :: (k -> Type) -> [k] -> Type) Source # | |
| type AllN (Telescope g :: (k -> Type) -> [k] -> Type) (c :: k -> Constraint) Source # | |
data Mismatch :: (k -> Type) -> (k -> Type) -> [k] -> Type where Source #
Constructors
| ML :: f x -> NS g xs -> Mismatch f g (x ': xs) | |
| MR :: NS f xs -> g x -> Mismatch f g (x ': xs) | |
| MS :: Mismatch f g xs -> Mismatch f g (x ': xs) |
Instances
| (All (Compose Eq f) xs, All (Compose Eq g) xs) => Eq (Mismatch f g xs) Source # | |
| (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) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Util.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 # max :: Mismatch f g xs -> Mismatch f g xs -> Mismatch f g xs # min :: Mismatch f g xs -> Mismatch f g xs -> Mismatch f g xs # | |
| (All (Compose Show f) xs, All (Compose Show g) xs) => Show (Mismatch f g xs) Source # | |
| (All (Compose NoThunks f) xs, All (Compose NoThunks g) xs) => NoThunks (Mismatch f g xs) Source # | |
newtype HardForkState f xs Source #
Generic hard fork state
This is used both for the consensus state and the ledger state.
Constructors
| HardForkState | |
Fields
| |
Instances
data EraTranslation xs Source #
Constructors
Instances
| NoThunks (EraTranslation xs) Source # | |
trivialEraTranslation :: EraTranslation '[blk] Source #
data InjectTx blk blk' Source #
Constructors
| InjectTx | |
Fields
| |
cannotInjectTx :: InjectTx blk blk' Source #
Constructors
| EraIndex | |
Fields
| |
class (LedgerSupportsProtocol blk, InspectLedger blk, LedgerSupportsMempool blk, HasTxId (GenTx blk), QueryLedger blk, HasPartialConsensusConfig (BlockProtocol blk), HasPartialLedgerConfig blk, ConvertRawHash blk, ReconstructNestedCtxt Header blk, CommonProtocolParams blk, ConfigSupportsNode blk, NodeInitStorage blk, Eq (GenTx blk), Eq (ApplyTxErr blk), Show blk, Show (Header blk), Show (CannotForge blk), Show (ForgeStateInfo blk), Show (ForgeStateUpdateError 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)
singleEraTransition' :: SingleEraBlock blk => WrapPartialLedgerConfig blk -> EraParams -> Bound -> LedgerState blk -> Maybe EpochNo Source #
eraIndexEmpty :: EraIndex '[] -> Void Source #
eraIndexZero :: EraIndex (x ': xs) Source #
eraIndexSucc :: EraIndex xs -> EraIndex (x ': xs) Source #
eraIndexToInt :: EraIndex xs -> Int Source #
initHardForkState :: f x -> HardForkState f (x ': xs) Source #
data WithBlockNo (f :: k -> Type) (a :: k) Source #
Constructors
| WithBlockNo | |
Fields
| |
Instances
| Show (f a) => Show (WithBlockNo f a) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol.ChainSel Methods showsPrec :: Int -> WithBlockNo f a -> ShowS # show :: WithBlockNo f a -> String # showList :: [WithBlockNo f a] -> ShowS # | |
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. |
| SelectSameProtocol :: BlockProtocol x ~ BlockProtocol y => AcrossEraSelection x y | Two eras running the same protocol In this case, we can just call NOTE: We require that the eras have the same protocol, not merely the
same |
| CustomChainSel :: (ChainSelConfig (BlockProtocol x) -> ChainSelConfig (BlockProtocol y) -> SelectView (BlockProtocol x) -> SelectView (BlockProtocol y) -> Ordering) -> AcrossEraSelection x y | Custom chain selection This is the most general form, and allows to override chain selection for the specific combination of two eras with a custom comparison function. |
acrossEraSelection :: All SingleEraBlock xs => NP WrapChainSelConfig xs -> Tails AcrossEraSelection xs -> WithBlockNo (NS WrapSelectView) xs -> WithBlockNo (NS WrapSelectView) xs -> Ordering Source #
mapWithBlockNo :: (f x -> g y) -> WithBlockNo f x -> WithBlockNo g y 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.
toPartialConsensusConfig :: proxy blk -> ConsensusConfig (BlockProtocol blk) -> PartialConsensusConfig (BlockProtocol blk) 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.
toPartialLedgerConfig :: proxy blk -> LedgerConfig blk -> PartialLedgerConfig blk Source #
Construct partial ledger config from full ledger config
See also toPartialConsensusConfig
noHardForksEpochInfo :: NoHardForks blk => TopLevelConfig blk -> EpochInfo Identity Source #
class (All SingleEraBlock xs, Typeable xs, IsNonEmpty xs) => CanHardFork xs where Source #
Methods
hardForkEraTranslation :: EraTranslation xs Source #
hardForkChainSel :: Tails AcrossEraSelection xs Source #
hardForkInjectTxs :: InPairs (RequiringBoth WrapLedgerConfig InjectTx) xs Source #
Instances
| SingleEraBlock blk => CanHardFork '[blk] Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Abstract.CanHardFork Methods hardForkEraTranslation :: EraTranslation '[blk] Source # hardForkChainSel :: Tails AcrossEraSelection '[blk] Source # hardForkInjectTxs :: InPairs (RequiringBoth WrapLedgerConfig InjectTx) '[blk] Source # | |
data HardForkLedgerView_ f xs Source #
Constructors
| HardForkLedgerView | |
Fields
| |
Instances
| (SListI xs, Show (Ticked a)) => Show (Ticked (HardForkLedgerView_ (K a :: Type -> Type) xs)) Source # | |
| (SListI xs, Show a) => Show (HardForkLedgerView_ (K a :: Type -> Type) xs) Source # | |
| 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 # | |
| data Ticked (HardForkLedgerView_ f xs) Source # | |
newtype MismatchEraInfo xs Source #
Constructors
| MismatchEraInfo | |
Fields
| |
Instances
| 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 # | |
| 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 # | |
| CanHardFork xs => NoThunks (MismatchEraInfo xs) Source # | |
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 OneEraTipInfo xs Source #
Constructors
| OneEraTipInfo | |
Fields
| |
Instances
| 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 => 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 => NoThunks (OneEraTipInfo xs) Source # | |
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 OneEraGenTxId xs Source #
Constructors
| OneEraGenTxId | |
Fields
| |
Instances
newtype OneEraGenTx xs Source #
Constructors
| OneEraGenTx | |
Fields
| |
Instances
| 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 => 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 => NoThunks (OneEraGenTx xs) Source # | |
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 OneEraApplyTxErr xs Source #
Constructors
| OneEraApplyTxErr | |
Fields | |
Instances
| CanHardFork xs => Eq (OneEraApplyTxErr xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras Methods (==) :: OneEraApplyTxErr xs -> OneEraApplyTxErr xs -> Bool # (/=) :: OneEraApplyTxErr xs -> OneEraApplyTxErr xs -> Bool # | |
| 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 # | |
newtype PerEraStorageConfig xs Source #
Constructors
| PerEraStorageConfig | |
Fields | |
Instances
| CanHardFork xs => NoThunks (PerEraStorageConfig xs) Source # | |
newtype PerEraLedgerConfig xs Source #
Constructors
| PerEraLedgerConfig | |
Fields | |
Instances
| CanHardFork xs => NoThunks (PerEraLedgerConfig xs) Source # | |
newtype PerEraConsensusConfig xs Source #
Constructors
| PerEraConsensusConfig | |
Fields | |
Instances
| CanHardFork xs => NoThunks (PerEraConsensusConfig xs) Source # | |
newtype PerEraCodecConfig xs Source #
Constructors
| PerEraCodecConfig | |
Fields | |
Instances
| CanHardFork xs => NoThunks (PerEraCodecConfig xs) Source # | |
newtype PerEraBlockConfig xs Source #
Constructors
| PerEraBlockConfig | |
Fields | |
Instances
| CanHardFork xs => NoThunks (PerEraBlockConfig xs) Source # | |
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.1.0.0-GfJNvFcM6lj2s5utKAUPEp" '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)))) | |
newtype HardForkBlock xs Source #
Constructors
| HardForkBlock | |
Fields
| |
Instances
data HardForkProtocol (xs :: [Type]) Source #
Instances
completeLedgerConfig' :: forall blk. HasPartialLedgerConfig blk => EpochInfo Identity -> WrapPartialLedgerConfig blk -> LedgerConfig blk Source #
completeLedgerConfig'' :: forall blk. HasPartialLedgerConfig blk => EpochInfo Identity -> WrapPartialLedgerConfig blk -> WrapLedgerConfig blk Source #
completeConsensusConfig' :: forall blk. HasPartialConsensusConfig (BlockProtocol blk) => EpochInfo Identity -> WrapPartialConsensusConfig blk -> ConsensusConfig (BlockProtocol blk) Source #
completeConsensusConfig'' :: forall blk. HasPartialConsensusConfig (BlockProtocol blk) => EpochInfo Identity -> WrapPartialConsensusConfig blk -> WrapConsensusConfig blk Source #
distribLedgerConfig :: CanHardFork xs => EpochInfo Identity -> LedgerConfig (HardForkBlock xs) -> NP WrapLedgerConfig xs Source #
distribTopLevelConfig :: All SingleEraBlock xs => EpochInfo Identity -> 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 #
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
type HardForkCanBeLeader xs = OneEraCanBeLeader xs Source #
We have one or more BlockForgings, and thus CanBeLeader proofs, for
each era in which we can forge blocks.
type HardForkIsLeader xs = OneEraIsLeader xs Source #
We are a leader if we have a proof from one of the eras
type HardForkChainDepState xs = HardForkState WrapChainDepState xs Source #
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 => Eq (HardForkLedgerUpdate xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods (==) :: HardForkLedgerUpdate xs -> HardForkLedgerUpdate xs -> Bool # (/=) :: HardForkLedgerUpdate xs -> HardForkLedgerUpdate xs -> Bool # | |
| 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 => 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 => Eq (HardForkLedgerWarning xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods (==) :: HardForkLedgerWarning xs -> HardForkLedgerWarning xs -> Bool # (/=) :: HardForkLedgerWarning xs -> HardForkLedgerWarning xs -> Bool # | |
| 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 # | |
data AnnForecast state view blk Source #
Forecast annotated with details about the ledger it was derived from
Constructors
| AnnForecast | |
Fields
| |
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
mkHardForkForecast :: forall state view xs. SListI xs => InPairs (TranslateForecast 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
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
hardForkApplyTxErrToEither :: HardForkApplyTxErr xs -> Either (MismatchEraInfo xs) (OneEraApplyTxErr xs) Source #
hardForkApplyTxErrFromEither :: Either (MismatchEraInfo xs) (OneEraApplyTxErr xs) -> HardForkApplyTxErr xs Source #
data QueryHardFork xs result where Source #
Constructors
| GetInterpreter :: QueryHardFork xs (Interpreter xs) | |
| GetCurrentEra :: QueryHardFork xs (EraIndex xs) |
Instances
| All SingleEraBlock xs => ShowQuery (QueryHardFork xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showResult :: QueryHardFork xs result -> result -> String # | |
| SameDepIndex (QueryHardFork xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods sameDepIndex :: QueryHardFork xs a -> QueryHardFork xs b -> Maybe (a :~: b) 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 QueryAnytime result where Source #
Constructors
| GetEraStart :: QueryAnytime (Maybe Bound) |
Instances
| ShowQuery QueryAnytime Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showResult :: QueryAnytime result -> result -> String # | |
| SameDepIndex QueryAnytime Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods sameDepIndex :: QueryAnytime a -> QueryAnytime b -> Maybe (a :~: b) 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 QueryIfCurrent :: [Type] -> Type -> Type where Source #
Constructors
| QZ :: Query x result -> QueryIfCurrent (x ': xs) result | |
| QS :: QueryIfCurrent xs result -> QueryIfCurrent (x ': xs) result |
Instances
| All SingleEraBlock xs => ShowQuery (QueryIfCurrent xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showResult :: QueryIfCurrent xs result -> result -> String # | |
| 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 => 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 # | |
type HardForkQueryResult xs = Either (MismatchEraInfo xs) Source #
getHardForkQuery :: Query (HardForkBlock xs) result -> (forall result'. (result :~: HardForkQueryResult xs result') -> QueryIfCurrent xs result' -> r) -> (forall x' xs'. (xs :~: (x' ': xs')) -> ProofNonEmpty xs' -> QueryAnytime result -> EraIndex xs -> r) -> (forall x' xs'. (xs :~: (x' ': xs')) -> ProofNonEmpty xs' -> QueryHardFork xs result -> r) -> r Source #
encodeQueryAnytimeResult :: QueryAnytime result -> result -> Encoding Source #
decodeQueryAnytimeResult :: QueryAnytime result -> forall s. Decoder s result Source #
encodeQueryHardForkResult :: SListI xs => QueryHardFork xs result -> result -> Encoding Source #
decodeQueryHardForkResult :: SListI xs => QueryHardFork xs result -> forall s. Decoder s result Source #
hardForkQueryInfo :: All SingleEraBlock xs => QueryIfCurrent xs result -> NS SingleEraInfo xs Source #
type HardForkForgeStateInfo xs = OneEraForgeStateInfo xs Source #
For each era in which we want to forge blocks, we have a BlockForging,
and thus ForgeStateInfo.
hardForkBlockForging :: forall m xs. (CanHardFork xs, Monad m) => NS (BlockForging m) xs -> BlockForging m (HardForkBlock xs) Source #