diff --git a/cmd/zetae2e/local/local.go b/cmd/zetae2e/local/local.go index ac47e9d184..eeaff65f9e 100644 --- a/cmd/zetae2e/local/local.go +++ b/cmd/zetae2e/local/local.go @@ -381,9 +381,9 @@ func localE2ETest(cmd *cobra.Command, _ []string) { } if testPerformance { - // eg.Go(ethereumDepositPerformanceRoutine(conf, deployerRunner, verbose, e2etests.TestStressEtherDepositName)) - // eg.Go(ethereumWithdrawPerformanceRoutine(conf, deployerRunner, verbose, e2etests.TestStressEtherWithdrawName)) - // eg.Go(solanaDepositPerformanceRoutine(conf, deployerRunner, verbose, e2etests.TestStressSolanaDepositName)) + eg.Go(ethereumDepositPerformanceRoutine(conf, deployerRunner, verbose, e2etests.TestStressEtherDepositName)) + eg.Go(ethereumWithdrawPerformanceRoutine(conf, deployerRunner, verbose, e2etests.TestStressEtherWithdrawName)) + eg.Go(solanaDepositPerformanceRoutine(conf, deployerRunner, verbose, e2etests.TestStressSolanaDepositName, e2etests.TestStressSPLDepositName)) eg.Go(solanaWithdrawPerformanceRoutine(conf, deployerRunner, verbose, e2etests.TestStressSolanaWithdrawName, e2etests.TestStressSPLWithdrawName)) } diff --git a/e2e/e2etests/e2etests.go b/e2e/e2etests/e2etests.go index 8e5cd55d46..46149e2346 100644 --- a/e2e/e2etests/e2etests.go +++ b/e2e/e2etests/e2etests.go @@ -112,6 +112,7 @@ const ( TestStressEtherDepositName = "stress_eth_deposit" TestStressBTCDepositName = "stress_btc_deposit" TestStressSolanaDepositName = "stress_solana_deposit" + TestStressSPLDepositName = "stress_spl_deposit" TestStressSolanaWithdrawName = "stress_solana_withdraw" TestStressSPLWithdrawName = "stress_spl_withdraw" @@ -772,15 +773,22 @@ var AllE2ETests = []runner.E2ETest{ ), runner.NewE2ETest( TestStressSolanaDepositName, - "stress test SOL/SPL deposit", + "stress test SOL deposit", []runner.ArgDefinition{ {Description: "amount in lamports", DefaultValue: "1200000"}, - {Description: "count of SOL deposits", DefaultValue: "10"}, - {Description: "amount in SPL tokens", DefaultValue: "1200000"}, - {Description: "count of SPL deposits", DefaultValue: "10"}, + {Description: "count of SOL deposits", DefaultValue: "50"}, }, TestStressSolanaDeposit, ), + runner.NewE2ETest( + TestStressSPLDepositName, + "stress test SPL deposit", + []runner.ArgDefinition{ + {Description: "amount in SPL tokens", DefaultValue: "1200000"}, + {Description: "count of SPL deposits", DefaultValue: "50"}, + }, + TestStressSPLDeposit, + ), runner.NewE2ETest( TestStressSolanaWithdrawName, "stress test SOL withdrawals", diff --git a/e2e/e2etests/test_stress_solana_deposit.go b/e2e/e2etests/test_stress_solana_deposit.go index 8bab80764f..03d7907d9c 100644 --- a/e2e/e2etests/test_stress_solana_deposit.go +++ b/e2e/e2etests/test_stress_solana_deposit.go @@ -13,20 +13,14 @@ import ( crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" ) -// TestStressSolanaDeposit tests the stressing deposit of SOL/SPL +// TestStressSolanaDeposit tests the stressing deposit of SOL func TestStressSolanaDeposit(r *runner.E2ERunner, args []string) { - require.Len(r, args, 4) + require.Len(r, args, 2) depositSOLAmount := utils.ParseBigInt(r, args[0]) numDepositsSOL := utils.ParseInt(r, args[1]) - depositSPLAmount := utils.ParseBigInt(r, args[2]) - numDepositsSPL := utils.ParseInt(r, args[3]) - - // load deployer private key - privKey := r.GetSolanaPrivKey() - - r.Logger.Print("starting stress test of %d SOL and %d SPL deposits", numDepositsSOL, numDepositsSPL) + r.Logger.Print("starting stress test of %d SOL deposits", numDepositsSOL) // create a wait group to wait for all the deposits to complete var eg errgroup.Group @@ -42,17 +36,6 @@ func TestStressSolanaDeposit(r *runner.E2ERunner, args []string) { eg.Go(func() error { return monitorDeposit(r, sig, i, time.Now()) }) } - // send the deposits SPL - for i := 0; i < numDepositsSPL; i++ { - i := i - - // execute the deposit SPL transaction - sig := r.SPLDepositAndCall(&privKey, depositSPLAmount.Uint64(), r.SPLAddr, r.EVMAddress(), nil) - r.Logger.Print("index %d: starting SPL deposit, sig: %s", i, sig.String()) - - eg.Go(func() error { return monitorDeposit(r, sig, i, time.Now()) }) - } - require.NoError(r, eg.Wait()) r.Logger.Print("all deposits completed") diff --git a/e2e/e2etests/test_stress_spl_deposit.go b/e2e/e2etests/test_stress_spl_deposit.go new file mode 100644 index 0000000000..a37e383254 --- /dev/null +++ b/e2e/e2etests/test_stress_spl_deposit.go @@ -0,0 +1,41 @@ +package e2etests + +import ( + "time" + + "github.com/stretchr/testify/require" + "github.com/zeta-chain/node/e2e/runner" + "github.com/zeta-chain/node/e2e/utils" + "golang.org/x/sync/errgroup" +) + +// TestStressSPLDeposit tests the stressing deposit of SPL +func TestStressSPLDeposit(r *runner.E2ERunner, args []string) { + require.Len(r, args, 2) + + depositSPLAmount := utils.ParseBigInt(r, args[0]) + numDepositsSPL := utils.ParseInt(r, args[1]) + + // load deployer private key + privKey := r.GetSolanaPrivKey() + + r.Logger.Print("starting stress test of %d SPL deposits", numDepositsSPL) + + // create a wait group to wait for all the deposits to complete + var eg errgroup.Group + + // send the deposits SPL + for i := 0; i < numDepositsSPL; i++ { + i := i + + // execute the deposit SPL transaction + sig := r.SPLDepositAndCall(&privKey, depositSPLAmount.Uint64(), r.SPLAddr, r.EVMAddress(), nil) + r.Logger.Print("index %d: starting SPL deposit, sig: %s", i, sig.String()) + + eg.Go(func() error { return monitorDeposit(r, sig, i, time.Now()) }) + } + + require.NoError(r, eg.Wait()) + + r.Logger.Print("all deposits completed") +}