mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 04:01:55 +00:00
allow commit votes for the last height when we're in
RoundStepNewHeight
This commit is contained in:
@@ -178,10 +178,15 @@ func (conR *ConsensusReactor) Receive(chId byte, peer *p2p.Peer, msgBytes []byte
|
||||
switch msg := msg_.(type) {
|
||||
case *VoteMessage:
|
||||
vote := msg.Vote
|
||||
// XXX if we're receiving a commit from the last block while...
|
||||
if rs.Height != vote.Height {
|
||||
if rs.Height == vote.Height+1 {
|
||||
if rs.Step == RoundStepNewHeight && vote.Type == types.VoteTypeCommit {
|
||||
goto VOTE_PASS // *ducks*
|
||||
}
|
||||
}
|
||||
return // Wrong height. Not necessarily a bad peer.
|
||||
}
|
||||
VOTE_PASS:
|
||||
validatorIndex := msg.ValidatorIndex
|
||||
address, _ := rs.Validators.GetByIndex(validatorIndex)
|
||||
added, index, err := conR.conS.AddVote(address, vote)
|
||||
|
@@ -13,6 +13,11 @@ Consensus State Machine Overview:
|
||||
at least Delta duration *after* +2/3 Commits were found.
|
||||
The step stays at NewHeight until this timeout occurs before
|
||||
proceeding to Propose.
|
||||
* The NewHeight is a transition period after the height is incremented,
|
||||
where the node still receives late commits before potentially proposing.
|
||||
The height should be incremented because a block had been
|
||||
"committed by the network", and clients should see that
|
||||
reflected as a new height.
|
||||
|
||||
+-------------------------------------+
|
||||
| |
|
||||
@@ -550,7 +555,6 @@ func (cs *ConsensusState) updateToState(state *sm.State, contiguous bool) {
|
||||
|
||||
// After the call cs.Step becomes RoundStepNewRound.
|
||||
func (cs *ConsensusState) setupNewRound(round uint) {
|
||||
// XXX Looks like this is just not called.
|
||||
// Sanity check
|
||||
if round == 0 {
|
||||
panic("setupNewRound() should never be called for round 0")
|
||||
|
Reference in New Issue
Block a user