Handle historic attestations correctly

This commit is contained in:
Eitan Seri-Levi
2026-04-25 15:44:33 +09:00
parent dacb8aeffe
commit 2e561a2a9f

View File

@@ -2005,8 +2005,14 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
// the VC and BN are out-of-sync due to time issues or overloading.
beacon_block_root = *head_state.get_block_root(request_slot)?;
beacon_state_root = *head_state.get_state_root(request_slot)?;
// TODO(gloas) if request_slot is a skipped slot, this is not a same slot attestation.
is_same_slot_attestation = true;
// Fetch the previous block root. If the previous block root equals
// the block root being attested to, the `request_slot` is a skipped slot
// and this is not a same slot attestation.
let prior_slot_root = head_state
.get_block_root(request_slot.saturating_sub(1u64))
.ok();
is_same_slot_attestation = prior_slot_root != Some(&beacon_block_root);
};
let target_slot = request_epoch.start_slot(T::EthSpec::slots_per_epoch());