ouroboros-consensus-0.26.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Ledger.Tables.Basics

Synopsis

Kinds

For convenience' sake, we define these kinds which convey the intended instantiation for the type variables.

type MapKind = TypeTypeType Source #

Something that holds two types, which intend to represent keys and values.

Ledger tables

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

Instances details
(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) Source # 
Instance details

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 #

(∀ k v. LedgerTableConstraints' l k v ⇒ Monoid (mk k v), LedgerTableConstraints l) ⇒ Monoid (LedgerTables l mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Combinators

Methods

memptyLedgerTables l mk #

mappendLedgerTables l mk → LedgerTables l mk → LedgerTables l mk #

mconcat ∷ [LedgerTables l mk] → LedgerTables l mk #

(∀ k v. LedgerTableConstraints' l k v ⇒ Semigroup (mk k v), LedgerTableConstraints l) ⇒ Semigroup (LedgerTables l mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Combinators

Methods

(<>)LedgerTables l mk → LedgerTables l mk → LedgerTables l mk #

sconcatNonEmpty (LedgerTables l mk) → LedgerTables l mk #

stimesIntegral b ⇒ b → LedgerTables l mk → LedgerTables l mk #

Generic (LedgerTables l mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

Associated Types

type Rep (LedgerTables l mk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type Rep (LedgerTables l mk) = D1 ('MetaData "LedgerTables" "Ouroboros.Consensus.Ledger.Tables.Basics" "ouroboros-consensus-0.26.0.0-inplace" 'True) (C1 ('MetaCons "LedgerTables" 'PrefixI 'True) (S1 ('MetaSel ('Just "getLedgerTables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mk (TxIn l) (TxOut l)))))

Methods

fromLedgerTables l mk → Rep (LedgerTables l mk) x #

toRep (LedgerTables l mk) x → LedgerTables l mk #

Show (mk (TxIn l) (TxOut l)) ⇒ Show (LedgerTables l mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

Methods

showsPrecIntLedgerTables l mk → ShowS #

showLedgerTables l mk → String #

showList ∷ [LedgerTables l mk] → ShowS #

Eq (mk (TxIn l) (TxOut l)) ⇒ Eq (LedgerTables l mk) Source # 
Instance details

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) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type TxIn (LedgerTables l) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type TxIn (LedgerTables l) = TxIn l
type TxOut (LedgerTables l) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type TxOut (LedgerTables l) = TxOut l
type Rep (LedgerTables l mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type Rep (LedgerTables l mk) = D1 ('MetaData "LedgerTables" "Ouroboros.Consensus.Ledger.Tables.Basics" "ouroboros-consensus-0.26.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) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables

type InitHint (LedgerTables l ValuesMK) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.API

type ReadHint (LedgerTables l ValuesMK) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.API

type WriteHint (LedgerTables l DiffMK) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.API

type family MemPackIdx (l ∷ LedgerStateKind) (mk ∷ MapKind) where ... Source #

Auxiliary information for IndexedMemPack.

Equations

MemPackIdx (LedgerTables l) mk = MemPackIdx l mk 
MemPackIdx (Ticked l) mk = MemPackIdx l mk 
MemPackIdx l mk = l mk 

type SameUtxoTypes (l ∷ LedgerStateKind) (l' ∷ LedgerStateKind) = (TxIn l ~ TxIn l', TxOut l ~ TxOut l') Source #

type family TxIn (l ∷ LedgerStateKind) Source #

Each LedgerState instance will have the notion of a TxIn for the tables.

This will change once there is more than one table.

Instances

Instances details
type TxIn (LedgerState (HardForkBlock xs)) Source #

Must be the CannonicalTxIn type, but this will probably change in the future to NS WrapTxIn xs. See HasCanonicalTxIn.

Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type TxIn (LedgerState (DualBlock m a)) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

type TxIn (ExtLedgerState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

type TxIn (ExtLedgerState blk) = TxIn (LedgerState blk)
type TxIn (TrivialLedgerTables l) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables

type TxIn (LedgerTables l) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type TxIn (LedgerTables l) = TxIn l
type TxIn (Ticked l) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type TxIn (Ticked l) = TxIn l

type family TxOut (l ∷ LedgerStateKind) Source #

Each LedgerState instance will have the notion of a TxOut for the tables.

This will change once there is more than one table.

Instances

Instances details
type TxOut (LedgerState (HardForkBlock xs)) Source #

Must be the HardForkTxOut type

Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type TxOut (LedgerState (DualBlock m a)) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

type TxOut (ExtLedgerState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

type TxOut (TrivialLedgerTables l) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables

type TxOut (LedgerTables l) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type TxOut (LedgerTables l) = TxOut l
type TxOut (Ticked l) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type TxOut (Ticked l) = TxOut l

castLedgerTables ∷ ∀ (l ∷ LedgerStateKind) (l' ∷ LedgerStateKind) (mk ∷ MapKind). SameUtxoTypes l l' ⇒ LedgerTables l mk → LedgerTables l' mk Source #