Module tx_fetcher
Expand description
Constants used by TransactionFetcher
.
Constants§
- Average byte size of an encoded transaction.
- Default budget for finding an idle fallback peer for any hash pending fetch, when said search is budget constrained.
- Default budget for finding hashes in the intersection of transactions announced by a peer and in the cache of hashes pending fetch, when said search is budget constrained.
- Default divisor of the max inflight request when calculating search breadth of the search for any idle peer to which to send a request filled with hashes pending fetch. The max inflight requests is configured in
TransactionFetcherInfo
. - Default divisor of the max inflight request when calculating search breadth of the search for the intersection of hashes announced by a peer and hashes pending fetch. The max inflight requests is configured in
TransactionFetcherInfo
. - search for any idle peer to which to send a request filled with hashes pending fetch. The max pending pool imports is configured in
PendingPoolImportsInfo
. - Default divisor to the max pending pool imports when calculating search breadth of the search for any idle peer to which to send a request filled with hashes pending fetch. The max pending pool imports is configured in
PendingPoolImportsInfo
. - Default marginal on fallback peers. This is the case, since a transaction is only requested once from each individual peer.
- Marginal on the number of hashes to preallocate memory for in a
GetPooledTransactions
request, when packed according to theEth68
protocol version. To make sure enough memory is preallocated in most cases, it’s sensible to use a margin. This, since the capacity is calculated based on median valueMEDIAN_BYTE_SIZE_SMALL_LEGACY_TX_ENCODED
. There may otherwise be a noteworthy number of cases where just 1 or 2 bytes too little memory is preallocated. - Default max size for cache of inflight and pending transactions fetch.
- Default limit for number of transactions waiting for an idle peer to be fetched from.
- Default maximum concurrent
GetPooledTransactions
requests. - Default maximum number of concurrent
GetPooledTransactions
s to allow per peer. This number reflects concurrent requests for different hashes. - Default number of alternative peers to keep track of for each transaction pending fetch. At most
DEFAULT_MAX_RETRIES
, which defaults to 2 peers, can ever be needed per peer. - Default max inflight request when fetching pending hashes.
- Default maximum number of hashes pending fetch to tolerate at any time.
- Default maximum request retires per
TxHash
. Note, this is reset should theTxHash
re-appear in an announcement after it has been evicted from the hashes pending fetch cache, i.e. the counter is restarted. If this happens, it is likely a very popular transaction, that should and can indeed be fetched hence this behaviour is favourable. - Default soft limit for a
PooledTransactions
response when it’s used as expected response in calibrating the filling of aGetPooledTransactions
request, when the request is filled from hashes pending fetch. - Default soft limit for the byte size of a
PooledTransactions
response on assembling aGetPooledTransactions
request. This defaults to less than theSOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE
, at 2 MiB, used when assembling aPooledTransactions
response. - Default soft limit for the number of hashes in a
GetPooledTransactions
request, when it is filled from hashes pending fetch. - Median observed size in bytes of a small encoded legacy transaction.
Functions§
- Returns the approx number of transactions that a
GetPooledTransactions
request will have capacity for w.r.t. theEth66
protocol version. This is useful for preallocating memory. - Returns the approx number of transaction hashes that a
GetPooledTransactions
request will have capacity for w.r.t. theEth68
protocol version. This is useful for preallocating memory.