blockchain: verify +2/3 (#5278)

## Description

Verify only +2/3 of the commit. 

Closes: #5259
This commit is contained in:
Marko
2020-08-25 07:07:19 +00:00
committed by GitHub
parent 1b961d021f
commit 135ac0400e
4 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -10,10 +10,12 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
## FEATURES
- [privval] \#5239 Add `chainID` to requests from client.
- [privval] \#5239 Add `chainID` to requests from client. (@marbar3778)
## IMPROVEMENTS
- [blockchain] \#5278 Verify only +2/3 of the signatures in a block when fast syncing. (@marbar3778)
## BUG FIXES
- [blockchain] \#5249 Fix fast sync halt with initial height > 1 (@erikgrinaker)
+1 -1
View File
@@ -358,7 +358,7 @@ FOR_LOOP:
// NOTE: we can probably make this more efficient, but note that calling
// first.Hash() doesn't verify the tx contents, so MakePartSet() is
// currently necessary.
err := state.Validators.VerifyCommit(
err := state.Validators.VerifyCommitLight(
chainID, firstID, first.Height, second.LastCommit)
if err != nil {
bcR.Logger.Error("Error in validation", "err", err)
+1 -1
View File
@@ -463,7 +463,7 @@ func (bcR *BlockchainReactor) processBlock() error {
// NOTE: we can probably make this more efficient, but note that calling
// first.Hash() doesn't verify the tx contents, so MakePartSet() is
// currently necessary.
err = bcR.state.Validators.VerifyCommit(chainID, firstID, first.Height, second.LastCommit)
err = bcR.state.Validators.VerifyCommitLight(chainID, firstID, first.Height, second.LastCommit)
if err != nil {
bcR.Logger.Error("error during commit verification", "err", err,
"first", first.Height, "second", second.Height)
+1 -1
View File
@@ -44,7 +44,7 @@ func (pc *pContext) setState(state state.State) {
}
func (pc pContext) verifyCommit(chainID string, blockID types.BlockID, height int64, commit *types.Commit) error {
return pc.state.Validators.VerifyCommit(chainID, blockID, height, commit)
return pc.state.Validators.VerifyCommitLight(chainID, blockID, height, commit)
}
func (pc *pContext) saveBlock(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit) {