mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 06:31:57 +00:00
proto: rename timing params to synchrony params (#7554)
This commit is contained in:
@@ -66,7 +66,7 @@ type pbtsTestHarness struct {
|
||||
|
||||
type pbtsTestConfiguration struct {
|
||||
// The timestamp consensus parameters to be used by the state machine under test.
|
||||
timingParams types.TimingParams
|
||||
synchronyParams types.SynchronyParams
|
||||
|
||||
// The setting to use for the TimeoutPropose configuration parameter.
|
||||
timeoutPropose time.Duration
|
||||
@@ -102,7 +102,7 @@ func newPBTSTestHarness(ctx context.Context, t *testing.T, tc pbtsTestConfigurat
|
||||
}
|
||||
cfg.Consensus.TimeoutPropose = tc.timeoutPropose
|
||||
consensusParams := types.DefaultConsensusParams()
|
||||
consensusParams.Timing = tc.timingParams
|
||||
consensusParams.Synchrony = tc.synchronyParams
|
||||
|
||||
state, privVals := makeGenesisState(t, cfg, genesisStateArgs{
|
||||
Params: consensusParams,
|
||||
@@ -332,7 +332,7 @@ func TestProposerWaitsForGenesisTime(t *testing.T) {
|
||||
// create a genesis time far (enough) in the future.
|
||||
initialTime := time.Now().Add(800 * time.Millisecond)
|
||||
cfg := pbtsTestConfiguration{
|
||||
timingParams: types.TimingParams{
|
||||
synchronyParams: types.SynchronyParams{
|
||||
Precision: 10 * time.Millisecond,
|
||||
MessageDelay: 10 * time.Millisecond,
|
||||
},
|
||||
@@ -360,7 +360,7 @@ func TestProposerWaitsForPreviousBlock(t *testing.T) {
|
||||
defer cancel()
|
||||
initialTime := time.Now().Add(time.Millisecond * 50)
|
||||
cfg := pbtsTestConfiguration{
|
||||
timingParams: types.TimingParams{
|
||||
synchronyParams: types.SynchronyParams{
|
||||
Precision: 100 * time.Millisecond,
|
||||
MessageDelay: 500 * time.Millisecond,
|
||||
},
|
||||
@@ -429,7 +429,7 @@ func TestTimelyProposal(t *testing.T) {
|
||||
initialTime := time.Now()
|
||||
|
||||
cfg := pbtsTestConfiguration{
|
||||
timingParams: types.TimingParams{
|
||||
synchronyParams: types.SynchronyParams{
|
||||
Precision: 10 * time.Millisecond,
|
||||
MessageDelay: 140 * time.Millisecond,
|
||||
},
|
||||
@@ -452,7 +452,7 @@ func TestTooFarInThePastProposal(t *testing.T) {
|
||||
|
||||
// localtime > proposedBlockTime + MsgDelay + Precision
|
||||
cfg := pbtsTestConfiguration{
|
||||
timingParams: types.TimingParams{
|
||||
synchronyParams: types.SynchronyParams{
|
||||
Precision: 1 * time.Millisecond,
|
||||
MessageDelay: 10 * time.Millisecond,
|
||||
},
|
||||
@@ -477,7 +477,7 @@ func TestTooFarInTheFutureProposal(t *testing.T) {
|
||||
|
||||
// localtime < proposedBlockTime - Precision
|
||||
cfg := pbtsTestConfiguration{
|
||||
timingParams: types.TimingParams{
|
||||
synchronyParams: types.SynchronyParams{
|
||||
Precision: 1 * time.Millisecond,
|
||||
MessageDelay: 10 * time.Millisecond,
|
||||
},
|
||||
|
||||
@@ -1362,12 +1362,12 @@ func (cs *State) enterPrevote(ctx context.Context, height int64, round int32) {
|
||||
}
|
||||
|
||||
func (cs *State) proposalIsTimely() bool {
|
||||
tp := types.TimingParams{
|
||||
Precision: cs.state.ConsensusParams.Timing.Precision,
|
||||
MessageDelay: cs.state.ConsensusParams.Timing.MessageDelay,
|
||||
sp := types.SynchronyParams{
|
||||
Precision: cs.state.ConsensusParams.Synchrony.Precision,
|
||||
MessageDelay: cs.state.ConsensusParams.Synchrony.MessageDelay,
|
||||
}
|
||||
|
||||
return cs.Proposal.IsTimely(cs.ProposalReceiveTime, tp, cs.state.InitialHeight)
|
||||
return cs.Proposal.IsTimely(cs.ProposalReceiveTime, sp, cs.state.InitialHeight)
|
||||
}
|
||||
|
||||
func (cs *State) defaultDoPrevote(ctx context.Context, height int64, round int32) {
|
||||
@@ -1399,9 +1399,9 @@ func (cs *State) defaultDoPrevote(ctx context.Context, height int64, round int32
|
||||
"received",
|
||||
tmtime.Canonical(cs.ProposalReceiveTime).Format(time.RFC3339Nano),
|
||||
"msg_delay",
|
||||
cs.state.ConsensusParams.Timing.MessageDelay,
|
||||
cs.state.ConsensusParams.Synchrony.MessageDelay,
|
||||
"precision",
|
||||
cs.state.ConsensusParams.Timing.Precision)
|
||||
cs.state.ConsensusParams.Synchrony.Precision)
|
||||
cs.signAddVote(ctx, tmproto.PrevoteType, nil, types.PartSetHeader{})
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user