Skip to content

Commit

Permalink
chore(starknet_sequencer_node): set consensus manager as active compo…
Browse files Browse the repository at this point in the history
…nent

commit-id:80cc5c87
  • Loading branch information
Itay-Tsabary-Starkware committed Dec 9, 2024
1 parent a0254dd commit 3d4444a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 34 deletions.
22 changes: 1 addition & 21 deletions config/sequencer/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,7 @@
"components.consensus_manager.execution_mode": {
"description": "The component execution mode.",
"privacy": "Public",
"value": "LocalExecutionWithRemoteDisabled"
},
"components.consensus_manager.local_server_config.#is_none": {
"description": "Flag for an optional field.",
"privacy": "TemporaryValue",
"value": false
},
"components.consensus_manager.local_server_config.channel_buffer_size": {
"description": "The communication channel buffer size.",
"privacy": "Public",
"value": 32
"value": "Enabled"
},
"components.consensus_manager.remote_client_config.#is_none": {
"description": "Flag for an optional field.",
Expand All @@ -294,16 +284,6 @@
"privacy": "Public",
"value": "0.0.0.0:8080"
},
"components.consensus_manager.remote_server_config.#is_none": {
"description": "Flag for an optional field.",
"privacy": "TemporaryValue",
"value": true
},
"components.consensus_manager.remote_server_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
2 changes: 1 addition & 1 deletion crates/starknet_integration_tests/src/config_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub async fn get_http_only_component_config(gateway_socket: SocketAddr) -> Compo
gateway: get_remote_component_config(gateway_socket),
monitoring_endpoint: Default::default(),
batcher: get_disabled_component_config(),
consensus_manager: get_disabled_component_config(),
consensus_manager: ActiveComponentExecutionConfig::disabled(),
mempool: get_disabled_component_config(),
mempool_p2p: get_disabled_component_config(),
state_sync: get_disabled_component_config(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use starknet_mempool_p2p::config::MempoolP2pConfig;
use starknet_mempool_p2p::MEMPOOL_TOPIC;
use starknet_sequencer_node::config::component_config::ComponentConfig;
use starknet_sequencer_node::config::component_execution_config::{
ActiveComponentExecutionConfig,
ReactiveComponentExecutionConfig,
ReactiveComponentExecutionMode,
};
Expand Down Expand Up @@ -58,11 +59,7 @@ async fn test_mempool_sends_tx_to_other_peer(mut tx_generator: MultiAccountTrans

// Derive the configuration for the mempool node.
let components = ComponentConfig {
consensus_manager: ReactiveComponentExecutionConfig {
execution_mode: ReactiveComponentExecutionMode::Disabled,
local_server_config: None,
..Default::default()
},
consensus_manager: ActiveComponentExecutionConfig::disabled(),
batcher: ReactiveComponentExecutionConfig {
execution_mode: ReactiveComponentExecutionMode::Disabled,
local_server_config: None,
Expand Down
5 changes: 2 additions & 3 deletions crates/starknet_sequencer_node/src/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ pub fn create_node_components(
ReactiveComponentExecutionMode::Disabled | ReactiveComponentExecutionMode::Remote => None,
};
let consensus_manager = match config.components.consensus_manager.execution_mode {
ReactiveComponentExecutionMode::LocalExecutionWithRemoteDisabled
| ReactiveComponentExecutionMode::LocalExecutionWithRemoteEnabled => {
ActiveComponentExecutionMode::Enabled => {
let batcher_client =
clients.get_batcher_shared_client().expect("Batcher Client should be available");
// TODO(shahak): Use the real client once we connect state sync to the node.
Expand All @@ -59,7 +58,7 @@ pub fn create_node_components(
state_sync_client,
))
}
ReactiveComponentExecutionMode::Disabled | ReactiveComponentExecutionMode::Remote => None,
ActiveComponentExecutionMode::Disabled => None,
};
let gateway = match config.components.gateway.execution_mode {
ReactiveComponentExecutionMode::LocalExecutionWithRemoteDisabled
Expand Down
5 changes: 2 additions & 3 deletions crates/starknet_sequencer_node/src/config/component_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ pub struct ComponentConfig {
#[validate]
pub batcher: ReactiveComponentExecutionConfig,
#[validate]
pub consensus_manager: ReactiveComponentExecutionConfig,
#[validate]
pub gateway: ReactiveComponentExecutionConfig,
#[validate]
pub mempool: ReactiveComponentExecutionConfig,
Expand All @@ -28,6 +26,7 @@ pub struct ComponentConfig {
pub state_sync: ReactiveComponentExecutionConfig,

// Active component configs.
pub consensus_manager: ActiveComponentExecutionConfig,
pub http_server: ActiveComponentExecutionConfig,
pub monitoring_endpoint: ActiveComponentExecutionConfig,
}
Expand All @@ -37,12 +36,12 @@ impl Default for ComponentConfig {
Self {
// Reactive component configs.
batcher: ReactiveComponentExecutionConfig::batcher_default_config(),
consensus_manager: ReactiveComponentExecutionConfig::consensus_manager_default_config(),
gateway: ReactiveComponentExecutionConfig::gateway_default_config(),
mempool: ReactiveComponentExecutionConfig::mempool_default_config(),
mempool_p2p: ReactiveComponentExecutionConfig::mempool_p2p_default_config(),
state_sync: ReactiveComponentExecutionConfig::state_sync_default_config(),
// Active component configs.
consensus_manager: Default::default(),
http_server: Default::default(),
monitoring_endpoint: Default::default(),
}
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet_sequencer_node/src/servers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ fn create_wrapper_servers(
config: &SequencerNodeConfig,
components: &mut SequencerNodeComponents,
) -> WrapperServers {
let consensus_manager_server = create_wrapper_server!(
let consensus_manager_server = create_wrapper_server_for_active_component!(
&config.components.consensus_manager.execution_mode,
components.consensus_manager
);
Expand Down

0 comments on commit 3d4444a

Please sign in to comment.