Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Shelley.Ledger.Mempool
Description
Shelley mempool integration
Synopsis
- data family GenTx blk
- newtype ApplyTxError era = ApplyTxError [PredicateFailure (EraRule "LEDGER" era)]
- data family TxId tx
- data family Validated x
- data WithTop a
- fixedBlockBodyOverhead :: Num a => a
- mkShelleyTx :: forall era proto. ShelleyBasedEra era => Tx era -> GenTx (ShelleyBlock proto era)
- mkShelleyValidatedTx :: forall era proto. ShelleyBasedEra era => Validated (Tx era) -> Validated (GenTx (ShelleyBlock proto era))
- perTxOverhead :: Num a => a
- data AlonzoMeasure = AlonzoMeasure {}
- fromExUnits :: ExUnits -> ExUnits' (WithTop Natural)
Documentation
Instances
newtype ApplyTxError era #
Constructors
ApplyTxError [PredicateFailure (EraRule "LEDGER" era)] |
Instances
Show (PredicateFailure (EraRule "LEDGER" era)) => Show (ApplyTxError era) | |
Defined in Cardano.Ledger.Shelley.API.Mempool | |
(Era era, DecCBOR (PredicateFailure (EraRule "LEDGER" era))) => FromCBOR (ApplyTxError era) | |
Defined in Cardano.Ledger.Shelley.API.Mempool | |
(Era era, EncCBOR (PredicateFailure (EraRule "LEDGER" era))) => ToCBOR (ApplyTxError era) | |
Defined in Cardano.Ledger.Shelley.API.Mempool Methods toCBOR :: ApplyTxError era -> Encoding encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (ApplyTxError era) -> Size encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [ApplyTxError era] -> Size | |
(Era era, DecCBOR (PredicateFailure (EraRule "LEDGER" era))) => DecCBOR (ApplyTxError era) | |
Defined in Cardano.Ledger.Shelley.API.Mempool Methods decCBOR :: Decoder s (ApplyTxError era) dropCBOR :: Proxy (ApplyTxError era) -> Decoder s () label :: Proxy (ApplyTxError era) -> Text | |
(Era era, EncCBOR (PredicateFailure (EraRule "LEDGER" era))) => EncCBOR (ApplyTxError era) | |
Defined in Cardano.Ledger.Shelley.API.Mempool Methods encCBOR :: ApplyTxError era -> Encoding encodedSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy (ApplyTxError era) -> Size encodedListSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy [ApplyTxError era] -> Size | |
Eq (PredicateFailure (EraRule "LEDGER" era)) => Eq (ApplyTxError era) | |
Defined in Cardano.Ledger.Shelley.API.Mempool Methods (==) :: ApplyTxError era -> ApplyTxError era -> Bool Source # (/=) :: ApplyTxError era -> ApplyTxError era -> Bool Source # | |
Typeable era => ShowProxy (ApplyTxError era :: TYPE LiftedRep) | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool Methods showProxy :: Proxy (ApplyTxError era) -> String | |
ShelleyBasedEra era => SerialiseNodeToClient (ShelleyBlock proto era) (ApplyTxError era) |
|
Defined in Ouroboros.Consensus.Shelley.Node.Serialisation Methods encodeNodeToClient :: CodecConfig (ShelleyBlock proto era) -> BlockNodeToClientVersion (ShelleyBlock proto era) -> ApplyTxError era -> Encoding decodeNodeToClient :: CodecConfig (ShelleyBlock proto era) -> BlockNodeToClientVersion (ShelleyBlock proto era) -> forall s. Decoder s (ApplyTxError era) |
Instances
Instances
Add a unique top element to a lattice.
TODO This should be relocated to `cardano-base:Data.Measure'.
Instances
Generic (WithTop a) Source # | |
Show a => Show (WithTop a) Source # | |
Eq a => Eq (WithTop a) Source # | |
Ord a => Ord (WithTop a) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool | |
Measure a => BoundedMeasure (WithTop a) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool | |
Measure a => Measure (WithTop a) Source # | |
type Rep (WithTop a) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool type Rep (WithTop a) = D1 ('MetaData "WithTop" "Ouroboros.Consensus.Shelley.Ledger.Mempool" "ouroboros-consensus-cardano-0.12.1.0-B7PPTiiOqdjFK3zhRUwDA9" 'False) (C1 ('MetaCons "NotTop" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Top" 'PrefixI 'False) (U1 :: Type -> Type)) |
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
.
mkShelleyTx :: forall era proto. ShelleyBasedEra era => Tx era -> GenTx (ShelleyBlock proto era) Source #
mkShelleyValidatedTx :: forall era proto. ShelleyBasedEra era => Validated (Tx era) -> Validated (GenTx (ShelleyBlock proto era)) Source #
perTxOverhead :: Num a => a Source #
Exported for tests
data AlonzoMeasure Source #
Constructors
AlonzoMeasure | |
Instances
fromExUnits :: ExUnits -> ExUnits' (WithTop Natural) Source #