diff --git a/crates/starknet_integration_tests/src/end_to_end_integration.rs b/crates/starknet_integration_tests/src/end_to_end_integration.rs index 70a972a55b..aa115a0b84 100644 --- a/crates/starknet_integration_tests/src/end_to_end_integration.rs +++ b/crates/starknet_integration_tests/src/end_to_end_integration.rs @@ -75,10 +75,13 @@ pub async fn end_to_end_integration(mut tx_generator: MultiAccountTransactionGen let mut available_ports = AvailablePorts::new(TestIdentifier::EndToEndIntegrationTest.into(), 0); - let component_configs: Vec = vec![ComponentConfig::default(); N_SEQUENCERS] - .into_iter() - .chain(get_remote_test_component_config(&mut available_ports)) - .collect(); + info!("Available ports: {:?}", available_ports); + info!("******************************************"); + let mut component_configs: Vec = + vec![ComponentConfig::default(); N_SEQUENCERS]; + component_configs.extend(get_remote_test_component_config(&mut available_ports)); + + info!("Component configs: {:?}", component_configs); info!("Running integration test setup."); // Creating the storage for the test. @@ -118,27 +121,35 @@ pub async fn end_to_end_integration(mut tx_generator: MultiAccountTransactionGen assert_eq!(nonce, expected_nonce); } -fn get_http_only_component_config(gateway_socket: SocketAddr) -> ComponentConfig { +fn get_http_only_component_config( + gateway_socket: SocketAddr, + mempool_socket: SocketAddr, +) -> ComponentConfig { let mut config = ComponentConfig::disabled(); config.http_server = ActiveComponentExecutionConfig::default(); - config.gateway = ReactiveComponentExecutionConfig::remote(gateway_socket); + config.gateway = ReactiveComponentExecutionConfig::local_with_remote_enabled(gateway_socket); + config.mempool = ReactiveComponentExecutionConfig::remote(mempool_socket); config.monitoring_endpoint = ActiveComponentExecutionConfig::default(); config } -fn get_non_http_component_config(gateway_socket: SocketAddr) -> ComponentConfig { +fn get_non_http_component_config(gateway_socket: SocketAddr, mempool_socket: SocketAddr) -> ComponentConfig { ComponentConfig { http_server: ActiveComponentExecutionConfig::disabled(), + gateway: ReactiveComponentExecutionConfig::remote(gateway_socket), + mempool: ReactiveComponentExecutionConfig::local_with_remote_enabled(mempool_socket), monitoring_endpoint: Default::default(), - gateway: ReactiveComponentExecutionConfig::local_with_remote_enabled(gateway_socket), ..ComponentConfig::default() } } -fn get_remote_test_component_config(available_ports: &mut AvailablePorts) -> Vec { +pub fn get_remote_test_component_config( + available_ports: &mut AvailablePorts, +) -> Vec { let gateway_socket = available_ports.get_next_local_host_socket(); + let mempool_socket = available_ports.get_next_local_host_socket(); vec![ - get_http_only_component_config(gateway_socket), - get_non_http_component_config(gateway_socket), + get_http_only_component_config(gateway_socket, mempool_socket), + get_non_http_component_config(gateway_socket, mempool_socket), ] } diff --git a/crates/starknet_integration_tests/src/integration_test_setup.rs b/crates/starknet_integration_tests/src/integration_test_setup.rs index a5ca887aec..0aa96084d2 100644 --- a/crates/starknet_integration_tests/src/integration_test_setup.rs +++ b/crates/starknet_integration_tests/src/integration_test_setup.rs @@ -1,5 +1,7 @@ use std::net::SocketAddr; use std::path::PathBuf; +use std::thread::sleep; +use std::time::Duration; use blockifier::context::ChainInfo; use mempool_test_utils::starknet_api_test_utils::{Contract, MultiAccountTransactionGenerator}; @@ -49,6 +51,11 @@ impl IntegrationTestSetup { let chain_info = create_chain_info(); let accounts = tx_generator.accounts(); let n_sequencers = component_configs.len(); + info!("Creating sequencers."); + info!("n_sequencers: {}", n_sequencers); + info!("component_configs len is: {}", component_configs.len()); + info!("Component configs: {:?}", component_configs); + sleep(Duration::from_secs(5)); let (mut consensus_manager_configs, consensus_proposals_channels) = create_consensus_manager_configs_and_channels(n_sequencers, &mut available_ports);