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

Ouroboros.Consensus.Mempool.Capacity

Description

Mempool capacity, size and transaction size datatypes.

This module also defines how to manually override the mempool capacity.

import           Ouroboros.Consensus.Mempool.Capacity (Capacity)
import qualified Ouroboros.Consensus.Mempool.Capacity as Capacity
Synopsis

Mempool capacity

data MempoolCapacityBytesOverride Source #

An override for the default MempoolCapacityBytes which is 2x the maximum transaction capacity

Constructors

NoMempoolCapacityBytesOverride

Use 2x the maximum transaction capacity of a block. This will change dynamically with the protocol parameters adopted in the current ledger.

MempoolCapacityBytesOverride !ByteSize32

Use the least multiple of the block capacity that is no less than this size.

computeMempoolCapacity ∷ ∀ blk (mk ∷ MapKind). LedgerSupportsMempool blk ⇒ LedgerConfig blk → TickedLedgerState blk mk → MempoolCapacityBytesOverrideTxMeasure blk Source #

If no override is provided, calculate the default mempool capacity as 2x the current ledger's maximum transaction capacity of a block.

If an override is present, reinterpret it as a number of blocks (rounded up), and then simply multiply the ledger's capacity by that number.

mkCapacityBytesOverrideByteSize32MempoolCapacityBytesOverride Source #

Create an override for the mempool capacity using the provided number of bytes.

Mempool Size

data MempoolSize Source #

The size of a mempool.

Constructors

MempoolSize 

Fields

Instances

Instances details
Monoid MempoolSize Source # 
Instance details

Defined in Ouroboros.Consensus.Mempool.Capacity

Semigroup MempoolSize Source # 
Instance details

Defined in Ouroboros.Consensus.Mempool.Capacity

Generic MempoolSize Source # 
Instance details

Defined in Ouroboros.Consensus.Mempool.Capacity

Associated Types

type Rep MempoolSize 
Instance details

Defined in Ouroboros.Consensus.Mempool.Capacity

type Rep MempoolSize = D1 ('MetaData "MempoolSize" "Ouroboros.Consensus.Mempool.Capacity" "ouroboros-consensus-0.26.0.0-inplace" 'False) (C1 ('MetaCons "MempoolSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "msNumTxs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "msNumBytes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteSize32)))
Show MempoolSize Source # 
Instance details

Defined in Ouroboros.Consensus.Mempool.Capacity

Eq MempoolSize Source # 
Instance details

Defined in Ouroboros.Consensus.Mempool.Capacity

NoThunks MempoolSize Source # 
Instance details

Defined in Ouroboros.Consensus.Mempool.Capacity

type Rep MempoolSize Source # 
Instance details

Defined in Ouroboros.Consensus.Mempool.Capacity

type Rep MempoolSize = D1 ('MetaData "MempoolSize" "Ouroboros.Consensus.Mempool.Capacity" "ouroboros-consensus-0.26.0.0-inplace" 'False) (C1 ('MetaCons "MempoolSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "msNumTxs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "msNumBytes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteSize32)))