You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(consensus): apply v2.7.0 hotfix to dev branch and revert optimization changes (#2357)
* Revert "fix(consensus): use signer pubkey to check for unique signatures and optimize performance, close XFN-03 (#1625)"
This reverts commit 81416e0.
* Revert "add syncinfo pool (#1236)"
This reverts commit db9c3de.
* consensus: use signer pubkey to check for unique signatures, close XFN-03 (#1643)
* use signer pubkey to check for unique signatures
* add error handling
* add go routines to process Ecrecover concurrently
add input validation and early return
* optimize
* Merge commit from fork (fix(consensus): signature dedup construction check)
* add signature dedup construction check at QC and TC generation process
* add tests
* add checking of signature S value to prevent malleable signature (signature flipping)
* add signature flip tests
* fix test
* fix test
* refactor hasLowS check to aware of signer and improve logs
* fix inaccurate pubkeys > addresses
(fix): fix tests due to change in error logging (#2352)
* keep logging improvement and dont revert config change
* fix formatting
* fix from copilot suggestions
1. Check QC and TC against highest QC TC. Skip if none of them need to be updated
657
+
2. Verify items including:
658
+
- verifyQC
659
+
- verifyTC
660
+
3. Broadcast(Not part of consensus)
661
+
*/
662
+
663
+
if (x.highestQuorumCert.ProposedBlockInfo.Round>=syncInfo.HighestQuorumCert.ProposedBlockInfo.Round) && (x.highestTimeoutCert.Round>=syncInfo.HighestTimeoutCert.Round) {
664
+
log.Debug("[VerifySyncInfoMessage] Round from incoming syncInfo message is no longer qualified", "Highest QC Round", x.highestQuorumCert.ProposedBlockInfo.Round, "Incoming SyncInfo QC Round", syncInfo.HighestQuorumCert.ProposedBlockInfo.Round, "highestTimeoutCert Round", x.highestTimeoutCert.Round, "Incoming syncInfo TC Round", syncInfo.HighestTimeoutCert.Round)
1. Check vote round with current round for fast fail(disqualifed)
701
+
2. Get masterNode list from snapshot by using vote.GapNumber
702
+
3. Check signature:
703
+
- Use ecRecover to get the public key
704
+
- Use the above public key to find out the xdc address
705
+
- Use the above xdc address to check against the master node list from step 1(For the running epoch)
706
+
4. Broadcast(Not part of consensus)
707
+
*/
708
+
ifvote.ProposedBlockInfo.Round<x.currentRound {
709
+
log.Debug("[VerifyVoteMessage] Disqualified vote message as the proposed round does not match currentRound", "voteHash", vote.Hash(), "voteProposedBlockInfoRound", vote.ProposedBlockInfo.Round, "currentRound", x.currentRound)
log.Error("[VerifyVoteMessage] fail to get snapshot for a vote message", "blockNum", vote.ProposedBlockInfo.Number, "blockHash", vote.ProposedBlockInfo.Hash, "voteHash", vote.Hash(), "error", err.Error())
log.Debug("[VerifyTimeoutMessage] Disqualified timeout message as the proposed round does not match currentRound", "timeoutHash", timeoutMsg.Hash(), "timeoutRound", timeoutMsg.Round, "currentRound", x.currentRound)
if (qcRound>0) && (float64(numValidSignatures) <float64(epochInfo.MasternodesLen)*certThreshold) {
915
+
if (qcRound>0) && (signatures==nil||float64(len(signatures)) <float64(epochInfo.MasternodesLen)*certThreshold) {
771
916
//First V2 Block QC, QC Signatures is initial nil
772
-
log.Warn("[verifyHeader] Invalid QC Signature is nil or less then config", "QCNumber", quorumCert.ProposedBlockInfo.Number, "numValidSignatures", numValidSignatures, "CertThreshold", float64(epochInfo.MasternodesLen)*certThreshold)
917
+
log.Warn("[verifyHeader] Invalid QC Signature is nil or less then config", "QCNumber", quorumCert.ProposedBlockInfo.Number, "LenSignatures", len(signatures), "CertThreshold", float64(epochInfo.MasternodesLen)*certThreshold)
0 commit comments