From b3151da92399dfeecfb71d034d10bbfa1afb535e Mon Sep 17 00:00:00 2001 From: AnieeG Date: Mon, 8 Jul 2024 12:58:28 -0700 Subject: [PATCH] remove unwanted changes --- .../ccip-tests/actions/ccip_helpers.go | 7 --- .../ccip-tests/load/ccip_loadgen.go | 53 ++----------------- 2 files changed, 3 insertions(+), 57 deletions(-) diff --git a/integration-tests/ccip-tests/actions/ccip_helpers.go b/integration-tests/ccip-tests/actions/ccip_helpers.go index 177130fe312..e2b9b70871e 100644 --- a/integration-tests/ccip-tests/actions/ccip_helpers.go +++ b/integration-tests/ccip-tests/actions/ccip_helpers.go @@ -185,7 +185,6 @@ type CCIPCommon struct { tokenPriceUpdateWatcher map[common.Address]*big.Int // key - token; value - timestamp of update gasUpdateWatcherMu *sync.Mutex gasUpdateWatcher map[uint64]*big.Int // key - destchain id; value - timestamp of update - priceUpdateFound chan struct{} } // FreeUpUnusedSpace sets nil to various elements of ccipModule which are only used @@ -476,7 +475,6 @@ func (ccipModule *CCIPCommon) WaitForPriceUpdates( Uint64("dest chain", destChainId). Str("source chain", ccipModule.ChainClient.GetNetworkName()). Msg("Price already updated") - ccipModule.priceUpdateFound <- struct{}{} return nil } // if not, wait for price update @@ -515,7 +513,6 @@ func (ccipModule *CCIPCommon) WaitForPriceUpdates( Uint64("dest chain", destChainId). Str("source chain", ccipModule.ChainClient.GetNetworkName()). Msg("Price updated") - ccipModule.priceUpdateFound <- struct{}{} return nil } case <-localCtx.Done(): @@ -577,7 +574,6 @@ func (ccipModule *CCIPCommon) WatchForPriceUpdates(ctx context.Context, lggr *ze ccipModule.gasUpdateWatcherMu = nil ccipModule.tokenPriceUpdateWatcher = nil ccipModule.tokenPriceUpdateWatcherMu = nil - ccipModule.priceUpdateFound = nil }() for { select { @@ -597,8 +593,6 @@ func (ccipModule *CCIPCommon) WatchForPriceUpdates(ctx context.Context, lggr *ze Msg("UsdPerTokenUpdated event received") case <-ctx.Done(): return - case <-ccipModule.priceUpdateFound: - return } } }() @@ -1276,7 +1270,6 @@ func DefaultCCIPModule( NoOfTokensNeedingDynamicPrice: pointer.GetInt(testGroupConf.TokenConfig.NoOfTokensWithDynamicPrice), poolFunds: testhelpers.Link(5), gasUpdateWatcherMu: &sync.Mutex{}, - priceUpdateFound: make(chan struct{}), gasUpdateWatcher: make(map[uint64]*big.Int), tokenPriceUpdateWatcherMu: &sync.Mutex{}, tokenPriceUpdateWatcher: make(map[common.Address]*big.Int), diff --git a/integration-tests/ccip-tests/load/ccip_loadgen.go b/integration-tests/ccip-tests/load/ccip_loadgen.go index 6a239d589c6..7809cf0523d 100644 --- a/integration-tests/ccip-tests/load/ccip_loadgen.go +++ b/integration-tests/ccip-tests/load/ccip_loadgen.go @@ -11,7 +11,6 @@ import ( "time" "github.com/AlekSi/pointer" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog" @@ -255,10 +254,10 @@ func (c *CCIPE2ELoad) Call(_ *wasp.Generator) *wasp.Response { } startTime := time.Now().UTC() if feeToken != common.HexToAddress("0x0") { - sendTx, err = sourceCCIP.Common.Router.CCIPSend(destChainSelector, msg, nil) + sendTx, err = sourceCCIP.Common.Router.CCIPSendAndProcessTx(destChainSelector, msg, nil) } else { // add a bit buffer to fee - sendTx, err = sourceCCIP.Common.Router.CCIPSend(destChainSelector, msg, new(big.Int).Add(big.NewInt(1e5), fee)) + sendTx, err = sourceCCIP.Common.Router.CCIPSendAndProcessTx(destChainSelector, msg, new(big.Int).Add(big.NewInt(1e5), fee)) } if err != nil { stats.UpdateState(&lggr, 0, testreporters.TX, time.Since(startTime), testreporters.Failure, nil) @@ -268,57 +267,11 @@ func (c *CCIPE2ELoad) Call(_ *wasp.Generator) *wasp.Response { return res } - err = sourceCCIP.Common.ChainClient.MarkTxAsSentOnL2(sendTx) - - if err != nil { - stats.UpdateState(&lggr, 0, testreporters.TX, time.Since(startTime), testreporters.Failure, nil) - res.Error = fmt.Sprintf("reqNo %d failed to mark tx as sent on L2 %s", msgSerialNo, err.Error()) - res.Data = stats.StatusByPhase - res.Failed = true - return res - } - txConfirmationTime := time.Now().UTC() // wait for the tx to be mined, timeout is set to 10 minutes lggr.Info().Str("tx", sendTx.Hash().Hex()).Msg("waiting for tx to be mined") - ctx, cancel := context.WithTimeout(context.Background(), sourceCCIP.Common.ChainClient.GetNetworkConfig().Timeout.Duration) - defer cancel() - rcpt, err := bind.WaitMined(ctx, sourceCCIP.Common.ChainClient.DeployBackend(), sendTx) - if err != nil { - res.Error = fmt.Sprintf("ccip-send request tx not mined, err=%s", err.Error()) - res.Failed = true - res.Data = stats.StatusByPhase - return res - } - if rcpt == nil { - res.Error = "ccip-send request tx not mined, receipt is nil" - res.Failed = true - res.Data = stats.StatusByPhase - return res - } - hdr, err := c.Lane.Source.Common.ChainClient.HeaderByNumber(context.Background(), rcpt.BlockNumber) - if err == nil && hdr != nil { - txConfirmationTime = hdr.Timestamp - } lggr = lggr.With().Str("Msg Tx", sendTx.Hash().String()).Logger() - if rcpt.Status != types.ReceiptStatusSuccessful { - stats.UpdateState(&lggr, 0, testreporters.TX, txConfirmationTime.Sub(startTime), testreporters.Failure, - &testreporters.TransactionStats{ - Fee: fee.String(), - GasUsed: rcpt.GasUsed, - TxHash: sendTx.Hash().Hex(), - NoOfTokensSent: len(msg.TokenAmounts), - MessageBytesLength: int64(len(msg.Data)), - }) - errReason, v, err := c.Lane.Source.Common.ChainClient.RevertReasonFromTx(rcpt.TxHash, router.RouterABI) - if err != nil { - errReason = "could not decode" - } - res.Error = fmt.Sprintf("ccip-send request receipt is not successful, errReason=%s, args =%v", errReason, v) - res.Failed = true - res.Data = stats.StatusByPhase - return res - } + stats.UpdateState(&lggr, 0, testreporters.TX, txConfirmationTime.Sub(startTime), testreporters.Success, nil) err = c.Validate(lggr, sendTx, txConfirmationTime, []*testreporters.RequestStat{stats}) if err != nil {