diff --git a/gpbft/gpbft.go b/gpbft/gpbft.go index 3cd67e8b..5bf4d814 100644 --- a/gpbft/gpbft.go +++ b/gpbft/gpbft.go @@ -509,7 +509,7 @@ func (i *instance) beginQuality() error { // Broadcast input value and wait to receive from others. i.current.Phase = QUALITY_PHASE i.participant.progression.NotifyProgress(i.current) - i.phaseTimeout = i.alarmAfterSynchronyWithMulti(i.participant.qualityDurationMulti) + i.phaseTimeout = i.alarmAfterSynchronyWithMulti(i.participant.qualityDeltaMulti) i.resetRebroadcastParams() i.broadcast(i.current.Round, QUALITY_PHASE, i.proposal, false, nil) metrics.phaseCounter.Add(context.TODO(), 1, metric.WithAttributes(attrQualityPhase)) diff --git a/gpbft/options.go b/gpbft/options.go index 4d808c10..fee9c308 100644 --- a/gpbft/options.go +++ b/gpbft/options.go @@ -23,7 +23,7 @@ type options struct { delta time.Duration deltaBackOffExponent float64 - qualityDurationMulti float64 + qualityDeltaMulti float64 committeeLookback uint64 maxLookaheadRounds uint64 @@ -40,7 +40,7 @@ func newOptions(o ...Option) (*options, error) { opts := &options{ delta: defaultDelta, deltaBackOffExponent: defaultDeltaBackOffExponent, - qualityDurationMulti: 1.0, + qualityDeltaMulti: 1.0, committeeLookback: defaultCommitteeLookback, rebroadcastAfter: defaultRebroadcastAfter, maxCachedInstances: defaultMaxCachedInstances, @@ -85,12 +85,12 @@ func WithDeltaBackOffExponent(e float64) Option { } } -func WithQualityDurationMultiplier(m float64) Option { +func WithQualityDeltaMultiplier(m float64) Option { return func(o *options) error { if m < 0 { return errors.New("quality duration multiplier cannot be less than zero") } - o.qualityDurationMulti = m + o.qualityDeltaMulti = m return nil } } diff --git a/manifest/manifest.go b/manifest/manifest.go index 40c489a8..3dd08161 100644 --- a/manifest/manifest.go +++ b/manifest/manifest.go @@ -37,7 +37,7 @@ var ( DefaultGpbftConfig = GpbftConfig{ Delta: 6 * time.Second, DeltaBackOffExponent: 2.0, - QualityDurationMultiplier: 1.0, + QualityDeltaMultiplier: 1.0, MaxLookaheadRounds: 5, ChainProposedLength: gpbft.ChainDefaultLen, RebroadcastBackoffBase: 6 * time.Second, @@ -99,10 +99,10 @@ func (c *CxConfig) Validate() error { } type GpbftConfig struct { - Delta time.Duration - DeltaBackOffExponent float64 - QualityDurationMultiplier float64 - MaxLookaheadRounds uint64 + Delta time.Duration + DeltaBackOffExponent float64 + QualityDeltaMultiplier float64 + MaxLookaheadRounds uint64 ChainProposedLength int @@ -120,8 +120,8 @@ func (g *GpbftConfig) Validate() error { return fmt.Errorf("gpbft backoff exponent must be at least 1.0, was %f", g.DeltaBackOffExponent) } - if g.QualityDurationMultiplier < 0 { - return fmt.Errorf("gpbft quality duration multiplier is negative: %f", g.QualityDurationMultiplier) + if g.QualityDeltaMultiplier < 0 { + return fmt.Errorf("gpbft quality duration multiplier is negative: %f", g.QualityDeltaMultiplier) } if g.ChainProposedLength < 1 { @@ -148,7 +148,7 @@ func (g *GpbftConfig) ToOptions() []gpbft.Option { return []gpbft.Option{ gpbft.WithDelta(g.Delta), gpbft.WithDeltaBackOffExponent(g.DeltaBackOffExponent), - gpbft.WithQualityDurationMultiplier(g.QualityDurationMultiplier), + gpbft.WithQualityDeltaMultiplier(g.QualityDeltaMultiplier), gpbft.WithMaxLookaheadRounds(g.MaxLookaheadRounds), gpbft.WithRebroadcastBackoff( DefaultGpbftConfig.RebroadcastBackoffExponent, diff --git a/manifest/manifest_test.go b/manifest/manifest_test.go index dc2c8e7f..dbf9a373 100644 --- a/manifest/manifest_test.go +++ b/manifest/manifest_test.go @@ -30,7 +30,7 @@ var base = manifest.Manifest{ Gpbft: manifest.GpbftConfig{ Delta: 10, DeltaBackOffExponent: 1.2, - QualityDurationMultiplier: 1.0, + QualityDeltaMultiplier: 1.0, MaxLookaheadRounds: 5, ChainProposedLength: gpbft.ChainDefaultLen, RebroadcastBackoffBase: 10,