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

Ouroboros.Consensus.Mempool.Impl

Description

Monadic side of the Mempool implementation.

Using the functions defined in Ouroboros.Consensus.Mempool.Impl.Pure, a dedicated constructor openMempool is provided to encapsulate the mempool functionality.

The implementation is based on a MempoolEnv that captures the relevant variables to manage the mempool and is then used to craft functions that conform to the Mempool datatype API.

The operations performed on the Mempool are written in a pure fashion in Ouroboros.Consensus.Mempool.Impl.Pure.

Synopsis

Documentation

openMempool ∷ (IOLike m, LedgerSupportsMempool blk, HasTxId (GenTx blk), ValidateEnvelope blk) ⇒ ResourceRegistry m → LedgerInterface m blk → LedgerConfig blk → MempoolCapacityBytesOverride → Tracer m (TraceEventMempool blk) → (GenTx blk → TxSizeInBytes) → m (Mempool m blk TicketNo) Source #

Create a Mempool m blk TicketNo in m to manipulate the mempool. It will also fork a thread that syncs the mempool and the ledger when the ledger changes.

For testing purposes

data LedgerInterface m blk Source #

Abstract interface needed to run a Mempool.

Constructors

LedgerInterface 

openMempoolWithoutSyncThread ∷ (IOLike m, LedgerSupportsMempool blk, HasTxId (GenTx blk), ValidateEnvelope blk) ⇒ LedgerInterface m blk → LedgerConfig blk → MempoolCapacityBytesOverride → Tracer m (TraceEventMempool blk) → (GenTx blk → TxSizeInBytes) → m (Mempool m blk TicketNo) Source #

Unlike openMempool, this function does not fork a background thread that synchronises with the ledger state whenever the later changes.

Intended for testing purposes.