From e6b5b441a5917f7454dc99364870d9048ac9eaa6 Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Mon, 27 Apr 2026 09:17:25 +0200 Subject: [PATCH] Fix Gloas http-api-tests failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two tests fail under FORK_NAME=gloas; only the first surfaces in CI because nextest aborts on the first failure. 1. status_tests::node_health_el_online_and_not_synced The test simulates "EL online but not synced" via mock_el.server.all_payloads_syncing(true), expecting the head to become optimistic so the endpoint returns 206. In Gloas, blocks don't carry execution payloads — the payload arrives via an envelope, so newPayload is never called during block import and the head is never marked optimistic. The endpoint correctly returns 200. Skip the test for Gloas, matching the existing pattern on el_error_on_new_payload. 2. tests::get_validator_payload_attestation_data Two issues stacked: - The test used ApiTester::new() (default phase0 spec) so the chain wasn't actually at the Gloas fork even with FORK_NAME=gloas. Switch to new_with_hard_forks(), which uses test_spec() and respects FORK_NAME. - produce_payload_attestation_data requires head.slot == request_slot, but the harness leaves the slot clock at head_slot + 1 with no block produced for that slot. Rewind the slot clock to the head slot in the test helper. Full Gloas http-api suite: 193 tests run: 193 passed. --- beacon_node/http_api/tests/status_tests.rs | 7 +++++++ beacon_node/http_api/tests/tests.rs | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/beacon_node/http_api/tests/status_tests.rs b/beacon_node/http_api/tests/status_tests.rs index 71d41d53b1..8b0d9899ee 100644 --- a/beacon_node/http_api/tests/status_tests.rs +++ b/beacon_node/http_api/tests/status_tests.rs @@ -200,8 +200,15 @@ async fn node_health_el_online_and_synced() { } /// Check `node health` endpoint when the EL is online but not synced. +// Gloas blocks don't carry execution payloads — the payload arrives via an envelope, +// so newPayload is never called during block import and the head is not marked +// optimistic when `all_payloads_syncing(true)`. Skip for Gloas. #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn node_health_el_online_and_not_synced() { + if fork_name_from_env().is_some_and(|f| f.gloas_enabled()) { + return; + } + let num_blocks = E::slots_per_epoch() / 2; let num_validators = E::slots_per_epoch(); let tester = post_merge_tester(num_blocks, num_validators).await; diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index 72abf82be4..8a95ac3e34 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -4436,7 +4436,11 @@ impl ApiTester { } pub async fn test_get_validator_payload_attestation_data(self) -> Self { - let slot = self.chain.slot().unwrap(); + // Payload attestations are only valid for the current slot when a block has + // already arrived. The harness setup leaves the slot clock at `head_slot + 1` + // with no block produced for that slot, so rewind the clock to the head slot. + let slot = self.chain.head_snapshot().beacon_block.slot(); + self.chain.slot_clock.set_slot(slot.as_u64()); let fork_name = self.chain.spec.fork_name_at_slot::(slot); let response = self @@ -8110,7 +8114,7 @@ async fn get_validator_payload_attestation_data() { if !fork_name_from_env().is_some_and(|f| f.gloas_enabled()) { return; } - ApiTester::new() + ApiTester::new_with_hard_forks() .await .test_get_validator_payload_attestation_data() .await;