Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Shelley.Ledger.Ledger
Synopsis
- data family LedgerState blk
- class (EraSegWits era, EraGovernance era, ApplyTx era, ApplyBlock era, CanStartFromGenesis era, GetLedgerView era, NoThunks (StashedAVVMAddresses era), EncCBOR (StashedAVVMAddresses era), DecCBOR (StashedAVVMAddresses era), Show (StashedAVVMAddresses era), Eq (StashedAVVMAddresses era), DecCBOR (PredicateFailure (EraRule "LEDGER" era)), EncCBOR (PredicateFailure (EraRule "LEDGER" era)), DecCBOR (PredicateFailure (EraRule "DELEGS" era)), EncCBOR (PredicateFailure (EraRule "DELEGS" era)), DecCBOR (PredicateFailure (EraRule "UTXOW" era)), EncCBOR (PredicateFailure (EraRule "UTXOW" era)), DSignable (EraCrypto era) (Hash (EraCrypto era) EraIndependentTxBody), NoThunks (PredicateFailure (EraRule "BBODY" era)), NoThunks (TranslationContext 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 (EraCrypto era))
- shelleyLedgerGlobals ∷ !Globals
- shelleyLedgerTranslationContext ∷ !(TranslationContext era)
- mkShelleyLedgerConfig ∷ ShelleyGenesis (EraCrypto era) → TranslationContext era → EpochInfo (Except PastHorizonException) → MaxMajorProtVer → ShelleyLedgerConfig era
- shelleyEraParams ∷ ShelleyGenesis c → EraParams
- shelleyEraParamsNeverHardForks ∷ ShelleyGenesis c → EraParams
- shelleyLedgerGenesis ∷ ShelleyLedgerConfig era → ShelleyGenesis (EraCrypto 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 (EraSegWits era, EraGovernance era, ApplyTx era, ApplyBlock era, CanStartFromGenesis era, GetLedgerView era, NoThunks (StashedAVVMAddresses era), EncCBOR (StashedAVVMAddresses era), DecCBOR (StashedAVVMAddresses era), Show (StashedAVVMAddresses era), Eq (StashedAVVMAddresses era), DecCBOR (PredicateFailure (EraRule "LEDGER" era)), EncCBOR (PredicateFailure (EraRule "LEDGER" era)), DecCBOR (PredicateFailure (EraRule "DELEGS" era)), EncCBOR (PredicateFailure (EraRule "DELEGS" era)), DecCBOR (PredicateFailure (EraRule "UTXOW" era)), EncCBOR (PredicateFailure (EraRule "UTXOW" era)), DSignable (EraCrypto era) (Hash (EraCrypto era) EraIndependentTxBody), NoThunks (PredicateFailure (EraRule "BBODY" era)), NoThunks (TranslationContext era)) ⇒ ShelleyBasedEra era Source #
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.
If this class becomes redundant, We can move it to ledger and re-export it from here.
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 (EraCrypto era) → TranslationContext era → EpochInfo (Except PastHorizonException) → MaxMajorProtVer → ShelleyLedgerConfig era Source #
shelleyEraParamsNeverHardForks ∷ ShelleyGenesis c → EraParams Source #
Separate variant of shelleyEraParams
to be used for a Shelley-only chain.
shelleyLedgerGenesis ∷ ShelleyLedgerConfig era → ShelleyGenesis (EraCrypto 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 #