reth_node_core/args/
rpc_state_cache.rsuse clap::Args;
use reth_rpc_server_types::constants::cache::{
DEFAULT_BLOCK_CACHE_MAX_LEN, DEFAULT_CONCURRENT_DB_REQUESTS, DEFAULT_HEADER_CACHE_MAX_LEN,
DEFAULT_RECEIPT_CACHE_MAX_LEN,
};
#[derive(Debug, Clone, Args, PartialEq, Eq)]
#[command(next_help_heading = "RPC State Cache")]
pub struct RpcStateCacheArgs {
#[arg(
long = "rpc-cache.max-blocks",
default_value_t = DEFAULT_BLOCK_CACHE_MAX_LEN,
)]
pub max_blocks: u32,
#[arg(
long = "rpc-cache.max-receipts",
default_value_t = DEFAULT_RECEIPT_CACHE_MAX_LEN,
)]
pub max_receipts: u32,
#[arg(
long = "rpc-cache.max-envs",
default_value_t = DEFAULT_HEADER_CACHE_MAX_LEN,
)]
pub max_headers: u32,
#[arg(
long = "rpc-cache.max-concurrent-db-requests",
default_value_t = DEFAULT_CONCURRENT_DB_REQUESTS,
)]
pub max_concurrent_db_requests: usize,
}
impl Default for RpcStateCacheArgs {
fn default() -> Self {
Self {
max_blocks: DEFAULT_BLOCK_CACHE_MAX_LEN,
max_receipts: DEFAULT_RECEIPT_CACHE_MAX_LEN,
max_headers: DEFAULT_HEADER_CACHE_MAX_LEN,
max_concurrent_db_requests: DEFAULT_CONCURRENT_DB_REQUESTS,
}
}
}