diff --git a/internal/consensus/state.go b/internal/consensus/state.go index cfc8ec209..f3d60b709 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -1902,7 +1902,7 @@ func (cs *State) defaultSetProposal(proposal *types.Proposal) error { Precision: cs.state.ConsensusParams.Timing.Precision, MessageDelay: cs.state.ConsensusParams.Timing.MessageDelay, } - if proposal.POLRound == -1 && !proposal.IsTimely(tmtime.DefaultSource{}, tp) { + if proposal.POLRound == -1 && !proposal.IsTimely(tmtime.DefaultSource{}, tp, cs.state.InitialHeight) { return ErrInvalidProposalNotTimely } diff --git a/types/proposal.go b/types/proposal.go index 07e8464d7..fa5918a6c 100644 --- a/types/proposal.go +++ b/types/proposal.go @@ -88,11 +88,11 @@ func (p *Proposal) ValidateBasic() error { // // For more information on the meaning of 'timely', see the proposer-based timestamp specification: // https://github.com/tendermint/spec/tree/master/spec/consensus/proposer-based-timestamp -func (p *Proposal) IsTimely(clock tmtime.Source, tp TimingParams) bool { +func (p *Proposal) IsTimely(clock tmtime.Source, tp TimingParams, genesisHeight int64) bool { lt := clock.Now() lhs := lt.Add(-tp.Precision).Add(-tp.MessageDelay) rhs := lt.Add(tp.Precision) - if lhs.Before(p.Timestamp) && rhs.After(p.Timestamp) { + if (p.Height == genesisHeight || lhs.Before(p.Timestamp)) && rhs.After(p.Timestamp) { return true } return false