Skip to content

Commit

Permalink
chore(starknet_integration_tests): use available ports for state sync
Browse files Browse the repository at this point in the history
commit-id:7d577cc9
  • Loading branch information
Itay-Tsabary-Starkware committed Dec 18, 2024
1 parent e66be61 commit 44f1d55
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/starknet_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ pub async fn create_config(
let rpc_state_reader_config = test_rpc_state_reader_config(rpc_server_addr);
let monitoring_endpoint_config =
MonitoringEndpointConfig { port: available_ports.get_next_port(), ..Default::default() };
let state_sync_config = create_state_sync_config(state_sync_storage_config, sequencer_index);
let state_sync_config =
create_state_sync_config(state_sync_storage_config, available_ports.get_next_port());

(
SequencerNodeConfig {
Expand Down Expand Up @@ -277,12 +278,12 @@ fn set_validator_id(consensus_manager_config: &mut ConsensusManagerConfig, seque
.unwrap();
}

pub fn create_state_sync_config(
fn create_state_sync_config(
state_sync_storage_config: StorageConfig,
sequencer_index: usize,
port: u16,
) -> StateSyncConfig {
let mut config =
StateSyncConfig { storage_config: state_sync_storage_config, ..Default::default() };
config.network_config.tcp_port += u16::try_from(sequencer_index).unwrap();
config.network_config.tcp_port = port;
config
}

0 comments on commit 44f1d55

Please sign in to comment.