Add one-off block verification rule for beacon chain bad block (#2180)

* Add one-off block verification rule for beacon chain bad block

* Add more comment
pull/2185/head
Rongjian Lan 5 years ago committed by GitHub
parent 721611a949
commit d98267c113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      core/block_validator.go

@ -91,7 +91,9 @@ func (v *BlockValidator) ValidateState(block, parent *types.Block, statedb *stat
// Validate the received block's bloom with the one derived from the generated receipts.
// For valid blocks this should always validate to true.
rbloom := types.CreateBloom(receipts)
if rbloom != header.Bloom() {
// Beacon chain block 1213181 is a one-off block with empty bloom which is expected to be non-empty.
// Skip the validation for it to avoid failure.
if rbloom != header.Bloom() && (block.NumberU64() != 1213181 || block.ShardID() != 0) {
return fmt.Errorf("invalid bloom (remote: %x local: %x)", header.Bloom(), rbloom)
}
// Tre receipt Trie's root (R = (Tr [[H1, R1], ... [Hn, R1]]))

Loading…
Cancel
Save