From 640a6d596d1e65d81ce6eecc4e766238b127f1d7 Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:08:01 -0700 Subject: [PATCH] CCIP-2573 - Handle TokenDeployer client creation when there is more than 1 router per chain (#1027) --- .../workflows/ccip-offchain-upgrade-tests.yml | 48 +++----- .github/workflows/integration-tests.yml | 7 ++ .../ccip-tests/actions/ccip_helpers.go | 103 +++++++++-------- .../ccip-tests/contracts/contract_deployer.go | 109 ++++++++++++++++++ .../override/mainnet-secondary.toml | 3 +- .../testconfig/override/mainnet.toml | 1 + .../testconfig/tomls/ccip-default.toml | 10 ++ .../testconfig/tomls/contract-version1.4.toml | 13 +++ .../tomls/node-pre-upgrade-compatibility.toml | 7 ++ .../testconfig/tomls/scalability.toml | 9 +- .../ccip-tests/testsetups/ccip.go | 16 +-- .../ccip-tests/testsetups/test_env.go | 11 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +- 16 files changed, 249 insertions(+), 100 deletions(-) create mode 100644 integration-tests/ccip-tests/testconfig/tomls/contract-version1.4.toml diff --git a/.github/workflows/ccip-offchain-upgrade-tests.yml b/.github/workflows/ccip-offchain-upgrade-tests.yml index 2e312874f0..50e02dfc55 100644 --- a/.github/workflows/ccip-offchain-upgrade-tests.yml +++ b/.github/workflows/ccip-offchain-upgrade-tests.yml @@ -94,14 +94,14 @@ jobs: AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - build-test-image-current-sha: + build-test-image: if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' needs: [ changes ] environment: integration permissions: id-token: write contents: read - name: Build Test Image with Current Sha + name: Build Test Image runs-on: ubuntu-latest steps: - name: Collect Metrics @@ -109,7 +109,7 @@ jobs: id: collect-gha-metrics uses: smartcontractkit/push-gha-metrics-action@dea9b546553cb4ca936607c2267a09c004e4ab3f # v3.0.0 with: - id: ccip-offchain-upgrade-compatibility-tests-build-test-image-current-sha + id: ccip-offchain-upgrade-compatibility-tests-build-test-image org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -125,19 +125,19 @@ jobs: uses: ./.github/actions/build-test-image with: # we just want to build the load tests - suites: ccip-tests/load + suites: ccip-tests/load ccip-tests/smoke QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - build-test-image-for-last-release: + last-release-info: if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' needs: [ changes ] environment: integration permissions: id-token: write contents: read - name: Build Test Image for Last Release + name: Fetch Info for Last Release runs-on: ubuntu-latest outputs: release_name: ${{ steps.fetch_last_release.outputs.release_name }} @@ -149,7 +149,7 @@ jobs: id: collect-gha-metrics uses: smartcontractkit/push-gha-metrics-action@dea9b546553cb4ca936607c2267a09c004e4ab3f # v3.0.0 with: - id: ccip-offchain-upgrade-compatibility-tests-build-test-image-for-last-release + id: ccip-offchain-upgrade-compatibility-tests-last-release-info org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -165,20 +165,6 @@ jobs: echo "release_name=${release_name}" >> $GITHUB_OUTPUT sha_ref=$(curl -s --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" --request GET https://api.github.com/repos/${{ github.repository }}/git/refs/tags/${release_name} | jq -r '.object.sha' | sort -V | tail -n 1) echo "sha_ref=${sha_ref}" >> $GITHUB_OUTPUT - - name: Checkout the repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - repository: smartcontractkit/ccip - ref: ${{ steps.fetch_last_release.outputs.sha_ref }} - - name: Build Test Image - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' - uses: ./.github/actions/build-test-image - with: - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - tag: ${{ steps.fetch_last_release.outputs.sha_ref }} - other_tags: ${{ steps.fetch_last_release.outputs.release_name }} # End Build Test Dependencies # run test with previous image @@ -190,7 +176,7 @@ jobs: pull-requests: write id-token: write contents: read - needs: [ changes, build-test-image-for-last-release ] + needs: [ changes, last-release-info, build-test-image ] outputs: existing_namespace: ${{ steps.fetch_namespace.outputs.existing_namespace }} triggered_by: ${{ steps.fetch_namespace.outputs.triggered_by }} @@ -203,11 +189,11 @@ jobs: run: ^TestSmokeCCIPForBidirectionalLane$ config_path: ./integration-tests/ccip-tests/testconfig/tomls/node-pre-upgrade-compatibility.toml runs-on: ubuntu-latest - name: CCIP Deployment with ${{ needs.build-test-image-for-last-release.outputs.release_tag }} - ${{ matrix.product.name }} + name: CCIP Deployment with ${{ needs.last-release-info.outputs.release_tag }} - ${{ matrix.product.name }} env: - RELEASE_TAG: ${{ needs.build-test-image-for-last-release.outputs.release_tag }} - RELEASE_SHA: ${{ needs.build-test-image-for-last-release.outputs.release_sha }} - RELEASE_NAME: ${{ needs.build-test-image-for-last-release.outputs.release_name }} + RELEASE_TAG: ${{ needs.last-release-info.outputs.release_tag }} + RELEASE_SHA: ${{ needs.last-release-info.outputs.release_sha }} + RELEASE_NAME: ${{ needs.last-release-info.outputs.release_name }} TEST_TRIGGERED_BY: ${{ matrix.product.name }}-${{ github.run_id }} steps: - name: Collect Metrics @@ -219,7 +205,7 @@ jobs: org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: CCIP Deployment with ${{ needs.build-test-image-for-last-release.outputs.release_tag }} - ${{ matrix.product.name }} + this-job-name: CCIP Deployment with ${{ needs.last-release-info.outputs.release_tag }} - ${{ matrix.product.name }} test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -253,11 +239,7 @@ jobs: env: BASE64_CCIP_CONFIG_OVERRIDE: ${{ steps.set_override_config.outputs.base_64_override }} TEST_BASE64_CCIP_CONFIG_OVERRIDE: ${{ steps.set_override_config.outputs.base_64_override }} - # uncomment this later for next release - # ENV_JOB_IMAGE: ${{ env.ENV_JOB_IMAGE_BASE }}:${{ env.RELEASE_SHA }} - # for now we run test with a specific test image pertaining to previous release with some added fixes - # this image use 1.2 ramps instead of incompatible 1.5-dev ramps from offchain v2.10.0-ccip1.4-release - ENV_JOB_IMAGE: ${{ env.ENV_JOB_IMAGE_BASE }}:release-v2.10.0-ccip1.4 + ENV_JOB_IMAGE: ${{ env.ENV_JOB_IMAGE_BASE }}:${{ github.sha }} TEST_SUITE: smoke TEST_ARGS: -test.timeout 30m TEST_LOG_LEVEL: info @@ -317,7 +299,7 @@ jobs: pull-requests: write id-token: write contents: read - needs: [ build-chainlink, changes, build-test-image-current-sha, run-test-with-last-release ] + needs: [ build-chainlink, changes, build-test-image, run-test-with-last-release ] strategy: fail-fast: false matrix: diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 95c83a80a4..00a83e9a60 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -285,6 +285,13 @@ jobs: file: ccip dir: ccip-tests/smoke run: -run ^TestSmokeCCIPForBidirectionalLane$ + - name: ccip-smoke-1.4-pools + nodes: 1 + os: ubuntu-latest + file: ccip + dir: ccip-tests/smoke + run: -run ^TestSmokeCCIPForBidirectionalLane$ + config_path: ./integration-tests/ccip-tests/testconfig/tomls/contract-version1.4.toml - name: ccip-smoke-usdc nodes: 1 os: ubuntu-latest diff --git a/integration-tests/ccip-tests/actions/ccip_helpers.go b/integration-tests/ccip-tests/actions/ccip_helpers.go index 954cc51fde..609ee92169 100644 --- a/integration-tests/ccip-tests/actions/ccip_helpers.go +++ b/integration-tests/ccip-tests/actions/ccip_helpers.go @@ -117,11 +117,12 @@ var ( RootSnoozeTime = 3 * time.Minute GethLabel = func(name string) string { + name = NetworkName(name) switch NetworkChart { case reorg.TXNodesAppLabel: return fmt.Sprintf("%s-ethereum-geth", name) case foundry.ChartName: - return fmt.Sprintf("%s-foundry", name) + return name } return "" } @@ -1150,11 +1151,10 @@ type StaticPriceConfig struct { func NewCCIPCommonFromConfig( logger zerolog.Logger, testGroupConf *testconfig.CCIPTestGroupConfig, - testEnv *CCIPTestEnv, chainClient blockchain.EVMClient, laneConfig *laneconfig.LaneConfig, ) (*CCIPCommon, error) { - newCCIPModule, err := DefaultCCIPModule(logger, testGroupConf, testEnv, chainClient) + newCCIPModule, err := DefaultCCIPModule(logger, testGroupConf, chainClient) if err != nil { return nil, err } @@ -1234,18 +1234,10 @@ func NewCCIPCommonFromConfig( func DefaultCCIPModule( logger zerolog.Logger, testGroupConf *testconfig.CCIPTestGroupConfig, - testEnv *CCIPTestEnv, chainClient blockchain.EVMClient, ) (*CCIPCommon, error) { networkCfg := chainClient.GetNetworkConfig() - var k8Env *environment.Environment - if testEnv != nil { - k8Env = testEnv.K8Env - } - if k8Env != nil && chainClient.NetworkSimulated() { - networkCfg.URLs = k8Env.URLs[chainClient.GetNetworkConfig().Name] - } - tokenDeployerChainClient, err := blockchain.ConcurrentEVMClient(*networkCfg, k8Env, chainClient, logger) + tokenDeployerChainClient, err := blockchain.ConcurrentEVMClient(*networkCfg, nil, chainClient, logger) if err != nil { return nil, errors.WithStack(fmt.Errorf("failed to create token deployment chain client for %s: %w", networkCfg.Name, err)) } @@ -1790,14 +1782,13 @@ func (sourceCCIP *SourceCCIPModule) SendRequest( func DefaultSourceCCIPModule( logger zerolog.Logger, testConf *testconfig.CCIPTestGroupConfig, - testEnv *CCIPTestEnv, chainClient blockchain.EVMClient, destChainId uint64, destChain string, laneConf *laneconfig.LaneConfig, ) (*SourceCCIPModule, error) { cmn, err := NewCCIPCommonFromConfig( - logger, testConf, testEnv, chainClient, laneConf, + logger, testConf, chainClient, laneConf, ) if err != nil { return nil, err @@ -2019,6 +2010,13 @@ func (destCCIP *DestCCIPModule) DeployContracts( if destCCIP.Common.ExistingDeployment { return fmt.Errorf("offramp address not provided in lane config") } + var tokenAdminReg common.Address + if contracts.NeedTokenAdminRegistry() { + if destCCIP.Common.TokenAdminRegistry == nil { + return fmt.Errorf("token admin registry contract address is not provided in lane config") + } + tokenAdminReg = destCCIP.Common.TokenAdminRegistry.EthAddress + } destCCIP.OffRamp, err = contractDeployer.DeployOffRamp( destCCIP.SourceChainSelector, destChainSelector, @@ -2028,7 +2026,7 @@ func (destCCIP *DestCCIPModule) DeployContracts( []common.Address{}, []common.Address{}, *destCCIP.Common.ARMContract, - destCCIP.Common.TokenAdminRegistry.EthAddress, + tokenAdminReg, ) if err != nil { return fmt.Errorf("deploying offramp shouldn't fail %w", err) @@ -2537,14 +2535,13 @@ func (destCCIP *DestCCIPModule) AssertSeqNumberExecuted( func DefaultDestinationCCIPModule( logger zerolog.Logger, testConf *testconfig.CCIPTestGroupConfig, - testEnv *CCIPTestEnv, chainClient blockchain.EVMClient, sourceChainId uint64, sourceChain string, laneConf *laneconfig.LaneConfig, ) (*DestCCIPModule, error) { cmn, err := NewCCIPCommonFromConfig( - logger, testConf, testEnv, chainClient, laneConf, + logger, testConf, chainClient, laneConf, ) if err != nil { return nil, err @@ -3475,7 +3472,6 @@ func (lane *CCIPLane) DeployNewCCIPLane( lane.Source, err = DefaultSourceCCIPModule( lane.Logger, testConf, - env, sourceChainClient, destChainClient.GetChainID().Uint64(), destChainClient.GetNetworkName(), srcConf, @@ -3484,7 +3480,7 @@ func (lane *CCIPLane) DeployNewCCIPLane( return fmt.Errorf("failed to create source module: %w", err) } lane.Dest, err = DefaultDestinationCCIPModule( - lane.Logger, testConf, env, + lane.Logger, testConf, destChainClient, sourceChainClient.GetChainID().Uint64(), sourceChainClient.GetNetworkName(), destConf, ) @@ -3698,17 +3694,26 @@ func SetOCR2Config( Interface("OCRParmsForCommit", OCR2ParamsForCommit). Interface("OCRParmsForExec", OCR2ParamsForExec). Msg("Setting OCR2 config") + commitOffchainCfg, err := contracts.NewCommitOffchainConfig( + *commonconfig.MustNewDuration(5 * time.Second), + 1e6, + 1e6, + *commonconfig.MustNewDuration(5 * time.Second), + 1e6, + *inflightExpiryCommit, + ) + if err != nil { + return fmt.Errorf("failed to create commit offchain config: %w", err) + } + + commitOnchainCfg, err := contracts.NewCommitOnchainConfig( + destCCIP.Common.PriceRegistry.EthAddress, + ) + if err != nil { + return fmt.Errorf("failed to create commit onchain config: %w", err) + } signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, err := contracts.NewOffChainAggregatorV2ConfigForCCIPPlugin( - commitNodes, testhelpers.NewCommitOffchainConfig( - *commonconfig.MustNewDuration(5 * time.Second), - 1e6, - 1e6, - *commonconfig.MustNewDuration(5 * time.Second), - 1e6, - *inflightExpiryCommit, - ), testhelpers.NewCommitOnchainConfig( - destCCIP.Common.PriceRegistry.EthAddress, - ), OCR2ParamsForCommit, 3*time.Minute) + commitNodes, commitOffchainCfg, commitOnchainCfg, OCR2ParamsForCommit, 3*time.Minute) if err != nil { return fmt.Errorf("failed to create ocr2 config params for commit: %w", err) } @@ -3724,24 +3729,32 @@ func SetOCR2Config( nodes = execNodes } if destCCIP.OffRamp != nil { + execOffchainCfg, err := contracts.NewExecOffchainConfig( + 1, + BatchGasLimit, + 0.7, + *inflightExpiryExec, + *commonconfig.MustNewDuration(RootSnoozeTime), + ) + if err != nil { + return fmt.Errorf("failed to create exec offchain config: %w", err) + } + execOnchainCfg, err := contracts.NewExecOnchainConfig( + uint32(DefaultPermissionlessExecThreshold.Seconds()), + destCCIP.Common.Router.EthAddress, + destCCIP.Common.PriceRegistry.EthAddress, + DefaultMaxNoOfTokensInMsg, + MaxDataBytes, + 200_000, + 50_000, + ) + if err != nil { + return fmt.Errorf("failed to create exec onchain config: %w", err) + } signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, err = contracts.NewOffChainAggregatorV2ConfigForCCIPPlugin( nodes, - testhelpers.NewExecOffchainConfig( - 1, - BatchGasLimit, - 0.7, - *inflightExpiryExec, - *commonconfig.MustNewDuration(RootSnoozeTime), - ), - testhelpers.NewExecOnchainConfig( - uint32(DefaultPermissionlessExecThreshold.Seconds()), - destCCIP.Common.Router.EthAddress, - destCCIP.Common.PriceRegistry.EthAddress, - DefaultMaxNoOfTokensInMsg, - MaxDataBytes, - 200_000, - 50_000, - ), + execOffchainCfg, + execOnchainCfg, OCR2ParamsForExec, 3*time.Minute, ) diff --git a/integration-tests/ccip-tests/contracts/contract_deployer.go b/integration-tests/ccip-tests/contracts/contract_deployer.go index fb17bf8d40..8a5b8eb797 100644 --- a/integration-tests/ccip-tests/contracts/contract_deployer.go +++ b/integration-tests/ccip-tests/contracts/contract_deployer.go @@ -56,6 +56,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc20" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" ) @@ -1387,6 +1389,113 @@ func stripKeyPrefix(key string) string { return key } +func NewCommitOffchainConfig( + GasPriceHeartBeat config.Duration, + DAGasPriceDeviationPPB uint32, + ExecGasPriceDeviationPPB uint32, + TokenPriceHeartBeat config.Duration, + TokenPriceDeviationPPB uint32, + InflightCacheExpiry config.Duration) (ccipconfig.OffchainConfig, error) { + switch VersionMap[CommitStoreContract] { + case Latest: + return testhelpers.NewCommitOffchainConfig( + GasPriceHeartBeat, + DAGasPriceDeviationPPB, + ExecGasPriceDeviationPPB, + TokenPriceHeartBeat, + TokenPriceDeviationPPB, + InflightCacheExpiry, + ), nil + case V1_2_0: + return testhelpers_1_4_0.NewCommitOffchainConfig( + GasPriceHeartBeat, + DAGasPriceDeviationPPB, + ExecGasPriceDeviationPPB, + TokenPriceHeartBeat, + TokenPriceDeviationPPB, + InflightCacheExpiry, + ), nil + default: + return nil, fmt.Errorf("version not supported: %s", VersionMap[CommitStoreContract]) + } +} + +func NewCommitOnchainConfig( + PriceRegistry common.Address, +) (abihelpers.AbiDefined, error) { + switch VersionMap[CommitStoreContract] { + case Latest: + return testhelpers.NewCommitOnchainConfig(PriceRegistry), nil + case V1_2_0: + return testhelpers_1_4_0.NewCommitOnchainConfig(PriceRegistry), nil + default: + return nil, fmt.Errorf("version not supported: %s", VersionMap[CommitStoreContract]) + } +} + +func NewExecOnchainConfig( + PermissionLessExecutionThresholdSeconds uint32, + Router common.Address, + PriceRegistry common.Address, + MaxNumberOfTokensPerMsg uint16, + MaxDataBytes uint32, + MaxPoolReleaseOrMintGas uint32, + MaxTokenTransferGas uint32, +) (abihelpers.AbiDefined, error) { + switch VersionMap[OffRampContract] { + case Latest: + return testhelpers.NewExecOnchainConfig( + PermissionLessExecutionThresholdSeconds, + Router, + PriceRegistry, + MaxNumberOfTokensPerMsg, + MaxDataBytes, + MaxPoolReleaseOrMintGas, + MaxTokenTransferGas, + ), nil + case V1_2_0: + return testhelpers_1_4_0.NewExecOnchainConfig( + PermissionLessExecutionThresholdSeconds, + Router, + PriceRegistry, + MaxNumberOfTokensPerMsg, + MaxDataBytes, + MaxPoolReleaseOrMintGas, + ), nil + default: + return nil, fmt.Errorf("version not supported: %s", VersionMap[OffRampContract]) + } +} + +func NewExecOffchainConfig( + destOptimisticConfirmations uint32, + batchGasLimit uint32, + relativeBoostPerWaitHour float64, + inflightCacheExpiry config.Duration, + rootSnoozeTime config.Duration, +) (ccipconfig.OffchainConfig, error) { + switch VersionMap[OffRampContract] { + case Latest: + return testhelpers.NewExecOffchainConfig( + destOptimisticConfirmations, + batchGasLimit, + relativeBoostPerWaitHour, + inflightCacheExpiry, + rootSnoozeTime, + ), nil + case V1_2_0: + return testhelpers_1_4_0.NewExecOffchainConfig( + destOptimisticConfirmations, + batchGasLimit, + relativeBoostPerWaitHour, + inflightCacheExpiry, + rootSnoozeTime, + ), nil + default: + return nil, fmt.Errorf("version not supported: %s", VersionMap[OffRampContract]) + } +} + func NewOffChainAggregatorV2ConfigForCCIPPlugin[T ccipconfig.OffchainConfig]( nodes []*client.CLNodesWithKeys, offchainCfg T, diff --git a/integration-tests/ccip-tests/testconfig/override/mainnet-secondary.toml b/integration-tests/ccip-tests/testconfig/override/mainnet-secondary.toml index fda9d4c590..7d457774b0 100644 --- a/integration-tests/ccip-tests/testconfig/override/mainnet-secondary.toml +++ b/integration-tests/ccip-tests/testconfig/override/mainnet-secondary.toml @@ -668,7 +668,7 @@ ExistingDeployment = true [CCIP.Groups.load.TokenConfig] NoOfTokensPerChain = 1 - +CCIPOwnerTokens = true [CCIP.Groups.load.LoadProfile] RequestPerUnitTime = [1] @@ -702,6 +702,7 @@ ReuseContracts = true [CCIP.Groups.smoke.TokenConfig] NoOfTokensPerChain = 1 +CCIPOwnerTokens = true [CCIP.Groups.smoke.MsgDetails] MsgType = 'Data' diff --git a/integration-tests/ccip-tests/testconfig/override/mainnet.toml b/integration-tests/ccip-tests/testconfig/override/mainnet.toml index b6da522eb2..72695ba754 100644 --- a/integration-tests/ccip-tests/testconfig/override/mainnet.toml +++ b/integration-tests/ccip-tests/testconfig/override/mainnet.toml @@ -757,6 +757,7 @@ ReuseContracts = true [CCIP.Groups.smoke.TokenConfig] NoOfTokensPerChain = 1 +CCIPOwnerTokens = true [CCIP.Groups.smoke.MsgDetails] MsgType = 'Data' diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml index 335e37d55e..f62612996c 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml @@ -272,6 +272,10 @@ TimeoutForPriceUpdate = '15m' # Duration to wait for the price update to time-ou # Could be removed once the pipeline is completely removed. WithPipeline = false NoOfTokensPerChain = 2 # number of bridge tokens to be deployed per network; if MsgType = 'Token'/'DataWithToken' +CCIPOwnerTokens = false # if true, the test will use deploy the tokens by the CCIPOwner, otherwise the tokens will be deployed by a non-owner account, only applicable for 1.5 pools and onwards + +#NoOfTokensWithDynamicPrice = 15 # number of tokens with dynamic price to be deployed +#DynamicPriceUpdateInterval ='15s' # Periodic interval to update the price of tokens, if there are tokens with dynamic price # uncomment the following if you want to run your tests with specific number of lanes; # in this case out of all the possible lane combinations, only the ones with the specified number of lanes will be considered @@ -347,6 +351,12 @@ TimeoutForPriceUpdate = '15m' # Duration to wait for the price update to time-ou # Could be removed once the pipeline is completely removed. WithPipeline = false NoOfTokensPerChain = 2 # number of bridge tokens to be deployed per network; if MsgType = 'Token'/'DataWithToken' +CCIPOwnerTokens = false # if true, the test will use deploy the tokens by the CCIPOwner, otherwise the tokens and pools will be deployed by a non-owner account, +# only applicable for 1.5 pools and onwards, if you are running with pre-1.5 pools, then set this to true to deploy token pools by CCIPOwner, otherwise +# the test will fail + +#NoOfTokensWithDynamicPrice = 15 # number of tokens with dynamic price to be deployed +#DynamicPriceUpdateInterval ='15s' # Periodic interval to update the price of tokens, if there are tokens with dynamic price # uncomment the following if you want to run your tests with specific number of lanes; # in this case out of all the possible lane combinations, only the ones with the specified number of lanes will be considered diff --git a/integration-tests/ccip-tests/testconfig/tomls/contract-version1.4.toml b/integration-tests/ccip-tests/testconfig/tomls/contract-version1.4.toml new file mode 100644 index 0000000000..392b058e5c --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/contract-version1.4.toml @@ -0,0 +1,13 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + +[CCIP.Groups.smoke.TokenConfig] +CCIPOwnerTokens = true + +[CCIP.Groups.load.TokenConfig] +CCIPOwnerTokens = true \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/node-pre-upgrade-compatibility.toml b/integration-tests/ccip-tests/testconfig/tomls/node-pre-upgrade-compatibility.toml index 45596cfffb..36ada83419 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/node-pre-upgrade-compatibility.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/node-pre-upgrade-compatibility.toml @@ -1,4 +1,11 @@ [CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + [CCIP.Groups] [CCIP.Groups.smoke] LocalCluster = false diff --git a/integration-tests/ccip-tests/testconfig/tomls/scalability.toml b/integration-tests/ccip-tests/testconfig/tomls/scalability.toml index bdbe1dcac1..872a6ae565 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/scalability.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/scalability.toml @@ -44,11 +44,11 @@ evm_supports_eip1559 = true evm_default_gas_limit = 6000000 evm_finality_depth = 1 -#[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-1] -#block_time = 1 +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-1] +block_time = 1 # -#[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-2] -#block_time = 1 +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-2] +block_time = 1 [CCIP.Env.NewCLCluster] NoOfNodes = 17 @@ -91,6 +91,7 @@ TimeoutForPriceUpdate = '15m' NoOfTokensPerChain = 60 NoOfTokensWithDynamicPrice = 15 DynamicPriceUpdateInterval ='15s' +CCIPOwnerTokens = true [CCIP.Groups.load.LoadProfile] TestDuration = '4h' diff --git a/integration-tests/ccip-tests/testsetups/ccip.go b/integration-tests/ccip-tests/testsetups/ccip.go index e3ceb46179..aead081b96 100644 --- a/integration-tests/ccip-tests/testsetups/ccip.go +++ b/integration-tests/ccip-tests/testsetups/ccip.go @@ -481,7 +481,7 @@ func (o *CCIPTestSetUpOutputs) DeployChainContracts( mainChainClient.ParallelTransactions(true) defer mainChainClient.Close() ccipCommon, err := actions.DefaultCCIPModule( - lggr, o.Cfg.TestGroupInput, o.Env, mainChainClient, + lggr, o.Cfg.TestGroupInput, mainChainClient, ) if err != nil { return errors.WithStack(fmt.Errorf("failed to create ccip common module for %s: %w", networkCfg.Name, err)) @@ -906,12 +906,14 @@ func CCIPDefaultTestSetUp( if contracts.NeedTokenAdminRegistry() && !pointer.GetBool(testConfig.TestGroupInput.TokenConfig.CCIPOwnerTokens) { for _, net := range testConfig.AllNetworks { chainClient := chainClientByChainID[net.ChainID] - // TODO: This is a total guess at how much funds we need to deploy the tokens. This could be way off, especially on live chains. - // There aren't a lot of good ways to estimate this though. See CCIP-2471. - _, err = chainClient.NewWallet(big.NewFloat(0.1)) - require.NoError(t, err, "failed to create new wallet to deploy tokens from") - err = chainClient.WaitForEvents() - require.NoError(t, err, "failed to wait for events after creating new wallet") + if !pointer.GetBool(testConfig.TestGroupInput.ExistingDeployment) { + // TODO: This is a total guess at how much funds we need to deploy the tokens. This could be way off, especially on live chains. + // There aren't a lot of good ways to estimate this though. See CCIP-2471. + _, err = chainClient.NewWallet(big.NewFloat(0.1)) + require.NoError(t, err, "failed to create new wallet to deploy tokens from") + err = chainClient.WaitForEvents() + require.NoError(t, err, "failed to wait for events after creating new wallet") + } } } diff --git a/integration-tests/ccip-tests/testsetups/test_env.go b/integration-tests/ccip-tests/testsetups/test_env.go index 498799eadd..8766cf925e 100644 --- a/integration-tests/ccip-tests/testsetups/test_env.go +++ b/integration-tests/ccip-tests/testsetups/test_env.go @@ -462,8 +462,9 @@ func DeployEnvironments( charts = append(charts, foundry.ChartName) testEnvironment. AddHelm(foundry.New(&foundry.Props{ + NetworkName: network.Name, Values: map[string]interface{}{ - "fullnameOverride": fmt.Sprintf("network-%s", network.Name), + "fullnameOverride": actions.NetworkName(network.Name), "anvil": map[string]interface{}{ "chainId": fmt.Sprintf("%d", network.ChainID), "blockTime": anvilConfig.BlockTime, @@ -528,17 +529,19 @@ func DeployEnvironments( if !network.Simulated { return network.URLs, network.HTTPURLs } - networkName := strings.ReplaceAll(strings.ToLower(network.Name), " ", "-") + networkName := actions.NetworkName(network.Name) var internalWsURLs, internalHttpURLs []string switch chart { case foundry.ChartName: - internalWsURLs = append(internalWsURLs, fmt.Sprintf("ws://%s-%s:8545", networkName, foundry.ChartName)) - internalHttpURLs = append(internalHttpURLs, fmt.Sprintf("http://%s-%s:8545", networkName, foundry.ChartName)) + internalWsURLs = append(internalWsURLs, fmt.Sprintf("ws://%s:8545", networkName)) + internalHttpURLs = append(internalHttpURLs, fmt.Sprintf("http://%s:8545", networkName)) case networkName: for i := 0; i < numOfTxNodes; i++ { internalWsURLs = append(internalWsURLs, fmt.Sprintf("ws://%s-ethereum-geth:8546", networkName)) internalHttpURLs = append(internalHttpURLs, fmt.Sprintf("http://%s-ethereum-geth:8544", networkName)) } + default: + return network.URLs, network.HTTPURLs } return internalWsURLs, internalHttpURLs diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 4527739119..8be2d5ded6 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -33,7 +33,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.17 github.com/smartcontractkit/chainlink-automation v1.0.3 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce - github.com/smartcontractkit/chainlink-testing-framework v1.30.1 + github.com/smartcontractkit/chainlink-testing-framework v1.30.8 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 3d51e1fcd9..74365be60f 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1520,8 +1520,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240605170242-555ff582f36 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240605170242-555ff582f36a/go.mod h1:QqcZSwLgEIn7YraAIRmomnBMAuVFephiHrIWVlkWbFI= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240531021326-99118e47f696 h1:h1E87+z+JcUEfvbJVF56SnZA/YUFE5ewUE61MaR/Ewg= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240531021326-99118e47f696/go.mod h1:OiWUTrrpSLLTMh7FINWjEh6mmDJCVPaC4yEsDCVaWdU= -github.com/smartcontractkit/chainlink-testing-framework v1.30.1 h1:JFoeSuOvdx8Rmfh5Z4KOH0FnjiLw3M2p7T4GLzTPLMk= -github.com/smartcontractkit/chainlink-testing-framework v1.30.1/go.mod h1:oEIggLGWyWfLkjWvuXLol8inUT4YbBb06fJx/S60gQ4= +github.com/smartcontractkit/chainlink-testing-framework v1.30.8 h1:RcsNZBCJ7q7dI7tyttkSV7QPW2+fQMmFneFDlvc7ymE= +github.com/smartcontractkit/chainlink-testing-framework v1.30.8/go.mod h1:E6uNEZhZZid9PHv6/Kq5Vn63GlO61ZcKB+/f0DKo3Q4= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449 h1:fX/xmGm1GBsD1ZZnooNT+eWA0hiTAqFlHzOC5CY4dy8= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449/go.mod h1:DC8sQMyTlI/44UCTL8QWFwb0bYNoXCfjwCv2hMivYZU= github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 h1:FFdvEzlYwcuVHkdZ8YnZR/XomeMGbz5E2F2HZI3I3w8= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 3e76a0b0f5..226e40e5aa 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -17,7 +17,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.3 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce - github.com/smartcontractkit/chainlink-testing-framework v1.30.1 + github.com/smartcontractkit/chainlink-testing-framework v1.30.8 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240214231432-4ad5eb95178c github.com/smartcontractkit/chainlink/v2 v2.9.0-beta0.0.20240216210048-da02459ddad8 github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 946e4a85e2..c1d0249b2e 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1510,8 +1510,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240605170242-555ff582f36 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240605170242-555ff582f36a/go.mod h1:QqcZSwLgEIn7YraAIRmomnBMAuVFephiHrIWVlkWbFI= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240531021326-99118e47f696 h1:h1E87+z+JcUEfvbJVF56SnZA/YUFE5ewUE61MaR/Ewg= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240531021326-99118e47f696/go.mod h1:OiWUTrrpSLLTMh7FINWjEh6mmDJCVPaC4yEsDCVaWdU= -github.com/smartcontractkit/chainlink-testing-framework v1.30.1 h1:JFoeSuOvdx8Rmfh5Z4KOH0FnjiLw3M2p7T4GLzTPLMk= -github.com/smartcontractkit/chainlink-testing-framework v1.30.1/go.mod h1:oEIggLGWyWfLkjWvuXLol8inUT4YbBb06fJx/S60gQ4= +github.com/smartcontractkit/chainlink-testing-framework v1.30.8 h1:RcsNZBCJ7q7dI7tyttkSV7QPW2+fQMmFneFDlvc7ymE= +github.com/smartcontractkit/chainlink-testing-framework v1.30.8/go.mod h1:E6uNEZhZZid9PHv6/Kq5Vn63GlO61ZcKB+/f0DKo3Q4= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449 h1:fX/xmGm1GBsD1ZZnooNT+eWA0hiTAqFlHzOC5CY4dy8= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449/go.mod h1:DC8sQMyTlI/44UCTL8QWFwb0bYNoXCfjwCv2hMivYZU= github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 h1:FFdvEzlYwcuVHkdZ8YnZR/XomeMGbz5E2F2HZI3I3w8=