From 1a6b02d58b57c7a6ed1b5a12cd5cc644c3ab1955 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Tue, 14 May 2024 16:12:00 +0200 Subject: [PATCH 1/4] fix: signer registration in aggregator stress test --- .../src/stress_test/aggregator_helpers.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs b/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs index ecfac461ee3..5fa62b39f93 100644 --- a/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs +++ b/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs @@ -60,14 +60,6 @@ pub async fn bootstrap_aggregator( restart_aggregator_and_move_one_epoch_forward(&mut aggregator, current_epoch, args).await?; - fake_signer::try_register_signer_until_registration_round_is_open( - &aggregator, - &signers_fixture.signers()[0], - *current_epoch + 1, - Duration::from_secs(60), - ) - .await?; - info!(">> Send the Signer Key Registrations payloads for the genesis signers"); let errors = fake_signer::register_signers_to_aggregator( &aggregator, @@ -77,13 +69,7 @@ pub async fn bootstrap_aggregator( .await?; assert_eq!(0, errors); - fake_signer::try_register_signer_until_registration_round_is_open( - &aggregator, - &signers_fixture.signers()[0], - *current_epoch + 1, - Duration::from_secs(60), - ) - .await?; + restart_aggregator_and_move_one_epoch_forward(&mut aggregator, current_epoch, args).await?; restart_aggregator_and_move_one_epoch_forward(&mut aggregator, current_epoch, args).await?; @@ -133,7 +119,7 @@ async fn restart_aggregator_and_move_one_epoch_forward( *current_epoch += 1; fake_chain::set_epoch(&args.mock_epoch_file_path(), *current_epoch); - info!(">> Restarting the aggregator with a large run interval"); + info!(">> Restarting the aggregator still with a large run interval"); aggregator.serve().unwrap(); wait::for_http_response( &format!("{}/epoch-settings", aggregator.endpoint()), From e1d8f6efb892d48615c5a57113c2100a5f52ea36 Mon Sep 17 00:00:00 2001 From: sfauvel Date: Thu, 16 May 2024 10:56:51 +0200 Subject: [PATCH 2/4] Keep only first part of stress test to be faster --- .../src/bin/load-aggregator/main.rs | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/mithril-test-lab/mithril-end-to-end/src/bin/load-aggregator/main.rs b/mithril-test-lab/mithril-end-to-end/src/bin/load-aggregator/main.rs index 0f472191c11..a4c518720ef 100644 --- a/mithril-test-lab/mithril-end-to-end/src/bin/load-aggregator/main.rs +++ b/mithril-test-lab/mithril-end-to-end/src/bin/load-aggregator/main.rs @@ -67,52 +67,52 @@ async fn main() -> StdResult<()> { let aggregator_endpoint = aggregator.endpoint(); reporter.stop(); - let mut scenario_parameters = ScenarioParameters { - aggregator, - aggregator_parameters, - signers_fixture, - immutable_db, - reporter, - precomputed_mithril_stake_distribution_signatures: mithril_stake_distribution_signatures, - }; - - let scenario_counters = ScenarioCounters { - current_epoch, - number_of_certificates: 1, - number_of_mithril_stake_distributions: 0, - number_of_snapshots: 0, - }; - - info!(">> Run phase 1 without client load"); - let scenario_counters = main_scenario(scenario_counters, &mut scenario_parameters).await?; - - info!(">> Run phase 2 with client load"); - let (shutdown_tx, mut shutdown_rx) = oneshot::channel(); - let clients_handle = tokio::spawn(async move { - if opts.num_clients > 0 { - loop { - tokio::select! { - _msg = &mut shutdown_rx => { - break; - } - _ = clients_scenario(aggregator_endpoint.clone(), opts.num_clients) => { - - } - } - } - } - }); - main_scenario(scenario_counters, &mut scenario_parameters) - .await - .expect("the main scenario should not fail"); - let _ = shutdown_tx.send(()); - clients_handle.await.unwrap(); - - info!(">> Display execution timings:"); - scenario_parameters.reporter.print_report(); - - info!(">> All steps executed successfully, stopping all tasks..."); - scenario_parameters.aggregator.stop().await.unwrap(); + // let mut scenario_parameters = ScenarioParameters { + // aggregator, + // aggregator_parameters, + // signers_fixture, + // immutable_db, + // reporter, + // precomputed_mithril_stake_distribution_signatures: mithril_stake_distribution_signatures, + // }; + + // let scenario_counters = ScenarioCounters { + // current_epoch, + // number_of_certificates: 1, + // number_of_mithril_stake_distributions: 0, + // number_of_snapshots: 0, + // }; + + // info!(">> Run phase 1 without client load"); + // let scenario_counters = main_scenario(scenario_counters, &mut scenario_parameters).await?; + + // info!(">> Run phase 2 with client load"); + // let (shutdown_tx, mut shutdown_rx) = oneshot::channel(); + // let clients_handle = tokio::spawn(async move { + // if opts.num_clients > 0 { + // loop { + // tokio::select! { + // _msg = &mut shutdown_rx => { + // break; + // } + // _ = clients_scenario(aggregator_endpoint.clone(), opts.num_clients) => { + + // } + // } + // } + // } + // }); + // main_scenario(scenario_counters, &mut scenario_parameters) + // .await + // .expect("the main scenario should not fail"); + // let _ = shutdown_tx.send(()); + // clients_handle.await.unwrap(); + + // info!(">> Display execution timings:"); + // scenario_parameters.reporter.print_report(); + + // info!(">> All steps executed successfully, stopping all tasks..."); + // scenario_parameters.aggregator.stop().await.unwrap(); Ok(()) } From 0e9614affa49d54de7bef013fe08dd0ff0d58b97 Mon Sep 17 00:00:00 2001 From: sfauvel Date: Thu, 16 May 2024 11:32:16 +0200 Subject: [PATCH 3/4] Uncomment code to execute all stress scenario --- .../src/bin/load-aggregator/main.rs | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/mithril-test-lab/mithril-end-to-end/src/bin/load-aggregator/main.rs b/mithril-test-lab/mithril-end-to-end/src/bin/load-aggregator/main.rs index a4c518720ef..0f472191c11 100644 --- a/mithril-test-lab/mithril-end-to-end/src/bin/load-aggregator/main.rs +++ b/mithril-test-lab/mithril-end-to-end/src/bin/load-aggregator/main.rs @@ -67,52 +67,52 @@ async fn main() -> StdResult<()> { let aggregator_endpoint = aggregator.endpoint(); reporter.stop(); - // let mut scenario_parameters = ScenarioParameters { - // aggregator, - // aggregator_parameters, - // signers_fixture, - // immutable_db, - // reporter, - // precomputed_mithril_stake_distribution_signatures: mithril_stake_distribution_signatures, - // }; - - // let scenario_counters = ScenarioCounters { - // current_epoch, - // number_of_certificates: 1, - // number_of_mithril_stake_distributions: 0, - // number_of_snapshots: 0, - // }; - - // info!(">> Run phase 1 without client load"); - // let scenario_counters = main_scenario(scenario_counters, &mut scenario_parameters).await?; - - // info!(">> Run phase 2 with client load"); - // let (shutdown_tx, mut shutdown_rx) = oneshot::channel(); - // let clients_handle = tokio::spawn(async move { - // if opts.num_clients > 0 { - // loop { - // tokio::select! { - // _msg = &mut shutdown_rx => { - // break; - // } - // _ = clients_scenario(aggregator_endpoint.clone(), opts.num_clients) => { - - // } - // } - // } - // } - // }); - // main_scenario(scenario_counters, &mut scenario_parameters) - // .await - // .expect("the main scenario should not fail"); - // let _ = shutdown_tx.send(()); - // clients_handle.await.unwrap(); - - // info!(">> Display execution timings:"); - // scenario_parameters.reporter.print_report(); - - // info!(">> All steps executed successfully, stopping all tasks..."); - // scenario_parameters.aggregator.stop().await.unwrap(); + let mut scenario_parameters = ScenarioParameters { + aggregator, + aggregator_parameters, + signers_fixture, + immutable_db, + reporter, + precomputed_mithril_stake_distribution_signatures: mithril_stake_distribution_signatures, + }; + + let scenario_counters = ScenarioCounters { + current_epoch, + number_of_certificates: 1, + number_of_mithril_stake_distributions: 0, + number_of_snapshots: 0, + }; + + info!(">> Run phase 1 without client load"); + let scenario_counters = main_scenario(scenario_counters, &mut scenario_parameters).await?; + + info!(">> Run phase 2 with client load"); + let (shutdown_tx, mut shutdown_rx) = oneshot::channel(); + let clients_handle = tokio::spawn(async move { + if opts.num_clients > 0 { + loop { + tokio::select! { + _msg = &mut shutdown_rx => { + break; + } + _ = clients_scenario(aggregator_endpoint.clone(), opts.num_clients) => { + + } + } + } + } + }); + main_scenario(scenario_counters, &mut scenario_parameters) + .await + .expect("the main scenario should not fail"); + let _ = shutdown_tx.send(()); + clients_handle.await.unwrap(); + + info!(">> Display execution timings:"); + scenario_parameters.reporter.print_report(); + + info!(">> All steps executed successfully, stopping all tasks..."); + scenario_parameters.aggregator.stop().await.unwrap(); Ok(()) } From 0655d595d63b1a5f70629dd49312c1d5d4085c51 Mon Sep 17 00:00:00 2001 From: sfauvel Date: Thu, 16 May 2024 14:48:38 +0200 Subject: [PATCH 4/4] Fix a call restart twice --- .../mithril-end-to-end/src/stress_test/aggregator_helpers.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs b/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs index 5fa62b39f93..8058767252b 100644 --- a/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs +++ b/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs @@ -71,8 +71,6 @@ pub async fn bootstrap_aggregator( restart_aggregator_and_move_one_epoch_forward(&mut aggregator, current_epoch, args).await?; - restart_aggregator_and_move_one_epoch_forward(&mut aggregator, current_epoch, args).await?; - info!(">> Send the Signer Key Registrations payloads for next genesis signers"); let errors = fake_signer::register_signers_to_aggregator( &aggregator,