mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 09:16:00 +00:00
Allow attestations to genesis block
This commit is contained in:
@@ -852,13 +852,18 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
result
|
result
|
||||||
};
|
};
|
||||||
|
|
||||||
if block.slot <= finalized_epoch.start_slot(T::EthSpec::slots_per_epoch()) {
|
if block.slot > 0
|
||||||
|
&& (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
|
// Ignore any attestation where the slot of `data.beacon_block_root` is equal to or
|
||||||
// prior to the finalized epoch.
|
// prior to the finalized epoch.
|
||||||
//
|
//
|
||||||
// For any valid attestation if the `beacon_block_root` is prior to finalization, then
|
// 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
|
// all other parameters (source, target, etc) must all be prior to finalization and
|
||||||
// therefore no longer interesting.
|
// therefore no longer interesting.
|
||||||
|
//
|
||||||
|
// We allow the case where the block is the genesis block. Without this, all
|
||||||
|
// attestations prior to the first block being produced would be invalid.
|
||||||
Ok(AttestationProcessingOutcome::FinalizedSlot {
|
Ok(AttestationProcessingOutcome::FinalizedSlot {
|
||||||
attestation: block.slot.epoch(T::EthSpec::slots_per_epoch()),
|
attestation: block.slot.epoch(T::EthSpec::slots_per_epoch()),
|
||||||
finalized: finalized_epoch,
|
finalized: finalized_epoch,
|
||||||
|
|||||||
Reference in New Issue
Block a user