Prevote nil if not timely

This commit is contained in:
Anca Zamfir
2021-12-09 08:25:54 -05:00
parent b03dced9af
commit 7180e47e92
6 changed files with 18 additions and 8 deletions
+2 -2
View File
@@ -129,8 +129,8 @@ func DefaultTimingParams() TimingParams {
// TODO(@wbanfield): Determine experimental values for these defaults
// https://github.com/tendermint/tendermint/issues/7202
return TimingParams{
Precision: 1 * time.Nanosecond,
MessageDelay: 1 * time.Nanosecond,
Precision: 10 * time.Millisecond,
MessageDelay: 500 * time.Millisecond,
}
}
+2 -2
View File
@@ -90,8 +90,8 @@ func (p *Proposal) ValidateBasic() error {
// https://github.com/tendermint/spec/tree/master/spec/consensus/proposer-based-timestamp
func (p *Proposal) IsTimely(clock tmtime.Source, tp TimingParams) bool {
lt := clock.Now()
lhs := lt.Add(-tp.Precision)
rhs := lt.Add(tp.Precision).Add(tp.MessageDelay)
lhs := lt.Add(-tp.Precision).Add(-tp.MessageDelay)
rhs := lt.Add(tp.Precision)
if lhs.Before(p.Timestamp) && rhs.After(p.Timestamp) {
return true
}