From ff77ffcfe18c0c19ab1bda7643022821bd168606 Mon Sep 17 00:00:00 2001 From: georgeee Date: Tue, 26 Sep 2023 20:33:45 +0200 Subject: [PATCH] Support separate payment/zkapp fee parameters in generator --- src/app/itn_orchestrator/src/generate.go | 11 ++++++----- src/app/itn_orchestrator/src/generate_test.go | 6 ++++-- src/app/itn_orchestrator/src/generator/main.go | 6 ++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/app/itn_orchestrator/src/generate.go b/src/app/itn_orchestrator/src/generate.go index ed4eb6da57c6..dac361bd1839 100644 --- a/src/app/itn_orchestrator/src/generate.go +++ b/src/app/itn_orchestrator/src/generate.go @@ -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 { @@ -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, @@ -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, } diff --git a/src/app/itn_orchestrator/src/generate_test.go b/src/app/itn_orchestrator/src/generate_test.go index e6369d16e153..ff820806f698 100644 --- a/src/app/itn_orchestrator/src/generate_test.go +++ b/src/app/itn_orchestrator/src/generate_test.go @@ -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, } } diff --git a/src/app/itn_orchestrator/src/generator/main.go b/src/app/itn_orchestrator/src/generator/main.go index 2e16e9e0a5f6..04f12705a696 100644 --- a/src/app/itn_orchestrator/src/generator/main.go +++ b/src/app/itn_orchestrator/src/generator/main.go @@ -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")