| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.PartialConfig
Synopsis
- 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
- class (UpdateLedger blk, NoThunks (PartialLedgerConfig blk)) => HasPartialLedgerConfig blk where
- type PartialLedgerConfig blk :: Type
- completeLedgerConfig :: proxy blk -> EpochInfo Identity -> PartialLedgerConfig blk -> LedgerConfig blk
- newtype WrapPartialLedgerConfig blk = WrapPartialLedgerConfig {}
- newtype WrapPartialConsensusConfig blk = WrapPartialConsensusConfig {}
- data EpochInfo (m :: Type -> Type) = EpochInfo {
- epochInfoSize_ :: HasCallStack => EpochNo -> m EpochSize
- epochInfoFirst_ :: HasCallStack => EpochNo -> m SlotNo
- epochInfoEpoch_ :: HasCallStack => SlotNo -> m EpochNo
- newtype Identity a = Identity {
- runIdentity :: a
Documentation
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 #
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 #
Newtype wrappers
newtype WrapPartialLedgerConfig blk Source #
Constructors
| WrapPartialLedgerConfig | |
Fields | |
Instances
| NoThunks (PartialLedgerConfig blk) => NoThunks (WrapPartialLedgerConfig blk) Source # | |
newtype WrapPartialConsensusConfig blk Source #
Constructors
| WrapPartialConsensusConfig | |
Fields | |
Instances
| NoThunks (PartialConsensusConfig (BlockProtocol blk)) => NoThunks (WrapPartialConsensusConfig blk) Source # | |
Convenience re-exports
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
| |
Identity functor and monad. (a non-strict monad)
Since: base-4.8.0.0
Constructors
| Identity | |
Fields
| |