dont verify the signature of the genesis block in backfill sync (#3846)

This commit is contained in:
realbigsean 2023-01-03 17:23:01 -05:00 committed by GitHub
parent 786d9834f5
commit e02fcb30ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,16 +153,20 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
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::<Result<Vec<_>, _>>()
.map_err(HistoricalBlockError::SignatureSet)