From 2cfe5ff380a262baea67d510d9e3e11a328ef8be Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Mon, 27 Apr 2026 10:10:51 +0200 Subject: [PATCH] Fix get_validator_duties_early after #8415 merge PR #8415 added Gloas-only payload-timeliness-committee assertions to test_get_validator_duties_early but kept the test using ApiTester::new() (default mainnet spec). With FORK_NAME=gloas this produces a phase0 chain, so post_validator_duties_ptc returns 500 with BeaconStateError(IncorrectStateVariant). Two issues fixed: 1. Switch the test wrapper to ApiTester::new_with_hard_forks() so the chain is actually at Gloas under FORK_NAME=gloas. This is the same pattern already used by get_validator_duties_ptc and get_validator_payload_attestation_data. 2. Compute dependent_root using ChainSpec::proposer_shuffling_decision_slot rather than the hardcoded "(current_epoch - 1).end_slot()" formula. Post-Fulu the proposer shuffling decision slot moved to the end of epoch N - 2, so the cache is now keyed by that root. The old formula matched the legacy cache key and silently passed on phase0 chains. Verified locally with FORK_NAME=gloas (195/195) and FORK_NAME=fulu (195/195). --- beacon_node/http_api/tests/tests.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index 8f9bddc1d6..b06371e8e8 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -3566,7 +3566,9 @@ impl ApiTester { let dependent_root = self .chain .block_root_at_slot( - current_epoch.start_slot(E::slots_per_epoch()) - 1, + self.chain + .spec + .proposer_shuffling_decision_slot::(current_epoch), WhenSlotSkipped::Prev, ) .unwrap() @@ -7971,7 +7973,7 @@ async fn get_validator_duties_early() { if !fork_name_from_env().is_some_and(|f| f.gloas_enabled()) { return; } - ApiTester::new() + ApiTester::new_with_hard_forks() .await .test_get_validator_duties_early() .await;