diff --git a/integration-tests/ccip-tests/actions/ccip_helpers.go b/integration-tests/ccip-tests/actions/ccip_helpers.go index 6b70a4f5c4..177130fe31 100644 --- a/integration-tests/ccip-tests/actions/ccip_helpers.go +++ b/integration-tests/ccip-tests/actions/ccip_helpers.go @@ -476,6 +476,7 @@ 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 diff --git a/integration-tests/ccip-tests/load/ccip_loadgen.go b/integration-tests/ccip-tests/load/ccip_loadgen.go index 7809cf0523..6a239d589c 100644 --- a/integration-tests/ccip-tests/load/ccip_loadgen.go +++ b/integration-tests/ccip-tests/load/ccip_loadgen.go @@ -11,6 +11,7 @@ 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" @@ -254,10 +255,10 @@ func (c *CCIPE2ELoad) Call(_ *wasp.Generator) *wasp.Response { } startTime := time.Now().UTC() if feeToken != common.HexToAddress("0x0") { - sendTx, err = sourceCCIP.Common.Router.CCIPSendAndProcessTx(destChainSelector, msg, nil) + sendTx, err = sourceCCIP.Common.Router.CCIPSend(destChainSelector, msg, nil) } else { // add a bit buffer to fee - sendTx, err = sourceCCIP.Common.Router.CCIPSendAndProcessTx(destChainSelector, msg, new(big.Int).Add(big.NewInt(1e5), fee)) + sendTx, err = sourceCCIP.Common.Router.CCIPSend(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) @@ -267,11 +268,57 @@ 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 { diff --git a/integration-tests/ccip-tests/load/helper.go b/integration-tests/ccip-tests/load/helper.go index e40c211497..50778f3c6d 100644 --- a/integration-tests/ccip-tests/load/helper.go +++ b/integration-tests/ccip-tests/load/helper.go @@ -12,12 +12,13 @@ import ( "github.com/AlekSi/pointer" "github.com/rs/zerolog" - "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/wasp" "github.com/stretchr/testify/require" "go.uber.org/atomic" "golang.org/x/sync/errgroup" + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-testing-framework/k8s/chaos" "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress-2024-06-27/baseline.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress-2024-06-27/baseline.toml index 7ca3b16cf0..82954fa322 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress-2024-06-27/baseline.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress-2024-06-27/baseline.toml @@ -58,7 +58,6 @@ evm_finality_depth = 200 [CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-1] block_time = 1 -block_gaslimit = 100000000 # [CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-2] diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress-2024-06-27/tier-a.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress-2024-06-27/tier-a.toml index 137e7129e6..afb1eb28a6 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress-2024-06-27/tier-a.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress-2024-06-27/tier-a.toml @@ -90,7 +90,6 @@ evm_finality_depth = 1 [CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-1] block_time = 1 -block_gaslimit = 100000000 # [CCIP.Env.Network.AnvilConfigs.SLOW-CHAIN-1] diff --git a/integration-tests/ccip-tests/testsetups/ccip.go b/integration-tests/ccip-tests/testsetups/ccip.go index 39e52164bc..f9d6a73930 100644 --- a/integration-tests/ccip-tests/testsetups/ccip.go +++ b/integration-tests/ccip-tests/testsetups/ccip.go @@ -56,6 +56,18 @@ var ( "memory": "6Gi", }, } + AnvilResourceProfile = map[string]interface{}{ + "requests": map[string]interface{}{ + "cpu": "4", + "memory": "6Gi", + "ephemeral-storage": "25Gi", + }, + "limits": map[string]interface{}{ + "cpu": "4", + "memory": "6Gi", + "ephemeral-storage": "25Gi", + }, + } // to set default values through test config use sync.once setContractVersion sync.Once setOCRParams sync.Once diff --git a/integration-tests/ccip-tests/testsetups/test_env.go b/integration-tests/ccip-tests/testsetups/test_env.go index 38e8c03a3a..2271da7169 100644 --- a/integration-tests/ccip-tests/testsetups/test_env.go +++ b/integration-tests/ccip-tests/testsetups/test_env.go @@ -476,6 +476,12 @@ func DeployEnvironments( // if anvilconfig is specified for a network addhelm for anvil if anvilConfig, exists := testInputs.EnvInput.Network.AnvilConfigs[strings.ToUpper(network.Name)]; exists { charts = append(charts, foundry.ChartName) + if anvilConfig.BaseFee == nil { + anvilConfig.BaseFee = pointer.ToInt64(1000000) + } + if anvilConfig.BlockGaslimit == nil { + anvilConfig.BlockGaslimit = pointer.ToInt64(100000000) + } testEnvironment. AddHelm(foundry.New(&foundry.Props{ NetworkName: network.Name, @@ -491,10 +497,10 @@ func DeployEnvironments( "forkComputeUnitsPerSecond": anvilConfig.ComputePerSecond, "forkNoRateLimit": anvilConfig.RateLimitDisabled, "blocksToKeepInMemory": anvilConfig.BlocksToKeepInMem, - "blockGasLimit": anvilConfig.BlockGaslimit, - "baseFee": anvilConfig.BaseFee, + "blockGasLimit": fmt.Sprintf("%d", pointer.GetInt64(anvilConfig.BlockGaslimit)), + "baseFee": fmt.Sprintf("%d", pointer.GetInt64(anvilConfig.BaseFee)), }, - "resources": testInputs.GethResourceProfile, + "resources": AnvilResourceProfile, }, })) selectedNetworks[i].Simulated = true