Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.PartialConfig
Contents
Synopsis
-
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 WrapPartialLedgerConfig blk = WrapPartialLedgerConfig { }
-
data
EpochInfo
(m ::
Type
->
Type
) =
EpochInfo
{
- epochInfoSize_ :: HasCallStack => EpochNo -> m EpochSize
- epochInfoFirst_ :: HasCallStack => EpochNo -> m SlotNo
- epochInfoEpoch_ :: HasCallStack => SlotNo -> m EpochNo
- epochInfoSlotToRelativeTime_ :: HasCallStack => SlotNo -> m RelativeTime
- epochInfoSlotLength_ :: HasCallStack => SlotNo -> m SlotLength
- type Except e = ExceptT e Identity
- data PastHorizonException
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 ( 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 wrappers
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 # | |
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.
Constructors
EpochInfo | |
Fields
|
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.