Skip to content

Commit

Permalink
fix(starknet_integration_tests): temporary fixes to make the e2e flow…
Browse files Browse the repository at this point in the history
… test pass (#2591)
  • Loading branch information
yair-starkware authored Dec 10, 2024
1 parent 9cab5e3 commit 13080c9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion crates/starknet_batcher/src/batcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ pub fn deadline_as_instant(deadline: chrono::DateTime<Utc>) -> BatcherResult<tok
let time_to_deadline = deadline - chrono::Utc::now();
let as_duration =
time_to_deadline.to_std().map_err(|_| BatcherError::TimeToDeadlineError { deadline })?;
Ok((std::time::Instant::now() + as_duration).into())
// TODO(Matan): this is a temporary solution to the timeout issue.
Ok((std::time::Instant::now() + (as_duration / 2)).into())
}

fn verify_block_input(
Expand Down
10 changes: 9 additions & 1 deletion crates/starknet_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,23 @@ pub fn create_consensus_manager_configs_and_channels(
);
// TODO: Need to also add a channel for votes, in addition to the proposals channel.

// TODO(Matan, Dan): set reasonable default timeouts.
let mut timeouts = papyrus_consensus::config::TimeoutsConfig::default();
timeouts.precommit_timeout *= 3;
timeouts.prevote_timeout *= 3;
timeouts.proposal_timeout *= 3;

let consensus_manager_configs = network_configs
.into_iter()
// TODO(Matan): Get config from default config file.
.map(|network_config| ConsensusManagerConfig {
consensus_config: ConsensusConfig {
start_height: BlockNumber(1),
consensus_delay: Duration::from_secs(1),
// TODO(Matan, Dan): Set the right amount
consensus_delay: Duration::from_secs(5),
network_config,
num_validators: u64::try_from(n_managers).unwrap(),
timeouts: timeouts.clone(),
..Default::default()
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async fn end_to_end_flow(mut tx_generator: MultiAccountTransactionGenerator) {
configure_tracing().await;

const LISTEN_TO_BROADCAST_MESSAGES_TIMEOUT: std::time::Duration =
std::time::Duration::from_secs(5);
std::time::Duration::from_secs(50);
// Setup.
let mut mock_running_system = FlowTestSetup::new_from_tx_generator(&tx_generator).await;

Expand Down

0 comments on commit 13080c9

Please sign in to comment.