Update Simulator tests (#5520)

* Rewrite Simulator

* Add fallback simulator

* Try Sean's test fix

* More fixes

* Cleanup

* Merge branch 'unstable' into update-simulator

* Update cli.rs

* Add sync sim to basic sim

* Formatting

* Add fixes and new block production check

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into update-simulator

* fix compile
This commit is contained in:
Mac L
2024-04-23 01:08:36 +10:00
committed by GitHub
parent 9b5895ca89
commit 67f8405921
18 changed files with 944 additions and 1036 deletions

View File

@@ -1,10 +1,8 @@
//! This crate provides a simluation that creates `n` beacon node and validator clients, each with
//! `v` validators. A deposit contract is deployed at the start of the simulation using a local
//! `anvil` instance (you must have `anvil` installed and avaliable on your path). All
//! beacon nodes independently listen for genesis from the deposit contract, then start operating.
//! This crate provides various simulations that create both beacon nodes and validator clients,
//! each with `v` validators.
//!
//! As the simulation runs, there are checks made to ensure that all components are running
//! correctly. If any of these checks fail, the simulation will exit immediately.
//! When a simulation runs, there are checks made to ensure that all components are operating
//! as expected. If any of these checks fail, the simulation will exit immediately.
//!
//! ## Future works
//!
@@ -16,13 +14,12 @@
#[macro_use]
extern crate clap;
mod basic_sim;
mod checks;
mod cli;
mod eth1_sim;
mod fallback_sim;
mod local_network;
mod no_eth1_sim;
mod retry;
mod sync_sim;
use cli::cli_app;
use env_logger::{Builder, Env};
@@ -37,21 +34,14 @@ fn main() {
let matches = cli_app().get_matches();
match matches.subcommand() {
("eth1-sim", Some(matches)) => match eth1_sim::run_eth1_sim(matches) {
("basic-sim", Some(matches)) => match basic_sim::run_basic_sim(matches) {
Ok(()) => println!("Simulation exited successfully"),
Err(e) => {
eprintln!("Simulation exited with error: {}", e);
std::process::exit(1)
}
},
("no-eth1-sim", Some(matches)) => match no_eth1_sim::run_no_eth1_sim(matches) {
Ok(()) => println!("Simulation exited successfully"),
Err(e) => {
eprintln!("Simulation exited with error: {}", e);
std::process::exit(1)
}
},
("syncing-sim", Some(matches)) => match sync_sim::run_syncing_sim(matches) {
("fallback-sim", Some(matches)) => match fallback_sim::run_fallback_sim(matches) {
Ok(()) => println!("Simulation exited successfully"),
Err(e) => {
eprintln!("Simulation exited with error: {}", e);