Skip to content

Commit

Permalink
Support separate payment/zkapp fee parameters in generator
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeee committed Oct 6, 2023
1 parent 9d1c32f commit ff77ffc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/app/itn_orchestrator/src/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ type GenParams struct {
MixMaxCostTpsRatio float64
LargePauseEveryNRounds, LargePauseMin int
MinBalanceChange, MaxBalanceChange, DeploymentFee uint64
PaymentAmount, MinFee, MaxFee, FundFee uint64
PaymentAmount, MinZkappFee, MaxZkappFee, FundFee uint64
MinPaymentFee, MaxPaymentFee uint64
}

type GeneratedCommand struct {
Expand Down Expand Up @@ -258,8 +259,8 @@ func (p *GenParams) Generate(round int) GeneratedRound {
Gap: p.Gap,
MinBalanceChange: p.MinBalanceChange,
MaxBalanceChange: p.MaxBalanceChange,
MinFee: p.MinFee,
MaxFee: p.MaxFee,
MinFee: p.MinZkappFee,
MaxFee: p.MaxZkappFee,
DeploymentFee: p.DeploymentFee,
MaxCost: maxCost,
NewAccountRatio: p.NewAccountRatio,
Expand All @@ -277,8 +278,8 @@ func (p *GenParams) Generate(round int) GeneratedRound {
Tps: tps - zkappTps,
MinTps: p.MinTps,
DurationMin: p.RoundDurationMin,
MinFee: p.MinFee,
MaxFee: p.MaxFee,
MinFee: p.MinPaymentFee,
MaxFee: p.MaxPaymentFee,
Amount: p.PaymentAmount,
Receiver: p.PaymentReceiver,
}
Expand Down
6 changes: 4 additions & 2 deletions src/app/itn_orchestrator/src/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ func someParams() GenParams {
MaxBalanceChange: 3e3,
DeploymentFee: 1e9,
PaymentAmount: 1e5,
MinFee: 1e9,
MaxFee: 3e9,
MinZkappFee: 1e9,
MaxZkappFee: 3e9,
MinPaymentFee: 1e8,
MaxPaymentFee: 3e8,
FundFee: 1e9,
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/app/itn_orchestrator/src/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ func main() {
flag.Uint64Var(&p.MinBalanceChange, "min-balance-change", 0, "Min balance change for zkapp account update")
flag.Uint64Var(&p.DeploymentFee, "deployment-fee", 1e9, "Zkapp deployment fee")
flag.Uint64Var(&p.FundFee, "fund-fee", 1e9, "Funding tx fee")
flag.Uint64Var(&p.MinFee, "min-fee", 1e9, "Min tx fee")
flag.Uint64Var(&p.MaxFee, "max-fee", 2e9, "Max tx fee")
flag.Uint64Var(&p.MinPaymentFee, "min-payment-fee", 1e8, "Min payment fee")
flag.Uint64Var(&p.MaxPaymentFee, "max-payment-fee", 2e8, "Max payment fee")
flag.Uint64Var(&p.MinZkappFee, "min-zkapp-fee", 1e9, "Min zkapp tx fee")
flag.Uint64Var(&p.MaxZkappFee, "max-zkapp-fee", 2e9, "Max zkapp tx fee")
flag.Uint64Var(&p.PaymentAmount, "payment-amount", 1e5, "Payment amount")
flag.Parse()
checkRatio(p.SenderRatio, "wrong sender ratio")
Expand Down

0 comments on commit ff77ffc

Please sign in to comment.