From c39fe62864c59732783ab2811304061bf51fbfc5 Mon Sep 17 00:00:00 2001 From: Itay Tsabary Date: Mon, 9 Dec 2024 10:39:21 +0200 Subject: [PATCH] chore(starknet_sequencer_node): add remote client to active component config commit-id:4f409ba2 --- config/sequencer/default_config.json | 25 +++++++++++++++++++ .../src/config/component_execution_config.rs | 11 +++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/config/sequencer/default_config.json b/config/sequencer/default_config.json index 5ea406f65d0..221fb3add74 100644 --- a/config/sequencer/default_config.json +++ b/config/sequencer/default_config.json @@ -509,6 +509,31 @@ "privacy": "Public", "value": "Enabled" }, + "components.monitoring_endpoint.remote_client_config.#is_none": { + "description": "Flag for an optional field.", + "privacy": "TemporaryValue", + "value": true + }, + "components.monitoring_endpoint.remote_client_config.idle_connections": { + "description": "The maximum number of idle connections to keep alive.", + "privacy": "Public", + "value": 18446744073709551615 + }, + "components.monitoring_endpoint.remote_client_config.idle_timeout": { + "description": "The duration in seconds to keep an idle connection open before closing.", + "privacy": "Public", + "value": 90 + }, + "components.monitoring_endpoint.remote_client_config.retries": { + "description": "The max number of retries for sending a message.", + "privacy": "Public", + "value": 3 + }, + "components.monitoring_endpoint.remote_client_config.socket": { + "description": "The remote component server socket.", + "privacy": "Public", + "value": "0.0.0.0:8080" + }, "components.state_sync.execution_mode": { "description": "The component execution mode.", "privacy": "Public", diff --git a/crates/starknet_sequencer_node/src/config/component_execution_config.rs b/crates/starknet_sequencer_node/src/config/component_execution_config.rs index 6f6312987e0..2bbb54437c5 100644 --- a/crates/starknet_sequencer_node/src/config/component_execution_config.rs +++ b/crates/starknet_sequencer_node/src/config/component_execution_config.rs @@ -73,22 +73,27 @@ impl Default for ReactiveComponentExecutionConfig { #[derive(Clone, Debug, Serialize, Deserialize, Validate, PartialEq)] pub struct ActiveComponentExecutionConfig { pub execution_mode: ActiveComponentExecutionMode, + pub remote_client_config: Option, } impl SerializeConfig for ActiveComponentExecutionConfig { fn dump(&self) -> BTreeMap { - BTreeMap::from_iter([ser_param( + let members = BTreeMap::from_iter([ser_param( "execution_mode", &self.execution_mode, "The component execution mode.", ParamPrivacyInput::Public, - )]) + )]); + vec![members, ser_optional_sub_config(&self.remote_client_config, "remote_client_config")] + .into_iter() + .flatten() + .collect() } } impl Default for ActiveComponentExecutionConfig { fn default() -> Self { - Self { execution_mode: ActiveComponentExecutionMode::Enabled } + Self { execution_mode: ActiveComponentExecutionMode::Enabled, remote_client_config: None } } }