Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: expose TransactionFetcher param in cli #10635

Merged
merged 16 commits into from
Aug 31, 2024
7 changes: 6 additions & 1 deletion book/cli/reth/debug/execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ Networking:

[default: 131072]

--max-capacity-cache-pending-fetch <COUNT>
Max capacity of the cache for pending fetch requests.

[default: 25600]

--to <TO>
The maximum block height

Expand Down Expand Up @@ -305,4 +310,4 @@ Display:

-q, --quiet
Silence all log output
```
```
7 changes: 6 additions & 1 deletion book/cli/reth/debug/in-memory-merkle.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ Networking:

[default: 131072]

--max-capacity-cache-pending-fetch <COUNT>
Max capacity of the cache for pending fetch requests.

[default: 25600]

--retries <RETRIES>
The number of retries per request

Expand Down Expand Up @@ -305,4 +310,4 @@ Display:

-q, --quiet
Silence all log output
```
```
7 changes: 6 additions & 1 deletion book/cli/reth/debug/merkle.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ Networking:

[default: 131072]

--max-capacity-cache-pending-fetch <COUNT>
Max capacity of the cache for pending fetch requests.

[default: 25600]

--retries <RETRIES>
The number of retries per request

Expand Down Expand Up @@ -308,4 +313,4 @@ Display:

-q, --quiet
Silence all log output
```
```
7 changes: 6 additions & 1 deletion book/cli/reth/debug/replay-engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ Networking:

[default: 131072]

--max-capacity-cache-pending-fetch <COUNT>
Max capacity of the cache for pending fetch requests.

[default: 25600]

--engine-api-store <PATH>
The path to read engine API messages from

Expand Down Expand Up @@ -305,4 +310,4 @@ Display:

-q, --quiet
Silence all log output
```
```
7 changes: 6 additions & 1 deletion book/cli/reth/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ Networking:

[default: 131072]

--max-capacity-cache-pending-fetch <COUNT>
Max capacity of the cache for pending fetch requests.

[default: 25600]

RPC:
--http
Enable the HTTP-RPC server
Expand Down Expand Up @@ -650,4 +655,4 @@ Display:

-q, --quiet
Silence all log output
```
```
7 changes: 6 additions & 1 deletion book/cli/reth/p2p.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ Networking:

[default: 131072]

--max-capacity-cache-pending-fetch <COUNT>
Max capacity of the cache for pending fetch requests.

[default: 25600]

Datadir:
--datadir <DATA_DIR>
The path to the data dir for all reth files and subdirectories.
Expand Down Expand Up @@ -308,4 +313,4 @@ Display:

-q, --quiet
Silence all log output
```
```
7 changes: 6 additions & 1 deletion book/cli/reth/stage/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ Networking:

[default: 131072]

--max-capacity-cache-pending-fetch <COUNT>
Max capacity of the cache for pending fetch requests.

[default: 25600]

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout
Expand Down Expand Up @@ -340,4 +345,4 @@ Display:

-q, --quiet
Silence all log output
```
```
7 changes: 6 additions & 1 deletion book/cli/reth/stage/unwind.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ Networking:

[default: 131072]

--max-capacity-cache-pending-fetch <COUNT>
Max capacity of the cache for pending fetch requests.

[default: 25600]

--offline
If this is enabled, then all stages except headers, bodies, and sender recovery will be unwound

Expand Down Expand Up @@ -305,4 +310,4 @@ Display:

-q, --quiet
Silence all log output
```
```
8 changes: 6 additions & 2 deletions crates/net/network/src/transactions/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -46,6 +47,8 @@ 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 for pending fetch requests.
royvardhan marked this conversation as resolved.
Show resolved Hide resolved
pub max_capacity_cache_pending_fetch: u32,
}

impl Default for TransactionFetcherConfig {
Expand All @@ -56,7 +59,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_pending_fetch: DEFAULT_MAX_CAPACITY_CACHE_PENDING_FETCH,
}
}
}
8 changes: 7 additions & 1 deletion crates/net/network/src/transactions/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ impl TransactionFetcher {
.metrics
.capacity_inflight_requests
.increment(tx_fetcher.info.max_inflight_requests as u64);
tx_fetcher.info.max_capacity_cache_pending_fetch = config.max_capacity_cache_pending_fetch;

tx_fetcher
}
Expand Down Expand Up @@ -1291,6 +1292,8 @@ 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 for pending fetch requests.
pub max_capacity_cache_pending_fetch: u32,
}

impl TransactionFetcherInfo {
Expand All @@ -1299,11 +1302,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_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_pending_fetch,
}
}
}
Expand All @@ -1313,7 +1318,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,
)
}
}
Expand Down
8 changes: 7 additions & 1 deletion crates/node/core/src/args/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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 the cache for pending fetch requests.
royvardhan marked this conversation as resolved.
Show resolved Hide resolved
#[arg(long = "max-capacity-cache-pending-fetch", value_name = "COUNT", default_value_t = DEFAULT_MAX_CAPACITY_CACHE_PENDING_FETCH, verbatim_doc_comment)]
royvardhan marked this conversation as resolved.
Show resolved Hide resolved
pub max_capacity_cache_pending_fetch: u32,
royvardhan marked this conversation as resolved.
Show resolved Hide resolved
}

impl NetworkArgs {
Expand Down Expand Up @@ -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_pending_fetch,
),
max_transactions_seen_by_peer_history: self.max_seen_tx_history,
};
Expand Down Expand Up @@ -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_pending_fetch: DEFAULT_MAX_CAPACITY_CACHE_PENDING_FETCH,
}
}
}
Expand Down
Loading