| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Network.TxSubmission.Inbound.V2.Policy
Contents
Synopsis
- data TxDecisionPolicy = TxDecisionPolicy {
- txsSizeInflightPerPeer :: !SizeInBytes
- txsSizePerBatch :: !SizeInBytes
- maxOutstandingTxBatchesPerPeer :: !Int
- txInflightMultiplicity :: !Int
- bufferedTxsMinLifetime :: !DiffTime
- scoreRate :: !Double
- scoreMax :: !Double
- scoreAcceptDecrement :: !Double
- interTxSpace :: !DiffTime
- inflightTimeout :: !DiffTime
- maxPeerClaimDelay :: !DiffTime
- disablePipelinedTxIdRequests :: !Bool
- mkTxDecisionPolicy :: TxSubmissionConfig -> Either TxConfigurationError TxDecisionPolicy
- saneTxDecisionPolicy :: TxDecisionPolicy -> TxSubmissionConfig -> Either TxConfigurationError ()
- data TxConfigurationError
- = NumUnacknowledgedTxIdsTooSmall NumTxIdsToAck
- | NumUnacknowledgedTxIdsTooLarge NumTxIdsToAck
- | MaxNumTxIdsToRequestTooSmall NumTxIdsToReq
- | MaxNumTxIdsToRequestTooLarge NumTxIdsToReq
- | TxsSizeInflightPerPeerTooSmall SizeInBytes
- | TxsSizePerBatchTooSmall SizeInBytes
- | TxsSizePerBatchTooLarge SizeInBytes NumTxIdsToAck
- | MaxOutstandingTxBatchesPerPeerTooSmall Int
- | TxInflightMultiplicityTooSmall Int
- | BufferedTxsMinLifetimeTooSmall DiffTime
- | ScoreRateTooSmall Double
- | ScoreMaxTooSmall Double
- | ScoreAcceptDecrementTooSmall Double
- | InterTxSpaceTooSmall DiffTime
- | InflightTimeoutTooSmall DiffTime DiffTime
- | MaxPeerClaimDelayTooSmall DiffTime
- data TxSubmissionConfig = TxSubmissionConfig {
- maxNumUnacknowledgedTxIds :: !NumTxIdsToAck
- maxNumTxIdsToRequest :: !NumTxIdsToReq
- defaultTxSubmissionConfigV2 :: TxSubmissionConfig
- max_TX_SIZE :: SizeInBytes
- max_TXID_SIZE :: SizeInBytes
- newtype NumTxIdsToReq = NumTxIdsToReq {}
Documentation
data TxDecisionPolicy Source #
Policy for making decisions
Constructors
| TxDecisionPolicy | |
Fields
| |
Instances
| NFData TxDecisionPolicy Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods rnf :: TxDecisionPolicy -> () # | |
| Show TxDecisionPolicy Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods showsPrec :: Int -> TxDecisionPolicy -> ShowS # show :: TxDecisionPolicy -> String # showList :: [TxDecisionPolicy] -> ShowS # | |
| Eq TxDecisionPolicy Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods (==) :: TxDecisionPolicy -> TxDecisionPolicy -> Bool # (/=) :: TxDecisionPolicy -> TxDecisionPolicy -> Bool # | |
mkTxDecisionPolicy :: TxSubmissionConfig -> Either TxConfigurationError TxDecisionPolicy Source #
The default policy for the given config. Returns a TxConfigurationError
if it isn't sane (see saneTxDecisionPolicy); the node should then report
it and halt.
saneTxDecisionPolicy :: TxDecisionPolicy -> TxSubmissionConfig -> Either TxConfigurationError () Source #
Sanity check for a TxDecisionPolicy: Right when every field lies
in the range the decision logic assumes, otherwise the first violated
bound as a TxConfigurationError.
All window and size limits must be positive (otherwise the peer can make
no progress), the rate, score and delay parameters must
be non-negative, and inflightTimeout must be at least interTxSpace
(their difference is used as a non-negative delay when bumping a stuck
entry's inflight-multiplicity cap). mkTxDecisionPolicy satisfies
it. The reply to the largest batch MUST fit within the StTxs size
limit. A batch can exceed txsSizePerBatch by being a single tx (of at
most max_TX_SIZE), so its advertised size is at most `max txsSizePerBatch
max_TX_SIZE`. It holds at most maxNumUnacknowledgedTxIds txs, and each
received tx can be larger than advertised by up to
const_MAX_TX_SIZE_DISCREPANCY. A MsgRequestTxs with
maxNumUnacknowledgedTxIds txids of size max_TXID_SIZE MUST fit within
the StIdle size limit. `max_TX_SIZE * maxNumTxIdsToRequest` MUST fit in
SizeInBytes.
data TxConfigurationError Source #
Why a TxDecisionPolicy with a TxSubmissionConfig isn't sane, see
saneTxDecisionPolicy. Each constructor carries the offending values.
Constructors
Instances
| Exception TxConfigurationError Source # | |
| Show TxConfigurationError Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods showsPrec :: Int -> TxConfigurationError -> ShowS # show :: TxConfigurationError -> String # showList :: [TxConfigurationError] -> ShowS # | |
| Eq TxConfigurationError Source # | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods (==) :: TxConfigurationError -> TxConfigurationError -> Bool # (/=) :: TxConfigurationError -> TxConfigurationError -> 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 # | |
defaultTxSubmissionConfigV2 :: TxSubmissionConfig Source #
TxSubmissionConfig for TxSubmissionLogicV2.
max_TX_SIZE :: SizeInBytes Source #
Maximal tx size.
It bounds the advertised tx size on every node-to-node version: the V2
inbound disconnects from a peer which advertises a larger tx
(ProtocolErrorTxSizeTooLarge). The bound is far above the ledger's
maximal tx size, and every version was already limited by it through the
ingress queue of the mini-protocol (see below). Increasing it requires
a new node-to-node version, since nodes running older versions disconnect
from peers which advertise larger txs.
Affects:
TxDecisionPolicymaximumIngressQueuefor `tx-submission` mini-protocol, seetxSubmissionProtocolLimits
max_TXID_SIZE :: SizeInBytes Source #
Upper bound on the size of an encoded txid, the same as used by
txSubmissionProtocolLimits.
It bounds maxNumUnacknowledgedTxIds: a MsgRequestTxs can carry up to
maxNumUnacknowledgedTxIds txids and must fit within the StIdle size
limit, see saneTxDecisionPolicy.
Re-exports
newtype NumTxIdsToReq #
Constructors
| NumTxIdsToReq | |
Fields | |