comment fixes from review

This commit is contained in:
William Banfield
2021-10-15 14:34:13 -04:00
parent c8e6d61974
commit 0db34a54e6
2 changed files with 6 additions and 5 deletions

View File

@@ -1265,7 +1265,9 @@ func (cs *State) createProposalBlock() (block *types.Block, blockParts *types.Pa
// Enter: `timeoutPropose` after entering Propose.
// Enter: proposal block and POL is ready.
// If we received a valid proposal within this round that matches the block we are
// If we received a valid proposal within this round and we are not locked on a block,
// we will prevote for block.
// Otherwise, if we receive a valid proposal that matches the block we are
// locked on or matches a block that received a POL in a round later than our
// locked round, prevote for the proposal, otherwise vote nil.
func (cs *State) enterPrevote(height int64, round int32) {

View File

@@ -865,7 +865,6 @@ func TestStateLock_PrevoteNilWhenLockedAndMissProposal(t *testing.T) {
/*
Round 1:
Create a proposal for block B, the same block from round 1.
Send a prevote for nil from each of the validators to cs1.
Send a precommit for nil from all of the validtors to cs1.
@@ -882,7 +881,7 @@ func TestStateLock_PrevoteNilWhenLockedAndMissProposal(t *testing.T) {
ensurePrevote(t, voteCh, height, round)
validatePrevote(t, cs1, round, vss[0], nil)
// Add prevotes from the remainder of the validators for the locked block.
// Add prevotes from the remainder of the validators nil.
signAddVotes(config, cs1, tmproto.PrevoteType, nil, types.PartSetHeader{}, vs2, vs3, vs4)
ensurePrecommit(t, voteCh, height, round)
// We should now be locked on the same block but with an updated locked round.
@@ -975,7 +974,7 @@ func TestStateLock_PrevoteNilWhenLockedAndDifferentProposal(t *testing.T) {
ensurePrevote(t, voteCh, height, round)
validatePrevote(t, cs1, round, vss[0], nil)
// Add prevotes from the remainder of the validators for the locked block.
// Add prevotes from the remainder of the validators for nil.
signAddVotes(config, cs1, tmproto.PrevoteType, nil, types.PartSetHeader{}, vs2, vs3, vs4)
// We should now be locked on the same block but prevote nil.
@@ -1380,7 +1379,7 @@ func TestStateLock_POLSafety1(t *testing.T) {
// finish prevote
ensurePrevote(t, voteCh, height, round)
// we should prevote what we're locked on
// we should prevote for nil
validatePrevote(t, cs1, round, vss[0], nil)
newStepCh := subscribe(cs1.eventBus, types.EventQueryNewRoundStep)