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

@@ -1017,6 +1017,28 @@ where
assert_ne!(slot, 0, "can't produce a block at slot 0");
assert!(slot >= state.slot());
// For Gloas, blinded and full blocks are structurally identical (no payload in body).
// Produce via the Gloas path and convert to blinded.
if self.spec.fork_name_at_slot::<E>(slot).gloas_enabled() {
let (block_contents, _envelope, pending_state) =
Box::pin(self.make_block_with_envelope(state, slot)).await;
let (signed_block, _blobs) = block_contents;
let signed_blinded = signed_block.clone_as_blinded();
let (mut blinded_block, _signature) = signed_blinded.deconstruct();
block_modifier(&mut blinded_block);
let proposer_index = pending_state
.get_beacon_proposer_index(slot, &self.spec)
.unwrap();
// Re-sign after modification.
let signed_blinded = blinded_block.sign(
&self.validator_keypairs[proposer_index].sk,
&pending_state.fork(),
pending_state.genesis_validators_root(),
&self.spec,
);
return (signed_blinded, pending_state);
}
complete_state_advance(&mut state, None, slot, &self.spec)
.expect("should be able to advance state to slot");
@@ -1238,6 +1260,21 @@ where
assert_ne!(slot, 0, "can't produce a block at slot 0");
assert!(slot >= state.slot());
// For Gloas forks, delegate to make_block_with_envelope which uses the
// Gloas-specific block production path, and return the pre-state.
if self.spec.fork_name_at_slot::<E>(slot).gloas_enabled() {
let pre_state = {
let mut s = state.clone();
complete_state_advance(&mut s, None, slot, &self.spec)
.expect("should be able to advance state to slot");
s.build_caches(&self.spec).expect("should build caches");
s
};
let (block_contents, _envelope, _state) =
Box::pin(self.make_block_with_envelope(state, slot)).await;
return (block_contents, pre_state);
}
complete_state_advance(&mut state, None, slot, &self.spec)
.expect("should be able to advance state to slot");