mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-28 02:03:32 +00:00
Fix Gloas http-api-tests failures
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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::<E>(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;
|
||||
|
||||
Reference in New Issue
Block a user