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

@@ -26,6 +26,7 @@ use eth2::{
types::{BlockId, StateId},
BeaconNodeHttpClient, Error as ApiError, Timeouts,
};
use execution_layer::test_utils::generate_genesis_header;
use execution_layer::ExecutionLayer;
use futures::channel::mpsc::Receiver;
use genesis::{interop_genesis_state, Eth1GenesisService, DEFAULT_ETH1_BLOCK_HASH};
@@ -267,6 +268,21 @@ where
)?;
builder.genesis_state(genesis_state).map(|v| (v, None))?
}
ClientGenesis::InteropMerge {
validator_count,
genesis_time,
} => {
let execution_payload_header = generate_genesis_header(&spec, true);
let keypairs = generate_deterministic_keypairs(validator_count);
let genesis_state = interop_genesis_state(
&keypairs,
genesis_time,
Hash256::from_slice(DEFAULT_ETH1_BLOCK_HASH),
execution_payload_header,
&spec,
)?;
builder.genesis_state(genesis_state).map(|v| (v, None))?
}
ClientGenesis::GenesisState => {
info!(
context.log(),

View File

@@ -24,6 +24,11 @@ pub enum ClientGenesis {
validator_count: usize,
genesis_time: u64,
},
// Creates a genesis state similar to the 2019 Canada specs, but starting post-Merge.
InteropMerge {
validator_count: usize,
genesis_time: u64,
},
/// Reads the genesis state and other persisted data from the `Store`.
FromStore,
/// Connects to an eth1 node and waits until it can create the genesis state from the deposit