From e02fcb30ab9e2a71df3a4d5292321711314d4393 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 3 Jan 2023 17:23:01 -0500 Subject: [PATCH] dont verify the signature of the genesis block in backfill sync (#3846) --- .../beacon_chain/src/historical_blocks.rs | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/beacon_node/beacon_chain/src/historical_blocks.rs b/beacon_node/beacon_chain/src/historical_blocks.rs index cc45a6bb9..85a9ec8fb 100644 --- a/beacon_node/beacon_chain/src/historical_blocks.rs +++ b/beacon_node/beacon_chain/src/historical_blocks.rs @@ -153,16 +153,20 @@ impl BeaconChain { let signature_set = blocks_to_import .iter() .zip_eq(block_roots) - .map(|(block, block_root)| { - block_proposal_signature_set_from_parts( - block, - Some(block_root), - block.message().proposer_index(), - &self.spec.fork_at_epoch(block.message().epoch()), - self.genesis_validators_root, - |validator_index| pubkey_cache.get(validator_index).cloned().map(Cow::Owned), - &self.spec, - ) + .filter_map(|(block, block_root)| { + (block_root != self.genesis_block_root).then(|| { + block_proposal_signature_set_from_parts( + block, + Some(block_root), + block.message().proposer_index(), + &self.spec.fork_at_epoch(block.message().epoch()), + self.genesis_validators_root, + |validator_index| { + pubkey_cache.get(validator_index).cloned().map(Cow::Owned) + }, + &self.spec, + ) + }) }) .collect::, _>>() .map_err(HistoricalBlockError::SignatureSet)