Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Shelley.Ledger.Mempool
Contents
Description
Shelley mempool integration
Synopsis
- data ApplyTxError era = ApplyTxError [PredicateFailure (LEDGERS era)]
- data family GenTx blk
- data family TxId tx
- mkShelleyTx :: ShelleyBasedEra era => Tx era -> GenTx (ShelleyBlock era)
- fixedBlockBodyOverhead :: Num a => a
- perTxOverhead :: Num a => a
Documentation
data ApplyTxError era Source #
Constructors
ApplyTxError [PredicateFailure (LEDGERS era)] |
Instances
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
mkShelleyTx :: ShelleyBasedEra era => Tx era -> GenTx (ShelleyBlock era) Source #
fixedBlockBodyOverhead :: Num a => a Source #
txInBlockSize
is used to estimate how many transactions we can grab from
the Mempool to put into the block we are going to forge without exceeding
the maximum block body size according to the ledger. If we exceed that
limit, we will have forged a block that is invalid according to the ledger.
We ourselves won't even adopt it, causing us to lose our slot, something we
must try to avoid.
For this reason it is better to overestimate the size of a transaction than to underestimate. The only downside is that we maybe could have put one (or more?) transactions extra in that block.
As the sum of the serialised transaction sizes is not equal to the size of
the serialised block body (TxSeq
) consisting of those transactions
(see cardano-node#1545 for an example), we account for some extra overhead
per transaction as a safety margin.
Also see perTxOverhead
.
perTxOverhead :: Num a => a Source #