| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Network.TxSubmission.Inbound.V1
Contents
Synopsis
- txSubmissionInbound :: 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 -> NumTxsToReq -> TxSubmissionMempoolReader txid tx idx m -> TxSubmissionMempoolWriter txid tx idx m err -> TxSubmissionServerPipelined txid tx m ()
- defaultTxSubmissionConfigV1 :: TxSubmissionConfig
- defaultMaxNumTxsToRequest :: NumTxsToReq
- maxSaneNumTxsToRequest :: NumTxsToReq
- saneMaxNumTxsToRequest :: NumTxsToReq -> Bool
- clampMaxNumTxsToRequest :: NumTxsToReq -> NumTxsToReq
- data TxSubmissionInitDelay
- data TxSubmissionMempoolWriter txid tx idx (m :: Type -> Type) err = TxSubmissionMempoolWriter {
- txId :: tx -> txid
- mempoolAddTxs :: [tx] -> m ([txid], [(txid, err)])
- data TraceTxSubmissionInbound txid tx
- = TraceTxSubmissionCollected [txid]
- | TraceTxSubmissionProcessed ProcessedTxCount
- | TraceTxInboundCanRequestMoreTxs Int
- | TraceTxInboundCannotRequestMoreTxs Int
- | TraceTxInboundAddedToMempool [txid] DiffTime
- | TraceTxInboundRejectedFromMempool [txid] DiffTime
- | TraceTxInboundError TxSubmissionProtocolError
- | TraceTxInboundRequestTxs [txid]
- | TraceTxInboundMaxNumTxsToRequestClamped NumTxsToReq
- | TraceTxInboundTerminated
- data TxSubmissionProtocolError
- = ProtocolErrorTxNotRequested
- | ProtocolErrorTxIdsNotRequested
- | (Typeable txid, Show txid, Eq txid) => ProtocolErrorTxSizeError [(txid, SizeInBytes, SizeInBytes)]
- | (Typeable txid, Show txid, Eq txid) => ProtocolErrorTxSizeTooLarge [(txid, SizeInBytes)]
- data ProcessedTxCount = ProcessedTxCount {
- ptxcAccepted :: Int
- ptxcRejected :: Int
- ptxcScore :: Double
- data TxSubmissionConfig = TxSubmissionConfig {
- maxNumUnacknowledgedTxIds :: !NumTxIdsToAck
- maxNumTxIdsToRequest :: !NumTxIdsToReq
Documentation
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, |
| -> NumTxsToReq | maximum number of txs to request, |
| -> TxSubmissionMempoolReader txid tx idx m | |
| -> TxSubmissionMempoolWriter txid tx idx m err | |
| -> TxSubmissionServerPipelined txid tx m () |
defaultTxSubmissionConfigV1 :: TxSubmissionConfig Source #
TxSubmissionConfig for TxSubmissionLogicV1.
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 TxSubmissionInitDelay Source #
Constructors
| TxSubmissionInitDelay DiffTime | |
| NoTxSubmissionInitDelay |
Instances
| Show TxSubmissionInitDelay Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Types Methods showsPrec :: Int -> TxSubmissionInitDelay -> ShowS # show :: TxSubmissionInitDelay -> String # showList :: [TxSubmissionInitDelay] -> ShowS # | |
| Eq TxSubmissionInitDelay Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Types Methods (==) :: TxSubmissionInitDelay -> TxSubmissionInitDelay -> Bool # (/=) :: TxSubmissionInitDelay -> TxSubmissionInitDelay -> Bool # | |
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
| |
data TraceTxSubmissionInbound txid tx Source #
Constructors
| TraceTxSubmissionCollected [txid] | Number of transactions just about to be inserted. |
| TraceTxSubmissionProcessed ProcessedTxCount | Just processed transaction pass/fail breakdown. |
| TraceTxInboundCanRequestMoreTxs Int | |
| TraceTxInboundCannotRequestMoreTxs Int | |
| TraceTxInboundAddedToMempool [txid] DiffTime | |
| TraceTxInboundRejectedFromMempool [txid] DiffTime | |
| TraceTxInboundError TxSubmissionProtocolError | |
| TraceTxInboundRequestTxs [txid] | |
| TraceTxInboundMaxNumTxsToRequestClamped NumTxsToReq | |
| TraceTxInboundTerminated | Server received |
Instances
| Show txid => Show (TraceTxSubmissionInbound txid tx) Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Types Methods showsPrec :: Int -> TraceTxSubmissionInbound txid tx -> ShowS # show :: TraceTxSubmissionInbound txid tx -> String # showList :: [TraceTxSubmissionInbound txid tx] -> ShowS # | |
| Eq txid => Eq (TraceTxSubmissionInbound txid tx) Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Types Methods (==) :: TraceTxSubmissionInbound txid tx -> TraceTxSubmissionInbound txid tx -> Bool # (/=) :: TraceTxSubmissionInbound txid tx -> TraceTxSubmissionInbound txid tx -> Bool # | |
data TxSubmissionProtocolError Source #
Constructors
| ProtocolErrorTxNotRequested | |
| ProtocolErrorTxIdsNotRequested | |
| (Typeable txid, Show txid, Eq txid) => ProtocolErrorTxSizeError [(txid, SizeInBytes, SizeInBytes)] | a list of txid for which the received size and advertised size didn't match. |
| (Typeable txid, Show txid, Eq txid) => ProtocolErrorTxSizeTooLarge [(txid, SizeInBytes)] | a list of txids advertised with a size above |
Instances
data ProcessedTxCount Source #
Constructors
| ProcessedTxCount | |
Fields
| |
Instances
| Show ProcessedTxCount Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Types Methods showsPrec :: Int -> ProcessedTxCount -> ShowS # show :: ProcessedTxCount -> String # showList :: [ProcessedTxCount] -> ShowS # | |
| Eq ProcessedTxCount Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Types Methods (==) :: ProcessedTxCount -> ProcessedTxCount -> Bool # (/=) :: ProcessedTxCount -> ProcessedTxCount -> Bool # | |
data TxSubmissionConfig Source #
Shared options between the inbound and outbound side.
Constructors
| TxSubmissionConfig | |
Fields
| |
Instances
| NFData TxSubmissionConfig Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods rnf :: TxSubmissionConfig -> () # | |
| Show TxSubmissionConfig Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods showsPrec :: Int -> TxSubmissionConfig -> ShowS # show :: TxSubmissionConfig -> String # showList :: [TxSubmissionConfig] -> ShowS # | |
| Eq TxSubmissionConfig Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods (==) :: TxSubmissionConfig -> TxSubmissionConfig -> Bool # (/=) :: TxSubmissionConfig -> TxSubmissionConfig -> Bool # | |