Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype HardForkBlock xs = HardForkBlock {}
- data HardForkProtocol (xs ∷ [Type])
- data family LedgerState blk ∷ Type
- data family BlockConfig blk ∷ Type
- data family CodecConfig blk ∷ Type
- data family ConsensusConfig p ∷ Type
- data HardForkLedgerConfig xs = HardForkLedgerConfig {}
- data family StorageConfig blk ∷ Type
- 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
- data EpochInfo (m ∷ Type → Type)
- type Except e = ExceptT e Identity
Hard fork protocol, block, and ledger state
newtype HardForkBlock xs Source #
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
Config
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 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 #
HardForkLedgerConfig | |
|
Instances
Generic (HardForkLedgerConfig xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Basics type Rep (HardForkLedgerConfig xs) ∷ Type → Type # 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.21.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 StorageConfig blk ∷ Type Source #
Config needed for the
NodeInitStorage
class. Defined here to
avoid circular dependencies.
Instances
Functions on config
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 #
Convenience re-exports
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.