mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
Gloas test fixes (#7932)
* use builder_pending_payments_limit in upgrade gloas * check_all_blocks_from_altair_to_fulu test to not cover gloas for now * store_tests fixes * remove gloas fork from CI network testing for now * remove gloas fork from CI network testing for now
This commit is contained in:
11
Makefile
11
Makefile
@@ -34,6 +34,11 @@ PROFILE ?= release
|
||||
# they run for different forks.
|
||||
FORKS=phase0 altair bellatrix capella deneb electra fulu gloas
|
||||
|
||||
# List of all hard forks up to gloas. This list is used to set env variables for several tests so that
|
||||
# they run for different forks.
|
||||
# TODO(EIP-7732) Remove this once we extend network tests to support gloas
|
||||
FORKS_BEFORE_GLOAS=phase0 altair bellatrix capella deneb electra fulu
|
||||
|
||||
# List of all recent hard forks. This list is used to set env variables for http_api tests
|
||||
RECENT_FORKS=electra fulu
|
||||
|
||||
@@ -188,7 +193,8 @@ nextest-run-ef-tests:
|
||||
./$(EF_TESTS)/check_all_files_accessed.py $(EF_TESTS)/.accessed_file_log.txt $(EF_TESTS)/consensus-spec-tests
|
||||
|
||||
# Run the tests in the `beacon_chain` crate for all known forks.
|
||||
test-beacon-chain: $(patsubst %,test-beacon-chain-%,$(FORKS))
|
||||
# TODO(EIP-7732) Extend to support gloas
|
||||
test-beacon-chain: $(patsubst %,test-beacon-chain-%,$(FORKS_BEFORE_GLOAS))
|
||||
|
||||
test-beacon-chain-%:
|
||||
env FORK_NAME=$* cargo nextest run --release --features "fork_from_env,slasher/lmdb,$(TEST_FEATURES)" -p beacon_chain
|
||||
@@ -209,7 +215,8 @@ test-op-pool-%:
|
||||
-p operation_pool
|
||||
|
||||
# Run the tests in the `network` crate for all known forks.
|
||||
test-network: $(patsubst %,test-network-%,$(FORKS))
|
||||
# TODO(EIP-7732) Extend to support gloas
|
||||
test-network: $(patsubst %,test-network-%,$(FORKS_BEFORE_GLOAS))
|
||||
|
||||
test-network-%:
|
||||
env FORK_NAME=$* cargo nextest run --release \
|
||||
|
||||
@@ -715,8 +715,9 @@ mod tests {
|
||||
harness
|
||||
}
|
||||
|
||||
// TODO(EIP-7732) Extend this test for gloas
|
||||
#[tokio::test]
|
||||
async fn check_all_blocks_from_altair_to_gloas() {
|
||||
async fn check_all_blocks_from_altair_to_fulu() {
|
||||
let slots_per_epoch = MinimalEthSpec::slots_per_epoch() as usize;
|
||||
let num_epochs = 12;
|
||||
let bellatrix_fork_epoch = 2usize;
|
||||
@@ -724,7 +725,6 @@ mod tests {
|
||||
let deneb_fork_epoch = 6usize;
|
||||
let electra_fork_epoch = 8usize;
|
||||
let fulu_fork_epoch = 10usize;
|
||||
let gloas_fork_epoch = 12usize;
|
||||
let num_blocks_produced = num_epochs * slots_per_epoch;
|
||||
|
||||
let mut spec = test_spec::<MinimalEthSpec>();
|
||||
@@ -734,7 +734,6 @@ mod tests {
|
||||
spec.deneb_fork_epoch = Some(Epoch::new(deneb_fork_epoch as u64));
|
||||
spec.electra_fork_epoch = Some(Epoch::new(electra_fork_epoch as u64));
|
||||
spec.fulu_fork_epoch = Some(Epoch::new(fulu_fork_epoch as u64));
|
||||
spec.gloas_fork_epoch = Some(Epoch::new(gloas_fork_epoch as u64));
|
||||
let spec = Arc::new(spec);
|
||||
|
||||
let harness = get_harness(VALIDATOR_COUNT, spec.clone());
|
||||
|
||||
@@ -137,6 +137,7 @@ fn get_states_descendant_of_block(
|
||||
.collect()
|
||||
}
|
||||
|
||||
// TODO(EIP-7732) Extend to support gloas
|
||||
#[tokio::test]
|
||||
async fn light_client_bootstrap_test() {
|
||||
let spec = test_spec::<E>();
|
||||
@@ -184,7 +185,6 @@ async fn light_client_bootstrap_test() {
|
||||
LightClientBootstrap::Deneb(lc_bootstrap) => lc_bootstrap.header.beacon.slot,
|
||||
LightClientBootstrap::Electra(lc_bootstrap) => lc_bootstrap.header.beacon.slot,
|
||||
LightClientBootstrap::Fulu(lc_bootstrap) => lc_bootstrap.header.beacon.slot,
|
||||
LightClientBootstrap::Gloas(lc_bootstrap) => lc_bootstrap.header.beacon.slot,
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
|
||||
@@ -87,7 +87,7 @@ pub fn upgrade_state_to_gloas<E: EthSpec>(
|
||||
execution_payload_availability: BitVector::default(), // All bits set to false initially
|
||||
builder_pending_payments: Vector::new(vec![
|
||||
BuilderPendingPayment::default();
|
||||
E::builder_pending_withdrawals_limit()
|
||||
E::builder_pending_payments_limit()
|
||||
])?,
|
||||
builder_pending_withdrawals: List::default(), // Empty list initially,
|
||||
latest_block_hash: pre.latest_execution_payload_header.block_hash,
|
||||
|
||||
@@ -354,6 +354,11 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq +
|
||||
Self::PendingConsolidationsLimit::to_usize()
|
||||
}
|
||||
|
||||
/// Returns the `BUILDER_PENDING_PAYMENTS_LIMIT` constant for this specification.
|
||||
fn builder_pending_payments_limit() -> usize {
|
||||
Self::BuilderPendingPaymentsLimit::to_usize()
|
||||
}
|
||||
|
||||
/// Returns the `BUILDER_PENDING_WITHDRAWALS_LIMIT` constant for this specification.
|
||||
fn builder_pending_withdrawals_limit() -> usize {
|
||||
Self::BuilderPendingWithdrawalsLimit::to_usize()
|
||||
|
||||
@@ -48,7 +48,7 @@ pub struct SignedExecutionPayloadEnvelope<E: EthSpec> {
|
||||
}
|
||||
|
||||
impl<E: EthSpec> SignedExecutionPayloadEnvelope<E> {
|
||||
pub fn message(&self) -> ExecutionPayloadEnvelopeRef<E> {
|
||||
pub fn message(&self) -> ExecutionPayloadEnvelopeRef<'_, E> {
|
||||
match self {
|
||||
Self::Gloas(signed) => ExecutionPayloadEnvelopeRef::Gloas(&signed.message),
|
||||
Self::NextFork(signed) => ExecutionPayloadEnvelopeRef::NextFork(&signed.message),
|
||||
|
||||
Reference in New Issue
Block a user