You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* loadtest: remove modes function, random-precompile and specific-precompile
* rename flag --lt-address to --loadtest-contract-address
* rename flag -b, --byte-count to --store-data-size
* rename flag --steady-state-tx-pool-size to --adaptive-target-size
* rename flag --send-only to --fire-and-forget
* rename flag --call-only to --eth-call-only
* remove flag -i, --iterations
* rename flag --to-random to --random-recipients
* rename --force-contract-deploy to --skip-contract-deploy (inverted logic); rename --keep-funded-amount to --keep-funds-after-test
* remove loadtest deploy flag
* make gen
* review docs
* make gen-doc
* rename multi-account flags from addresses to accounts
* fix typos
* add --send-only alias to --fire-and-forget flag
* make gen-doc
* fix send-only alias flag name
Copy file name to clipboardExpand all lines: cmd/loadtest/app.go
+29-38Lines changed: 29 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -42,36 +42,33 @@ type (
42
42
Concurrency*int64
43
43
BatchSize*uint64
44
44
TimeLimit*int64
45
-
ToRandom*bool
46
-
CallOnly*bool
47
-
CallOnlyLatestBlock*bool
45
+
RandomRecipients*bool
46
+
EthCallOnly*bool
47
+
EthCallOnlyLatestBlock*bool
48
48
ChainID*uint64
49
49
PrivateKey*string
50
50
ToAddress*string
51
51
EthAmountInWei*uint64
52
52
RateLimit*float64
53
53
AdaptiveRateLimit*bool
54
-
SteadyStateTxPoolSize*uint64
54
+
AdaptiveTargetSize*uint64
55
55
AdaptiveRateLimitIncrement*uint64
56
56
AdaptiveCycleDuration*uint64
57
57
AdaptiveBackoffFactor*float64
58
58
Modes*[]string
59
-
Function*uint64
60
-
Iterations*uint64
61
-
ByteCount*uint64
59
+
StoreDataSize*uint64
62
60
Seed*int64
63
-
LtAddress*string
61
+
LoadtestContractAddress*string
64
62
ERC20Address*string
65
63
ERC721Address*string
66
64
DelAddress*string
67
-
ForceContractDeploy*bool
68
65
ForceGasLimit*uint64
69
66
ForceGasPrice*uint64
70
67
ForcePriorityGasPrice*uint64
71
68
ShouldProduceSummary*bool
72
69
SummaryOutputMode*string
73
70
LegacyTransactionMode*bool
74
-
SendOnly*bool
71
+
FireAndForget*bool
75
72
RecallLength*uint64
76
73
ContractAddress*string
77
74
ContractCallData*string
@@ -82,11 +79,11 @@ type (
82
79
BlobFeeCap*uint64
83
80
StartNonce*uint64
84
81
GasPriceMultiplier*float64
85
-
SendingAddressCount*uint64
86
-
AddressFundingAmount*big.Int
87
-
PreFundSendingAddresses*bool
88
-
KeepFundedAmount*bool
89
-
SendingAddressesFile*string
82
+
SendingAccountsCount*uint64
83
+
AccountFundingAmount*big.Int
84
+
PreFundSendingAccounts*bool
85
+
KeepFundsAfterTest*bool
86
+
SendingAccountsFile*string
90
87
Proxy*string
91
88
WaitForReceipt*bool
92
89
ReceiptRetryMax*uint
@@ -166,8 +163,8 @@ var (
166
163
0xF0, 0x0D, 0xBA, 0xBE,
167
164
}
168
165
169
-
randSrc*rand.Rand
170
-
defaultFunding=new(big.Int).SetUint64(0) // 1 ETH
166
+
randSrc*rand.Rand
167
+
defaultAccountFundingAmount=new(big.Int).SetUint64(0) // 1 ETH
171
168
)
172
169
173
170
// LoadtestCmd represents the loadtest command
@@ -225,18 +222,17 @@ func initFlags() {
225
222
ltp.PrivateKey=LoadtestCmd.PersistentFlags().String("private-key", codeQualityPrivateKey, "The hex encoded private key that we'll use to send transactions")
226
223
ltp.ChainID=LoadtestCmd.PersistentFlags().Uint64("chain-id", 0, "The chain id for the transactions.")
227
224
ltp.ToAddress=LoadtestCmd.PersistentFlags().String("to-address", "0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF", "The address that we're going to send to")
228
-
ltp.ToRandom=LoadtestCmd.PersistentFlags().Bool("to-random", false, "When doing a transfer test, should we send to random addresses rather than DEADBEEFx5")
229
-
ltp.CallOnly=LoadtestCmd.PersistentFlags().Bool("call-only", false, "When using this mode, rather than sending a transaction, we'll just call. This mode is incompatible with adaptive rate limiting, summarization, and a few other features.")
230
-
ltp.CallOnlyLatestBlock=LoadtestCmd.PersistentFlags().Bool("call-only-latest", false, "When using call only mode with recall, should we execute on the latest block or on the original block")
225
+
ltp.RandomRecipients=LoadtestCmd.PersistentFlags().Bool("random-recipients", false, "When doing a transfer test, should we send to random addresses rather than DEADBEEFx5")
226
+
ltp.EthCallOnly=LoadtestCmd.PersistentFlags().Bool("eth-call-only", false, "When using this mode, rather than sending a transaction, we'll just call. This mode is incompatible with adaptive rate limiting, summarization, and a few other features.")
227
+
ltp.EthCallOnlyLatestBlock=LoadtestCmd.PersistentFlags().Bool("eth-call-only-latest", false, "When using call only mode with recall, should we execute on the latest block or on the original block")
231
228
ltp.EthAmountInWei=LoadtestCmd.PersistentFlags().Uint64("eth-amount-in-wei", 0, "The amount of ether in wei to send on every transaction")
232
229
ltp.RateLimit=LoadtestCmd.PersistentFlags().Float64("rate-limit", 4, "An overall limit to the number of requests per second. Give a number less than zero to remove this limit all together")
233
230
ltp.AdaptiveRateLimit=LoadtestCmd.PersistentFlags().Bool("adaptive-rate-limit", false, "Enable AIMD-style congestion control to automatically adjust request rate")
234
-
ltp.SteadyStateTxPoolSize=LoadtestCmd.PersistentFlags().Uint64("steady-state-tx-pool-size", 1000, "When using adaptive rate limiting, this value sets the target queue size. If the queue is smaller than this value, we'll speed up. If the queue is smaller than this value, we'll back off.")
231
+
ltp.AdaptiveTargetSize=LoadtestCmd.PersistentFlags().Uint64("adaptive-target-size", 1000, "When using adaptive rate limiting, this value sets the target queue size. If the queue is smaller than this value, we'll speed up. If the queue is smaller than this value, we'll back off.")
235
232
ltp.AdaptiveRateLimitIncrement=LoadtestCmd.PersistentFlags().Uint64("adaptive-rate-limit-increment", 50, "When using adaptive rate limiting, this flag controls the size of the additive increases.")
236
233
ltp.AdaptiveCycleDuration=LoadtestCmd.PersistentFlags().Uint64("adaptive-cycle-duration-seconds", 10, "When using adaptive rate limiting, this flag controls how often we check the queue size and adjust the rates")
237
234
ltp.AdaptiveBackoffFactor=LoadtestCmd.PersistentFlags().Float64("adaptive-backoff-factor", 2, "When using adaptive rate limiting, this flag controls our multiplicative decrease value.")
238
235
ltp.GasPriceMultiplier=LoadtestCmd.PersistentFlags().Float64("gas-price-multiplier", 1, "A multiplier to increase or decrease the gas price")
239
-
ltp.Iterations=LoadtestCmd.PersistentFlags().Uint64P("iterations", "i", 1, "If we're making contract calls, this controls how many times the contract will execute the instruction in a loop. If we are making ERC721 Mints, this indicates the minting batch size")
240
236
ltp.Seed=LoadtestCmd.PersistentFlags().Int64("seed", 123456, "A seed for generating random values and addresses")
241
237
ltp.ForceGasLimit=LoadtestCmd.PersistentFlags().Uint64("gas-limit", 0, "In environments where the gas limit can't be computed on the fly, we can specify it manually. This can also be used to avoid eth_estimateGas")
242
238
ltp.ForceGasPrice=LoadtestCmd.PersistentFlags().Uint64("gas-price", 0, "In environments where the gas price can't be determined automatically, we can specify it manually")
@@ -246,40 +242,35 @@ func initFlags() {
246
242
ltp.BatchSize=LoadtestCmd.PersistentFlags().Uint64("batch-size", 999, "Number of batches to perform at a time for receipt fetching. Default is 999 requests at a time.")
247
243
ltp.SummaryOutputMode=LoadtestCmd.PersistentFlags().String("output-mode", "text", "Format mode for summary output (json | text)")
248
244
ltp.LegacyTransactionMode=LoadtestCmd.PersistentFlags().Bool("legacy", false, "Send a legacy transaction instead of an EIP1559 transaction.")
249
-
ltp.SendOnly=LoadtestCmd.PersistentFlags().Bool("send-only", false, "Send transactions and load without waiting for it to be mined.")
245
+
ltp.FireAndForget=LoadtestCmd.PersistentFlags().Bool("fire-and-forget", false, "Send transactions and load without waiting for it to be mined.")
246
+
LoadtestCmd.PersistentFlags().BoolVar(ltp.FireAndForget, "send-only", false, "Alias for --fire-and-forget.")
250
247
ltp.BlobFeeCap=LoadtestCmd.Flags().Uint64("blob-fee-cap", 100000, "The blob fee cap, or the maximum blob fee per chunk, in Gwei.")
251
-
ltp.SendingAddressCount=LoadtestCmd.Flags().Uint64("sending-address-count", 1, "The number of sending addresses to use. This is useful for avoiding pool account queue.")
252
-
ltp.AddressFundingAmount=defaultFunding
253
-
LoadtestCmd.Flags().Var(&flag_loader.BigIntValue{Val: ltp.AddressFundingAmount}, "address-funding-amount", "The amount in wei to fund the sending addresses with. Set to 0 to disable account funding (useful for call-only mode or pre-funded addresses).")
254
-
ltp.PreFundSendingAddresses=LoadtestCmd.Flags().Bool("pre-fund-sending-addresses", false, "If set to true, the sending addresses will be funded at the start of the execution, otherwise all addresses will be funded when used for the first time.")
255
-
ltp.KeepFundedAmount=LoadtestCmd.Flags().Bool("keep-funded-amount", false, "If set to true, the funded amount will be kept in the sending addresses. Otherwise, the funded amount will be refunded back to the account used to fund the account.")
256
-
ltp.SendingAddressesFile=LoadtestCmd.Flags().String("sending-addresses-file", "", "The file containing the sending addresses private keys, one per line. This is useful for avoiding pool account queue but also to keep the same sending addresses for different execution cycles.")
248
+
ltp.SendingAccountsCount=LoadtestCmd.Flags().Uint64("sending-accounts-count", 1, "The number of sending accounts to use. This is useful for avoiding pool account queue.")
LoadtestCmd.Flags().Var(&flag_loader.BigIntValue{Val: ltp.AccountFundingAmount}, "account-funding-amount", "The amount in wei to fund the sending accounts with. Set to 0 to disable account funding (useful for eth-call-only mode or pre-funded accounts).")
251
+
ltp.PreFundSendingAccounts=LoadtestCmd.Flags().Bool("pre-fund-sending-accounts", false, "If set to true, the sending accounts will be funded at the start of the execution, otherwise all accounts will be funded when used for the first time.")
252
+
ltp.KeepFundsAfterTest=LoadtestCmd.Flags().Bool("keep-funds-after-test", false, "If set to true, the funded amount will be kept in the sending accounts. Otherwise, the funded amount will be refunded back to the account used to fund the account.")
253
+
ltp.SendingAccountsFile=LoadtestCmd.Flags().String("sending-accounts-file", "", "The file containing the sending accounts private keys, one per line. This is useful for avoiding pool account queue but also to keep the same sending accounts for different execution cycles.")
257
254
258
255
// Local flags.
259
-
ltp.Modes=LoadtestCmd.Flags().StringSliceP("mode", "m", []string{"t"}, `The testing mode to use. It can be multiple like: "c,d,f,t"
256
+
ltp.Modes=LoadtestCmd.Flags().StringSliceP("mode", "m", []string{"t"}, `The testing mode to use. It can be multiple like: "d,t"
260
257
2, erc20 - Send ERC20 tokens
261
258
7, erc721 - Mint ERC721 tokens
262
259
b, blob - Send blob transactions
263
-
c, call - Call random contract functions
264
260
cc, contract-call - Make contract calls
265
261
d, deploy - Deploy contracts
266
-
f, function - Call random contract functions
267
262
i, inscription - Send inscription transactions
268
263
inc, increment - Increment a counter
269
-
pr, random-precompile - Call random precompiled contracts
270
-
px, specific-precompile - Call specific precompiled contracts
271
264
r, random - Random modes (does not include the following modes: blob, call, inscription, recall, rpc, uniswapv3)
272
265
R, recall - Replay or simulate transactions
273
266
rpc - Call random rpc methods
274
267
s, store - Store bytes in a dynamic byte array
275
268
t, transaction - Send transactions
276
269
v3, uniswapv3 - Perform UniswapV3 swaps`)
277
-
ltp.Function=LoadtestCmd.Flags().Uint64P("function", "f", 1, "A specific function to be called if running with --mode f or a specific precompiled contract when running with --mode a")
278
-
ltp.ByteCount=LoadtestCmd.Flags().Uint64P("byte-count", "b", 1024, "If we're in store mode, this controls how many bytes we'll try to store in our contract")
279
-
ltp.LtAddress=LoadtestCmd.Flags().String("lt-address", "", "The address of a pre-deployed load test contract")
270
+
ltp.StoreDataSize=LoadtestCmd.Flags().Uint64("store-data-size", 1024, "If we're in store mode, this controls how many bytes we'll try to store in our contract")
271
+
ltp.LoadtestContractAddress=LoadtestCmd.Flags().String("loadtest-contract-address", "", "The address of a pre-deployed load test contract")
280
272
ltp.ERC20Address=LoadtestCmd.Flags().String("erc20-address", "", "The address of a pre-deployed ERC20 contract")
281
273
ltp.ERC721Address=LoadtestCmd.Flags().String("erc721-address", "", "The address of a pre-deployed ERC721 contract")
282
-
ltp.ForceContractDeploy=LoadtestCmd.Flags().Bool("force-contract-deploy", false, "Some load test modes don't require a contract deployment. Set this flag to true to force contract deployments. This will still respect the --lt-address flags.")
283
274
ltp.RecallLength=LoadtestCmd.Flags().Uint64("recall-blocks", 50, "The number of blocks that we'll attempt to fetch for recall")
284
275
ltp.ContractAddress=LoadtestCmd.Flags().String("contract-address", "", "The address of the contract that will be used in --mode contract-call. This must be paired up with --mode contract-call and --calldata")
285
276
ltp.ContractCallData=LoadtestCmd.Flags().String("calldata", "", "The hex encoded calldata passed in. The format is function signature + arguments encoded together. This must be paired up with --mode contract-call and --contract-address")
0 commit comments