From 2ae9e2fd556f43f405ffdf3ff6518935b5128694 Mon Sep 17 00:00:00 2001 From: PanGan21 Date: Sun, 6 Oct 2024 10:23:55 +0200 Subject: [PATCH 1/7] feat: add timeout flag and override default rpc timeout value --- crates/cli/src/opts/ethereum.rs | 20 ++++++++++++++++++++ crates/cli/src/utils/mod.rs | 5 +++++ crates/config/src/lib.rs | 21 +++++++++++++++++++++ crates/forge/tests/cli/config.rs | 1 + 4 files changed, 47 insertions(+) diff --git a/crates/cli/src/opts/ethereum.rs b/crates/cli/src/opts/ethereum.rs index c4e8f08875df..02064a6f1486 100644 --- a/crates/cli/src/opts/ethereum.rs +++ b/crates/cli/src/opts/ethereum.rs @@ -40,6 +40,13 @@ pub struct RpcOpts { /// "0x6bb38c26db65749ab6e472080a3d20a2f35776494e72016d1e339593f21c59bc"]' #[arg(long, env = "ETH_RPC_JWT_SECRET")] pub jwt_secret: Option, + + /// Timeout for the rpc request + /// + /// The timeout will be used to override the default timeout for RPC. + /// Default value is 45s + #[arg(long, env = "ETH_RPC_TIMEOUT")] + pub timeout: Option, } impl_figment_convert_cast!(RpcOpts); @@ -76,6 +83,16 @@ impl RpcOpts { Ok(jwt) } + /// Returns the rpc timeout. + pub fn timeout<'a>(&'a self, config: Option<&'a Config>) -> Result>> { + let timeout = match (self.timeout.as_ref(), config) { + (Some(timeout), _) => Some(Cow::Borrowed(timeout)), + (None, Some(config)) => config.get_rpc_timeout()?, + (None, None) => None, + }; + Ok(timeout) + } + pub fn dict(&self) -> Dict { let mut dict = Dict::new(); if let Ok(Some(url)) = self.url(None) { @@ -84,6 +101,9 @@ impl RpcOpts { if let Ok(Some(jwt)) = self.jwt(None) { dict.insert("eth_rpc_jwt".into(), jwt.into_owned().into()); } + if let Ok(Some(timeout)) = self.timeout(None) { + dict.insert("eth_rpc_timeout".into(), timeout.into_owned().into()); + } dict } } diff --git a/crates/cli/src/utils/mod.rs b/crates/cli/src/utils/mod.rs index 736793e67cd5..33e48b872372 100644 --- a/crates/cli/src/utils/mod.rs +++ b/crates/cli/src/utils/mod.rs @@ -102,6 +102,11 @@ pub fn get_provider_builder(config: &Config) -> Result { builder = builder.jwt(jwt.as_ref()); } + let timeout = config.get_rpc_timeout()?; + if let Some(timeout) = timeout { + builder = builder.timeout(Duration::from_secs(*timeout.as_ref())); + } + Ok(builder) } diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index 648d40e66625..75538b3b2d06 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -238,6 +238,8 @@ pub struct Config { pub eth_rpc_url: Option, /// JWT secret that should be used for any rpc calls pub eth_rpc_jwt: Option, + /// timeout that should be used for any rpc calls + pub eth_rpc_timeout: Option, /// etherscan API key, or alias for an `EtherscanConfig` in `etherscan` table pub etherscan_api_key: Option, /// Multiple etherscan api configs and their aliases @@ -1126,6 +1128,24 @@ impl Config { Ok(self.eth_rpc_jwt.as_ref().map(|jwt| Cow::Borrowed(jwt.as_str()))) } + /// Returns the configured RPC timeout value. + /// + /// Returns: + /// - The RPC timeout value, if configured. + /// + /// # Example + /// + /// ``` + /// use foundry_config::Config; + /// # fn t() { + /// let config = Config::with_root("./"); + /// let rpc_timeout = config.get_rpc_timeout().unwrap().unwrap(); + /// # } + /// ``` + pub fn get_rpc_timeout(&self) -> Result>, UnresolvedEnvVarError> { + Ok(self.eth_rpc_timeout.as_ref().map(|timeout| Cow::Borrowed(timeout))) + } + /// Returns the configured rpc url /// /// Returns: @@ -2208,6 +2228,7 @@ impl Default for Config { memory_limit: 1 << 27, // 2**27 = 128MiB = 134_217_728 bytes eth_rpc_url: None, eth_rpc_jwt: None, + eth_rpc_timeout: None, etherscan_api_key: None, verbosity: 0, remappings: vec![], diff --git a/crates/forge/tests/cli/config.rs b/crates/forge/tests/cli/config.rs index c061af78f0ef..b1b755abeb7b 100644 --- a/crates/forge/tests/cli/config.rs +++ b/crates/forge/tests/cli/config.rs @@ -105,6 +105,7 @@ forgetest!(can_extract_config_values, |prj, cmd| { memory_limit: 1 << 27, eth_rpc_url: Some("localhost".to_string()), eth_rpc_jwt: None, + eth_rpc_timeout: None, etherscan_api_key: None, etherscan: Default::default(), verbosity: 4, From 99d442e004ca84021efe6a09febedda514af1711 Mon Sep 17 00:00:00 2001 From: PanGan21 Date: Sun, 6 Oct 2024 10:32:11 +0200 Subject: [PATCH 2/7] fix clippy --- crates/config/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index 75538b3b2d06..defb7b01dd8d 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -1143,7 +1143,7 @@ impl Config { /// # } /// ``` pub fn get_rpc_timeout(&self) -> Result>, UnresolvedEnvVarError> { - Ok(self.eth_rpc_timeout.as_ref().map(|timeout| Cow::Borrowed(timeout))) + Ok(self.eth_rpc_timeout.as_ref().map(Cow::Borrowed)) } /// Returns the configured rpc url From 1666ac4596b9899c9f9ac89c7befa3efd9c9b0ae Mon Sep 17 00:00:00 2001 From: PanGan21 Date: Sun, 6 Oct 2024 11:56:52 +0200 Subject: [PATCH 3/7] fix: move timeout to rpc args --- crates/cast/bin/cmd/rpc.rs | 19 +++++++++++++++++-- crates/cli/src/opts/ethereum.rs | 20 -------------------- crates/cli/src/utils/mod.rs | 5 ----- crates/config/src/lib.rs | 21 --------------------- crates/forge/tests/cli/config.rs | 1 - 5 files changed, 17 insertions(+), 49 deletions(-) diff --git a/crates/cast/bin/cmd/rpc.rs b/crates/cast/bin/cmd/rpc.rs index cae5d3386a68..102635b5b0d3 100644 --- a/crates/cast/bin/cmd/rpc.rs +++ b/crates/cast/bin/cmd/rpc.rs @@ -1,3 +1,5 @@ +use std::time::Duration; + use cast::Cast; use clap::Parser; use eyre::Result; @@ -29,16 +31,29 @@ pub struct RpcArgs { #[arg(long, short = 'w')] raw: bool, + /// Timeout for the rpc request + /// + /// The timeout will be used to override the default timeout for RPC. + /// Default value is 45s + #[arg(long, env = "ETH_RPC_TIMEOUT")] + pub timeout: Option, + #[command(flatten)] rpc: RpcOpts, } impl RpcArgs { pub async fn run(self) -> Result<()> { - let Self { raw, method, params, rpc } = self; + let Self { raw, method, params, rpc, timeout } = self; let config = Config::from(&rpc); - let provider = utils::get_provider(&config)?; + let mut builder = utils::get_provider_builder(&config)?; + + if let Some(timeout) = timeout { + builder = builder.timeout(Duration::from_secs(timeout)); + } + + let provider = builder.build()?; let params = if raw { if params.is_empty() { diff --git a/crates/cli/src/opts/ethereum.rs b/crates/cli/src/opts/ethereum.rs index 02064a6f1486..c4e8f08875df 100644 --- a/crates/cli/src/opts/ethereum.rs +++ b/crates/cli/src/opts/ethereum.rs @@ -40,13 +40,6 @@ pub struct RpcOpts { /// "0x6bb38c26db65749ab6e472080a3d20a2f35776494e72016d1e339593f21c59bc"]' #[arg(long, env = "ETH_RPC_JWT_SECRET")] pub jwt_secret: Option, - - /// Timeout for the rpc request - /// - /// The timeout will be used to override the default timeout for RPC. - /// Default value is 45s - #[arg(long, env = "ETH_RPC_TIMEOUT")] - pub timeout: Option, } impl_figment_convert_cast!(RpcOpts); @@ -83,16 +76,6 @@ impl RpcOpts { Ok(jwt) } - /// Returns the rpc timeout. - pub fn timeout<'a>(&'a self, config: Option<&'a Config>) -> Result>> { - let timeout = match (self.timeout.as_ref(), config) { - (Some(timeout), _) => Some(Cow::Borrowed(timeout)), - (None, Some(config)) => config.get_rpc_timeout()?, - (None, None) => None, - }; - Ok(timeout) - } - pub fn dict(&self) -> Dict { let mut dict = Dict::new(); if let Ok(Some(url)) = self.url(None) { @@ -101,9 +84,6 @@ impl RpcOpts { if let Ok(Some(jwt)) = self.jwt(None) { dict.insert("eth_rpc_jwt".into(), jwt.into_owned().into()); } - if let Ok(Some(timeout)) = self.timeout(None) { - dict.insert("eth_rpc_timeout".into(), timeout.into_owned().into()); - } dict } } diff --git a/crates/cli/src/utils/mod.rs b/crates/cli/src/utils/mod.rs index 33e48b872372..736793e67cd5 100644 --- a/crates/cli/src/utils/mod.rs +++ b/crates/cli/src/utils/mod.rs @@ -102,11 +102,6 @@ pub fn get_provider_builder(config: &Config) -> Result { builder = builder.jwt(jwt.as_ref()); } - let timeout = config.get_rpc_timeout()?; - if let Some(timeout) = timeout { - builder = builder.timeout(Duration::from_secs(*timeout.as_ref())); - } - Ok(builder) } diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index defb7b01dd8d..648d40e66625 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -238,8 +238,6 @@ pub struct Config { pub eth_rpc_url: Option, /// JWT secret that should be used for any rpc calls pub eth_rpc_jwt: Option, - /// timeout that should be used for any rpc calls - pub eth_rpc_timeout: Option, /// etherscan API key, or alias for an `EtherscanConfig` in `etherscan` table pub etherscan_api_key: Option, /// Multiple etherscan api configs and their aliases @@ -1128,24 +1126,6 @@ impl Config { Ok(self.eth_rpc_jwt.as_ref().map(|jwt| Cow::Borrowed(jwt.as_str()))) } - /// Returns the configured RPC timeout value. - /// - /// Returns: - /// - The RPC timeout value, if configured. - /// - /// # Example - /// - /// ``` - /// use foundry_config::Config; - /// # fn t() { - /// let config = Config::with_root("./"); - /// let rpc_timeout = config.get_rpc_timeout().unwrap().unwrap(); - /// # } - /// ``` - pub fn get_rpc_timeout(&self) -> Result>, UnresolvedEnvVarError> { - Ok(self.eth_rpc_timeout.as_ref().map(Cow::Borrowed)) - } - /// Returns the configured rpc url /// /// Returns: @@ -2228,7 +2208,6 @@ impl Default for Config { memory_limit: 1 << 27, // 2**27 = 128MiB = 134_217_728 bytes eth_rpc_url: None, eth_rpc_jwt: None, - eth_rpc_timeout: None, etherscan_api_key: None, verbosity: 0, remappings: vec![], diff --git a/crates/forge/tests/cli/config.rs b/crates/forge/tests/cli/config.rs index b1b755abeb7b..c061af78f0ef 100644 --- a/crates/forge/tests/cli/config.rs +++ b/crates/forge/tests/cli/config.rs @@ -105,7 +105,6 @@ forgetest!(can_extract_config_values, |prj, cmd| { memory_limit: 1 << 27, eth_rpc_url: Some("localhost".to_string()), eth_rpc_jwt: None, - eth_rpc_timeout: None, etherscan_api_key: None, etherscan: Default::default(), verbosity: 4, From 5891a8d34eeb191702f8d6fc3f926552ca2f6620 Mon Sep 17 00:00:00 2001 From: PanGan21 Date: Mon, 21 Oct 2024 21:53:04 +0200 Subject: [PATCH 4/7] refactor: move rpc timeout to RpcOpts --- crates/cast/bin/cmd/rpc.rs | 19 ++----------------- crates/cli/src/opts/ethereum.rs | 20 ++++++++++++++++++++ crates/cli/src/utils/mod.rs | 5 +++++ crates/config/src/lib.rs | 21 +++++++++++++++++++++ crates/forge/tests/cli/config.rs | 1 + 5 files changed, 49 insertions(+), 17 deletions(-) diff --git a/crates/cast/bin/cmd/rpc.rs b/crates/cast/bin/cmd/rpc.rs index 102635b5b0d3..cae5d3386a68 100644 --- a/crates/cast/bin/cmd/rpc.rs +++ b/crates/cast/bin/cmd/rpc.rs @@ -1,5 +1,3 @@ -use std::time::Duration; - use cast::Cast; use clap::Parser; use eyre::Result; @@ -31,29 +29,16 @@ pub struct RpcArgs { #[arg(long, short = 'w')] raw: bool, - /// Timeout for the rpc request - /// - /// The timeout will be used to override the default timeout for RPC. - /// Default value is 45s - #[arg(long, env = "ETH_RPC_TIMEOUT")] - pub timeout: Option, - #[command(flatten)] rpc: RpcOpts, } impl RpcArgs { pub async fn run(self) -> Result<()> { - let Self { raw, method, params, rpc, timeout } = self; + let Self { raw, method, params, rpc } = self; let config = Config::from(&rpc); - let mut builder = utils::get_provider_builder(&config)?; - - if let Some(timeout) = timeout { - builder = builder.timeout(Duration::from_secs(timeout)); - } - - let provider = builder.build()?; + let provider = utils::get_provider(&config)?; let params = if raw { if params.is_empty() { diff --git a/crates/cli/src/opts/ethereum.rs b/crates/cli/src/opts/ethereum.rs index c4e8f08875df..582ed28ba2f3 100644 --- a/crates/cli/src/opts/ethereum.rs +++ b/crates/cli/src/opts/ethereum.rs @@ -40,6 +40,13 @@ pub struct RpcOpts { /// "0x6bb38c26db65749ab6e472080a3d20a2f35776494e72016d1e339593f21c59bc"]' #[arg(long, env = "ETH_RPC_JWT_SECRET")] pub jwt_secret: Option, + + /// Timeout for the rpc request + /// + /// The rpc-timeout will be used to override the default timeout for RPC. + /// Default value is 45s + #[arg(long, env = "ETH_RPC_TIMEOUT")] + pub rpc_timeout: Option, } impl_figment_convert_cast!(RpcOpts); @@ -76,6 +83,16 @@ impl RpcOpts { Ok(jwt) } + /// Returns the rpc timeout. + pub fn rpc_timeout<'a>(&'a self, config: Option<&'a Config>) -> Result>> { + let rpc_timeout = match (self.rpc_timeout.as_ref(), config) { + (Some(rpc_timeout), _) => Some(Cow::Borrowed(rpc_timeout)), + (None, Some(config)) => config.get_rpc_timeout()?, + (None, None) => None, + }; + Ok(rpc_timeout) + } + pub fn dict(&self) -> Dict { let mut dict = Dict::new(); if let Ok(Some(url)) = self.url(None) { @@ -84,6 +101,9 @@ impl RpcOpts { if let Ok(Some(jwt)) = self.jwt(None) { dict.insert("eth_rpc_jwt".into(), jwt.into_owned().into()); } + if let Ok(Some(rpc_timeout)) = self.rpc_timeout(None) { + dict.insert("eth_rpc_timeout".into(), rpc_timeout.into_owned().into()); + } dict } } diff --git a/crates/cli/src/utils/mod.rs b/crates/cli/src/utils/mod.rs index 5b7523447ec9..6584456f83ae 100644 --- a/crates/cli/src/utils/mod.rs +++ b/crates/cli/src/utils/mod.rs @@ -103,6 +103,11 @@ pub fn get_provider_builder(config: &Config) -> Result { builder = builder.jwt(jwt.as_ref()); } + let rpc_timeout = config.get_rpc_timeout()?; + if let Some(rpc_timeout) = rpc_timeout { + builder = builder.timeout(Duration::from_secs(*rpc_timeout.as_ref())); + } + Ok(builder) } diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index d70a8dab401f..cd5949ff8e51 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -238,6 +238,8 @@ pub struct Config { pub eth_rpc_url: Option, /// JWT secret that should be used for any rpc calls pub eth_rpc_jwt: Option, + /// timeout that should be used for any rpc calls + pub eth_rpc_timeout: Option, /// etherscan API key, or alias for an `EtherscanConfig` in `etherscan` table pub etherscan_api_key: Option, /// Multiple etherscan api configs and their aliases @@ -1126,6 +1128,24 @@ impl Config { Ok(self.eth_rpc_jwt.as_ref().map(|jwt| Cow::Borrowed(jwt.as_str()))) } + /// Returns the configured RPC timeout value. + /// + /// Returns: + /// - The RPC timeout value, if configured. + /// + /// # Example + /// + /// ``` + /// use foundry_config::Config; + /// # fn t() { + /// let config = Config::with_root("./"); + /// let rpc_timeout = config.get_rpc_timeout().unwrap().unwrap(); + /// # } + /// ``` + pub fn get_rpc_timeout(&self) -> Result>, UnresolvedEnvVarError> { + Ok(self.eth_rpc_timeout.as_ref().map(|timeout| Cow::Borrowed(timeout))) + } + /// Returns the configured rpc url /// /// Returns: @@ -2208,6 +2228,7 @@ impl Default for Config { memory_limit: 1 << 27, // 2**27 = 128MiB = 134_217_728 bytes eth_rpc_url: None, eth_rpc_jwt: None, + eth_rpc_timeout: None, etherscan_api_key: None, verbosity: 0, remappings: vec![], diff --git a/crates/forge/tests/cli/config.rs b/crates/forge/tests/cli/config.rs index c061af78f0ef..b1b755abeb7b 100644 --- a/crates/forge/tests/cli/config.rs +++ b/crates/forge/tests/cli/config.rs @@ -105,6 +105,7 @@ forgetest!(can_extract_config_values, |prj, cmd| { memory_limit: 1 << 27, eth_rpc_url: Some("localhost".to_string()), eth_rpc_jwt: None, + eth_rpc_timeout: None, etherscan_api_key: None, etherscan: Default::default(), verbosity: 4, From a2a7cb7237ff7b90f315159fdf281abf988e8a9a Mon Sep 17 00:00:00 2001 From: PanGan21 Date: Mon, 21 Oct 2024 21:55:32 +0200 Subject: [PATCH 5/7] clippy --- crates/config/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index cd5949ff8e51..e6fed7ec5780 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -1143,7 +1143,7 @@ impl Config { /// # } /// ``` pub fn get_rpc_timeout(&self) -> Result>, UnresolvedEnvVarError> { - Ok(self.eth_rpc_timeout.as_ref().map(|timeout| Cow::Borrowed(timeout))) + Ok(self.eth_rpc_timeout.as_ref().map(Cow::Borrowed)) } /// Returns the configured rpc url From b7b00fc0e3fd354f3ab563b712ecaf3b09214a16 Mon Sep 17 00:00:00 2001 From: PanGan21 Date: Thu, 24 Oct 2024 09:36:51 +0200 Subject: [PATCH 6/7] refactor unecessary code --- crates/cli/src/opts/ethereum.rs | 14 ++------------ crates/cli/src/utils/mod.rs | 5 ++--- crates/config/src/lib.rs | 18 ------------------ 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/crates/cli/src/opts/ethereum.rs b/crates/cli/src/opts/ethereum.rs index 582ed28ba2f3..4fed78e2957d 100644 --- a/crates/cli/src/opts/ethereum.rs +++ b/crates/cli/src/opts/ethereum.rs @@ -83,16 +83,6 @@ impl RpcOpts { Ok(jwt) } - /// Returns the rpc timeout. - pub fn rpc_timeout<'a>(&'a self, config: Option<&'a Config>) -> Result>> { - let rpc_timeout = match (self.rpc_timeout.as_ref(), config) { - (Some(rpc_timeout), _) => Some(Cow::Borrowed(rpc_timeout)), - (None, Some(config)) => config.get_rpc_timeout()?, - (None, None) => None, - }; - Ok(rpc_timeout) - } - pub fn dict(&self) -> Dict { let mut dict = Dict::new(); if let Ok(Some(url)) = self.url(None) { @@ -101,8 +91,8 @@ impl RpcOpts { if let Ok(Some(jwt)) = self.jwt(None) { dict.insert("eth_rpc_jwt".into(), jwt.into_owned().into()); } - if let Ok(Some(rpc_timeout)) = self.rpc_timeout(None) { - dict.insert("eth_rpc_timeout".into(), rpc_timeout.into_owned().into()); + if let Some(rpc_timeout) = self.rpc_timeout { + dict.insert("eth_rpc_timeout".into(), rpc_timeout.into()); } dict } diff --git a/crates/cli/src/utils/mod.rs b/crates/cli/src/utils/mod.rs index 6584456f83ae..58469cbe337c 100644 --- a/crates/cli/src/utils/mod.rs +++ b/crates/cli/src/utils/mod.rs @@ -103,9 +103,8 @@ pub fn get_provider_builder(config: &Config) -> Result { builder = builder.jwt(jwt.as_ref()); } - let rpc_timeout = config.get_rpc_timeout()?; - if let Some(rpc_timeout) = rpc_timeout { - builder = builder.timeout(Duration::from_secs(*rpc_timeout.as_ref())); + if let Some(rpc_timeout) = config.eth_rpc_timeout { + builder = builder.timeout(Duration::from_secs(rpc_timeout)); } Ok(builder) diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index e6fed7ec5780..26ccfa088a38 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -1128,24 +1128,6 @@ impl Config { Ok(self.eth_rpc_jwt.as_ref().map(|jwt| Cow::Borrowed(jwt.as_str()))) } - /// Returns the configured RPC timeout value. - /// - /// Returns: - /// - The RPC timeout value, if configured. - /// - /// # Example - /// - /// ``` - /// use foundry_config::Config; - /// # fn t() { - /// let config = Config::with_root("./"); - /// let rpc_timeout = config.get_rpc_timeout().unwrap().unwrap(); - /// # } - /// ``` - pub fn get_rpc_timeout(&self) -> Result>, UnresolvedEnvVarError> { - Ok(self.eth_rpc_timeout.as_ref().map(Cow::Borrowed)) - } - /// Returns the configured rpc url /// /// Returns: From fc84a71d53199cf0b2c9769fd8e72639b6c9159a Mon Sep 17 00:00:00 2001 From: zerosnacks <95942363+zerosnacks@users.noreply.github.com> Date: Thu, 24 Oct 2024 19:53:50 +0200 Subject: [PATCH 7/7] Apply suggestions from code review Minor documentation nits --- crates/cli/src/opts/ethereum.rs | 7 ++++--- crates/config/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/cli/src/opts/ethereum.rs b/crates/cli/src/opts/ethereum.rs index 4fed78e2957d..b858d998fafb 100644 --- a/crates/cli/src/opts/ethereum.rs +++ b/crates/cli/src/opts/ethereum.rs @@ -41,10 +41,11 @@ pub struct RpcOpts { #[arg(long, env = "ETH_RPC_JWT_SECRET")] pub jwt_secret: Option, - /// Timeout for the rpc request + /// Timeout for the RPC request in seconds. /// - /// The rpc-timeout will be used to override the default timeout for RPC. - /// Default value is 45s + /// The specified timeout will be used to override the default timeout for RPC requests. + /// + /// Default value: 45 #[arg(long, env = "ETH_RPC_TIMEOUT")] pub rpc_timeout: Option, } diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index 26ccfa088a38..2a75f3b23c72 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -238,7 +238,7 @@ pub struct Config { pub eth_rpc_url: Option, /// JWT secret that should be used for any rpc calls pub eth_rpc_jwt: Option, - /// timeout that should be used for any rpc calls + /// Timeout that should be used for any rpc calls pub eth_rpc_timeout: Option, /// etherscan API key, or alias for an `EtherscanConfig` in `etherscan` table pub etherscan_api_key: Option,