Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data family LedgerState blk
- class (EraSegWits era, EraGov era, ApplyTx era, ApplyBlock era, EraTransition 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 "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 {}
- mkShelleyLedgerConfig ∷ ShelleyGenesis (EraCrypto era) → TranslationContext era → EpochInfo (Except PastHorizonException) → 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 ∷ EraGov era ⇒ 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
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
class (EraSegWits era, EraGov era, ApplyTx era, ApplyBlock era, EraTransition 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 "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/IntersectMBO/ouroboros-network/issues/2890
Instances
newtype ShelleyLedgerError era Source #
Instances
data ShelleyTip proto era Source #
ShelleyTip | |
|
Instances
newtype ShelleyTransition Source #
Information required to determine the hard fork point from Shelley to the next ledger
ShelleyTransitionInfo | |
|
Instances
Generic ShelleyTransition Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger type Rep ShelleyTransition ∷ Type → Type # | |
Show ShelleyTransition Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger showsPrec ∷ Int → ShelleyTransition → ShowS # show ∷ ShelleyTransition → String # showList ∷ [ShelleyTransition] → ShowS # | |
Eq ShelleyTransition Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger | |
NoThunks ShelleyTransition Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger | |
type Rep ShelleyTransition Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger type Rep ShelleyTransition = D1 ('MetaData "ShelleyTransition" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-cardano-0.20.0.0-inplace" 'True) (C1 ('MetaCons "ShelleyTransitionInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyAfterVoting") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))) |
data family Ticked st Source #
" Ticked " piece of state, either LedgerState
or ChainDepState
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. There are exactly two methods in the interface
that do that: tickChainDepState
and
applyChainTickLedgerResult
.
Also note that a successful forecast
must equal
forecastFor
(ledgerViewForecastAt
cfg st)
slot
. Thus a
protocolLedgerView
cfg
(applyChainTick
cfg slot st)LedgerView
can only be projected
from a Ticked
state, but cannot itself be ticked.
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 #
ShelleyLedgerConfig | |
|
Instances
mkShelleyLedgerConfig ∷ ShelleyGenesis (EraCrypto era) → TranslationContext era → EpochInfo (Except PastHorizonException) → 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
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 #
∀ era.Show (BlockTransitionError era) ⇒ ShelleyReapplyException (BlockTransitionError era) |
getPParams ∷ EraGov era ⇒ 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 #