Skip to content

Commit

Permalink
chore(starknet_sequencer_node): remove remote client config from acti…
Browse files Browse the repository at this point in the history
…ve component (#3154)

commit-id:cb97fead
  • Loading branch information
nadin-Starkware authored Jan 7, 2025
1 parent 12e7766 commit 95e7789
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 100 deletions.
75 changes: 0 additions & 75 deletions config/sequencer/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,31 +284,6 @@
"privacy": "Public",
"value": "Enabled"
},
"components.consensus_manager.remote_client_config.#is_none": {
"description": "Flag for an optional field.",
"privacy": "TemporaryValue",
"value": true
},
"components.consensus_manager.remote_client_config.idle_connections": {
"description": "The maximum number of idle connections to keep alive.",
"privacy": "Public",
"value": 18446744073709551615
},
"components.consensus_manager.remote_client_config.idle_timeout": {
"description": "The duration in seconds to keep an idle connection open before closing.",
"privacy": "Public",
"value": 90
},
"components.consensus_manager.remote_client_config.retries": {
"description": "The max number of retries for sending a message.",
"privacy": "Public",
"value": 3
},
"components.consensus_manager.remote_client_config.socket": {
"description": "The remote component server socket.",
"privacy": "Public",
"value": "0.0.0.0:8080"
},
"components.gateway.execution_mode": {
"description": "The component execution mode.",
"privacy": "Public",
Expand Down Expand Up @@ -364,31 +339,6 @@
"privacy": "Public",
"value": "Enabled"
},
"components.http_server.remote_client_config.#is_none": {
"description": "Flag for an optional field.",
"privacy": "TemporaryValue",
"value": true
},
"components.http_server.remote_client_config.idle_connections": {
"description": "The maximum number of idle connections to keep alive.",
"privacy": "Public",
"value": 18446744073709551615
},
"components.http_server.remote_client_config.idle_timeout": {
"description": "The duration in seconds to keep an idle connection open before closing.",
"privacy": "Public",
"value": 90
},
"components.http_server.remote_client_config.retries": {
"description": "The max number of retries for sending a message.",
"privacy": "Public",
"value": 3
},
"components.http_server.remote_client_config.socket": {
"description": "The remote component server socket.",
"privacy": "Public",
"value": "0.0.0.0:8080"
},
"components.l1_provider.execution_mode": {
"description": "The component execution mode.",
"privacy": "Public",
Expand Down Expand Up @@ -544,31 +494,6 @@
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,16 @@ impl ReactiveComponentExecutionConfig {
#[validate(schema(function = "validate_active_component_execution_config"))]
pub struct ActiveComponentExecutionConfig {
pub execution_mode: ActiveComponentExecutionMode,
pub remote_client_config: Option<RemoteClientConfig>,
}

impl SerializeConfig for ActiveComponentExecutionConfig {
fn dump(&self) -> BTreeMap<ParamPath, SerializedParam> {
let members = BTreeMap::from_iter([ser_param(
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()
)])
}
}

Expand All @@ -141,11 +136,11 @@ impl Default for ActiveComponentExecutionConfig {

impl ActiveComponentExecutionConfig {
pub fn disabled() -> Self {
Self { execution_mode: ActiveComponentExecutionMode::Disabled, remote_client_config: None }
Self { execution_mode: ActiveComponentExecutionMode::Disabled }
}

pub fn enabled() -> Self {
Self { execution_mode: ActiveComponentExecutionMode::Enabled, remote_client_config: None }
Self { execution_mode: ActiveComponentExecutionMode::Enabled }
}
}

Expand Down Expand Up @@ -181,23 +176,9 @@ fn validate_reactive_component_execution_config(
}

fn validate_active_component_execution_config(
component_config: &ActiveComponentExecutionConfig,
_component_config: &ActiveComponentExecutionConfig,
) -> Result<(), ValidationError> {
match (component_config.execution_mode.clone(), component_config.remote_client_config.is_some())
{
(ActiveComponentExecutionMode::Disabled, true) => {
error!(
"Invalid active component execution configuration: Disabled mode with \
remote_client_config: {:?}",
component_config.remote_client_config
);
let mut error =
ValidationError::new("Invalid active component execution configuration.");
error.message = Some("Ensure settings align with the chosen execution mode.".into());
Err(error)
}
_ => Ok(()),
}
Ok(())
}

// There are components that are described with a reactive mode setting, however, result in the
Expand Down

0 comments on commit 95e7789

Please sign in to comment.