ouroboros-consensus-byron-0.1.0.0: Byron ledger integration in the Ouroboros consensus layer
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Byron.Ledger.Mempool

Description

Byron mempool integration

Synopsis

Mempool integration

data family GenTx blk Source #

Generalized transaction

The mempool (and, accordingly, blocks) consist of "generalized transactions"; this could be "proper" transactions (transferring funds) but also other kinds of things such as update proposals, delegations, etc.

Instances

Instances details
SerialiseNodeToNode ByronBlock (GenTx ByronBlock) Source #

No CBOR-in-CBOR, because we check for canonical encodings, which means we can use the recomputed encoding for the annotation.

Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

SerialiseNodeToNode ByronBlock (GenTxId ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

SerialiseNodeToClient ByronBlock (GenTx ByronBlock) Source #

No CBOR-in-CBOR, because we check for canonical encodings, which means we can use the recomputed encoding for the annotation.

Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

SerialiseNodeToClient ByronBlock (GenTxId ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

ShowProxy (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

ShowProxy (TxId (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Eq (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Eq (TxId (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Eq (Validated (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Ord (TxId (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Show (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Show (GenTxId ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Show (Validated (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Generic (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Associated Types

type Rep (GenTx ByronBlock) ∷ TypeType Source #

Generic (Validated (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Associated Types

type Rep (Validated (GenTx ByronBlock)) ∷ TypeType Source #

HasTxId (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Condense (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Condense (GenTxId ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

NoThunks (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Methods

noThunks ∷ Context → GenTx ByronBlockIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → GenTx ByronBlockIO (Maybe ThunkInfo) #

showTypeOfProxy (GenTx ByronBlock) → String #

NoThunks (TxId (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Methods

noThunks ∷ Context → TxId (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → TxId (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

showTypeOfProxy (TxId (GenTx ByronBlock)) → String #

NoThunks (Validated (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Methods

noThunks ∷ Context → Validated (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → Validated (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

showTypeOfProxy (Validated (GenTx ByronBlock)) → String #

data GenTx ByronBlock Source #

Generalized transactions in Byron

This is effectively the same as AMempoolPayload but we cache the transaction ID (a hash).

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

data GenTx ByronBlock
type Rep (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type Rep (Validated (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type Rep (Validated (GenTx ByronBlock)) = D1 ('MetaData "Validated" "Ouroboros.Consensus.Byron.Ledger.Mempool" "ouroboros-consensus-byron-0.1.0.0-inplace" 'True) (C1 ('MetaCons "ValidatedByronTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "forgetValidatedByronTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (GenTx ByronBlock))))
data TxId (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

data TxId (GenTx ByronBlock)
newtype Validated (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

data family TxId tx Source #

A generalized transaction, GenTx, identifier.

Instances

Instances details
SerialiseNodeToNode ByronBlock (GenTxId ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

SerialiseNodeToClient ByronBlock (GenTxId ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

ShowProxy (TxId (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Eq (TxId (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Ord (TxId (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Show (GenTxId ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Condense (GenTxId ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

NoThunks (TxId (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Methods

noThunks ∷ Context → TxId (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → TxId (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

showTypeOfProxy (TxId (GenTx ByronBlock)) → String #

data TxId (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

data TxId (GenTx ByronBlock)

data family Validated x Source #

" Validated " transaction or block

The ledger defines how to validate transactions and blocks. It's possible the type before and after validation may be distinct (eg Alonzo transactions), which originally motivated this family.

We also gain the related benefit that certain interface functions, such as those that reapply blocks, can have a more precise type now. TODO

Similarly, the Node-to-Client mini protocols can explicitly indicate that the client trusts the blocks from the local server, by having the server send Validated blocks to the client. TODO

Note that validation has different implications for a transaction than for a block. In particular, a validated transaction can be " reapplied " to different ledger states, whereas a validated block must only be " reapplied " to the exact same ledger state (eg as part of rebuilding from an on-disk ledger snapshot).

Since the ledger defines validation, see the ledger details for concrete examples of what determines the validity (wrt to a LedgerState) of a transaction and/or block. Example properties include: a transaction's claimed inputs exist and are still unspent, a block carries a sufficient cryptographic signature, etc.

Instances

Instances details
Eq (Validated (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Show (Validated (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Generic (Validated (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Associated Types

type Rep (Validated (GenTx ByronBlock)) ∷ TypeType Source #

NoThunks (Validated (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Methods

noThunks ∷ Context → Validated (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → Validated (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

showTypeOfProxy (Validated (GenTx ByronBlock)) → String #

type Rep (Validated (GenTx ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type Rep (Validated (GenTx ByronBlock)) = D1 ('MetaData "Validated" "Ouroboros.Consensus.Byron.Ledger.Mempool" "ouroboros-consensus-byron-0.1.0.0-inplace" 'True) (C1 ('MetaCons "ValidatedByronTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "forgetValidatedByronTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (GenTx ByronBlock))))
newtype Validated (GenTx ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

Transaction IDs

byronIdDlg ∷ ACertificate ByteString → CertificateId Source #

byronIdProp ∷ AProposal ByteString → UpId Source #

byronIdTx ∷ ATxAux ByteString → TxId Source #

byronIdVote ∷ AVote ByteString → VoteId Source #

Serialisation

decodeByronGenTx ∷ Decoder s (GenTx ByronBlock) Source #

The ByteString annotation will be the canonical encoding.

While the new implementation does not care about canonical encodings, the old one does. When a generalised transaction arrives that is not in its canonical encoding (only the ATxAux of the ByronTx can be produced by nodes that are not under our control), the old implementation will reject it. Therefore, we need to reject them too. See #905.

We use the ledger to check for canonical encodings: the ledger will check whether the signed hash of the transaction (in the case of a ATxAux, the transaction witness) matches the annotated bytestring. Is therefore important that the annotated bytestring be the canonical encoding, not the original, possibly non-canonical encoding.

Low-level API (primarily for testing)

Auxiliary functions

countByronGenTxsByronBlockWord64 Source #

Count all (generalized) transactions in the block

Orphan instances

TxLimits ByronBlock Source # 
Instance details

Associated Types

type TxMeasure ByronBlock Source #

LedgerSupportsMempool ByronBlock Source # 
Instance details

HasTxs ByronBlock Source # 
Instance details

ShowProxy (GenTx ByronBlock) Source # 
Instance details

ShowProxy (TxId (GenTx ByronBlock)) Source # 
Instance details

Eq (GenTx ByronBlock) Source # 
Instance details

Eq (TxId (GenTx ByronBlock)) Source # 
Instance details

Eq (Validated (GenTx ByronBlock)) Source # 
Instance details

Ord (TxId (GenTx ByronBlock)) Source # 
Instance details

Show (GenTx ByronBlock) Source # 
Instance details

Show (GenTxId ByronBlock) Source # 
Instance details

Show (Validated (GenTx ByronBlock)) Source # 
Instance details

Generic (GenTx ByronBlock) Source # 
Instance details

Associated Types

type Rep (GenTx ByronBlock) ∷ TypeType Source #

Generic (Validated (GenTx ByronBlock)) Source # 
Instance details

Associated Types

type Rep (Validated (GenTx ByronBlock)) ∷ TypeType Source #

HasTxId (GenTx ByronBlock) Source # 
Instance details

Condense (GenTx ByronBlock) Source # 
Instance details

Condense (GenTxId ByronBlock) Source # 
Instance details

NoThunks (GenTx ByronBlock) Source # 
Instance details

Methods

noThunks ∷ Context → GenTx ByronBlockIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → GenTx ByronBlockIO (Maybe ThunkInfo) #

showTypeOfProxy (GenTx ByronBlock) → String #

NoThunks (TxId (GenTx ByronBlock)) Source # 
Instance details

Methods

noThunks ∷ Context → TxId (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → TxId (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

showTypeOfProxy (TxId (GenTx ByronBlock)) → String #

NoThunks (Validated (GenTx ByronBlock)) Source # 
Instance details

Methods

noThunks ∷ Context → Validated (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → Validated (GenTx ByronBlock) → IO (Maybe ThunkInfo) #

showTypeOfProxy (Validated (GenTx ByronBlock)) → String #

ShowProxy ApplyMempoolPayloadErr Source # 
Instance details

Methods

showProxyProxy ApplyMempoolPayloadErr → String Source #