Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(starknet_integration_tests): temporary fixes to make the e2e flow test pass #2591

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();

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
Loading