diff --git a/consensus/consensus_v2.go b/consensus/consensus_v2.go index 57fa4ef9b..25045a3f1 100644 --- a/consensus/consensus_v2.go +++ b/consensus/consensus_v2.go @@ -522,6 +522,7 @@ func (consensus *Consensus) commitBlock(blk *types.Block, committedMsg *FBFTMess } if !committedMsg.HasSingleSender() { consensus.getLogger().Error().Msg("[TryCatchup] Leader message can not have multiple sender keys") + return errIncorrectSender } atomic.AddUint64(&consensus.blockNum, 1) diff --git a/consensus/fbft_log.go b/consensus/fbft_log.go index f66cebb46..d578030c4 100644 --- a/consensus/fbft_log.go +++ b/consensus/fbft_log.go @@ -90,6 +90,8 @@ func (m *FBFTMessage) id() fbftMsgID { if m.HasSingleSender() { copy(id[idTypeBytes+idViewIDBytes+idHashBytes:], m.SenderPubkeys[0].Bytes[:]) } else { + // Currently this case is not reachable as only validator will use id() func + // and validator won't receive message with multiple senders copy(id[idTypeBytes+idViewIDBytes+idHashBytes:], m.SenderPubkeyBitmap[:]) } return id diff --git a/consensus/view_change_construct.go b/consensus/view_change_construct.go index 194dc060d..8fa29433a 100644 --- a/consensus/view_change_construct.go +++ b/consensus/view_change_construct.go @@ -241,7 +241,7 @@ var ( errVerifyM2 = errors.New("failed to verfiy signature for M2 message") errM1Payload = errors.New("failed to verify multi signature for M1 prepared payload") errNoQuorum = errors.New("no quorum on M1 (prepared) payload") - errIncorrectSender = errors.New("view change msg must have only one sender") + errIncorrectSender = errors.New("multiple senders not allowed") ) // ProcessViewChangeMsg process the view change message after verification