From 2f1aa10d4df62e2fa85926c80345fb1f8d8c8422 Mon Sep 17 00:00:00 2001 From: Shane K Moore <41407272+shane-moore@users.noreply.github.com> Date: Fri, 29 Aug 2025 09:45:25 -0700 Subject: [PATCH] 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 --- Makefile | 11 +++++++++-- beacon_node/beacon_chain/src/beacon_block_streamer.rs | 5 ++--- beacon_node/beacon_chain/tests/store_tests.rs | 2 +- consensus/state_processing/src/upgrade/gloas.rs | 2 +- consensus/types/src/eth_spec.rs | 5 +++++ .../types/src/signed_execution_payload_envelope.rs | 2 +- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 66d0b68268..3b9d999e9a 100644 --- a/Makefile +++ b/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 \ diff --git a/beacon_node/beacon_chain/src/beacon_block_streamer.rs b/beacon_node/beacon_chain/src/beacon_block_streamer.rs index d4ce38927b..0ad08c5811 100644 --- a/beacon_node/beacon_chain/src/beacon_block_streamer.rs +++ b/beacon_node/beacon_chain/src/beacon_block_streamer.rs @@ -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::(); @@ -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()); diff --git a/beacon_node/beacon_chain/tests/store_tests.rs b/beacon_node/beacon_chain/tests/store_tests.rs index fbb592b510..62c08adc21 100644 --- a/beacon_node/beacon_chain/tests/store_tests.rs +++ b/beacon_node/beacon_chain/tests/store_tests.rs @@ -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::(); @@ -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!( diff --git a/consensus/state_processing/src/upgrade/gloas.rs b/consensus/state_processing/src/upgrade/gloas.rs index e1ca954e11..628af7c5c9 100644 --- a/consensus/state_processing/src/upgrade/gloas.rs +++ b/consensus/state_processing/src/upgrade/gloas.rs @@ -87,7 +87,7 @@ pub fn upgrade_state_to_gloas( 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, diff --git a/consensus/types/src/eth_spec.rs b/consensus/types/src/eth_spec.rs index f4c7abefe7..b00c07865f 100644 --- a/consensus/types/src/eth_spec.rs +++ b/consensus/types/src/eth_spec.rs @@ -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() diff --git a/consensus/types/src/signed_execution_payload_envelope.rs b/consensus/types/src/signed_execution_payload_envelope.rs index d8a5ca0b23..bba7b149fd 100644 --- a/consensus/types/src/signed_execution_payload_envelope.rs +++ b/consensus/types/src/signed_execution_payload_envelope.rs @@ -48,7 +48,7 @@ pub struct SignedExecutionPayloadEnvelope { } impl SignedExecutionPayloadEnvelope { - pub fn message(&self) -> ExecutionPayloadEnvelopeRef { + pub fn message(&self) -> ExecutionPayloadEnvelopeRef<'_, E> { match self { Self::Gloas(signed) => ExecutionPayloadEnvelopeRef::Gloas(&signed.message), Self::NextFork(signed) => ExecutionPayloadEnvelopeRef::NextFork(&signed.message),