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

@@ -331,7 +331,7 @@ impl<E: EthSpec> PendingComponents<E> {
format!(
"block {} blobs {}/{}",
block_count,
self.verified_blobs.len(),
self.verified_blobs.iter().flatten().count(),
num_expected_blobs
)
}

View File

@@ -10,7 +10,6 @@ use derivative::Derivative;
use fork_choice::ProtoBlock;
use kzg::{Error as KzgError, Kzg};
use proto_array::Block;
use slasher::test_utils::E;
use slot_clock::SlotClock;
use ssz_derive::{Decode, Encode};
use std::iter;
@@ -589,19 +588,19 @@ fn verify_proposer_and_signature<T: BeaconChainTypes>(
chain: &BeaconChain<T>,
) -> Result<(), GossipDataColumnError> {
let column_slot = data_column.slot();
let column_epoch = column_slot.epoch(E::slots_per_epoch());
let slots_per_epoch = T::EthSpec::slots_per_epoch();
let column_epoch = column_slot.epoch(slots_per_epoch);
let column_index = data_column.index;
let block_root = data_column.block_root();
let block_parent_root = data_column.block_parent_root();
let proposer_shuffling_root =
if parent_block.slot.epoch(T::EthSpec::slots_per_epoch()) == column_epoch {
parent_block
.next_epoch_shuffling_id
.shuffling_decision_block
} else {
parent_block.root
};
let proposer_shuffling_root = if parent_block.slot.epoch(slots_per_epoch) == column_epoch {
parent_block
.next_epoch_shuffling_id
.shuffling_decision_block
} else {
parent_block.root
};
// We lock the cache briefly to get or insert a OnceCell, then drop the lock
// before doing proposer shuffling calculation via `OnceCell::get_or_try_init`. This avoids
@@ -649,7 +648,7 @@ fn verify_proposer_and_signature<T: BeaconChainTypes>(
let proposer_index = *epoch_proposers
.proposers
.get(column_slot.as_usize() % T::EthSpec::slots_per_epoch() as usize)
.get(column_slot.as_usize() % slots_per_epoch as usize)
.ok_or_else(|| BeaconChainError::NoProposerForSlot(column_slot))?;
let fork = epoch_proposers.fork;