fixing test

This commit is contained in:
hopinheimer
2026-02-26 04:38:45 -05:00
parent 6d747232f2
commit eb1b81063d
6 changed files with 96 additions and 42 deletions

View File

@@ -73,6 +73,22 @@ impl ForkChoiceTest {
Self { harness }
}
/// Creates a new tester with the GLOAS fork active at epoch 1.
/// Genesis is a standard Fulu block (epoch 0), so block production works normally.
/// Tests that need GLOAS semantics should advance the chain into epoch 1 first.
pub fn new_with_gloas() -> Self {
let mut spec = ForkName::latest_stable().make_genesis_spec(ChainSpec::default());
spec.gloas_fork_epoch = Some(Epoch::new(1));
let harness = BeaconChainHarness::builder(MainnetEthSpec)
.spec(spec.into())
.deterministic_keypairs(VALIDATOR_COUNT)
.fresh_ephemeral_store()
.mock_execution_layer()
.build();
Self { harness }
}
/// Get a value from the `ForkChoice` instantiation.
fn get<T, U>(&self, func: T) -> U
where
@@ -948,9 +964,17 @@ async fn invalid_attestation_future_block() {
}
/// Payload attestations (index == 1) are invalid when they refer to a block in the same slot.
/// This check only applies when GLOAS is active.
///
/// TODO(gloas): un-ignore once the test harness supports Gloas block production.
/// The validation logic is gated on `spec.fork_name_at_slot().gloas_enabled()` in
/// `validate_on_attestation`, which requires a block to exist at a GLOAS-enabled slot.
/// Currently the mock execution layer cannot produce Gloas blocks (no
/// `signed_execution_payload_bid` support).
#[ignore]
#[tokio::test]
async fn invalid_attestation_payload_during_same_slot() {
ForkChoiceTest::new()
ForkChoiceTest::new_with_gloas()
.apply_blocks_without_new_attestations(1)
.await
.apply_attestation_to_chain(