mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
engine_v2: fix unsynchronized QC verification Error, close XFN-09 (#1609)
This commit is contained in:
parent
c7fb2e875d
commit
2ad225d6d1
1 changed files with 5 additions and 5 deletions
|
|
@ -732,7 +732,7 @@ func (x *XDPoS_v2) verifyQC(blockChainReader consensus.ChainReader, quorumCert *
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
wg.Add(len(signatures))
|
wg.Add(len(signatures))
|
||||||
var haveError error
|
sigErrChan := make(chan error, len(signatures))
|
||||||
|
|
||||||
for _, signature := range signatures {
|
for _, signature := range signatures {
|
||||||
go func(sig types.Signature) {
|
go func(sig types.Signature) {
|
||||||
|
|
@ -743,12 +743,12 @@ func (x *XDPoS_v2) verifyQC(blockChainReader consensus.ChainReader, quorumCert *
|
||||||
}), sig, epochInfo.Masternodes)
|
}), sig, epochInfo.Masternodes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("[verifyQC] Error while verfying QC message signatures", "Error", err)
|
log.Error("[verifyQC] Error while verfying QC message signatures", "Error", err)
|
||||||
haveError = errors.New("error while verfying QC message signatures")
|
sigErrChan <- errors.New("error while verfying QC message signatures")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !verified {
|
if !verified {
|
||||||
log.Warn("[verifyQC] Signature not verified doing QC verification", "QC", quorumCert)
|
log.Warn("[verifyQC] Signature not verified doing QC verification", "QC", quorumCert)
|
||||||
haveError = errors.New("fail to verify QC due to signature mis-match")
|
sigErrChan <- errors.New("fail to verify QC due to signature mis-match")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}(signature)
|
}(signature)
|
||||||
|
|
@ -756,8 +756,8 @@ func (x *XDPoS_v2) verifyQC(blockChainReader consensus.ChainReader, quorumCert *
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
elapsed := time.Since(start)
|
elapsed := time.Since(start)
|
||||||
log.Debug("[verifyQC] time verify message signatures of qc", "elapsed", elapsed)
|
log.Debug("[verifyQC] time verify message signatures of qc", "elapsed", elapsed)
|
||||||
if haveError != nil {
|
if len(sigErrChan) > 0 {
|
||||||
return haveError
|
return <-sigErrChan
|
||||||
}
|
}
|
||||||
epochSwitchNumber := epochInfo.EpochSwitchBlockInfo.Number.Uint64()
|
epochSwitchNumber := epochInfo.EpochSwitchBlockInfo.Number.Uint64()
|
||||||
gapNumber := epochSwitchNumber - epochSwitchNumber%x.config.Epoch - x.config.Gap
|
gapNumber := epochSwitchNumber - epochSwitchNumber%x.config.Epoch - x.config.Gap
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue