mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: expose TransactionFetcher param in cli (#10635)
This commit is contained in:
5
book/cli/reth/debug/execution.md
vendored
5
book/cli/reth/debug/execution.md
vendored
@ -221,6 +221,11 @@ Networking:
|
||||
|
||||
[default: 131072]
|
||||
|
||||
--max-tx-pending-fetch <COUNT>
|
||||
Max capacity of cache of hashes for transactions pending fetch.
|
||||
|
||||
[default: 25600]
|
||||
|
||||
--to <TO>
|
||||
The maximum block height
|
||||
|
||||
|
||||
5
book/cli/reth/debug/in-memory-merkle.md
vendored
5
book/cli/reth/debug/in-memory-merkle.md
vendored
@ -221,6 +221,11 @@ Networking:
|
||||
|
||||
[default: 131072]
|
||||
|
||||
--max-tx-pending-fetch <COUNT>
|
||||
Max capacity of cache of hashes for transactions pending fetch.
|
||||
|
||||
[default: 25600]
|
||||
|
||||
--retries <RETRIES>
|
||||
The number of retries per request
|
||||
|
||||
|
||||
5
book/cli/reth/debug/merkle.md
vendored
5
book/cli/reth/debug/merkle.md
vendored
@ -221,6 +221,11 @@ Networking:
|
||||
|
||||
[default: 131072]
|
||||
|
||||
--max-tx-pending-fetch <COUNT>
|
||||
Max capacity of cache of hashes for transactions pending fetch.
|
||||
|
||||
[default: 25600]
|
||||
|
||||
--retries <RETRIES>
|
||||
The number of retries per request
|
||||
|
||||
|
||||
5
book/cli/reth/debug/replay-engine.md
vendored
5
book/cli/reth/debug/replay-engine.md
vendored
@ -221,6 +221,11 @@ Networking:
|
||||
|
||||
[default: 131072]
|
||||
|
||||
--max-tx-pending-fetch <COUNT>
|
||||
Max capacity of cache of hashes for transactions pending fetch.
|
||||
|
||||
[default: 25600]
|
||||
|
||||
--engine-api-store <PATH>
|
||||
The path to read engine API messages from
|
||||
|
||||
|
||||
5
book/cli/reth/node.md
vendored
5
book/cli/reth/node.md
vendored
@ -213,6 +213,11 @@ Networking:
|
||||
|
||||
[default: 131072]
|
||||
|
||||
--max-tx-pending-fetch <COUNT>
|
||||
Max capacity of cache of hashes for transactions pending fetch.
|
||||
|
||||
[default: 25600]
|
||||
|
||||
RPC:
|
||||
--http
|
||||
Enable the HTTP-RPC server
|
||||
|
||||
5
book/cli/reth/p2p.md
vendored
5
book/cli/reth/p2p.md
vendored
@ -198,6 +198,11 @@ Networking:
|
||||
|
||||
[default: 131072]
|
||||
|
||||
--max-tx-pending-fetch <COUNT>
|
||||
Max capacity of cache of hashes for transactions pending fetch.
|
||||
|
||||
[default: 25600]
|
||||
|
||||
Datadir:
|
||||
--datadir <DATA_DIR>
|
||||
The path to the data dir for all reth files and subdirectories.
|
||||
|
||||
5
book/cli/reth/stage/run.md
vendored
5
book/cli/reth/stage/run.md
vendored
@ -264,6 +264,11 @@ Networking:
|
||||
|
||||
[default: 131072]
|
||||
|
||||
--max-tx-pending-fetch <COUNT>
|
||||
Max capacity of cache of hashes for transactions pending fetch.
|
||||
|
||||
[default: 25600]
|
||||
|
||||
Logging:
|
||||
--log.stdout.format <FORMAT>
|
||||
The format to use for logs written to stdout
|
||||
|
||||
5
book/cli/reth/stage/unwind.md
vendored
5
book/cli/reth/stage/unwind.md
vendored
@ -226,6 +226,11 @@ Networking:
|
||||
|
||||
[default: 131072]
|
||||
|
||||
--max-tx-pending-fetch <COUNT>
|
||||
Max capacity of cache of hashes for transactions pending fetch.
|
||||
|
||||
[default: 25600]
|
||||
|
||||
--offline
|
||||
If this is enabled, then all stages except headers, bodies, and sender recovery will be unwound
|
||||
|
||||
|
||||
@ -6,7 +6,8 @@ use super::{
|
||||
SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE,
|
||||
};
|
||||
use crate::transactions::constants::tx_fetcher::{
|
||||
DEFAULT_MAX_COUNT_CONCURRENT_REQUESTS, DEFAULT_MAX_COUNT_CONCURRENT_REQUESTS_PER_PEER,
|
||||
DEFAULT_MAX_CAPACITY_CACHE_PENDING_FETCH, DEFAULT_MAX_COUNT_CONCURRENT_REQUESTS,
|
||||
DEFAULT_MAX_COUNT_CONCURRENT_REQUESTS_PER_PEER,
|
||||
};
|
||||
|
||||
/// Configuration for managing transactions within the network.
|
||||
@ -46,6 +47,11 @@ pub struct TransactionFetcherConfig {
|
||||
/// [`PooledTransactions`](reth_eth_wire::PooledTransactions) response on packing a
|
||||
/// [`GetPooledTransactions`](reth_eth_wire::GetPooledTransactions) request with hashes.
|
||||
pub soft_limit_byte_size_pooled_transactions_response_on_pack_request: usize,
|
||||
/// Max capacity of the cache of transaction hashes, for transactions that weren't yet fetched.
|
||||
/// A transaction is pending fetch if its hash didn't fit into a
|
||||
/// [`GetPooledTransactions`](reth_eth_wire::GetPooledTransactions) yet, or it wasn't returned
|
||||
/// upon request to peers.
|
||||
pub max_capacity_cache_txns_pending_fetch: u32,
|
||||
}
|
||||
|
||||
impl Default for TransactionFetcherConfig {
|
||||
@ -56,7 +62,8 @@ impl Default for TransactionFetcherConfig {
|
||||
soft_limit_byte_size_pooled_transactions_response:
|
||||
SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE,
|
||||
soft_limit_byte_size_pooled_transactions_response_on_pack_request:
|
||||
DEFAULT_SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESP_ON_PACK_GET_POOLED_TRANSACTIONS_REQ
|
||||
DEFAULT_SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESP_ON_PACK_GET_POOLED_TRANSACTIONS_REQ,
|
||||
max_capacity_cache_txns_pending_fetch: DEFAULT_MAX_CAPACITY_CACHE_PENDING_FETCH,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,6 +134,8 @@ impl TransactionFetcher {
|
||||
.metrics
|
||||
.capacity_inflight_requests
|
||||
.increment(tx_fetcher.info.max_inflight_requests as u64);
|
||||
tx_fetcher.info.max_capacity_cache_txns_pending_fetch =
|
||||
config.max_capacity_cache_txns_pending_fetch;
|
||||
|
||||
tx_fetcher
|
||||
}
|
||||
@ -1291,6 +1293,10 @@ pub struct TransactionFetcherInfo {
|
||||
/// Soft limit for the byte size of a [`PooledTransactions`] response, upon assembling the
|
||||
/// response. Spec'd at 2 MiB, but can be adjusted for research purpose.
|
||||
pub soft_limit_byte_size_pooled_transactions_response: usize,
|
||||
/// Max capacity of the cache of transaction hashes, for transactions that weren't yet fetched.
|
||||
/// A transaction is pending fetch if its hash didn't fit into a [`GetPooledTransactions`] yet,
|
||||
/// or it wasn't returned upon request to peers.
|
||||
pub max_capacity_cache_txns_pending_fetch: u32,
|
||||
}
|
||||
|
||||
impl TransactionFetcherInfo {
|
||||
@ -1299,11 +1305,13 @@ impl TransactionFetcherInfo {
|
||||
max_inflight_requests: usize,
|
||||
soft_limit_byte_size_pooled_transactions_response_on_pack_request: usize,
|
||||
soft_limit_byte_size_pooled_transactions_response: usize,
|
||||
max_capacity_cache_txns_pending_fetch: u32,
|
||||
) -> Self {
|
||||
Self {
|
||||
max_inflight_requests,
|
||||
soft_limit_byte_size_pooled_transactions_response_on_pack_request,
|
||||
soft_limit_byte_size_pooled_transactions_response,
|
||||
max_capacity_cache_txns_pending_fetch,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1313,7 +1321,8 @@ impl Default for TransactionFetcherInfo {
|
||||
Self::new(
|
||||
DEFAULT_MAX_COUNT_CONCURRENT_REQUESTS as usize * DEFAULT_MAX_COUNT_CONCURRENT_REQUESTS_PER_PEER as usize,
|
||||
DEFAULT_SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESP_ON_PACK_GET_POOLED_TRANSACTIONS_REQ,
|
||||
SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE
|
||||
SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE,
|
||||
DEFAULT_MAX_CAPACITY_CACHE_PENDING_FETCH,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ use reth_network::{
|
||||
transactions::{
|
||||
constants::{
|
||||
tx_fetcher::{
|
||||
DEFAULT_MAX_COUNT_CONCURRENT_REQUESTS,
|
||||
DEFAULT_MAX_CAPACITY_CACHE_PENDING_FETCH, DEFAULT_MAX_COUNT_CONCURRENT_REQUESTS,
|
||||
DEFAULT_MAX_COUNT_CONCURRENT_REQUESTS_PER_PEER,
|
||||
},
|
||||
tx_manager::{
|
||||
@ -144,6 +144,10 @@ pub struct NetworkArgs {
|
||||
/// Default is 128 KiB.
|
||||
#[arg(long = "pooled-tx-pack-soft-limit", value_name = "BYTES", default_value_t = DEFAULT_SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESP_ON_PACK_GET_POOLED_TRANSACTIONS_REQ, verbatim_doc_comment)]
|
||||
pub soft_limit_byte_size_pooled_transactions_response_on_pack_request: usize,
|
||||
|
||||
/// Max capacity of cache of hashes for transactions pending fetch.
|
||||
#[arg(long = "max-tx-pending-fetch", value_name = "COUNT", default_value_t = DEFAULT_MAX_CAPACITY_CACHE_PENDING_FETCH, verbatim_doc_comment)]
|
||||
pub max_capacity_cache_txns_pending_fetch: u32,
|
||||
}
|
||||
|
||||
impl NetworkArgs {
|
||||
@ -191,6 +195,7 @@ impl NetworkArgs {
|
||||
self.max_concurrent_tx_requests_per_peer,
|
||||
self.soft_limit_byte_size_pooled_transactions_response,
|
||||
self.soft_limit_byte_size_pooled_transactions_response_on_pack_request,
|
||||
self.max_capacity_cache_txns_pending_fetch,
|
||||
),
|
||||
max_transactions_seen_by_peer_history: self.max_seen_tx_history,
|
||||
};
|
||||
@ -297,6 +302,7 @@ impl Default for NetworkArgs {
|
||||
soft_limit_byte_size_pooled_transactions_response_on_pack_request: DEFAULT_SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESP_ON_PACK_GET_POOLED_TRANSACTIONS_REQ,
|
||||
max_pending_pool_imports: DEFAULT_MAX_COUNT_PENDING_POOL_IMPORTS,
|
||||
max_seen_tx_history: DEFAULT_MAX_COUNT_TRANSACTIONS_SEEN_BY_PEER,
|
||||
max_capacity_cache_txns_pending_fetch: DEFAULT_MAX_CAPACITY_CACHE_PENDING_FETCH,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user