Add Electra forks to basic sim tests (#7199)

This PR adds transitions to Electra ~~and Fulu~~ fork epochs in the simulator tests.

~~It also covers blob inclusion verification and data column syncing on a full node in Fulu.~~

UPDATE: Remove fulu fork from sim tests due to https://github.com/sigp/lighthouse/pull/7199#issuecomment-2852281176
This commit is contained in:
Jimmy Chen
2025-05-08 18:43:44 +10:00
committed by GitHub
parent e90fcbe657
commit 4b9c16fc71
6 changed files with 46 additions and 34 deletions

View File

@@ -128,17 +128,23 @@ pub async fn verify_full_block_production_up_to<E: EthSpec>(
slot_delay(slot, slot_duration).await;
let beacon_nodes = network.beacon_nodes.read();
let beacon_chain = beacon_nodes[0].client.beacon_chain().unwrap();
let num_blocks = beacon_chain
let block_slots = beacon_chain
.chain_dump()
.unwrap()
.iter()
.take_while(|s| s.beacon_block.slot() <= slot)
.count();
.map(|s| s.beacon_block.slot().as_usize())
.collect::<Vec<_>>();
let num_blocks = block_slots.len();
if num_blocks != slot.as_usize() + 1 {
let missed_slots = (0..slot.as_usize())
.filter(|slot| !block_slots.contains(slot))
.collect::<Vec<_>>();
return Err(format!(
"There wasn't a block produced at every slot, got: {}, expected: {}",
"There wasn't a block produced at every slot, got: {}, expected: {}, missed: {:?}",
num_blocks,
slot.as_usize() + 1
slot.as_usize() + 1,
missed_slots
));
}
Ok(())
@@ -185,12 +191,17 @@ pub async fn verify_full_sync_aggregates_up_to<E: EthSpec>(
.get_beacon_blocks::<E>(BlockId::Slot(Slot::new(slot)))
.await
.map(|resp| {
resp.unwrap()
.data
.message()
.body()
.sync_aggregate()
.map(|agg| agg.num_set_bits())
resp.unwrap_or_else(|| {
panic!(
"Beacon block for slot {} not returned from Beacon API",
slot
)
})
.data
.message()
.body()
.sync_aggregate()
.map(|agg| agg.num_set_bits())
})
.map_err(|e| format!("Error while getting beacon block: {:?}", e))?
.map_err(|_| format!("Altair block {} should have sync aggregate", slot))?;