|
|
@ -114,10 +114,6 @@ func (consensus *Consensus) onPrepared(msg *msg_pb.Message) { |
|
|
|
Msg("Wrong BlockNum Received, ignoring!") |
|
|
|
Msg("Wrong BlockNum Received, ignoring!") |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if recvMsg.BlockNum > consensus.blockNum { |
|
|
|
|
|
|
|
consensus.getLogger().Warn().Msgf("[OnPrepared] low consensus block number. Spin sync") |
|
|
|
|
|
|
|
consensus.spinUpStateSync() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// check validity of prepared signature
|
|
|
|
// check validity of prepared signature
|
|
|
|
blockHash := recvMsg.BlockHash |
|
|
|
blockHash := recvMsg.BlockHash |
|
|
@ -153,6 +149,12 @@ func (consensus *Consensus) onPrepared(msg *msg_pb.Message) { |
|
|
|
if !consensus.onPreparedSanityChecks(&blockObj, recvMsg) { |
|
|
|
if !consensus.onPreparedSanityChecks(&blockObj, recvMsg) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if recvMsg.BlockNum > consensus.blockNum { |
|
|
|
|
|
|
|
consensus.getLogger().Warn().Msgf("[OnPrepared] low consensus block number. Spin sync") |
|
|
|
|
|
|
|
consensus.spinUpStateSync() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
consensus.mutex.Lock() |
|
|
|
consensus.mutex.Lock() |
|
|
|
defer consensus.mutex.Unlock() |
|
|
|
defer consensus.mutex.Unlock() |
|
|
|
|
|
|
|
|
|
|
@ -236,10 +238,6 @@ func (consensus *Consensus) onCommitted(msg *msg_pb.Message) { |
|
|
|
if !consensus.isRightBlockNumCheck(recvMsg) { |
|
|
|
if !consensus.isRightBlockNumCheck(recvMsg) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if recvMsg.BlockNum > consensus.blockNum { |
|
|
|
|
|
|
|
consensus.getLogger().Info().Msg("[OnCommitted] low consensus block number. Spin up state sync") |
|
|
|
|
|
|
|
consensus.spinUpStateSync() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aggSig, mask, err := consensus.ReadSignatureBitmapPayload(recvMsg.Payload, 0) |
|
|
|
aggSig, mask, err := consensus.ReadSignatureBitmapPayload(recvMsg.Payload, 0) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
@ -272,6 +270,11 @@ func (consensus *Consensus) onCommitted(msg *msg_pb.Message) { |
|
|
|
|
|
|
|
|
|
|
|
consensus.FBFTLog.AddMessage(recvMsg) |
|
|
|
consensus.FBFTLog.AddMessage(recvMsg) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if recvMsg.BlockNum > consensus.blockNum { |
|
|
|
|
|
|
|
consensus.getLogger().Info().Msg("[OnCommitted] low consensus block number. Spin up state sync") |
|
|
|
|
|
|
|
consensus.spinUpStateSync() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
consensus.mutex.Lock() |
|
|
|
consensus.mutex.Lock() |
|
|
|
defer consensus.mutex.Unlock() |
|
|
|
defer consensus.mutex.Unlock() |
|
|
|
|
|
|
|
|
|
|
|