Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(starknet_integration_tests): temporary fixes to make the e2e flow…
Browse files Browse the repository at this point in the history
… test pass
yair-starkware committed Dec 10, 2024
1 parent b1ee806 commit bff4ffa
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
@@ -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(
10 changes: 9 additions & 1 deletion crates/starknet_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
@@ -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()
},
})
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ async fn end_to_end_flow(mut tx_generator: MultiAccountTransactionGenerator) {
configure_tracing();

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;

0 comments on commit bff4ffa

Please sign in to comment.