| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Byron.Ledger.Mempool
Description
Byron mempool integration
Synopsis
- data family GenTx blk
- data family TxId tx
- byronIdTx :: ATxAux ByteString -> TxId
- byronIdDlg :: ACertificate ByteString -> CertificateId
- byronIdProp :: AProposal ByteString -> UpId
- byronIdVote :: AVote ByteString -> VoteId
- encodeByronGenTx :: GenTx ByronBlock -> Encoding
- decodeByronGenTx :: Decoder s (GenTx ByronBlock)
- encodeByronGenTxId :: GenTxId ByronBlock -> Encoding
- decodeByronGenTxId :: Decoder s (GenTxId ByronBlock)
- encodeByronApplyTxError :: ApplyTxErr ByronBlock -> Encoding
- decodeByronApplyTxError :: Decoder s (ApplyTxErr ByronBlock)
- toMempoolPayload :: GenTx ByronBlock -> AMempoolPayload ByteString
- fromMempoolPayload :: AMempoolPayload ByteString -> GenTx ByronBlock
- countByronGenTxs :: ByronBlock -> Word64
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
A generalized transaction, GenTx, identifier.
Instances
Transaction IDs
byronIdProp :: AProposal ByteString -> UpId 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
countByronGenTxs :: ByronBlock -> Word64 Source #
Count all (generalized) transactions in the block