| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Mempool.Update
Description
Operations that update the mempool. They are internally divided in the pure and impure sides of the operation.
Synopsis
- data WhichAddTx (f ∷ Type → Type) where
- implAddTx ∷ (IOLike m, MonadTimer m, LedgerSupportsMempool blk, HasTxId (GenTx blk)) ⇒ MempoolEnv m blk → WhichAddTx f → AddTxOnBehalfOf → GenTx blk → m (f (MempoolAddTxResult blk))
- implRemoveTxsEvenIfValid ∷ (IOLike m, LedgerSupportsMempool blk, HasTxId (GenTx blk)) ⇒ MempoolEnv m blk → NonEmpty (GenTxId blk) → m ()
- implSyncWithLedger ∷ (IOLike m, LedgerSupportsMempool blk, ValidateEnvelope blk, HasTxId (GenTx blk)) ⇒ (InternalState blk → r) → MempoolEnv m blk → m r
Documentation
data WhichAddTx (f ∷ Type → Type) where Source #
A GADT that enables the shared implementation of addTx and testTryAddTx.
Constructors
| ProductionAddTx ∷ WhichAddTx Identity | |
| TestingAddTx ∷ !DiffTime → WhichAddTx Maybe | The argument unique to The |
Arguments
| ∷ (IOLike m, MonadTimer m, LedgerSupportsMempool blk, HasTxId (GenTx blk)) | |
| ⇒ MempoolEnv m blk | |
| → WhichAddTx f | |
| → AddTxOnBehalfOf | Whether we're acting on behalf of a remote peer or a local client. |
| → GenTx blk | The transaction to add to the mempool. |
| → m (f (MempoolAddTxResult blk)) |
Add a single transaction to the mempool.
If there is no space, then the ProductionAddTx caller will block until
there space, and try again, repeatedly until it succeeds. It only releases
the lock when this loop terminates.
If there is no space, the TestingAddTx caller will immediately return
Nothing.
implRemoveTxsEvenIfValid ∷ (IOLike m, LedgerSupportsMempool blk, HasTxId (GenTx blk)) ⇒ MempoolEnv m blk → NonEmpty (GenTxId blk) → m () Source #
See removeTxsEvenIfValid.
Arguments
| ∷ (IOLike m, LedgerSupportsMempool blk, ValidateEnvelope blk, HasTxId (GenTx blk)) | |
| ⇒ (InternalState blk → r) | This argument is only to be able to acquire a snapshot in the same
atomically block as the re-sync when testing the mempool in the QSM
parallel tests. We could instead always compute a snapshot and ignore it in
the common case, but it seems acceptable to not even create the thunk for
it. This will be set to |
| → MempoolEnv m blk | |
| → m r |
See syncWithLedger.