Skip to content

Commit d38e9e5

Browse files
committed
Rename mix-max-cost to max-cost-mixed (previous name was misleading)
1 parent 85dcb3a commit d38e9e5

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

orchestrator/src/generate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type GenParams struct {
2626
RotationKeys, RotationServers []string
2727
RotationPermutation bool
2828
RotationRatio float64
29-
MixMaxCostTpsRatio float64
29+
MaxCostMixedTpsRatio float64
3030
LargePauseEveryNRounds, LargePauseMin int
3131
MinBalanceChange, MaxBalanceChange, DeploymentFee uint64
3232
PaymentAmount, MinZkappFee, MaxZkappFee, FundFee uint64
@@ -73,7 +73,7 @@ func DefaultGenParams() GenParams {
7373
RotationServers: []string{},
7474
RotationPermutation: false,
7575
RotationRatio: 0.3,
76-
MixMaxCostTpsRatio: 0.0,
76+
MaxCostMixedTpsRatio: 0.0,
7777
LargePauseEveryNRounds: 8,
7878
LargePauseMin: 0,
7979
MinBalanceChange: 0,
@@ -318,10 +318,10 @@ func (p *GenParams) Generate(round int) GeneratedRound {
318318
tps := SampleTps(p.BaseTps, p.StressTps)
319319
maxCost := p.MaxCost
320320
zkappRatio := p.ZkappRatio
321-
if p.MixMaxCostTpsRatio > 1e-3 && (round&1) == 1 {
321+
if p.MaxCostMixedTpsRatio > 1e-3 && (round&1) == 1 {
322322
maxCost = true
323323
zkappRatio = 1
324-
tps *= p.MixMaxCostTpsRatio
324+
tps *= p.MaxCostMixedTpsRatio
325325
}
326326
experimentName := fmt.Sprintf("%s-%d", p.ExperimentName, round)
327327
onlyZkapps := math.Abs(1-zkappRatio) < 1e-3

orchestrator/src/generate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func someParams() GenParams {
2626
PaymentReceiver: "B62qpPita1s7Dbnr7MVb3UK8fdssZixL1a4536aeMYxbTJEtRGGyS8U",
2727
PrivkeysPerFundCmd: 2,
2828
GenerateFundKeys: 20,
29-
MixMaxCostTpsRatio: 0.7,
29+
MaxCostMixedTpsRatio: 0.7,
3030
LargePauseEveryNRounds: 8,
3131
LargePauseMin: 240,
3232
MinBalanceChange: 1e3,

orchestrator/src/generate_validation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ func ValidationSteps(p *GenParams) []ValidationStep {
4141
simpleRangeCheck(p.MinStopRatio, "min stop ratio"),
4242
simpleRangeCheck(p.MaxStopRatio, "max stop ratio"),
4343
simpleRangeCheck(p.StopCleanRatio, "stop-clean ratio"),
44-
simpleRangeCheck(p.MixMaxCostTpsRatio, "max-cost-mixed ratio"),
44+
simpleRangeCheck(p.MaxCostMixedTpsRatio, "max-cost-mixed ratio"),
4545
simpleRangeCheck(p.RotationRatio, "rotation ratio"),
4646
{
4747
ErrorMsg: "both max-cost-mixed and max-cost specified",
4848
Check: func(p *GenParams) bool {
49-
return p.MaxCost && p.MixMaxCostTpsRatio > 1e-3
49+
return p.MaxCost && p.MaxCostMixedTpsRatio > 1e-3
5050
},
5151
ExitCode: 2,
5252
},

orchestrator/src/service/inputs/generator.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type GeneratorInputData struct {
1111
BaseTps *float64 `json:"base_tps,omitempty"`
1212
StressTps *float64 `json:"stress_tps,omitempty"`
1313
MinTps *float64 `json:"min_tps,omitempty"`
14-
MixMaxCostTpsRatio *float64 `json:"mix_max_cost_tps_ratio,omitempty"`
14+
MaxCostMixedTpsRatio *float64 `json:"max_cost_mixed_tps_ratio,omitempty"`
1515
MinStopRatio *float64 `json:"min_stop_ratio,omitempty"`
1616
MaxStopRatio *float64 `json:"max_stop_ratio,omitempty"`
1717
SenderRatio *float64 `json:"sender_ratio,omitempty"`
@@ -54,7 +54,7 @@ type GeneratorInputData struct {
5454
} `json:"fees,omitempty"`
5555
}
5656

57-
const mixMaxCostTpsRatioHelp = "when provided, specifies ratio of tps (proportional to total tps) for max cost transactions to be used every other round, zkapps ratio for these rounds is set to 100%"
57+
const maxCostMixedTpsRatioHelp = "when provided, specifies ratio of tps (proportional to total tps) for max cost transactions to be used every other round, zkapps ratio for these rounds is set to 100%"
5858

5959
func (inputData *GeneratorInputData) ApplyWithDefaults(p *lib.GenParams) {
6060

@@ -66,7 +66,7 @@ func (inputData *GeneratorInputData) ApplyWithDefaults(p *lib.GenParams) {
6666
lib.SetOrDefault(inputData.BaseTps, &p.BaseTps, defaults.BaseTps)
6767
lib.SetOrDefault(inputData.StressTps, &p.StressTps, defaults.StressTps)
6868
lib.SetOrDefault(inputData.MinTps, &p.MinTps, defaults.MinTps)
69-
lib.SetOrDefault(inputData.MixMaxCostTpsRatio, &p.MixMaxCostTpsRatio, defaults.MixMaxCostTpsRatio)
69+
lib.SetOrDefault(inputData.MaxCostMixedTpsRatio, &p.MaxCostMixedTpsRatio, defaults.MaxCostMixedTpsRatio)
7070
lib.SetOrDefault(inputData.MinStopRatio, &p.MinStopRatio, defaults.MinStopRatio)
7171
lib.SetOrDefault(inputData.MaxStopRatio, &p.MaxStopRatio, defaults.MaxStopRatio)
7272
lib.SetOrDefault(inputData.SenderRatio, &p.SenderRatio, defaults.SenderRatio)

0 commit comments

Comments
 (0)