feat: add max logs per response cli arg (#4644)

This commit is contained in:
Matthias Seitz
2023-09-18 22:49:39 +02:00
committed by GitHub
parent 733ee19395
commit 55339d7025
4 changed files with 14 additions and 10 deletions

View File

@ -51,8 +51,6 @@ pub(crate) const RPC_DEFAULT_MAX_REQUEST_SIZE_MB: u32 = 15;
pub(crate) const RPC_DEFAULT_MAX_RESPONSE_SIZE_MB: u32 = 115;
/// Default number of incoming connections.
pub(crate) const RPC_DEFAULT_MAX_CONNECTIONS: u32 = 100;
/// Default number of incoming connections.
pub(crate) const RPC_DEFAULT_MAX_TRACING_REQUESTS: u32 = 25;
/// Parameters for configuring the rpc more granularity via CLI
#[derive(Debug, Args)]
@ -135,9 +133,13 @@ pub struct RpcServerArgs {
pub rpc_max_connections: u32,
/// Maximum number of concurrent tracing requests.
#[arg(long, value_name = "COUNT", default_value_t = RPC_DEFAULT_MAX_TRACING_REQUESTS)]
#[arg(long, value_name = "COUNT", default_value_t = constants::DEFAULT_MAX_TRACING_REQUESTS)]
pub rpc_max_tracing_requests: u32,
/// Maximum number of logs that can be returned in a single response.
#[arg(long, value_name = "COUNT", default_value_t = constants::DEFAULT_MAX_LOGS_PER_RESPONSE)]
pub rpc_max_logs_per_response: usize,
/// Maximum gas limit for `eth_call` and call tracing RPC methods.
#[arg(
long,
@ -323,6 +325,7 @@ impl RethRpcConfig for RpcServerArgs {
fn eth_config(&self) -> EthConfig {
EthConfig::default()
.max_tracing_requests(self.rpc_max_tracing_requests)
.max_logs_per_response(self.rpc_max_logs_per_response)
.rpc_gas_cap(self.rpc_gas_cap)
.gpo_config(self.gas_price_oracle_config())
}