proto: deduplicate consensus params (#9287)

This commit is contained in:
Callum Waters
2022-08-22 10:50:21 +02:00
committed by GitHub
parent 0ca3a89c90
commit 2d8df1bd4e
29 changed files with 623 additions and 1164 deletions

View File

@@ -2267,9 +2267,10 @@ func (cs *State) signVote(
func (cs *State) voteTime() time.Time {
now := tmtime.Now()
minVoteTime := now
// Minimum time increment between blocks
const timeIota = time.Millisecond
// TODO: We should remove next line in case we don't vote for v in case cs.ProposalBlock == nil,
// even if cs.LockedBlock != nil. See https://docs.tendermint.com/master/spec/.
timeIota := time.Duration(cs.state.ConsensusParams.Block.TimeIotaMs) * time.Millisecond
if cs.LockedBlock != nil {
// See the BFT time spec https://docs.tendermint.com/master/spec/consensus/bft-time.html
minVoteTime = cs.LockedBlock.Time.Add(timeIota)