Skip to content

Commit

Permalink
Skip check when the 100% check is achieved. (#4625)
Browse files Browse the repository at this point in the history
* fix(consensus): skip is all collected

* fix(consensus): add the IsAllSigsCollected

* fix(consensus): remove consensus.decider.IsAllSigsCollected()

* fix(consensus): remove code
  • Loading branch information
diego1q2w authored Feb 2, 2024
1 parent 8d5f20f commit ca91cb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 4 additions & 1 deletion consensus/consensus_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ func (consensus *Consensus) finalCommit() {
return
}
consensus.getLogger().Info().Hex("new", commitSigAndBitmap).Msg("[finalCommit] Overriding commit signatures!!")
consensus.Blockchain().WriteCommitSig(block.NumberU64(), commitSigAndBitmap)

if err := consensus.Blockchain().WriteCommitSig(block.NumberU64(), commitSigAndBitmap); err != nil {
consensus.getLogger().Warn().Err(err).Msg("[finalCommit] failed writting commit sig")
}

// Send committed message before block insertion.
// if leader successfully finalizes the block, send committed message to validators
Expand Down
8 changes: 0 additions & 8 deletions consensus/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,6 @@ func (consensus *Consensus) onCommit(recvMsg *FBFTMessage) {
//// Read - Start
viewID := consensus.getCurBlockViewID()

if consensus.decider.IsAllSigsCollected() {
logger.Info().Msg("[OnCommit] 100% Enough commits received")
consensus.finalCommit()

consensus.msgSender.StopRetry(msg_pb.MessageType_PREPARED)
return
}

quorumIsMet := consensus.decider.IsQuorumAchieved(quorum.Commit)
//// Read - End

Expand Down

0 comments on commit ca91cb2

Please sign in to comment.