fix block validation in stage bodies

pull/4465/head
“GheisMohammadi” 1 year ago
parent cd7ccbe827
commit 772d8658e1
No known key found for this signature in database
GPG Key ID: 15073AED3829FE90
  1. 13
      api/service/stagedstreamsync/stage_bodies.go

@ -187,12 +187,6 @@ func (b *StageBodies) runBlockWorkerLoop(ctx context.Context, gbm *blockDownload
gbm.HandleRequestError(batch, err, stid)
b.configs.protocol.RemoveStream(stid)
} else {
if b.configs.extractReceiptHashes {
if err = b.verifyBlockAndExtractReceiptsData(blockBytes, sigBytes, s); err != nil {
gbm.HandleRequestError(batch, err, stid)
continue
}
}
if err = b.saveBlocks(ctx, gbm.tx, batch, blockBytes, sigBytes, loopID, stid); err != nil {
panic(ErrSaveBlocksToDbFailed)
}
@ -231,10 +225,9 @@ func (b *StageBodies) verifyBlockAndExtractReceiptsData(batchBlockBytes [][]byte
block.SetCurrentCommitSig(sigBytes)
}
if block.NumberU64() != i {
return ErrInvalidBlockNumber
}
// if block.NumberU64() != i {
// return ErrInvalidBlockNumber
// }
if err := verifyBlock(b.configs.bc, block); err != nil {
return err
}

Loading…
Cancel
Save