Expand description
Constants used by TransactionFetcher
.
Constants§
- AVERAGE_
BYTE_ SIZE_ TX_ ENCODED - Average byte size of an encoded transaction.
- DEFAULT_
BUDGET_ FIND_ IDLE_ FALLBACK_ PEER - Default budget for finding an idle fallback peer for any hash pending fetch, when said search is budget constrained.
- DEFAULT_
BUDGET_ FIND_ INTERSECTION_ ANNOUNCED_ BY_ PEER_ AND_ PENDING_ FETCH - 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_ MAX_ COUNT_ INFLIGHT_ REQUESTS_ ON_ FIND_ IDLE_ PEER - 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_ MAX_ COUNT_ INFLIGHT_ REQUESTS_ ON_ FIND_ INTERSECTION - 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
. - DEFAULT_
DIVISOR_ MAX_ COUNT_ PENDING_ POOL_ IMPORTS_ ON_ FIND_ IDLE_ PEER - 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_ MAX_ COUNT_ PENDING_ POOL_ IMPORTS_ ON_ FIND_ INTERSECTION - 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_ COUNT_ FALLBACK_ PEERS - Default marginal on fallback peers. This is the case, since a transaction is only requested once from each individual peer.
- DEFAULT_
MARGINAL_ COUNT_ HASHES_ GET_ POOLED_ TRANSACTIONS_ REQUEST - 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_ CAPACITY_ CACHE_ INFLIGHT_ AND_ PENDING_ FETCH - Default max size for cache of inflight and pending transactions fetch.
- DEFAULT_
MAX_ CAPACITY_ CACHE_ PENDING_ FETCH - Default limit for number of transactions waiting for an idle peer to be fetched from.
- DEFAULT_
MAX_ COUNT_ CONCURRENT_ REQUESTS - Default maximum concurrent
GetPooledTransactions
requests. - DEFAULT_
MAX_ COUNT_ CONCURRENT_ REQUESTS_ PER_ PEER - Default maximum number of concurrent
GetPooledTransactions
s to allow per peer. This number reflects concurrent requests for different hashes. - DEFAULT_
MAX_ COUNT_ FALLBACK_ PEERS - 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_ COUNT_ INFLIGHT_ REQUESTS_ ON_ FETCH_ PENDING_ HASHES - Default max inflight request when fetching pending hashes.
- DEFAULT_
MAX_ COUNT_ PENDING_ FETCH - Default maximum number of hashes pending fetch to tolerate at any time.
- DEFAULT_
MAX_ RETRIES - 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_ BYTE_ SIZE_ POOLED_ TRANSACTIONS_ RESPONSE_ ON_ FETCH_ PENDING_ HASHES - 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_ BYTE_ SIZE_ POOLED_ TRANSACTIONS_ RESP_ ON_ PACK_ GET_ POOLED_ TRANSACTIONS_ REQ - 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_ COUNT_ HASHES_ IN_ GET_ POOLED_ TRANSACTIONS_ REQUEST_ ON_ FETCH_ PENDING_ HASHES - Default soft limit for the number of hashes in a
GetPooledTransactions
request, when it is filled from hashes pending fetch. - MEDIAN_
BYTE_ SIZE_ SMALL_ LEGACY_ TX_ ENCODED - Median observed size in bytes of a small encoded legacy transaction.
Functions§
- approx_
capacity_ get_ pooled_ transactions_ req_ eth66 - 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. - approx_
capacity_ get_ pooled_ transactions_ req_ eth68 - 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.