Remove duplicated attestation finalization check
This commit is contained in:
parent
6cd0af766e
commit
8fb9e1f648
@ -555,23 +555,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
.store
|
||||
.get::<BeaconBlock<T::EthSpec>>(&attestation.data.beacon_block_root)?
|
||||
{
|
||||
let finalized_epoch = self.head().beacon_state.finalized_checkpoint.epoch;
|
||||
|
||||
if attestation_head_block.slot
|
||||
<= finalized_epoch.start_slot(T::EthSpec::slots_per_epoch())
|
||||
{
|
||||
// Ignore any attestation where the slot of `data.beacon_block_root` is equal to or
|
||||
// prior to the finalized epoch.
|
||||
//
|
||||
// For any valid attestation if the `beacon_block_root` is prior to finalization, then
|
||||
// all other parameters (source, target, etc) must all be prior to finalization and
|
||||
// therefore no longer interesting.
|
||||
return Ok(AttestationProcessingOutcome::FinalizedSlot {
|
||||
attestation: attestation_head_block.epoch(),
|
||||
finalized: finalized_epoch,
|
||||
});
|
||||
}
|
||||
|
||||
// Attempt to process the attestation using the `self.head()` state.
|
||||
//
|
||||
// This is purely an effort to avoid loading a `BeaconState` unnecessarily from the DB.
|
||||
|
Loading…
Reference in New Issue
Block a user