Skip to content

Commit 5758ce4

Browse files
committed
rename --force-contract-deploy to --skip-contract-deploy (inverted logic); rename --keep-funded-amount to --keep-funds-after-test
1 parent ba45995 commit 5758ce4

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

cmd/loadtest/app.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type (
6262
ERC20Address *string
6363
ERC721Address *string
6464
DelAddress *string
65-
ForceContractDeploy *bool
65+
SkipContractDeploy *bool
6666
ForceGasLimit *uint64
6767
ForceGasPrice *uint64
6868
ForcePriorityGasPrice *uint64
@@ -83,7 +83,7 @@ type (
8383
SendingAddressCount *uint64
8484
AddressFundingAmount *big.Int
8585
PreFundSendingAddresses *bool
86-
KeepFundedAmount *bool
86+
KeepFundsAfterTest *bool
8787
SendingAddressesFile *string
8888
Proxy *string
8989

@@ -246,7 +246,7 @@ func initFlags() {
246246
ltp.AddressFundingAmount = defaultFunding
247247
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).")
248248
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.")
249-
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.")
249+
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.")
250250
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.")
251251

252252
// Local flags.
@@ -269,7 +269,7 @@ v3, uniswapv3 - Perform UniswapV3 swaps`)
269269
ltp.LoadtestContractAddress = LoadtestCmd.Flags().String("loadtest-contract-address", "", "The address of a pre-deployed load test contract")
270270
ltp.ERC20Address = LoadtestCmd.Flags().String("erc20-address", "", "The address of a pre-deployed ERC20 contract")
271271
ltp.ERC721Address = LoadtestCmd.Flags().String("erc721-address", "", "The address of a pre-deployed ERC721 contract")
272-
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 --loadtest-contract-address flags.")
272+
ltp.SkipContractDeploy = LoadtestCmd.Flags().Bool("skip-contract-deploy", true, "Some load test modes don't require a contract deployment. Set this flag to true(default) to skip contract deployments. This will still respect the --loadtest-contract-address flags.")
273273
ltp.RecallLength = LoadtestCmd.Flags().Uint64("recall-blocks", 50, "The number of blocks that we'll attempt to fetch for recall")
274274
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")
275275
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")

cmd/loadtest/loadtest.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@ func mainLoop(ctx context.Context, c *ethclient.Client, rpc *ethrpc.Client) erro
677677
// deploy and instantiate the load tester contract
678678
var ltAddr ethcommon.Address
679679
var ltContract *tester.LoadTester
680-
if anyModeRequiresLoadTestContract(ltp.ParsedModes) || *inputLoadTestParams.ForceContractDeploy {
680+
mustDeployContract := !*inputLoadTestParams.SkipContractDeploy
681+
if mustDeployContract || anyModeRequiresLoadTestContract(ltp.ParsedModes) {
681682
ltAddr, ltContract, err = getLoadTestContract(ctx, c, tops, cops)
682683
if err != nil {
683684
return err

doc/polycli_loadtest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,14 @@ The codebase has a contract that used for load testing. It's written in Solidity
119119
--eth-call-only 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.
120120
--eth-call-only-latest When using call only mode with recall, should we execute on the latest block or on the original block
121121
--fire-and-forget Send transactions and load without waiting for it to be mined.
122-
--force-contract-deploy Some load test modes don't require a contract deployment. Set this flag to true to force contract deployments. This will still respect the --loadtest-contract-address flags.
123122
--function-arg strings The arguments that will be passed to a contract function call. This must be paired up with "--mode contract-call" and "--contract-address". Args can be passed multiple times: "--function-arg 'test' --function-arg 999" or comma separated values "--function-arg "test",9". The ordering of the arguments must match the ordering of the function parameters.
124123
--function-signature string The contract's function signature that will be called. The format is '<function name>(<types...>)'. This must be paired up with '--mode contract-call' and '--contract-address'. If the function requires parameters you can pass them with '--function-arg <value>'.
125124
--gas-limit uint 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
126125
--gas-price uint In environments where the gas price can't be determined automatically, we can specify it manually
127126
--gas-price-multiplier float A multiplier to increase or decrease the gas price (default 1)
128127
-h, --help help for loadtest
129128
--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\"}")
130-
--keep-funded-amount 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.
129+
--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.
131130
--legacy Send a legacy transaction instead of an EIP1559 transaction.
132131
--loadtest-contract-address string The address of a pre-deployed load test contract
133132
-m, --mode strings The testing mode to use. It can be multiple like: "c,d,f,t"
@@ -159,6 +158,7 @@ The codebase has a contract that used for load testing. It's written in Solidity
159158
--seed int A seed for generating random values and addresses (default 123456)
160159
--sending-address-count uint The number of sending addresses to use. This is useful for avoiding pool account queue. (default 1)
161160
--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 addresses for different execution cycles.
161+
--skip-contract-deploy Some load test modes don't require a contract deployment. Set this flag to true(default) to skip contract deployments. This will still respect the --loadtest-contract-address flags. (default true)
162162
--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)
163163
--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
164164
-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

Comments
 (0)