From 8bfedb6ff019ca5309d6694ad881faafc5705435 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Mon, 20 Sep 2021 17:14:36 -0400 Subject: [PATCH] comment updates --- internal/consensus/state.go | 1 - internal/consensus/state_test.go | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/consensus/state.go b/internal/consensus/state.go index cb3cbdc8f..782adb1a2 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -2061,7 +2061,6 @@ func (cs *State) addVote(vote *types.Vote, peerID types.NodeID) (added bool, err if blockID, ok := prevotes.TwoThirdsMajority(); ok { // There was a polka! // If it matches our ProposalBlock, update the ValidBlock - // If we're locked but this is a recent polka, lock on the new block. if (cs.LockedBlock != nil) && (cs.LockedRound < vote.Round) && (vote.Round <= cs.Round) && diff --git a/internal/consensus/state_test.go b/internal/consensus/state_test.go index a8cea879f..4c7a454d3 100644 --- a/internal/consensus/state_test.go +++ b/internal/consensus/state_test.go @@ -803,7 +803,6 @@ func TestStatePOLDoesNotUnlock(t *testing.T) { // go to prevote, prevote for locked block (not proposal) ensurePrevote(voteCh, height, round) validatePrevote(t, cs1, round, vss[0], theBlockHash) - // add >2/3 prevotes for nil from all other validators signAddVotes(config, cs1, tmproto.PrevoteType, nil, types.PartSetHeader{}, vs2, vs3, vs4) @@ -1204,7 +1203,7 @@ func TestProposeValidBlock(t *testing.T) { signAddVotes(config, cs1, tmproto.PrevoteType, propBlockHash, propBlock.MakePartSet(partSize).Header(), vs2, vs3, vs4) ensurePrecommit(voteCh, height, round) - // we should have precommitted + // we should have precommitted the proposed block in this round. validatePrecommit(t, cs1, round, round, vss[0], propBlockHash, propBlockHash) signAddVotes(config, cs1, tmproto.PrecommitType, nil, types.PartSetHeader{}, vs2, vs3, vs4) @@ -1226,7 +1225,8 @@ func TestProposeValidBlock(t *testing.T) { signAddVotes(config, cs1, tmproto.PrecommitType, nil, types.PartSetHeader{}, vs2, vs3, vs4) ensurePrecommit(voteCh, height, round) - // we should have precommitted + // we should have precommitted nil during this round because we received + // >2/3 precommits for nil from the other validators. validatePrecommit(t, cs1, round, 0, vss[0], nil, propBlockHash) incrementRound(vs2, vs3, vs4)