Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.ByronSpec.Ledger.Ledger
Synopsis
- newtype ByronSpecLedgerError = ByronSpecLedgerError {}
- initByronSpecLedgerState ∷ ∀ (mk ∷ MapKind). ByronSpecGenesis → LedgerState ByronSpecBlock mk
- data family LedgerState blk (mk ∷ MapKind)
- newtype LedgerTables (l ∷ LedgerStateKind) (mk ∷ MapKind) = LedgerTables {
- getLedgerTables ∷ mk (TxIn l) (TxOut l)
- data family Ticked (st ∷ k) ∷ k
Documentation
newtype ByronSpecLedgerError Source #
Constructors
ByronSpecLedgerError | |
Fields |
Instances
Show ByronSpecLedgerError Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger Methods showsPrec ∷ Int → ByronSpecLedgerError → ShowS # show ∷ ByronSpecLedgerError → String # showList ∷ [ByronSpecLedgerError] → ShowS # | |
Eq ByronSpecLedgerError Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger Methods | |
NoThunks ByronSpecLedgerError Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger |
initByronSpecLedgerState ∷ ∀ (mk ∷ MapKind). ByronSpecGenesis → LedgerState ByronSpecBlock mk Source #
Type family instances
data family LedgerState blk (mk ∷ MapKind) Source #
Ledger state associated with a block
This is the Consensus notion of a Ledger 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 signal that the
expected instantiation is either a LedgerState
or some wrapper over it
(like the ExtLedgerState
).
This type is parametrized over mk ::
to express the
MapKind
LedgerTables
contained in such a LedgerState
. See LedgerTables
for a
more thorough description.
The main operations we can do with a LedgerState
are ticking (defined in
IsLedger
), and applying a block (defined in
ApplyBlock
).
Instances
newtype LedgerTables (l ∷ LedgerStateKind) (mk ∷ MapKind) Source #
The Ledger Tables represent the portion of the data on disk that has been pulled from disk and attached to the in-memory Ledger State or that will eventually be written to disk.
With UTxO-HD and the split of the Ledger ledger state into the in-memory
part and the on-disk part, this splitting was reflected in the new type
parameter added to the (Consensus)
LedgerState
, to which we refer as "the
MapKind" or mk
.
Every LedgerState
(or LedgerState
-like
type, such as the ExtLedgerState
) is
associated with a LedgerTables
and they both share the mk
. They both are
of kind LedgerStateKind
. LedgerTables
is just a way to refer only to a
partial view of the on-disk data without having the rest of the in-memory
LedgerState
in scope.
The mk
can be instantiated to anything that is map-like, i.e. that expects
two type parameters, the key and the value.
Constructors
LedgerTables | |
Fields
|
Instances
(Ord (TxIn l), Eq (TxOut l), Show (TxIn l), Show (TxOut l), NoThunks (TxIn l), NoThunks (TxOut l), MemPack (TxIn l), IndexedMemPack (MemPackIdx l EmptyMK) (TxOut l)) ⇒ HasLedgerTables (LedgerTables l) | |||||
Defined in Ouroboros.Consensus.Ledger.Tables Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ LedgerTables l mk → LedgerTables (LedgerTables l) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ LedgerTables l any → LedgerTables (LedgerTables l) mk → LedgerTables l mk Source # | |||||
Generic (LedgerTables l mk) | |||||
Defined in Ouroboros.Consensus.Ledger.Tables.Basics Associated Types
Methods from ∷ LedgerTables l mk → Rep (LedgerTables l mk) x # to ∷ Rep (LedgerTables l mk) x → LedgerTables l mk # | |||||
Show (mk (TxIn l) (TxOut l)) ⇒ Show (LedgerTables l mk) | |||||
Defined in Ouroboros.Consensus.Ledger.Tables.Basics Methods showsPrec ∷ Int → LedgerTables l mk → ShowS # show ∷ LedgerTables l mk → String # showList ∷ [LedgerTables l mk] → ShowS # | |||||
Eq (mk (TxIn l) (TxOut l)) ⇒ Eq (LedgerTables l mk) | |||||
Defined in Ouroboros.Consensus.Ledger.Tables.Basics Methods (==) ∷ LedgerTables l mk → LedgerTables l mk → Bool # (/=) ∷ LedgerTables l mk → LedgerTables l mk → Bool # | |||||
NoThunks (mk (TxIn l) (TxOut l)) ⇒ NoThunks (LedgerTables l mk) | |||||
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |||||
type TxIn (LedgerTables l) | |||||
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |||||
type TxOut (LedgerTables l) | |||||
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |||||
type Rep (LedgerTables l mk) | |||||
Defined in Ouroboros.Consensus.Ledger.Tables.Basics type Rep (LedgerTables l mk) = D1 ('MetaData "LedgerTables" "Ouroboros.Consensus.Ledger.Tables.Basics" "ouroboros-consensus-0.27.0.0-inplace" 'True) (C1 ('MetaCons "LedgerTables" 'PrefixI 'True) (S1 ('MetaSel ('Just "getLedgerTables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mk (TxIn l) (TxOut l))))) | |||||
type SerializeTablesHint (LedgerTables l ValuesMK) | |||||
Defined in Ouroboros.Consensus.Ledger.Tables | |||||
type InitHint (LedgerTables l ValuesMK) | |||||
type ReadHint (LedgerTables l ValuesMK) | |||||
type WriteHint (LedgerTables l DiffMK) | |||||
data family Ticked (st ∷ k) ∷ k 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
Show (Ticked ()) | |
Bridge m a ⇒ GetTip (Ticked (LedgerState (DualBlock m a))) | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
GetTip (Ticked (LedgerState ByronSpecBlock)) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger Methods getTip ∷ ∀ (mk ∷ MapKind). Ticked (LedgerState ByronSpecBlock) mk → Point (Ticked (LedgerState ByronSpecBlock)) Source # | |
IsLedger (LedgerState blk) ⇒ GetTip (Ticked (ExtLedgerState blk)) | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods getTip ∷ ∀ (mk ∷ MapKind). Ticked (ExtLedgerState blk) mk → Point (Ticked (ExtLedgerState blk)) Source # | |
(Bridge m a, NoThunks (TxOut (LedgerState m)), NoThunks (TxIn (LedgerState m)), Show (TxOut (LedgerState m)), Show (TxIn (LedgerState m)), Eq (TxOut (LedgerState m)), Ord (TxIn (LedgerState m)), MemPack (TxIn (LedgerState m))) ⇒ HasLedgerTables (Ticked (LedgerState (DualBlock m a))) | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (DualBlock m a)) mk → LedgerTables (Ticked (LedgerState (DualBlock m a))) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (DualBlock m a)) any → LedgerTables (Ticked (LedgerState (DualBlock m a))) mk → Ticked (LedgerState (DualBlock m a)) mk Source # | |
HasLedgerTables (Ticked (LedgerState ByronSpecBlock)) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState ByronSpecBlock) mk → LedgerTables (Ticked (LedgerState ByronSpecBlock)) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState ByronSpecBlock) any → LedgerTables (Ticked (LedgerState ByronSpecBlock)) mk → Ticked (LedgerState ByronSpecBlock) mk Source # | |
(HasLedgerTables (Ticked (LedgerState blk)), NoThunks (TxOut (LedgerState blk)), NoThunks (TxIn (LedgerState blk)), Show (TxOut (LedgerState blk)), Show (TxIn (LedgerState blk)), Eq (TxOut (LedgerState blk)), Ord (TxIn (LedgerState blk)), MemPack (TxIn (LedgerState blk))) ⇒ HasLedgerTables (Ticked (ExtLedgerState blk)) | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (ExtLedgerState blk) mk → LedgerTables (Ticked (ExtLedgerState blk)) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (ExtLedgerState blk) any → LedgerTables (Ticked (ExtLedgerState blk)) mk → Ticked (ExtLedgerState blk) mk Source # | |
LedgerTablesAreTrivial (Ticked (LedgerState ByronSpecBlock)) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger Methods convertMapKind ∷ ∀ (mk ∷ MapKind) (mk' ∷ MapKind). Ticked (LedgerState ByronSpecBlock) mk → Ticked (LedgerState ByronSpecBlock) mk' Source # | |
LedgerTablesAreTrivial (Ticked (LedgerState blk)) ⇒ LedgerTablesAreTrivial (Ticked (ExtLedgerState blk)) | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods convertMapKind ∷ ∀ (mk ∷ MapKind) (mk' ∷ MapKind). Ticked (ExtLedgerState blk) mk → Ticked (ExtLedgerState blk) mk' Source # | |
Show (Ticked (LedgerState ByronSpecBlock) mk) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger Methods showsPrec ∷ Int → Ticked (LedgerState ByronSpecBlock) mk → ShowS # show ∷ Ticked (LedgerState ByronSpecBlock) mk → String # showList ∷ [Ticked (LedgerState ByronSpecBlock) mk] → ShowS # | |
Eq (Ticked (LedgerState ByronSpecBlock) mk) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger Methods (==) ∷ Ticked (LedgerState ByronSpecBlock) mk → Ticked (LedgerState ByronSpecBlock) mk → Bool # (/=) ∷ Ticked (LedgerState ByronSpecBlock) mk → Ticked (LedgerState ByronSpecBlock) mk → Bool # | |
NoThunks (Ticked (LedgerState (DualBlock m a)) mk) | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
NoThunks (Ticked (LedgerState ByronSpecBlock) mk) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger Methods noThunks ∷ Context → Ticked (LedgerState ByronSpecBlock) mk → IO (Maybe ThunkInfo) Source # wNoThunks ∷ Context → Ticked (LedgerState ByronSpecBlock) mk → IO (Maybe ThunkInfo) Source # showTypeOf ∷ Proxy (Ticked (LedgerState ByronSpecBlock) mk) → String Source # | |
Show (Ticked (f a)) ⇒ Show (((Ticked ∷ Type → Type) :.: f) a) | |
NoThunks (Ticked (f a)) ⇒ NoThunks (((Ticked ∷ Type → Type) :.: f) a) | |
data Ticked () | |
Defined in Ouroboros.Consensus.Ticked | |
data Ticked (HardForkChainDepState xs ∷ Type) | |
data Ticked (HeaderState blk ∷ Type) | |
Defined in Ouroboros.Consensus.HeaderValidation | |
data Ticked (PBftState c ∷ Type) | |
Defined in Ouroboros.Consensus.Protocol.PBFT | |
newtype Ticked (WrapChainDepState blk ∷ Type) | |
Defined in Ouroboros.Consensus.TypeFamilyWrappers | |
type HeaderHash (Ticked l ∷ k) | |
Defined in Ouroboros.Consensus.Ticked | |
type TxIn (Ticked l) | |
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |
type TxOut (Ticked l) | |
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |
data Ticked (LedgerState (HardForkBlock xs) ∷ MapKind → Type) (mk ∷ MapKind) | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger data Ticked (LedgerState (HardForkBlock xs) ∷ MapKind → Type) (mk ∷ MapKind) = TickedHardForkLedgerState {} | |
data Ticked (LedgerState (DualBlock m a) ∷ MapKind → Type) (mk ∷ MapKind) | |
Defined in Ouroboros.Consensus.Ledger.Dual data Ticked (LedgerState (DualBlock m a) ∷ MapKind → Type) (mk ∷ MapKind) = TickedDualLedgerState {} | |
data Ticked (LedgerState ByronSpecBlock) (mk ∷ MapKind) Source # | |
data Ticked (ExtLedgerState blk ∷ MapKind → Type) (mk ∷ MapKind) | |
Defined in Ouroboros.Consensus.Ledger.Extended data Ticked (ExtLedgerState blk ∷ MapKind → Type) (mk ∷ MapKind) = TickedExtLedgerState {
|
Orphan instances
UpdateLedger ByronSpecBlock Source # | |||||||||
CommonProtocolParams ByronSpecBlock Source # | |||||||||
Methods maxHeaderSize ∷ ∀ (mk ∷ MapKind). LedgerState ByronSpecBlock mk → Word32 Source # maxTxSize ∷ ∀ (mk ∷ MapKind). LedgerState ByronSpecBlock mk → Word32 Source # | |||||||||
GetTip (LedgerState ByronSpecBlock) Source # | |||||||||
Methods getTip ∷ ∀ (mk ∷ MapKind). LedgerState ByronSpecBlock mk → Point (LedgerState ByronSpecBlock) Source # | |||||||||
IsLedger (LedgerState ByronSpecBlock) Source # | |||||||||
Associated Types
| |||||||||
CanStowLedgerTables (LedgerState ByronSpecBlock) Source # | |||||||||
HasLedgerTables (LedgerState ByronSpecBlock) Source # | |||||||||
Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ LedgerState ByronSpecBlock mk → LedgerTables (LedgerState ByronSpecBlock) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ LedgerState ByronSpecBlock any → LedgerTables (LedgerState ByronSpecBlock) mk → LedgerState ByronSpecBlock mk Source # | |||||||||
LedgerTablesAreTrivial (LedgerState ByronSpecBlock) Source # | |||||||||
Methods convertMapKind ∷ ∀ (mk ∷ MapKind) (mk' ∷ MapKind). LedgerState ByronSpecBlock mk → LedgerState ByronSpecBlock mk' Source # | |||||||||
ApplyBlock (LedgerState ByronSpecBlock) ByronSpecBlock Source # | |||||||||
Methods applyBlockLedgerResultWithValidation ∷ ValidationPolicy → ComputeLedgerEvents → LedgerCfg (LedgerState ByronSpecBlock) → ByronSpecBlock → Ticked (LedgerState ByronSpecBlock) ValuesMK → Except (LedgerErr (LedgerState ByronSpecBlock)) (LedgerResult (LedgerState ByronSpecBlock) (LedgerState ByronSpecBlock DiffMK)) Source # applyBlockLedgerResult ∷ ComputeLedgerEvents → LedgerCfg (LedgerState ByronSpecBlock) → ByronSpecBlock → Ticked (LedgerState ByronSpecBlock) ValuesMK → Except (LedgerErr (LedgerState ByronSpecBlock)) (LedgerResult (LedgerState ByronSpecBlock) (LedgerState ByronSpecBlock DiffMK)) Source # reapplyBlockLedgerResult ∷ ComputeLedgerEvents → LedgerCfg (LedgerState ByronSpecBlock) → ByronSpecBlock → Ticked (LedgerState ByronSpecBlock) ValuesMK → LedgerResult (LedgerState ByronSpecBlock) (LedgerState ByronSpecBlock DiffMK) Source # getBlockKeySets ∷ ByronSpecBlock → LedgerTables (LedgerState ByronSpecBlock) KeysMK Source # | |||||||||
Generic (LedgerState ByronSpecBlock mk) Source # | |||||||||
Associated Types
Methods from ∷ LedgerState ByronSpecBlock mk → Rep (LedgerState ByronSpecBlock mk) x # to ∷ Rep (LedgerState ByronSpecBlock mk) x → LedgerState ByronSpecBlock mk # | |||||||||
Show (LedgerState ByronSpecBlock mk) Source # | |||||||||
Methods showsPrec ∷ Int → LedgerState ByronSpecBlock mk → ShowS # show ∷ LedgerState ByronSpecBlock mk → String # showList ∷ [LedgerState ByronSpecBlock mk] → ShowS # | |||||||||
Eq (LedgerState ByronSpecBlock mk) Source # | |||||||||
Methods (==) ∷ LedgerState ByronSpecBlock mk → LedgerState ByronSpecBlock mk → Bool # (/=) ∷ LedgerState ByronSpecBlock mk → LedgerState ByronSpecBlock mk → Bool # | |||||||||
NoThunks (LedgerState ByronSpecBlock mk) Source # | |||||||||
Methods noThunks ∷ Context → LedgerState ByronSpecBlock mk → IO (Maybe ThunkInfo) Source # wNoThunks ∷ Context → LedgerState ByronSpecBlock mk → IO (Maybe ThunkInfo) Source # showTypeOf ∷ Proxy (LedgerState ByronSpecBlock mk) → String Source # | |||||||||
GetTip (Ticked (LedgerState ByronSpecBlock)) Source # | |||||||||
Methods getTip ∷ ∀ (mk ∷ MapKind). Ticked (LedgerState ByronSpecBlock) mk → Point (Ticked (LedgerState ByronSpecBlock)) Source # | |||||||||
HasLedgerTables (Ticked (LedgerState ByronSpecBlock)) Source # | |||||||||
Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState ByronSpecBlock) mk → LedgerTables (Ticked (LedgerState ByronSpecBlock)) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState ByronSpecBlock) any → LedgerTables (Ticked (LedgerState ByronSpecBlock)) mk → Ticked (LedgerState ByronSpecBlock) mk Source # | |||||||||
LedgerTablesAreTrivial (Ticked (LedgerState ByronSpecBlock)) Source # | |||||||||
Methods convertMapKind ∷ ∀ (mk ∷ MapKind) (mk' ∷ MapKind). Ticked (LedgerState ByronSpecBlock) mk → Ticked (LedgerState ByronSpecBlock) mk' Source # | |||||||||
Serialise (LedgerState ByronSpecBlock mk) Source # | |||||||||
Methods encode ∷ LedgerState ByronSpecBlock mk → Encoding Source # decode ∷ Decoder s (LedgerState ByronSpecBlock mk) Source # encodeList ∷ [LedgerState ByronSpecBlock mk] → Encoding Source # decodeList ∷ Decoder s [LedgerState ByronSpecBlock mk] Source # | |||||||||
IndexedMemPack (LedgerState ByronSpecBlock EmptyMK) Void Source # | |||||||||
Methods indexedPackedByteCount ∷ LedgerState ByronSpecBlock EmptyMK → Void → Int Source # indexedPackM ∷ LedgerState ByronSpecBlock EmptyMK → Void → Pack s () Source # indexedUnpackM ∷ Buffer b ⇒ LedgerState ByronSpecBlock EmptyMK → Unpack b Void Source # indexedTypeName ∷ LedgerState ByronSpecBlock EmptyMK → String Source # | |||||||||
Show (Ticked (LedgerState ByronSpecBlock) mk) Source # | |||||||||
Methods showsPrec ∷ Int → Ticked (LedgerState ByronSpecBlock) mk → ShowS # show ∷ Ticked (LedgerState ByronSpecBlock) mk → String # showList ∷ [Ticked (LedgerState ByronSpecBlock) mk] → ShowS # | |||||||||
Eq (Ticked (LedgerState ByronSpecBlock) mk) Source # | |||||||||
Methods (==) ∷ Ticked (LedgerState ByronSpecBlock) mk → Ticked (LedgerState ByronSpecBlock) mk → Bool # (/=) ∷ Ticked (LedgerState ByronSpecBlock) mk → Ticked (LedgerState ByronSpecBlock) mk → Bool # | |||||||||
NoThunks (Ticked (LedgerState ByronSpecBlock) mk) Source # | |||||||||
Methods noThunks ∷ Context → Ticked (LedgerState ByronSpecBlock) mk → IO (Maybe ThunkInfo) Source # wNoThunks ∷ Context → Ticked (LedgerState ByronSpecBlock) mk → IO (Maybe ThunkInfo) Source # showTypeOf ∷ Proxy (Ticked (LedgerState ByronSpecBlock) mk) → String Source # |