mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-18 22:49:34 +00:00
Handle historic attestations correctly
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user