Ignore unknown blocks at fork choice
This commit is contained in:
parent
67fe21c1c0
commit
f4121d9deb
@ -119,13 +119,15 @@ impl<T: BeaconChainTypes> ForkChoice<T> {
|
|||||||
//
|
//
|
||||||
// https://github.com/ethereum/eth2.0-specs/blob/v0.7.0/specs/core/0_fork-choice.md
|
// https://github.com/ethereum/eth2.0-specs/blob/v0.7.0/specs/core/0_fork-choice.md
|
||||||
for attestation in &block.body.attestations {
|
for attestation in &block.body.attestations {
|
||||||
let block = self
|
// If the `data.beacon_block_root` block is not known to us, simply ignore the latest
|
||||||
|
// vote.
|
||||||
|
if let Some(block) = self
|
||||||
.store
|
.store
|
||||||
.get::<BeaconBlock<T::EthSpec>>(&attestation.data.beacon_block_root)?
|
.get::<BeaconBlock<T::EthSpec>>(&attestation.data.beacon_block_root)?
|
||||||
.ok_or_else(|| Error::MissingBlock(attestation.data.beacon_block_root))?;
|
{
|
||||||
|
|
||||||
self.process_attestation(state, attestation, &block)?;
|
self.process_attestation(state, attestation, &block)?;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This does not apply a vote to the block, it just makes fork choice aware of the block so
|
// This does not apply a vote to the block, it just makes fork choice aware of the block so
|
||||||
// it can still be identified as the head even if it doesn't have any votes.
|
// it can still be identified as the head even if it doesn't have any votes.
|
||||||
|
Loading…
Reference in New Issue
Block a user