Skip to content

Commit

Permalink
test: test
Browse files Browse the repository at this point in the history
commit-id:300ffcf0
  • Loading branch information
nadin-Starkware committed Dec 26, 2024
1 parent 4a95470 commit 41e12fc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
33 changes: 22 additions & 11 deletions crates/starknet_integration_tests/src/end_to_end_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ComponentConfig> = 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<ComponentConfig> =
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.
Expand Down Expand Up @@ -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<ComponentConfig> {
pub fn get_remote_test_component_config(
available_ports: &mut AvailablePorts,
) -> Vec<ComponentConfig> {
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),
]
}
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 41e12fc

Please sign in to comment.