Remove duplicated attestation finalization check

This commit is contained in:
Paul Hauner 2019-08-13 19:48:03 +10:00
parent 6cd0af766e
commit 8fb9e1f648
No known key found for this signature in database
GPG Key ID: 303E4494BB28068C

View File

@ -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.