From d23aa5de18e3e1ee24e5eab9fcd0e47c92dbc540 Mon Sep 17 00:00:00 2001 From: Nadin Jbara <93648739+nadin-Starkware@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:30:08 +0200 Subject: [PATCH] chore(starknet_integration_tests): pass the number of composed sequencer as an arg (#3283) commit-id:613d3ef2 --- crates/starknet_integration_tests/src/flow_test_setup.rs | 3 ++- crates/starknet_integration_tests/src/sequencer_manager.rs | 1 + crates/starknet_integration_tests/src/utils.rs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/starknet_integration_tests/src/flow_test_setup.rs b/crates/starknet_integration_tests/src/flow_test_setup.rs index a7580e9f9b..bc55ede520 100644 --- a/crates/starknet_integration_tests/src/flow_test_setup.rs +++ b/crates/starknet_integration_tests/src/flow_test_setup.rs @@ -202,8 +202,9 @@ pub fn create_consensus_manager_configs_and_channels( ), ); + let n_network_configs = network_configs.len(); let consensus_manager_configs = - create_consensus_manager_configs_from_network_configs(network_configs); + create_consensus_manager_configs_from_network_configs(network_configs, n_network_configs); (consensus_manager_configs, broadcast_channels) } diff --git a/crates/starknet_integration_tests/src/sequencer_manager.rs b/crates/starknet_integration_tests/src/sequencer_manager.rs index 528f461f70..5b400fd600 100644 --- a/crates/starknet_integration_tests/src/sequencer_manager.rs +++ b/crates/starknet_integration_tests/src/sequencer_manager.rs @@ -217,6 +217,7 @@ pub(crate) async fn get_sequencer_setup_configs( let consensus_manager_configs = create_consensus_manager_configs_from_network_configs( create_connected_network_configs(available_ports.get_next_ports(n_distributed_sequencers)), + component_configs.len(), ); // TODO(Nadin): define the test storage here and pass it to the create_state_sync_configs and to diff --git a/crates/starknet_integration_tests/src/utils.rs b/crates/starknet_integration_tests/src/utils.rs index 26aa2d4a29..6ca4b9332a 100644 --- a/crates/starknet_integration_tests/src/utils.rs +++ b/crates/starknet_integration_tests/src/utils.rs @@ -117,6 +117,7 @@ pub async fn create_node_config( pub(crate) fn create_consensus_manager_configs_from_network_configs( network_configs: Vec, + n_composed_nodes: usize, ) -> Vec { // TODO(Matan, Dan): set reasonable default timeouts. let mut timeouts = TimeoutsConfig::default(); @@ -124,7 +125,7 @@ pub(crate) fn create_consensus_manager_configs_from_network_configs( timeouts.prevote_timeout *= 3; timeouts.proposal_timeout *= 3; - let num_validators = u64::try_from(network_configs.len()).unwrap(); + let num_validators = u64::try_from(n_composed_nodes).unwrap(); network_configs .into_iter()