agglayer_config/
l2.rs

1use std::time::Duration;
2
3use serde::{Deserialize, Serialize};
4
5/// Configuration of the communication with the L2 nodes.
6#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
7#[serde(rename_all = "kebab-case")]
8pub struct L2 {
9    #[serde(with = "crate::with::HumanDuration")]
10    #[serde(default = "L2::default_rpc_timeout")]
11    pub rpc_timeout: Duration,
12}
13
14impl L2 {
15    const fn default_rpc_timeout() -> Duration {
16        Duration::from_secs(45)
17    }
18}
19
20impl Default for L2 {
21    fn default() -> Self {
22        Self {
23            rpc_timeout: Self::default_rpc_timeout(),
24        }
25    }
26}