Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(loadtest): implement uniswapv3 loadtest #122

Closed
wants to merge 137 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
62fa6b0
doc: document how to generate new loadtest mode string
leovct Sep 19, 2023
399cc6c
chore: build uniswap v3 contracts
leovct Sep 19, 2023
56d0a5c
chore: remove avail cmds
leovct Sep 19, 2023
62d916e
chore: generate go bindings for uniswap contracts
leovct Sep 19, 2023
46681dd
doc: document how to build uniswap contracts and how to generate go b…
leovct Sep 19, 2023
d1abfca
feat: add uniswap v3 loadtest mode
leovct Sep 19, 2023
69c6ea7
doc: update doc
leovct Sep 19, 2023
ec4f016
chore: define deployment config for uniswap
leovct Sep 19, 2023
752822e
chore: lint
leovct Sep 19, 2023
1dbb6b2
feat: enable 1 bp fee tier
leovct Sep 19, 2023
596adf9
chore: remove unused contracts and deploy multicall
leovct Sep 19, 2023
e079493
feat: deploy ProxyAdmin
leovct Sep 19, 2023
4845b25
chore: clean up
leovct Sep 19, 2023
1fab4dc
chore: make lint
leovct Sep 19, 2023
ffd9f04
feat: deploy TickLens
leovct Sep 19, 2023
f2393a7
chore: minor change
leovct Sep 19, 2023
7b375f2
chore: refactor to use generics
leovct Sep 20, 2023
7539cc5
chore: clean up
leovct Sep 20, 2023
380cb1a
chore: rename lib contract
leovct Sep 20, 2023
04ea6fd
feat: deploy NFTDescriptor and WETH9
leovct Sep 20, 2023
f39503c
feat: deploy TransparentUpgradeableProxy
leovct Sep 20, 2023
8e7e46e
chore: generate NonfungiblePositionManager go binding
leovct Sep 20, 2023
e0b26fe
feat: deploy NonfungiblePositionManager contract
leovct Sep 20, 2023
b15d753
chore: generate go binding for V3Migrator
leovct Sep 20, 2023
da6a379
feat: deploy V3Migrator
leovct Sep 20, 2023
f198cf9
chore: raise geth gas limit and send more funds to the loadtest account
leovct Sep 20, 2023
74f96a8
chore: update build process
leovct Sep 20, 2023
576cd1f
chore: update contract bytecode
leovct Sep 20, 2023
4ab1fde
feat: transfer factory ownership
leovct Sep 20, 2023
3b922ce
chore: generate go binding for UniswapV3Staker
leovct Sep 20, 2023
f90231e
chore: update build process
leovct Sep 20, 2023
71e05d4
fix: build process
leovct Sep 20, 2023
dd8ba18
feat: deploy staker
leovct Sep 20, 2023
b60b661
chore: generate go bindings for QuoterV2
leovct Sep 20, 2023
33245b1
feat: deploy QuoterV2
leovct Sep 20, 2023
dc2cba2
chore: generate go bindings for SwapRouter02
leovct Sep 20, 2023
2ea1130
chore: clean up build process
leovct Sep 20, 2023
d2dc571
chore: update bindings
leovct Sep 20, 2023
15b6176
chore: clean up
leovct Sep 20, 2023
016c709
fix: build issues
leovct Sep 20, 2023
d49b37c
chore: new bytecodes
leovct Sep 20, 2023
5e87cb6
doc: update doc
leovct Sep 20, 2023
8418c09
feat: deploy SwapRouter02
leovct Sep 20, 2023
176ffc7
feat: transfer ProxyAdmin ownership
leovct Sep 20, 2023
8f72995
chore: update debug msgs
leovct Sep 20, 2023
acb0f75
fix: update owner address
leovct Sep 20, 2023
26dfdc0
chore: clean up
leovct Sep 20, 2023
74189d2
chore: forge init
leovct Sep 20, 2023
c8a5802
forge install: forge-std
leovct Sep 20, 2023
573ad78
chore: forge init
leovct Sep 20, 2023
de3d208
forge install: forge-std
leovct Sep 20, 2023
de9267f
chore: add ERC20 contracts
leovct Sep 20, 2023
3591976
fix: remove quotes from ERC20 bytecode
leovct Sep 20, 2023
96b2985
feat: generate go bindings for ERC20
leovct Sep 20, 2023
fd7d5b7
feat: deploy the two ERC20 contracts
leovct Sep 20, 2023
e22c472
feat: approve erc20 spendings
leovct Sep 20, 2023
2a58173
feat: create pool between the erc20 contracts
leovct Sep 20, 2023
6f7fea8
chore: make sure pool is deployed before moving on
leovct Sep 20, 2023
f687992
chore: generate go binding for UniswapV3Pool
leovct Sep 20, 2023
2ef0f6c
feat: initialize, provied liquidity and swap tokens
leovct Sep 20, 2023
b9de3d9
chore: clean up
leovct Sep 20, 2023
c522675
chore: lint
leovct Sep 20, 2023
d3ac524
doc: update `polycli loadtest` doc
leovct Sep 20, 2023
34332cd
fix: build process
leovct Sep 20, 2023
e03575e
chore: update sqrtX96price computation
leovct Sep 20, 2023
9f33d98
chore: refactor
leovct Sep 20, 2023
61e0397
chore: new bytecode
leovct Sep 20, 2023
f09d5b3
chore: remove unused code
leovct Sep 20, 2023
817db0f
chore: minor update to build process
leovct Sep 20, 2023
8249d23
chore: document script
leovct Sep 20, 2023
f57ef32
fix: shadowed vars
leovct Sep 20, 2023
059e47b
chore: test remove artefacts
leovct Sep 20, 2023
3e748d6
chore: nit
leovct Sep 20, 2023
77cc519
chore: only upload relevant v3-core contracts
leovct Sep 20, 2023
f696882
chore: remove all v3-periphery contracts
leovct Sep 20, 2023
7705aea
chore: upload only relevant v3-periphery contracts
leovct Sep 20, 2023
31b3eec
chore: remove the rest of the contracts
leovct Sep 20, 2023
7c64c02
chore: only upload relevant contracts
leovct Sep 20, 2023
b51c1a3
chore: update bytecode
leovct Sep 20, 2023
a59ac4f
chore: build script name option change
leovct Sep 20, 2023
3984b4a
chore: bindings script nit
leovct Sep 20, 2023
ead8fbd
chore: new bytecode
leovct Sep 20, 2023
8cdd208
chore: refactor
leovct Sep 20, 2023
ca13026
chore: small nits
leovct Sep 20, 2023
0d9dba9
chore: remove unused field
leovct Sep 20, 2023
f52cd77
feat: enable pre-deployed contract mode for uniswap
leovct Sep 21, 2023
59b8299
fix: retrieve pool instead of creating a new one
leovct Sep 21, 2023
4bad8b9
fix: issue with initializing a pool twice
leovct Sep 21, 2023
1424ba6
feat: add loadtest fn
leovct Sep 21, 2023
d45186a
doc: gen
leovct Sep 21, 2023
8841536
chore: make lint
leovct Sep 21, 2023
1945b0c
Merge branch 'main' into feat/uniswap-loadtest
leovct Oct 2, 2023
b8eef8b
chore: `go mod tidy`
leovct Oct 2, 2023
8f2cac5
chore: update ERC20 contract
leovct Oct 3, 2023
aa8641e
chore: generate new bindings for ERC20
leovct Oct 3, 2023
6eb456d
chore: fix some issues with Swapper and ERC20
leovct Oct 3, 2023
783a871
chore: rename ERC20 contract to Swapper
leovct Oct 3, 2023
18cc742
chore: fix the pool initialization issue
leovct Oct 3, 2023
7d70acd
chore: specify the amount of tokens to mint
leovct Oct 3, 2023
10a5ce1
chore: rename contract
leovct Oct 3, 2023
e21b489
chore: update build process
leovct Oct 4, 2023
c81ffca
chore: update `Swapper` contract
leovct Oct 4, 2023
55bb5d9
chore: don't commit tmp/
leovct Oct 4, 2023
531c255
chore: hack to update the NonfungibleTokenPositionDescriptorMetaData …
leovct Oct 4, 2023
ba3039e
chore: document how to update the deploy fn of NFTPositionDescriptor
leovct Oct 4, 2023
7d5ccdd
chore: add a warning in the script
leovct Oct 4, 2023
6a247b1
chore: more debug
leovct Oct 4, 2023
80a69c1
chore: rename TokenA and TokenB into Token0 and Token1
leovct Oct 4, 2023
1c31daf
chore: add debug
leovct Oct 4, 2023
b945031
chore: update debug msgs
leovct Oct 4, 2023
695dc26
feat: move uniswapv3 loadtest to subcommand
leovct Oct 4, 2023
6216001
chore: nits
leovct Oct 4, 2023
50a11b6
chore: remove `fmt.Sprintf()`
leovct Oct 4, 2023
756a9ba
chore: clean up
leovct Oct 4, 2023
be715ee
chore: rename contracts
leovct Oct 4, 2023
df5cd97
chore: update steps
leovct Oct 4, 2023
7ca3a9f
fix: proxy data
leovct Oct 4, 2023
ebddf14
chore: nit
leovct Oct 4, 2023
60f8a5d
chore: clean up
leovct Oct 4, 2023
05cb287
chore: update `uniswapv3` cmd usage
leovct Oct 4, 2023
0b6de0f
Merge branch 'main' into feat/uniswap-loadtest
leovct Oct 5, 2023
78c9a18
chore: update build process
leovct Oct 5, 2023
0f4cec8
chore: update binding process
leovct Oct 5, 2023
94b646d
chore: save nft descriptor lib address to file
leovct Oct 5, 2023
fa1b434
chore: update nftdescriptor lib address
leovct Oct 5, 2023
5d2614d
chore: hack
leovct Oct 5, 2023
835c4b7
fix: issues
leovct Oct 5, 2023
a0958f5
chore: clean up
leovct Oct 6, 2023
70b54b1
chore: diplay tx hashes in trace mode
leovct Oct 10, 2023
30f89db
chore: use swap-router v1.1.0 instead of v1.3.0
leovct Oct 10, 2023
3c4a4a7
Merge branch 'main' into feat/uniswap-loadtest
leovct Oct 12, 2023
ab3dda4
fix: `blockUntilSuccessful` default case return a nil error
leovct Oct 12, 2023
7e3362a
fix: `TransparentUpgradeableProxy` deployment
leovct Oct 12, 2023
4a0decb
chore: nit
leovct Oct 12, 2023
b8a8dc4
chore: solve lint issue
leovct Oct 12, 2023
97c814c
Merge branch 'main' into feat/uniswap-loadtest
leovct Oct 16, 2023
3c32dd2
Merge branch 'main' into feat/uniswap-loadtest
leovct Oct 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ gen-go-bindings: ## Generate go bindings for smart contracts.
$(call gen_go_binding,contracts/tokens/ERC20,ERC20,tokens,contracts/tokens)
$(call gen_go_binding,contracts/tokens/ERC721,ERC721,tokens,contracts/tokens)
$(call gen_go_binding,contracts/loadtester,LoadTester,contracts,contracts)
cd contracts/uniswapv3 && ./build.sh all && ./bindings.sh

# Generate go binding.
# - $1: input_dir
Expand Down
40 changes: 4 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ We run a lot of different blockchain technologies. Different tools often have in
- [Features](#features)
- [Testing](#testing)
- [Contributing](#contributing)
- [References](#references)
- [Reference](#reference)

## Install

Expand Down Expand Up @@ -148,43 +148,11 @@ You can then generate some load to make sure that blocks with transactions are b
$ polycli loadtest --verbosity 700 --chain-id 1337 --concurrency 1 --requests 1000 --rate-limit 5 --mode c http://127.0.0.1:8545
```

## Contributing
# Contributing

The `Makefile` is here to assist you to build the project, run tests, generate documentation or go bindings, etc.
- If you add a new loadtest mode, don't forget to update the loadtest mode string by running the following command: `cd cmd/loadtest && stringer -type=loadTestMode`. You can install [stringer](https://pkg.go.dev/golang.org/x/tools/cmd/stringer) with `go install golang.org/x/tools/cmd/stringer@latest`.

```sh
$ make
Usage:
make <target>
help Display this help.

Build
generate Generate protobuf stubs.
build Build go binary.
install Install the go binary.
cross Cross-compile go binaries using CGO.
simplecross Cross-compile go binaries without using CGO.
clean Clean the binary folder.

Test
test Run tests.

Generation
gen-doc Generate documentation for `polycli`.
gen-loadtest-modes Generate loadtest modes strings.
gen-go-bindings Generate go bindings for smart contracts.

Lint
lint Run linters.

Clients
geth Start a local geth node.
avail Start a local avail node.
geth-loadtest Fund test account with 5k ETH and run loadtest against an EVM/Geth chain.
avail-loadtest Run loadtest against an Avail chain.
```

## References
# Reference

Sending some value to the default load testing account.

Expand Down
23 changes: 16 additions & 7 deletions cmd/loadtest/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ type (
)

var (
//go:embed usage.md
usage string
//go:embed genericUsage.md
genericUsage string
inputLoadTestParams loadTestParams
loadTestResults []loadTestSample
loadTestResutsMutex sync.RWMutex
Expand Down Expand Up @@ -150,7 +150,7 @@ var (
var LoadtestCmd = &cobra.Command{
Use: "loadtest url",
Short: "Run a generic load test against an Eth/EVM style JSON-RPC endpoint.",
Long: usage,
Long: genericUsage,
RunE: func(cmd *cobra.Command, args []string) error {
err := runLoadTest(cmd.Context())
if err != nil {
Expand Down Expand Up @@ -188,8 +188,12 @@ var LoadtestCmd = &cobra.Command{
}

func init() {
ltp := new(loadTestParams)
initFlags()
initSubCommands()
}

func initFlags() {
ltp := new(loadTestParams)
ltp.Requests = LoadtestCmd.PersistentFlags().Int64P("requests", "n", 1, "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.")
ltp.Concurrency = LoadtestCmd.PersistentFlags().Int64P("concurrency", "c", 1, "Number of requests to perform concurrently. Default is one request at a time.")
ltp.TimeLimit = LoadtestCmd.PersistentFlags().Int64P("time-limit", "t", -1, "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.")
Expand All @@ -206,7 +210,7 @@ func init() {
ltp.AdaptiveRateLimitIncrement = LoadtestCmd.PersistentFlags().Uint64("adaptive-rate-limit-increment", 50, "When using adaptive rate limiting, this flag controls the size of the additive increases.")
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")
ltp.AdaptiveBackoffFactor = LoadtestCmd.PersistentFlags().Float64("adaptive-backoff-factor", 2, "When using adaptive rate limiting, this flag controls our multiplicative decrease value.")
ltp.Modes = LoadtestCmd.PersistentFlags().StringSliceP("mode", "m", []string{"t"}, `The testing mode to use. It can be multiple like: "t,c,d,f"
ltp.Modes = LoadtestCmd.Flags().StringSliceP("mode", "m", []string{"t"}, `The testing mode to use. It can be multiple like: "t,c,d,f"
t - sending transactions
d - deploy contract
c - call random contract functions
Expand All @@ -217,15 +221,16 @@ s - store mode
r - random modes
2 - ERC20 Transfers
7 - ERC721 Mints
v3 - UniswapV3 swaps
R - total recall
rpc - call random rpc methods`)
ltp.Function = LoadtestCmd.PersistentFlags().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`")
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")
ltp.ByteCount = LoadtestCmd.PersistentFlags().Uint64P("byte-count", "b", 1024, "If we're in store mode, this controls how many bytes we'll try to store in our contract")
ltp.Seed = LoadtestCmd.PersistentFlags().Int64("seed", 123456, "A seed for generating random values and addresses")
ltp.LtAddress = LoadtestCmd.PersistentFlags().String("lt-address", "", "The address of a pre-deployed load test contract")
ltp.ERC20Address = LoadtestCmd.PersistentFlags().String("erc20-address", "", "The address of a pre-deployed erc 20 contract")
ltp.ERC721Address = LoadtestCmd.PersistentFlags().String("erc721-address", "", "The address of a pre-deployed erc 721 contract")
ltp.ERC20Address = LoadtestCmd.PersistentFlags().String("erc20-address", "", "The address of a pre-deployed ERC20 contract")
ltp.ERC721Address = LoadtestCmd.PersistentFlags().String("erc721-address", "", "The address of a pre-deployed ERC721 contract")
ltp.ContractCallNumberOfBlocksToWaitFor = LoadtestCmd.PersistentFlags().Uint64("contract-call-nb-blocks-to-wait-for", 30, "The number of blocks to wait for before giving up on a contract deployment")
ltp.ContractCallBlockInterval = LoadtestCmd.PersistentFlags().Uint64("contract-call-block-interval", 1, "During deployment, this flag controls if we should check every block, every other block, or every nth block to determine that the contract has been deployed")
ltp.ForceContractDeploy = LoadtestCmd.PersistentFlags().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.")
Expand All @@ -241,3 +246,7 @@ rpc - call random rpc methods`)

// TODO Compression
}

func initSubCommands() {
LoadtestCmd.AddCommand(uniswapV3LoadTestCmd)
}
File renamed without changes.
71 changes: 69 additions & 2 deletions cmd/loadtest/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import (

"github.com/maticnetwork/polygon-cli/contracts"
"github.com/maticnetwork/polygon-cli/contracts/tokens"
"github.com/maticnetwork/polygon-cli/contracts/uniswapv3"

_ "embed"

"github.com/maticnetwork/polygon-cli/metrics"
"github.com/maticnetwork/polygon-cli/rpctypes"
"github.com/maticnetwork/polygon-cli/util"
Expand Down Expand Up @@ -51,6 +55,7 @@ const (
loadTestModeERC721
loadTestModePrecompiledContracts
loadTestModePrecompiledContract
loadTestModeUniswapV3

// All the modes AFTER random mode will not be used when mode random is selected
loadTestModeRandom
Expand All @@ -61,6 +66,8 @@ const (
codeQualityPrivateKey = "42b6e34dc21598a807dc19d7784c71b2a7a01f6480dc6f58258f78e539f1a1fa"
)

var waitingPeriodExhaustedErr = fmt.Errorf("waiting period exhausted")

func characterToLoadTestMode(mode string) (loadTestMode, error) {
switch mode {
case "t", "transaction":
Expand All @@ -87,6 +94,8 @@ func characterToLoadTestMode(mode string) (loadTestMode, error) {
return loadTestModePrecompiledContracts, nil
case "R", "recall":
return loadTestModeRecall, nil
case "v3", "uniswapv3":
return loadTestModeUniswapV3, nil
case "rpc":
return loadTestModeRPC, nil
default:
Expand Down Expand Up @@ -432,6 +441,62 @@ func mainLoop(ctx context.Context, c *ethclient.Client, rpc *ethrpc.Client) erro
log.Debug().Str("erc721Addr", erc721Addr.String()).Msg("Obtained erc 721 contract address")
}

uniswapAddresses := UniswapV3Addresses{
FactoryV3: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapFactoryV3),
Multicall: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapMulticall),
ProxyAdmin: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapProxyAdmin),
TickLens: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapTickLens),
NFTDescriptorLib: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapNFTLibDescriptor),
NFTPositionDescriptor: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapNFTPositionDescriptor),
TransparentUpgradeableProxy: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapUpgradeableProxy),
NFPositionManager: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapNFPositionManager),
Migrator: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapMigrator),
Staker: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapStaker),
QuoterV2: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapQuoterV2),
SwapRouter02: ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapSwapRouter),
WETH9: ethcommon.HexToAddress(*uniswapv3LoadTestParams.WETH9),
}
var uniswapV3Config UniswapV3Config
var poolConfig PoolConfig
if mode == loadTestModeUniswapV3 || mode == loadTestModeRandom {
uniswapV3Config, err = deployUniswapV3(ctx, c, tops, cops, uniswapAddresses, *ltp.FromETHAddress)
if err != nil {
return nil
}
log.Debug().Interface("config", uniswapV3Config.ToAddresses()).Msg("UniswapV3 deployment config")

tokensAToMint := big.NewInt(1_000_000_000_000_000_000)
var token0Config contractConfig[uniswapv3.Swapper]
token0Config, err = deploySwapperContract(ctx, c, tops, cops, uniswapV3Config, "Token0", "A", tokensAToMint, *ltp.FromETHAddress, ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapPoolToken0))
if err != nil {
return nil
}

tokensBToMint := big.NewInt(1_000_000_000_000_000_000)
var token1Config contractConfig[uniswapv3.Swapper]
token1Config, err = deploySwapperContract(ctx, c, tops, cops, uniswapV3Config, "Token1", "B", tokensBToMint, *ltp.FromETHAddress, ethcommon.HexToAddress(*uniswapv3LoadTestParams.UniswapPoolToken1))
if err != nil {
return nil
}

fees := big.NewInt(3_000)
poolConfig = PoolConfig{Fees: fees}
if token0Config.Address.Hex() < token1Config.Address.Hex() {
poolConfig.Token0 = token0Config
poolConfig.ReserveA = tokensAToMint
poolConfig.Token1 = token1Config
poolConfig.ReserveB = tokensBToMint
} else {
poolConfig.Token0 = token1Config
poolConfig.ReserveA = tokensBToMint
poolConfig.Token1 = token0Config
poolConfig.ReserveB = tokensAToMint
}
if err = createPool(ctx, c, tops, cops, uniswapV3Config, poolConfig, *ltp.FromETHAddress); err != nil {
return nil
}
}

var recallTransactions []rpctypes.PolyTransaction
if mode == loadTestModeRecall {
recallTransactions, err = getRecallTransactions(ctx, c, rpc)
Expand Down Expand Up @@ -535,6 +600,8 @@ func mainLoop(ctx context.Context, c *ethclient.Client, rpc *ethrpc.Client) erro
startReq, endReq, tErr = loadTestCallPrecompiledContracts(ctx, c, myNonceValue, ltContract, false)
case loadTestModeRecall:
startReq, endReq, tErr = loadTestRecall(ctx, c, myNonceValue, recallTransactions[int(currentNonce)%len(recallTransactions)])
case loadTestModeUniswapV3:
startReq, endReq, tErr = loadTestUniswapV3(ctx, c, myNonceValue, uniswapV3Config, poolConfig)
case loadTestModeRPC:
startReq, endReq, tErr = loadTestRPC(ctx, c, myNonceValue, indexedActivity)
default:
Expand Down Expand Up @@ -728,8 +795,8 @@ func blockUntilSuccessful(ctx context.Context, c *ethclient.Client, f func() err
blockDiff = currentBlockNumber % startBlockNumber
}
if blockDiff > numberOfBlocksToWaitFor {
log.Error().Err(err).Dur("elapsedTimeSeconds", elapsed).Msg("Exhausted waiting period")
return err
log.Error().Err(err).Dur("elapsedTimeSeconds", elapsed).Msg("waiting period exhausted")
return waitingPeriodExhaustedErr
}

currentBlockNumber, err = c.BlockNumber(ctx)
Expand Down
11 changes: 6 additions & 5 deletions cmd/loadtest/loadtestmode_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading