|
|
@ -113,6 +113,10 @@ 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 |
|
|
@ -148,12 +152,6 @@ 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() |
|
|
|
|
|
|
|
|
|
|
@ -239,6 +237,10 @@ func (consensus *Consensus) onCommitted(msg *msg_pb.Message) { |
|
|
|
Msg("Wrong BlockNum Received, ignoring!") |
|
|
|
Msg("Wrong BlockNum Received, ignoring!") |
|
|
|
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 { |
|
|
|