From c9c8d4d6d4f8cc1b40be9f53d55b71f63161f6b3 Mon Sep 17 00:00:00 2001 From: Nikolay Nedkov Date: Thu, 3 Aug 2023 14:15:43 +0300 Subject: [PATCH] test: fixing things and adding make entry for the e2e test. Signed-off-by: Nikolay Nedkov --- test/Makefile | 20 +++++++ .../sequencer/common/params/constants.go | 2 +- .../common/transactions/transactions.go | 23 +++++--- .../pool_processing_erc20_test.go | 2 +- .../e2e/erc20-transfers/tx_sender.go | 8 +-- .../eth-transfers/pool_processing_eth_test.go | 2 +- .../sequencer/e2e/eth-transfers/tx_sender.go | 17 ++++-- .../e2e/uniswap-transfers/tx_sender.go | 16 ++++-- .../sequencer/scripts/common/results/print.go | 54 ++++++++++++++----- .../sequencer/scripts/erc20-transfers/main.go | 4 +- .../sequencer/scripts/eth-transfers/main.go | 6 ++- .../scripts/uniswap-transfers/main.go | 4 +- test/scripts/uniswap/pkg/setup.go | 2 +- test/scripts/uniswap/pkg/swap.go | 16 ++++-- 14 files changed, 130 insertions(+), 46 deletions(-) diff --git a/test/Makefile b/test/Makefile index c04ffbb555..585f11d588 100644 --- a/test/Makefile +++ b/test/Makefile @@ -258,6 +258,26 @@ benchmark-sequencer-erc20-transfers: stop touch ./results/out.dat ; \ go test -bench=. -timeout=600m | tee ./results/out.dat ; + +.PHONY: benchmark-sequencer-uniswap-transfers +benchmark-sequencer-uniswap-transfers: stop + $(RUNL1NETWORK) + $(RUNSTATEDB) + $(RUNPOOLDB) + $(RUNEVENTDB) + sleep 5 + $(RUNZKPROVER) + $(RUNSYNC) + sleep 2 + $(RUNL2GASPRICER) + $(RUNJSONRPC) + docker ps -a + docker logs $(DOCKERCOMPOSEZKPROVER) + @ cd benchmarks/sequencer/e2e/uniswap-transfers ; \ + mkdir -p results ; \ + touch ./results/out.dat ; \ + go test -bench=. -timeout=600m | tee ./results/out.dat ; + .PHONY: run-db run-db: ## Runs the node database $(RUNSTATEDB) diff --git a/test/benchmarks/sequencer/common/params/constants.go b/test/benchmarks/sequencer/common/params/constants.go index e33095ac62..d30f97b8fe 100644 --- a/test/benchmarks/sequencer/common/params/constants.go +++ b/test/benchmarks/sequencer/common/params/constants.go @@ -12,5 +12,5 @@ const ( // PrometheusPort is the port where prometheus is running PrometheusPort = 9092 // NumberOfOperations is the number of transactions to send - NumberOfOperations = 10 + NumberOfOperations = 300 ) diff --git a/test/benchmarks/sequencer/common/transactions/transactions.go b/test/benchmarks/sequencer/common/transactions/transactions.go index a3900c3db1..543e018f07 100644 --- a/test/benchmarks/sequencer/common/transactions/transactions.go +++ b/test/benchmarks/sequencer/common/transactions/transactions.go @@ -15,11 +15,20 @@ import ( "github.com/0xPolygonHermez/zkevm-node/test/operations" "github.com/0xPolygonHermez/zkevm-node/test/scripts/uniswap/pkg" "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" ) // SendAndWait sends a number of transactions and waits for them to be marked as pending in the pool -func SendAndWait(auth *bind.TransactOpts, client *ethclient.Client, getTxsByStatus func(ctx context.Context, status pool.TxStatus, limit uint64) ([]pool.Transaction, error), nTxs int, erc20SC *ERC20.ERC20, uniswapDeployments *pkg.Deployments, txSenderFunc func(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth *bind.TransactOpts, erc20SC *ERC20.ERC20, uniswapDeployments *pkg.Deployments) error) error { +func SendAndWait( + auth *bind.TransactOpts, + client *ethclient.Client, + getTxsByStatus func(ctx context.Context, status pool.TxStatus, limit uint64) ([]pool.Transaction, error), + nTxs int, + erc20SC *ERC20.ERC20, + uniswapDeployments *pkg.Deployments, + txSenderFunc func(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth *bind.TransactOpts, erc20SC *ERC20.ERC20, uniswapDeployments *pkg.Deployments) ([]*types.Transaction, error), +) ([]*types.Transaction, error) { auth.GasLimit = 2100000 log.Debugf("Sending %d txs ...", nTxs) startingNonce := uint64(0) @@ -29,18 +38,20 @@ func SendAndWait(auth *bind.TransactOpts, client *ethclient.Client, getTxsByStat maxNonce := uint64(nTxs) + startingNonce IP := getPublicIP() + allTxs := make([]*types.Transaction, 0, nTxs) for nonce := startingNonce; nonce < maxNonce; nonce++ { - err := txSenderFunc(client, auth.GasPrice, nonce, auth, erc20SC, uniswapDeployments) + txs, err := txSenderFunc(client, auth.GasPrice, nonce, auth, erc20SC, uniswapDeployments) if err != nil { for err != nil && err.Error() == "nonce intrinsic error" { log.Warnf("nonce intrinsic error, retrying with nonce %d", nonce) - err = txSenderFunc(client, auth.GasPrice, nonce, auth, erc20SC, uniswapDeployments) + txs, err = txSenderFunc(client, auth.GasPrice, nonce, auth, erc20SC, uniswapDeployments) } if err == nil { continue } - return err + return nil, err } + allTxs = append(allTxs, txs...) } log.Debug("All txs were sent!") log.Debug("Waiting pending transactions To be added in the pool ...") @@ -62,12 +73,12 @@ func SendAndWait(auth *bind.TransactOpts, client *ethclient.Client, getTxsByStat return done, nil }) if err != nil { - return err + return nil, err } log.Debug("All pending txs are added in the pool!") - return nil + return allTxs, nil } func getPublicIP() string { diff --git a/test/benchmarks/sequencer/e2e/erc20-transfers/pool_processing_erc20_test.go b/test/benchmarks/sequencer/e2e/erc20-transfers/pool_processing_erc20_test.go index e2ba491975..9d28837b6c 100644 --- a/test/benchmarks/sequencer/e2e/erc20-transfers/pool_processing_erc20_test.go +++ b/test/benchmarks/sequencer/e2e/erc20-transfers/pool_processing_erc20_test.go @@ -46,7 +46,7 @@ func BenchmarkSequencerERC20TransfersPoolProcess(b *testing.B) { } initialCount, err := pl.CountTransactionsByStatus(params.Ctx, pool.TxStatusSelected) require.NoError(b, err) - err = transactions.SendAndWait(auth, client, pl.GetTxsByStatus, params.NumberOfOperations, erc20SC, nil, TxSender) + _, err = transactions.SendAndWait(auth, client, pl.GetTxsByStatus, params.NumberOfOperations, erc20SC, nil, TxSender) require.NoError(b, err) var ( diff --git a/test/benchmarks/sequencer/e2e/erc20-transfers/tx_sender.go b/test/benchmarks/sequencer/e2e/erc20-transfers/tx_sender.go index 0f310d010b..fdbdf57ae1 100644 --- a/test/benchmarks/sequencer/e2e/erc20-transfers/tx_sender.go +++ b/test/benchmarks/sequencer/e2e/erc20-transfers/tx_sender.go @@ -3,6 +3,8 @@ package erc20_transfers import ( "math/big" + "github.com/ethereum/go-ethereum/core/types" + "github.com/0xPolygonHermez/zkevm-node/log" "github.com/0xPolygonHermez/zkevm-node/test/benchmarks/sequencer/common/params" "github.com/0xPolygonHermez/zkevm-node/test/contracts/bin/ERC20" @@ -23,7 +25,7 @@ var ( ) // TxSender sends ERC20 transfer to the sequencer -func TxSender(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth *bind.TransactOpts, erc20SC *ERC20.ERC20, uniswapDeployments *uniswap.Deployments) error { +func TxSender(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth *bind.TransactOpts, erc20SC *ERC20.ERC20, uniswapDeployments *uniswap.Deployments) ([]*types.Transaction, error) { log.Debugf("sending tx num: %d nonce: %d", countTxs, nonce) auth.Nonce = new(big.Int).SetUint64(nonce) var actualTransferAmount *big.Int @@ -32,10 +34,10 @@ func TxSender(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth } else { actualTransferAmount = big.NewInt(0).Add(transferAmountBig, auth.Nonce) } - _, err := erc20SC.Transfer(auth, params.To, actualTransferAmount) + tx, err := erc20SC.Transfer(auth, params.To, actualTransferAmount) if err == nil { countTxs += 1 } - return err + return []*types.Transaction{tx}, err } diff --git a/test/benchmarks/sequencer/e2e/eth-transfers/pool_processing_eth_test.go b/test/benchmarks/sequencer/e2e/eth-transfers/pool_processing_eth_test.go index 35f13c11a1..59e5e87033 100644 --- a/test/benchmarks/sequencer/e2e/eth-transfers/pool_processing_eth_test.go +++ b/test/benchmarks/sequencer/e2e/eth-transfers/pool_processing_eth_test.go @@ -27,7 +27,7 @@ func BenchmarkSequencerEthTransfersPoolProcess(b *testing.B) { require.NoError(b, err) timeForSetup := time.Since(start) setup.BootstrapSequencer(b, opsman) - err = transactions.SendAndWait(auth, client, pl.GetTxsByStatus, params.NumberOfOperations, nil, nil, TxSender) + _, err = transactions.SendAndWait(auth, client, pl.GetTxsByStatus, params.NumberOfOperations, nil, nil, TxSender) require.NoError(b, err) var ( diff --git a/test/benchmarks/sequencer/e2e/eth-transfers/tx_sender.go b/test/benchmarks/sequencer/e2e/eth-transfers/tx_sender.go index 0090e151e8..113bf5d380 100644 --- a/test/benchmarks/sequencer/e2e/eth-transfers/tx_sender.go +++ b/test/benchmarks/sequencer/e2e/eth-transfers/tx_sender.go @@ -23,13 +23,20 @@ var ( ) // TxSender sends eth transfer to the sequencer -func TxSender(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth *bind.TransactOpts, erc20SC *ERC20.ERC20, uniswapDeployments *uniswap.Deployments) error { +func TxSender(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth *bind.TransactOpts, erc20SC *ERC20.ERC20, uniswapDeployments *uniswap.Deployments) ([]*types.Transaction, error) { log.Debugf("sending tx num: %d nonce: %d", countTxs, nonce) - auth.Nonce = big.NewInt(int64(nonce)) - tx := types.NewTransaction(nonce, params.To, ethAmount, uint64(gasLimit), gasPrice, nil) + auth.Nonce = new(big.Int).SetUint64(nonce) + tx := types.NewTx(&types.LegacyTx{ + GasPrice: gasPrice, + Nonce: nonce, + Gas: uint64(gasLimit), + To: ¶ms.To, + Value: ethAmount, + Data: nil, + }) signedTx, err := auth.Signer(auth.From, tx) if err != nil { - return err + return nil, err } err = l2Client.SendTransaction(params.Ctx, signedTx) @@ -44,5 +51,5 @@ func TxSender(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth countTxs += 1 } - return err + return []*types.Transaction{signedTx}, err } diff --git a/test/benchmarks/sequencer/e2e/uniswap-transfers/tx_sender.go b/test/benchmarks/sequencer/e2e/uniswap-transfers/tx_sender.go index 442d43ac79..aadb3fb03b 100644 --- a/test/benchmarks/sequencer/e2e/uniswap-transfers/tx_sender.go +++ b/test/benchmarks/sequencer/e2e/uniswap-transfers/tx_sender.go @@ -2,9 +2,13 @@ package uniswap_transfers import ( "errors" + "fmt" "math/big" + "strings" "time" + "github.com/ethereum/go-ethereum/core/types" + "github.com/0xPolygonHermez/zkevm-node/log" "github.com/0xPolygonHermez/zkevm-node/state" "github.com/0xPolygonHermez/zkevm-node/test/contracts/bin/ERC20" @@ -21,15 +25,17 @@ var ( ) // TxSender sends eth transfer to the sequencer -func TxSender(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth *bind.TransactOpts, erc20SC *ERC20.ERC20, uniswapDeployments *uniswap.Deployments) error { - log.Debugf("swap number: %d", countTxs, nonce) +func TxSender(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth *bind.TransactOpts, erc20SC *ERC20.ERC20, uniswapDeployments *uniswap.Deployments) ([]*types.Transaction, error) { + msg := fmt.Sprintf("# swap cycle number: %d #", countTxs) + delimiter := strings.Repeat("#", len(msg)) + log.Infof("%s\n%s\n%s", delimiter, msg, delimiter) var err error - uniswap.SwapTokens(l2Client, auth, *uniswapDeployments) + transactions := uniswap.SwapTokens(l2Client, auth, *uniswapDeployments) if errors.Is(err, state.ErrStateNotSynchronized) || errors.Is(err, state.ErrInsufficientFunds) { for errors.Is(err, state.ErrStateNotSynchronized) || errors.Is(err, state.ErrInsufficientFunds) { time.Sleep(sleepTime) - uniswap.SwapTokens(l2Client, auth, *uniswapDeployments) + transactions = uniswap.SwapTokens(l2Client, auth, *uniswapDeployments) } } @@ -37,5 +43,5 @@ func TxSender(l2Client *ethclient.Client, gasPrice *big.Int, nonce uint64, auth countTxs += 1 } - return err + return transactions, err } diff --git a/test/benchmarks/sequencer/scripts/common/results/print.go b/test/benchmarks/sequencer/scripts/common/results/print.go index a89feb5362..cafdfeab3e 100644 --- a/test/benchmarks/sequencer/scripts/common/results/print.go +++ b/test/benchmarks/sequencer/scripts/common/results/print.go @@ -1,28 +1,56 @@ package results import ( + "fmt" "time" "github.com/0xPolygonHermez/zkevm-node/log" "github.com/0xPolygonHermez/zkevm-node/test/benchmarks/sequencer/common/params" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" ) // Print prints the results of the benchmark -func Print(elapsed time.Duration) { +func Print(client *ethclient.Client, elapsed time.Duration, txs []*types.Transaction) { + // calculate the total gas used + var totalGas uint64 + for _, tx := range txs { + // Fetch the transaction receipt + receipt, err := client.TransactionReceipt(params.Ctx, tx.Hash()) + if err != nil { + log.Error("Unable to fetch transaction receipt", "error", err) + continue + } + + totalGas += receipt.GasUsed + } + + // calculate the average gas used per transaction + var avgGas uint64 + if len(txs) > 0 { + avgGas = totalGas / uint64(len(txs)) + } + + // calculate the gas per second + gasPerSecond := float64(len(txs)*int(avgGas)) / elapsed.Seconds() + // Print results - log.Info("##########") - log.Info("# Result #") - log.Info("##########") - log.Infof("Total time took for the sequencer to select all txs from the pool: %v", elapsed) - log.Infof("Number of txs sent: %d", params.NumberOfOperations) - log.Infof("Txs per second: %f", float64(params.NumberOfOperations)/elapsed.Seconds()) + fmt.Println("##########") + fmt.Println("# Result #") + fmt.Println("##########") + fmt.Printf("Total time took for the sequencer to select all txs from the pool: %v\n", elapsed) + fmt.Printf("Number of operations sent: %d\n", params.NumberOfOperations) + fmt.Printf("Txs per second: %f\n", float64(params.NumberOfOperations)/elapsed.Seconds()) + fmt.Printf("Average gas used per transaction: %d\n", avgGas) + fmt.Printf("Total Gas: %d\n", totalGas) + fmt.Printf("Gas per second: %f\n", gasPerSecond) } func PrintUniswapDeployments(deployments time.Duration, count uint64) { - log.Info("#######################") - log.Info("# Uniswap Deployments #") - log.Info("#######################") - log.Infof("Total time took for the sequencer to deploy all contracts: %v", deployments) - log.Infof("Number of txs sent: %d", count) - log.Infof("Txs per second: %f", float64(count)/deployments.Seconds()) + fmt.Println("#######################") + fmt.Println("# Uniswap Deployments #") + fmt.Println("#######################") + fmt.Printf("Total time took for the sequencer to deploy all contracts: %v\n", deployments) + fmt.Printf("Number of txs sent: %d\n", count) + fmt.Printf("Txs per second: %f\n", float64(count)/deployments.Seconds()) } diff --git a/test/benchmarks/sequencer/scripts/erc20-transfers/main.go b/test/benchmarks/sequencer/scripts/erc20-transfers/main.go index c3baeef8d1..300948bb99 100644 --- a/test/benchmarks/sequencer/scripts/erc20-transfers/main.go +++ b/test/benchmarks/sequencer/scripts/erc20-transfers/main.go @@ -29,7 +29,7 @@ func main() { panic(err) } // Send Txs - err = transactions.SendAndWait( + allTxs, err := transactions.SendAndWait( auth, l2Client, pl.GetTxsByStatus, @@ -53,5 +53,5 @@ func main() { panic(err) } elapsed := lastL2BlockTimestamp.Sub(start) - results.Print(elapsed) + results.Print(l2Client, elapsed, allTxs) } diff --git a/test/benchmarks/sequencer/scripts/eth-transfers/main.go b/test/benchmarks/sequencer/scripts/eth-transfers/main.go index 9a9b43ef8f..19648efcaa 100644 --- a/test/benchmarks/sequencer/scripts/eth-transfers/main.go +++ b/test/benchmarks/sequencer/scripts/eth-transfers/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "time" "github.com/0xPolygonHermez/zkevm-node/pool" @@ -23,7 +24,7 @@ func main() { start := time.Now() // Send Txs - err = transactions.SendAndWait( + allTxs, err := transactions.SendAndWait( auth, l2Client, pl.GetTxsByStatus, @@ -33,6 +34,7 @@ func main() { ethtransfers.TxSender, ) if err != nil { + fmt.Println(auth.Nonce) panic(err) } @@ -47,5 +49,5 @@ func main() { panic(err) } elapsed := lastL2BlockTimestamp.Sub(start) - results.Print(elapsed) + results.Print(l2Client, elapsed, allTxs) } diff --git a/test/benchmarks/sequencer/scripts/uniswap-transfers/main.go b/test/benchmarks/sequencer/scripts/uniswap-transfers/main.go index fe89404fd6..14618367a6 100644 --- a/test/benchmarks/sequencer/scripts/uniswap-transfers/main.go +++ b/test/benchmarks/sequencer/scripts/uniswap-transfers/main.go @@ -29,7 +29,7 @@ func main() { elapsedTimeForDeployments := time.Since(start) // Send Txs - err = transactions.SendAndWait( + allTxs, err := transactions.SendAndWait( auth, l2Client, pl.GetTxsByStatus, @@ -55,7 +55,7 @@ func main() { } elapsed := lastL2BlockTimestamp.Sub(start) results.PrintUniswapDeployments(elapsedTimeForDeployments, deploymentTxsCount) - results.Print(elapsed) + results.Print(l2Client, elapsed, allTxs) totalTxsCount := uniswap.GetExecutedTransactionsCount() log.Info("##############################") diff --git a/test/scripts/uniswap/pkg/setup.go b/test/scripts/uniswap/pkg/setup.go index aaf5f84c98..93d0253272 100644 --- a/test/scripts/uniswap/pkg/setup.go +++ b/test/scripts/uniswap/pkg/setup.go @@ -86,7 +86,7 @@ func DeployContractsAndAddLiquidity(client *ethclient.Client, auth *bind.Transac log.Debugf("Mint C Coin tx: %v", tx.Hash().Hex()) fmt.Println() // wrapping eth - wethDepositoAmount := "10000000000000000" + wethDepositoAmount := "0000000000000000" log.Debugf("Depositing %v ETH for account %v on token wEth", wethDepositoAmount, auth.From) auth.Value, _ = big.NewInt(0).SetString(wethDepositoAmount, encoding.Base10) tx, err = wethSC.Deposit(auth) diff --git a/test/scripts/uniswap/pkg/swap.go b/test/scripts/uniswap/pkg/swap.go index fe523c20ac..01bf4d13f1 100644 --- a/test/scripts/uniswap/pkg/swap.go +++ b/test/scripts/uniswap/pkg/swap.go @@ -5,6 +5,8 @@ import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum/core/types" + "github.com/0xPolygonHermez/zkevm-node/log" "github.com/0xPolygonHermez/zkevm-node/test/contracts/bin/uniswap/v2/core/UniswapV2Factory" "github.com/0xPolygonHermez/zkevm-node/test/contracts/bin/uniswap/v2/core/UniswapV2Pair" @@ -14,7 +16,8 @@ import ( "github.com/ethereum/go-ethereum/ethclient" ) -func SwapTokens(client *ethclient.Client, auth *bind.TransactOpts, deployments Deployments) { +func SwapTokens(client *ethclient.Client, auth *bind.TransactOpts, deployments Deployments) []*types.Transaction { + transactions := make([]*types.Transaction, 0, 2) // Execute swaps const swapExactAmountInNumber = 10 swapExactAmountIn := big.NewInt(swapExactAmountInNumber) @@ -29,7 +32,8 @@ func SwapTokens(client *ethclient.Client, auth *bind.TransactOpts, deployments D ChkErr(err) log.Debugf("before first swap cCoin.balanceOf[%s]: %d", auth.From.Hex(), value) log.Debugf("Swaping tokens from A <-> B") - SwapExactTokensForTokens(auth, client, deployments.Factory, deployments.Router, deployments.ACoinAddr, deployments.BCoinAddr, swapExactAmountIn) + res := SwapExactTokensForTokens(auth, client, deployments.Factory, deployments.Router, deployments.ACoinAddr, deployments.BCoinAddr, swapExactAmountIn) + transactions = append(transactions, res...) fmt.Println() value, err = deployments.ACoin.BalanceOf(&bind.CallOpts{}, auth.From) ChkErr(err) @@ -41,13 +45,16 @@ func SwapTokens(client *ethclient.Client, auth *bind.TransactOpts, deployments D ChkErr(err) log.Debugf("after first swap cCoin.balanceOf[%s]: %d", auth.From.Hex(), value) log.Debugf("Swaping tokens from B <-> C") - SwapExactTokensForTokens(auth, client, deployments.Factory, deployments.Router, deployments.BCoinAddr, deployments.CCoinAddr, swapExactAmountIn2) + res = SwapExactTokensForTokens(auth, client, deployments.Factory, deployments.Router, deployments.BCoinAddr, deployments.CCoinAddr, swapExactAmountIn2) + transactions = append(transactions, res...) fmt.Println() + + return transactions } func SwapExactTokensForTokens(auth *bind.TransactOpts, client *ethclient.Client, factory *UniswapV2Factory.UniswapV2Factory, router *UniswapV2Router02.UniswapV2Router02, - tokenA, tokenB common.Address, exactAmountIn *big.Int) { + tokenA, tokenB common.Address, exactAmountIn *big.Int) []*types.Transaction { ctx := context.Background() logPrefix := fmt.Sprintf("SwapExactTokensForTokens %v <-> %v", tokenA.Hex(), tokenB.Hex()) pairAddr, err := factory.GetPair(nil, tokenA, tokenB) @@ -63,4 +70,5 @@ func SwapExactTokensForTokens(auth *bind.TransactOpts, client *ethclient.Client, log.Debug(logPrefix, " exactAmountIn: ", exactAmountIn, " amountOut: ", amountOut) tx, err := router.SwapExactTokensForTokens(auth, exactAmountIn, amountOut, []common.Address{tokenA, tokenB}, auth.From, getDeadline()) err = WaitForTransactionAndIncrementNonce(client, auth, err, ctx, tx) + return []*types.Transaction{tx} }