Gloas HTTP API tests passing (#9154)

Get the Gloas HTTP API tests passing, partly through fixes and partly through disabling tests that don't fit the Gloas paradigm.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>

Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>

Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>

Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
Michael Sproul
2026-04-30 18:15:26 +10:00
committed by GitHub
parent 728356ad03
commit 8bb14d6f3d
8 changed files with 249 additions and 53 deletions

View File

@@ -1,21 +1,21 @@
//! Tests related to the beacon node's sync status
use beacon_chain::{
BlockError,
test_utils::{AttestationStrategy, BlockStrategy, LightClientStrategy, SyncCommitteeStrategy},
test_utils::{
AttestationStrategy, BlockStrategy, LightClientStrategy, SyncCommitteeStrategy,
fork_name_from_env, test_spec,
},
};
use execution_layer::{PayloadStatusV1, PayloadStatusV1Status};
use http_api::test_utils::InteractiveTester;
use reqwest::StatusCode;
use types::{EthSpec, ExecPayload, ForkName, MinimalEthSpec, Slot, Uint256};
use types::{EthSpec, ExecPayload, MinimalEthSpec, Slot, Uint256};
type E = MinimalEthSpec;
/// Create a new test environment that is post-merge with `chain_depth` blocks.
async fn post_merge_tester(chain_depth: u64, validator_count: u64) -> InteractiveTester<E> {
// TODO(EIP-7732): extend tests for Gloas by reverting back to using `ForkName::latest()`
// Issue is that these tests do block production via `extend_chain_with_sync` which expects to be able to use `state.latest_execution_payload_header` during block production, but Gloas uses `latest_execution_bid` instead
// This will be resolved in a subsequent block processing PR
let mut spec = ForkName::Fulu.make_genesis_spec(E::default_spec());
let mut spec = test_spec::<E>();
spec.terminal_total_difficulty = Uint256::from(1);
let tester = InteractiveTester::<E>::new(Some(spec), validator_count as usize).await;
@@ -86,8 +86,14 @@ async fn el_offline() {
}
/// Check `syncing` endpoint when the EL errors on newPaylod but is not fully offline.
// Gloas blocks don't carry execution payloads — the payload arrives via an envelope,
// so newPayload is never called during block import. Skip for Gloas.
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn el_error_on_new_payload() {
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;
@@ -100,6 +106,7 @@ async fn el_error_on_new_payload() {
.make_block(pre_state, Slot::new(num_blocks + 1))
.await;
let (block, blobs) = block_contents;
let block_hash = block
.message()
.body()
@@ -193,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;