diff --git a/crates/starknet_integration_tests/src/flow_test_setup.rs b/crates/starknet_integration_tests/src/flow_test_setup.rs index 415494ff4d..eb95afc72f 100644 --- a/crates/starknet_integration_tests/src/flow_test_setup.rs +++ b/crates/starknet_integration_tests/src/flow_test_setup.rs @@ -24,6 +24,7 @@ use crate::utils::{ create_chain_info, create_config, create_consensus_manager_configs_and_channels, + get_http_server_config, }; const SEQUENCER_0: usize = 0; @@ -95,7 +96,7 @@ pub struct SequencerSetup { // Handle of the sequencer node. pub sequencer_node_handles: Vec>>, - pub config: SequencerNodeConfig, + pub configs: Vec, } impl SequencerSetup { @@ -120,7 +121,7 @@ impl SequencerSetup { .await; // Derive the configuration for the sequencer node. - let (config, _required_params) = create_config( + let (configs, _required_params) = create_config( sequencer_index, chain_info, rpc_server_addr, @@ -129,16 +130,27 @@ impl SequencerSetup { ) .await; - debug!("Sequencer config: {:#?}", config); + debug!("Sequencer configs: {:#?}", configs); - let (_clients, servers) = create_node_modules(&config); + let mut all_clients = vec![]; + let mut all_servers = vec![]; + for config in configs.iter() { + let (clients, servers) = create_node_modules(config); + all_clients.push(clients); + all_servers.push(servers); + } - let HttpServerConfig { ip, port } = config.http_server_config; - let add_tx_http_client = HttpTestClient::new(SocketAddr::from((ip, port))); + let HttpServerConfig { ip, port } = + get_http_server_config(&configs).expect("No matching HttpServerConfig found"); + let add_tx_http_client = HttpTestClient::new(SocketAddr::from((*ip, *port))); // Build and run the sequencer node. - let sequencer_node_future = run_component_servers(servers); - let sequencer_node_handles = vec![task_executor.spawn_with_handle(sequencer_node_future)]; + let mut sequencer_node_handles = vec![]; + for server in all_servers { + let sequencer_node_future = run_component_servers(server); + let sequencer_node_handle = task_executor.spawn_with_handle(sequencer_node_future); + sequencer_node_handles.push(sequencer_node_handle); + } // Wait for server to spin up. // TODO(Gilad): Replace with a persistent Client with a built-in retry to protect against CI @@ -151,7 +163,7 @@ impl SequencerSetup { batcher_storage_file_handle: storage_for_test.batcher_storage_handle, rpc_storage_file_handle: storage_for_test.rpc_storage_handle, sequencer_node_handles, - config, + configs, } } diff --git a/crates/starknet_integration_tests/src/integration_test_setup.rs b/crates/starknet_integration_tests/src/integration_test_setup.rs index c83fb2f6a9..5c2f23d757 100644 --- a/crates/starknet_integration_tests/src/integration_test_setup.rs +++ b/crates/starknet_integration_tests/src/integration_test_setup.rs @@ -57,7 +57,7 @@ impl IntegrationTestSetup { create_consensus_manager_configs_and_channels(SEQUENCER_INDICES.len()); // Derive the configuration for the sequencer node. - let (config, required_params) = create_config( + let (configs, required_params) = create_config( SEQUENCER_INDEX, chain_info, rpc_server_addr, @@ -66,9 +66,11 @@ impl IntegrationTestSetup { ) .await; + let config = &configs[0]; + let node_config_dir_handle = tempdir().unwrap(); let node_config_path = dump_config_file_changes( - &config, + config, required_params, node_config_dir_handle.path().to_path_buf(), ); @@ -84,7 +86,7 @@ impl IntegrationTestSetup { add_tx_http_client, is_alive_test_client, batcher_storage_handle: storage_for_test.batcher_storage_handle, - batcher_storage_config: config.batcher_config.storage, + batcher_storage_config: config.batcher_config.storage.clone(), rpc_storage_handle: storage_for_test.rpc_storage_handle, node_config_dir_handle, node_config_path, diff --git a/crates/starknet_integration_tests/src/utils.rs b/crates/starknet_integration_tests/src/utils.rs index 6d9c9d67c3..0732612c46 100644 --- a/crates/starknet_integration_tests/src/utils.rs +++ b/crates/starknet_integration_tests/src/utils.rs @@ -50,7 +50,7 @@ pub async fn create_config( rpc_server_addr: SocketAddr, batcher_storage_config: StorageConfig, mut consensus_manager_config: ConsensusManagerConfig, -) -> (SequencerNodeConfig, RequiredParams) { +) -> (Vec, RequiredParams) { set_validator_id(&mut consensus_manager_config, sequencer_index); let fee_token_addresses = chain_info.fee_token_addresses.clone(); let batcher_config = create_batcher_config(batcher_storage_config, chain_info.clone()); @@ -62,7 +62,7 @@ pub async fn create_config( let monitoring_endpoint_config = create_monitoring_endpoint_config(sequencer_index); ( - SequencerNodeConfig { + vec![SequencerNodeConfig { batcher_config, consensus_manager_config, gateway_config, @@ -71,7 +71,7 @@ pub async fn create_config( mempool_p2p_config, monitoring_endpoint_config, ..Default::default() - }, + }], RequiredParams { chain_id: chain_info.chain_id, eth_fee_token_address: fee_token_addresses.eth_fee_token_address,