Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Shelley.Ledger.Ledger
Synopsis
- data family LedgerState blk
- class (ShelleyBasedEra era, GetLedgerView era, State (EraRule "PPUP" era) ~ PPUPState era, Default (State (EraRule "PPUP" era)), HasField "_maxBBSize" (PParams era) Natural, HasField "_maxBHSize" (PParams era) Natural, HasField "_maxTxSize" (PParams era) Natural, HasField "_a0" (PParams era) NonNegativeInterval, HasField "_nOpt" (PParams era) Natural, HasField "_rho" (PParams era) UnitInterval, HasField "_tau" (PParams era) UnitInterval, ValidateScript era, FromCBOR (PParams era), ToCBOR (PParams era), HasField "_protocolVersion" (PParamsDelta era) (StrictMaybe ProtVer), FromCBOR (PParamsDelta era), AdditionalGenesisConfig era ~ TranslationContext era, ToCBORGroup (TxSeq era), NoThunks (TranslationContext era), FromCBOR (Annotator (Witnesses era)), ToCBOR (Witnesses era), Eq (TxSeq era), Show (TxSeq era), FromCBOR (Annotator (TxSeq era))) ⇒ ShelleyBasedEra era
- newtype ShelleyLedgerError era = BBodyError (BlockTransitionError era)
- data ShelleyTip proto era = ShelleyTip {
- shelleyTipSlotNo ∷ !SlotNo
- shelleyTipBlockNo ∷ !BlockNo
- shelleyTipHash ∷ !(HeaderHash (ShelleyBlock proto era))
- newtype ShelleyTransition = ShelleyTransitionInfo {}
- data family Ticked st
- castShelleyTip ∷ HeaderHash (ShelleyBlock proto era) ~ HeaderHash (ShelleyBlock proto' era') ⇒ ShelleyTip proto era → ShelleyTip proto' era'
- shelleyLedgerTipPoint ∷ LedgerState (ShelleyBlock proto era) → Point (ShelleyBlock proto era)
- shelleyTipToPoint ∷ WithOrigin (ShelleyTip proto era) → Point (ShelleyBlock proto era)
- data ShelleyLedgerConfig era = ShelleyLedgerConfig {
- shelleyLedgerCompactGenesis ∷ !(CompactGenesis era)
- shelleyLedgerGlobals ∷ !Globals
- shelleyLedgerTranslationContext ∷ !(TranslationContext era)
- mkShelleyLedgerConfig ∷ ShelleyGenesis era → TranslationContext era → EpochInfo (Except PastHorizonException) → MaxMajorProtVer → ShelleyLedgerConfig era
- shelleyEraParams ∷ ShelleyGenesis era → EraParams
- shelleyEraParamsNeverHardForks ∷ ShelleyGenesis era → EraParams
- shelleyLedgerGenesis ∷ ShelleyLedgerConfig era → ShelleyGenesis era
- data ShelleyLedgerEvent era
- = ShelleyLedgerEventBBODY (Event (EraRule "BBODY" era))
- | ShelleyLedgerEventTICK (Event (EraRule "TICK" era))
- data ShelleyReapplyException = ∀ era.Show (BlockTransitionError era) ⇒ ShelleyReapplyException (BlockTransitionError era)
- getPParams ∷ NewEpochState era → PParams era
- decodeShelleyAnnTip ∷ ShelleyCompatible proto era ⇒ Decoder s (AnnTip (ShelleyBlock proto era))
- decodeShelleyLedgerState ∷ ∀ era proto s. ShelleyCompatible proto era ⇒ Decoder s (LedgerState (ShelleyBlock proto era))
- encodeShelleyAnnTip ∷ ShelleyCompatible proto era ⇒ AnnTip (ShelleyBlock proto era) → Encoding
- encodeShelleyHeaderState ∷ ShelleyCompatible proto era ⇒ HeaderState (ShelleyBlock proto era) → Encoding
- encodeShelleyLedgerState ∷ ShelleyCompatible proto era ⇒ LedgerState (ShelleyBlock proto era) → Encoding
Documentation
data family LedgerState blk Source #
Ledger state associated with a block
Instances
class (ShelleyBasedEra era, GetLedgerView era, State (EraRule "PPUP" era) ~ PPUPState era, Default (State (EraRule "PPUP" era)), HasField "_maxBBSize" (PParams era) Natural, HasField "_maxBHSize" (PParams era) Natural, HasField "_maxTxSize" (PParams era) Natural, HasField "_a0" (PParams era) NonNegativeInterval, HasField "_nOpt" (PParams era) Natural, HasField "_rho" (PParams era) UnitInterval, HasField "_tau" (PParams era) UnitInterval, ValidateScript era, FromCBOR (PParams era), ToCBOR (PParams era), HasField "_protocolVersion" (PParamsDelta era) (StrictMaybe ProtVer), FromCBOR (PParamsDelta era), AdditionalGenesisConfig era ~ TranslationContext era, ToCBORGroup (TxSeq era), NoThunks (TranslationContext era), FromCBOR (Annotator (Witnesses era)), ToCBOR (Witnesses era), Eq (TxSeq era), Show (TxSeq era), FromCBOR (Annotator (TxSeq era))) ⇒ ShelleyBasedEra era Source #
The ledger already defines ShelleyBasedEra
as the top-level
constraint on an era, however, consensus often needs some more functionality
than the ledger currently provides.
Either the functionality shouldn't or can't live in the ledger, in which case
it can be part and remain part of ShelleyBasedEra
. Or, the functionality
should live in the ledger, but hasn't yet been added to the ledger, or it
hasn't yet been propagated to this repository, in which case it can be added
to this class until that is the case.
By having the same name as the class defined in ledger, we can, if this class becomes redundant, switch to the ledger-defined one without having to update all the code using it. We can just export the right one from this module.
TODO Currently we include some constraints on the update state which are needed to determine the hard fork point. In the future this should be replaced with an appropriate API - see https://github.com/input-output-hk/ouroboros-network/issues/2890
Minimal complete definition
Instances
newtype ShelleyLedgerError era Source #
Constructors
BBodyError (BlockTransitionError era) |
Instances
data ShelleyTip proto era Source #
Constructors
ShelleyTip | |
Fields
|
Instances
newtype ShelleyTransition Source #
Information required to determine the hard fork point from Shelley to the next ledger
Constructors
ShelleyTransitionInfo | |
Fields
|
Instances
data family Ticked st 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
castShelleyTip ∷ HeaderHash (ShelleyBlock proto era) ~ HeaderHash (ShelleyBlock proto' era') ⇒ ShelleyTip proto era → ShelleyTip proto' era' Source #
shelleyLedgerTipPoint ∷ LedgerState (ShelleyBlock proto era) → Point (ShelleyBlock proto era) Source #
shelleyTipToPoint ∷ WithOrigin (ShelleyTip proto era) → Point (ShelleyBlock proto era) Source #
Ledger config
data ShelleyLedgerConfig era Source #
Constructors
ShelleyLedgerConfig | |
Fields
|
Instances
mkShelleyLedgerConfig ∷ ShelleyGenesis era → TranslationContext era → EpochInfo (Except PastHorizonException) → MaxMajorProtVer → ShelleyLedgerConfig era Source #
shelleyEraParams ∷ ShelleyGenesis era → EraParams Source #
shelleyEraParamsNeverHardForks ∷ ShelleyGenesis era → EraParams Source #
Separate variant of shelleyEraParams
to be used for a Shelley-only chain.
shelleyLedgerGenesis ∷ ShelleyLedgerConfig era → ShelleyGenesis era Source #
Auxiliary
data ShelleyLedgerEvent era Source #
All events emitted by the Shelley ledger API
Constructors
ShelleyLedgerEventBBODY (Event (EraRule "BBODY" era)) | An event emitted when (re)applying a block |
ShelleyLedgerEventTICK (Event (EraRule "TICK" era)) | An event emitted during the chain tick |
data ShelleyReapplyException Source #
Constructors
∀ era.Show (BlockTransitionError era) ⇒ ShelleyReapplyException (BlockTransitionError era) |
Instances
getPParams ∷ NewEpochState era → PParams era Source #
Serialisation
decodeShelleyAnnTip ∷ ShelleyCompatible proto era ⇒ Decoder s (AnnTip (ShelleyBlock proto era)) Source #
decodeShelleyLedgerState ∷ ∀ era proto s. ShelleyCompatible proto era ⇒ Decoder s (LedgerState (ShelleyBlock proto era)) Source #
encodeShelleyAnnTip ∷ ShelleyCompatible proto era ⇒ AnnTip (ShelleyBlock proto era) → Encoding Source #
encodeShelleyHeaderState ∷ ShelleyCompatible proto era ⇒ HeaderState (ShelleyBlock proto era) → Encoding Source #
encodeShelleyLedgerState ∷ ShelleyCompatible proto era ⇒ LedgerState (ShelleyBlock proto era) → Encoding Source #