From f4121d9debb4ff235d8d6c74236d00d373be4020 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Fri, 9 Aug 2019 12:34:56 +1000 Subject: [PATCH] Ignore unknown blocks at fork choice --- beacon_node/beacon_chain/src/fork_choice.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/beacon_node/beacon_chain/src/fork_choice.rs b/beacon_node/beacon_chain/src/fork_choice.rs index 6800f61d8..640f5223d 100644 --- a/beacon_node/beacon_chain/src/fork_choice.rs +++ b/beacon_node/beacon_chain/src/fork_choice.rs @@ -119,12 +119,14 @@ impl ForkChoice { // // https://github.com/ethereum/eth2.0-specs/blob/v0.7.0/specs/core/0_fork-choice.md 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 .get::>(&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