| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.Basics
Synopsis
- data HardForkProtocol (xs :: [Type])
- newtype HardForkBlock xs = HardForkBlock {
- getHardForkBlock :: OneEraBlock xs
- data family LedgerState blk :: Type
- data family ConsensusConfig p :: Type
- data family BlockConfig blk :: Type
- data family CodecConfig blk :: Type
- data family StorageConfig blk :: Type
- data HardForkLedgerConfig xs = HardForkLedgerConfig {
- hardForkLedgerConfigShape :: !(Shape xs)
- hardForkLedgerConfigPerEra :: !(PerEraLedgerConfig xs)
- 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
- data EpochInfo (m :: Type -> Type)
- data Identity a
Hard fork protocol, block, and ledger state
data HardForkProtocol (xs :: [Type]) Source #
Instances
newtype HardForkBlock xs Source #
Constructors
| HardForkBlock | |
Fields
| |
Instances
data family LedgerState blk :: Type Source #
Ledger state associated with a block
Instances
Config
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 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 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 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)))) | |
Functions on config
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 #
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.
Identity functor and monad. (a non-strict monad)
Since: base-4.8.0.0