ouroboros-network
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.TxSubmission.Inbound.V1

Contents

Synopsis

Documentation

txSubmissionInbound Source #

Arguments

:: forall txid tx idx (m :: Type -> Type) err. (Ord txid, NoThunks txid, NoThunks tx, MonadSTM m, MonadThrow m, MonadDelay m) 
=> Tracer m (TraceTxSubmissionInbound txid tx) 
-> TxSubmissionInitDelay 
-> TxSubmissionConfig

configuration, defaultTxSubmissionConfigV1

-> NumTxsToReq

maximum number of txs to request, defaultMaxNumTxsToRequest; it is clamped by clampMaxNumTxsToRequest to the range checked by saneMaxNumTxsToRequest

-> TxSubmissionMempoolReader txid tx idx m 
-> TxSubmissionMempoolWriter txid tx idx m err 
-> TxSubmissionServerPipelined txid tx m () 

defaultMaxNumTxsToRequest :: NumTxsToReq Source #

The default number of txs to request.

maxSaneNumTxsToRequest :: NumTxsToReq Source #

The largest sane number of txs to request: a MsgReplyTxs with that many txs of max_TX_SIZE, each up to const_MAX_TX_SIZE_DISCREPANCY larger, fits within the StTxs size limit. txSubmissionInbound selects txs by count only, without a limit on their size.

saneMaxNumTxsToRequest :: NumTxsToReq -> Bool Source #

Sanity check for the number of txs to request: it must be positive (with `0` the inbound would send empty requests forever) and at most maxSaneNumTxsToRequest (otherwise an honest peer's reply can exceed the StTxs size limit).

clampMaxNumTxsToRequest :: NumTxsToReq -> NumTxsToReq Source #

Clamp the number of txs to request to the range checked by saneMaxNumTxsToRequest.

Re-exports

data TxSubmissionMempoolWriter txid tx idx (m :: Type -> Type) err Source #

The consensus layer functionality that the inbound side of the tx submission logic requires.

This is provided to the tx submission logic by the consensus layer.

Constructors

TxSubmissionMempoolWriter 

Fields

  • txId :: tx -> txid

    Compute the transaction id from a transaction.

    This is used in the protocol handler to verify a full transaction matches a previously given transaction id.

  • mempoolAddTxs :: [tx] -> m ([txid], [(txid, err)])

    Supply a batch of transactions to the mempool. They are either accepted or rejected individually, but in the order supplied.

    Return list of valid tx's added to the mempool and a list of invalid tx's with the corresponding error.

data ProcessedTxCount Source #

Constructors

ProcessedTxCount 

Fields

data TxSubmissionConfig Source #

Shared options between the inbound and outbound side.

Constructors

TxSubmissionConfig 

Fields

  • maxNumUnacknowledgedTxIds :: !NumTxIdsToAck

    maximum number of unacknowledged txids; it MUST be positive, and small enough for a MsgRequestTxs with that many txids to fit within the StIdle size limit (see max_TXID_SIZE). Before NodeToNodeV_16 it is a protocol parameter and must not be changed; since NodeToNodeV_16 it is a local setting.

  • maxNumTxIdsToRequest :: !NumTxIdsToReq

    maximum number of txids an inbound client can request at a time.