reth_node_core/args/
ress_args.rs

1use clap::Args;
2
3/// The default number of maximum active connections.
4const MAX_ACTIVE_CONNECTIONS_DEFAULT: u64 = 5;
5
6/// The default maximum witness lookback window.
7const MAX_WITNESS_WINDOW_DEFAULT: u64 = 1024;
8
9/// The default maximum number of witnesses to generate in parallel.
10const WITNESS_MAX_PARALLEL_DEFAULT: usize = 5;
11
12/// The default witness cache size.
13const WITNESS_CACHE_SIZE_DEFAULT: u32 = 10;
14
15/// Parameters for configuring the `ress` subprotocol.
16#[derive(Debug, Clone, Args, PartialEq, Eq)]
17#[command(next_help_heading = "Ress")]
18pub struct RessArgs {
19    /// Enable support for `ress` subprotocol.
20    #[arg(long = "ress.enable", default_value_t = false)]
21    pub enabled: bool,
22
23    /// The maximum number of active connections for `ress` subprotocol.
24    #[arg(long = "ress.max-active-connections", default_value_t = MAX_ACTIVE_CONNECTIONS_DEFAULT)]
25    pub max_active_connections: u64,
26
27    /// The maximum witness lookback window.
28    #[arg(long = "ress.max-witness-window", default_value_t = MAX_WITNESS_WINDOW_DEFAULT)]
29    pub max_witness_window: u64,
30
31    /// The maximum number of witnesses to generate in parallel.
32    #[arg(long = "ress.witness-max-parallel", default_value_t = WITNESS_MAX_PARALLEL_DEFAULT)]
33    pub witness_max_parallel: usize,
34
35    /// Witness cache size.
36    #[arg(long = "ress.witness-cache-size", default_value_t = WITNESS_CACHE_SIZE_DEFAULT)]
37    pub witness_cache_size: u32,
38}
39
40impl Default for RessArgs {
41    fn default() -> Self {
42        Self {
43            enabled: false,
44            max_active_connections: MAX_ACTIVE_CONNECTIONS_DEFAULT,
45            max_witness_window: MAX_WITNESS_WINDOW_DEFAULT,
46            witness_max_parallel: WITNESS_MAX_PARALLEL_DEFAULT,
47            witness_cache_size: WITNESS_CACHE_SIZE_DEFAULT,
48        }
49    }
50}