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
Copy file name to clipboardExpand all lines: cmd/loadtest/app.go
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -79,11 +79,11 @@ type (
79
79
BlobFeeCap*uint64
80
80
StartNonce*uint64
81
81
GasPriceMultiplier*float64
82
-
SendingAddressCount*uint64
83
-
AddressFundingAmount*big.Int
84
-
PreFundSendingAddresses*bool
82
+
SendingAccountsCount*uint64
83
+
AccountFundingAmount*big.Int
84
+
PreFundSendingAccounts*bool
85
85
KeepFundsAfterTest*bool
86
-
SendingAddressesFile*string
86
+
SendingAccountsFile*string
87
87
Proxy*string
88
88
89
89
// Computed
@@ -160,8 +160,8 @@ var (
160
160
0xF0, 0x0D, 0xBA, 0xBE,
161
161
}
162
162
163
-
randSrc*rand.Rand
164
-
defaultFunding=new(big.Int).SetUint64(0) // 1 ETH
163
+
randSrc*rand.Rand
164
+
defaultAccountFundingAmount=new(big.Int).SetUint64(0) // 1 ETH
165
165
)
166
166
167
167
// LoadtestCmd represents the loadtest command
@@ -241,12 +241,12 @@ func initFlags() {
241
241
ltp.LegacyTransactionMode=LoadtestCmd.PersistentFlags().Bool("legacy", false, "Send a legacy transaction instead of an EIP1559 transaction.")
242
242
ltp.FireAndForget=LoadtestCmd.PersistentFlags().Bool("fire-and-forget", false, "Send transactions and load without waiting for it to be mined.")
243
243
ltp.BlobFeeCap=LoadtestCmd.Flags().Uint64("blob-fee-cap", 100000, "The blob fee cap, or the maximum blob fee per chunk, in Gwei.")
244
-
ltp.SendingAddressCount=LoadtestCmd.Flags().Uint64("sending-address-count", 1, "The number of sending addresses to use. This is useful for avoiding pool account queue.")
245
-
ltp.AddressFundingAmount=defaultFunding
246
-
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 eth-call-only mode or pre-funded addresses).")
247
-
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.")
248
-
ltp.KeepFundsAfterTest=LoadtestCmd.Flags().Bool("keep-funds-after-test", 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.")
249
-
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.")
244
+
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).")
247
+
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.")
248
+
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.")
249
+
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.")
250
250
251
251
// Local flags.
252
252
ltp.Modes=LoadtestCmd.Flags().StringSliceP("mode", "m", []string{"t"}, `The testing mode to use. It can be multiple like: "d,t"
log.Error().Err(err).Msg("Unable to fund sending addresses")
368
+
log.Error().Err(err).Msg("Unable to fund sending accounts")
369
369
iErr:=accountPool.ReturnFunds(ctx)
370
370
ifiErr!=nil {
371
371
log.Error().
372
372
Err(iErr).
373
-
Msg("There was an issue returning the funds from the sending addresses back to the funding address")
374
-
returnfmt.Errorf("unable to return funds from sending addresses. %w", iErr)
373
+
Msg("There was an issue returning the funds from the sending accounts back to the funding account")
374
+
returnfmt.Errorf("unable to return funds from sending accounts. %w", iErr)
375
375
}
376
-
returnfmt.Errorf("unable to fund sending addresses. %w", err)
376
+
returnfmt.Errorf("unable to fund sending accounts. %w", err)
377
377
}
378
378
} elseif!*inputLoadTestParams.EthCallOnly {
379
-
// When using multiple sending addresses and not using --eth-call-only and --address-funding-amount <= 0, we need to make sure the addresses get funded
379
+
// When using multiple sending accounts and not using --eth-call-only and --account-funding-amount <= 0, we need to make sure the accounts get funded
380
380
// Set default funding to 1 ETH (1000000000000000000 wei)
Copy file name to clipboardExpand all lines: doc/polycli_loadtest.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,12 +79,12 @@ The codebase has a contract that used for load testing. It's written in Solidity
79
79
## Flags
80
80
81
81
```bash
82
+
--account-funding-amount big.Int 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).
82
83
--adaptive-backoff-factor float When using adaptive rate limiting, this flag controls our multiplicative decrease value. (default 2)
83
84
--adaptive-cycle-duration-seconds uint When using adaptive rate limiting, this flag controls how often we check the queue size and adjust the rates (default 10)
84
85
--adaptive-rate-limit Enable AIMD-style congestion control to automatically adjust request rate
85
86
--adaptive-rate-limit-increment uint When using adaptive rate limiting, this flag controls the size of the additive increases. (default 50)
86
87
--adaptive-target-size uint 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. (default 1000)
87
-
--address-funding-amount big.Int The amount in wei to fund the sending addresses with. Set to 0 to disable account funding (useful for eth-call-only mode or pre-funded addresses).
88
88
--batch-size uint Number of batches to perform at a timefor receipt fetching. Default is 999 requests at a time. (default 999)
89
89
--blob-fee-cap uint The blob fee cap, or the maximum blob fee per chunk, in Gwei. (default 100000)
90
90
--calldata string The hex encoded calldata passed in. The format is functionsignature + arguments encoded together. This must be paired up with --mode contract-call and --contract-address
@@ -105,7 +105,7 @@ The codebase has a contract that used for load testing. It's written in Solidity
105
105
--gas-price-multiplier float A multiplier to increase or decrease the gas price (default 1)
106
106
-h, --help helpfor loadtest
107
107
--inscription-content string The inscription content that will be encoded as calldata. This must be paired up with --mode inscription (default "data:,{\"p\":\"erc-20\",\"op\":\"mint\",\"tick\":\"TEST\",\"amt\":\"1\"}")
108
-
--keep-funds-after-test 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.
108
+
--keep-funds-after-test 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.
109
109
--legacy Send a legacy transaction instead of an EIP1559 transaction.
110
110
--loadtest-contract-address string The address of a pre-deployed load test contract
111
111
-m, --mode strings The testing mode to use. It can be multiple like: "d,t"
@@ -124,7 +124,7 @@ The codebase has a contract that used for load testing. It's written in Solidity
--nonce uint Use this flag to manually set the starting nonce
126
126
--output-mode string Format mode for summary output (json | text) (default "text")
127
-
--pre-fund-sending-addresses 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.
127
+
--pre-fund-sending-accountsIf 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.
128
128
--priority-gas-price uint Specify Gas Tip Price in the case of EIP-1559
129
129
--private-key string The hex encoded private key that we'll use to send transactions (default "42b6e34dc21598a807dc19d7784c71b2a7a01f6480dc6f58258f78e539f1a1fa")
130
130
--proxy string Use the proxy specified
@@ -134,8 +134,8 @@ The codebase has a contract that used for load testing. It's written in Solidity
134
134
-n, --requests int Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking results. (default 1)
135
135
-r, --rpc-url string The RPC endpoint url (default "http://localhost:8545")
136
136
--seed int A seed for generating random values and addresses (default 123456)
137
-
--sending-address-count uint The number of sending addresses to use. This is useful for avoiding pool account queue. (default 1)
138
-
--sending-addresses-file string 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 addressesfor different execution cycles.
137
+
--sending-accounts-count uint The number of sending accounts to use. This is useful for avoiding pool account queue. (default 1)
138
+
--sending-accounts-file string 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 accountsfor different execution cycles.
139
139
--store-data-size uint If we're in store mode, this controls how many bytes we'll try to store in our contract (default 1024)
140
140
--summarize Should we produce an execution summary after the load test has finished. If you're running a large load test, this can take a long time
141
141
-t, --time-limit int Maximum number of seconds to spend for benchmarking. Use this to benchmark within a fixed total amount of time. Per default there is no time limit. (default -1)
0 commit comments