From 748f85380712b53b52040e086050e1047efbb263 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 11:07:42 -0800 Subject: [PATCH 01/22] test: disable unit test setup --- .github/workflows/ci-core.yml | 82 +++++++++++++++++------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index bc6b7f39571..c2291f46e07 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -198,12 +198,12 @@ jobs: should-run: ${{ needs.filter.outputs.should-run-core-tests }} trunk-auto-quarantine: "true" - - cmd: go_core_tests_integration - os: ${{ needs.runner-config.outputs.core-tests-integration-runner }} - should-run: ${{ needs.filter.outputs.should-run-core-tests }} - trunk-auto-quarantine: "true" - setup-solana: "true" - install-loopps: "true" + # - cmd: go_core_tests_integration + # os: ${{ needs.runner-config.outputs.core-tests-integration-runner }} + # should-run: ${{ needs.filter.outputs.should-run-core-tests }} + # trunk-auto-quarantine: "true" + # setup-solana: "true" + # install-loopps: "true" - cmd: go_core_fuzz os: ${{ needs.runner-config.outputs.core-fuzz-tests-runner }} @@ -255,33 +255,33 @@ jobs: go-version-file: ${{ matrix.type.go-mod-directory }}go.mod go-module-file: ${{ matrix.type.go-mod-directory }}go.sum - - name: Setup Solana - if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-solana == 'true' }} - uses: ./.github/actions/setup-solana - - - name: Setup Aptos - if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-aptos == 'true' }} - uses: aptos-labs/actions/install-aptos-cli@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025 - with: - CLI_VERSION: 7.10.0 - - - name: Setup Sui CLI v1.57.2 - if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-sui == 'true' }} - uses: ./.github/actions/setup-sui - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - version: mainnet-1.57.2 - - - name: Setup wasmd - if: ${{ matrix.type.should-run == 'true' }} - uses: ./.github/actions/setup-wasmd - - - name: Setup Postgres - if: ${{ matrix.type.should-run == 'true' }} - uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1 - with: - tmpfs: "true" - image-tag: "16-alpine" + # - name: Setup Solana + # if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-solana == 'true' }} + # uses: ./.github/actions/setup-solana + + # - name: Setup Aptos + # if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-aptos == 'true' }} + # uses: aptos-labs/actions/install-aptos-cli@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025 + # with: + # CLI_VERSION: 7.10.0 + + # - name: Setup Sui CLI v1.57.2 + # if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-sui == 'true' }} + # uses: ./.github/actions/setup-sui + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # version: mainnet-1.57.2 + + # - name: Setup wasmd + # if: ${{ matrix.type.should-run == 'true' }} + # uses: ./.github/actions/setup-wasmd + + # - name: Setup Postgres + # if: ${{ matrix.type.should-run == 'true' }} + # uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1 + # with: + # tmpfs: "true" + # image-tag: "16-alpine" - name: Touching core/web/assets/index.html if: ${{ matrix.type.should-run == 'true' }} @@ -291,15 +291,15 @@ jobs: if: ${{ matrix.type.should-run == 'true' }} run: go mod download - - name: Setup DB - if: ${{ matrix.type.should-run == 'true' }} - run: go run ./core/store/cmd/preparetest - env: - CL_DATABASE_URL: ${{ env.DB_URL }} + # - name: Setup DB + # if: ${{ matrix.type.should-run == 'true' }} + # run: go run ./core/store/cmd/preparetest + # env: + # CL_DATABASE_URL: ${{ env.DB_URL }} - - name: Install LOOP Plugins - if: ${{ matrix.type.should-run == 'true' && matrix.type.install-loopps == 'true' }} - run: make install-plugins + # - name: Install LOOP Plugins + # if: ${{ matrix.type.should-run == 'true' && matrix.type.install-loopps == 'true' }} + # run: make install-plugins - name: Increase Timeouts for Fuzz/Race # Increase timeouts for scheduled runs only From fda087bddb00b695215b7c3045d1679ac130e923 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 12:43:34 -0800 Subject: [PATCH 02/22] test: tag some tests --- .github/workflows/ci-core-integration.yml | 136 ++++++++++++++ .github/workflows/ci-core.yml | 1 - ...st.go => cs_chain_contracts_integ_test.go} | 2 + .../solana_v0_1_1/cs_deploy_chain_test.go | 8 - ..._test.go => cs_solana_token_integ_test.go} | 28 +-- .../cs_solana_token_unit_test.go | 39 ++++ ...ol_test.go => cs_token_pool_integ_test.go} | 2 + ...serve_test.go => self_serve_integ_test.go} | 2 + .../changeset/solana_v0_1_1/testutils_test.go | 13 ++ ..._ccip_to_mcms_with_timelock_integ_test.go} | 152 +--------------- ...er_ccip_to_mcms_with_timelock_unit_test.go | 167 ++++++++++++++++++ tools/bin/go_core_ccip_deployment_tests | 5 + 12 files changed, 370 insertions(+), 185 deletions(-) create mode 100644 .github/workflows/ci-core-integration.yml rename deployment/ccip/changeset/solana_v0_1_1/{cs_chain_contracts_test.go => cs_chain_contracts_integ_test.go} (99%) rename deployment/ccip/changeset/solana_v0_1_1/{cs_solana_token_test.go => cs_solana_token_integ_test.go} (87%) create mode 100644 deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_unit_test.go rename deployment/ccip/changeset/solana_v0_1_1/{cs_token_pool_test.go => cs_token_pool_integ_test.go} (99%) rename deployment/ccip/changeset/solana_v0_1_1/{self_serve_test.go => self_serve_integ_test.go} (99%) create mode 100644 deployment/ccip/changeset/solana_v0_1_1/testutils_test.go rename deployment/ccip/changeset/solana_v0_1_1/{transfer_ccip_to_mcms_with_timelock_test.go => transfer_ccip_to_mcms_with_timelock_integ_test.go} (78%) create mode 100644 deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_unit_test.go diff --git a/.github/workflows/ci-core-integration.yml b/.github/workflows/ci-core-integration.yml new file mode 100644 index 00000000000..7df9d624bce --- /dev/null +++ b/.github/workflows/ci-core-integration.yml @@ -0,0 +1,136 @@ +name: CI Core Integration +run-name: CI Core Integration + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +# Run on key branches to make sure integration is good, otherwise run on all PR's +on: + push: + branches: + - develop + - "release/*" + merge_group: + pull_request: + + +jobs: + core: + env: + # We explicitly have this env var not be "CL_DATABASE_URL" to avoid having it be used by core related tests + # when they should not be using it, while still allowing us to DRY up the setup + DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable + strategy: + fail-fast: false + matrix: + type: + - module: Deployment + cmd: deployment_tests + os: runs-on=${{ github.run_id }}-deployment/cpu=48/ram=96/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache + tags: "integration solana" + go-mod-directory: "deployment/" + + name: "${{ matrix.type.module }} - Tagged Tests (${{matrix.type.tags}})" + timeout-minutes: 20 + runs-on: ${{ matrix.type.os }} + permissions: + id-token: write + contents: read + actions: read + steps: + - name: Enable S3 Cache for Self-Hosted Runners + # these env vars are set (and exposed) when it is a self-hosted runner with extras=s3-cache + if: ${{ env.RUNS_ON_INSTANCE_ID != '' && env.ACTIONS_CACHE_URL != '' }} + uses: runs-on/action@66d4449b717b5462159659523d1241051ff470b9 # v1 + + - name: Checkout the repo + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + # race/fuzz tests don't benefit repeated caching, so restore from develop's build cache + restore-build-cache-only: ${{ matrix.type.cmd == 'go_core_fuzz' || matrix.type.cmd == 'go_core_race_tests' }} + build-cache-version: ${{ matrix.type.cmd }} + go-version-file: ${{ matrix.type.go-mod-directory }}go.mod + go-module-file: ${{ matrix.type.go-mod-directory }}go.sum + + - name: Setup Solana + uses: ./.github/actions/setup-solana + + # - name: Setup Aptos + # if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-aptos == 'true' }} + # uses: aptos-labs/actions/install-aptos-cli@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025 + # with: + # CLI_VERSION: 7.10.0 + + # - name: Setup Sui CLI v1.57.2 + # if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-sui == 'true' }} + # uses: ./.github/actions/setup-sui + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # version: mainnet-1.57.2 + + # - name: Setup wasmd + # if: ${{ matrix.type.should-run == 'true' }} + # uses: ./.github/actions/setup-wasmd + + - name: Setup Postgres + if: ${{ matrix.type.should-run == 'true' }} + uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1 + with: + tmpfs: "true" + image-tag: "16-alpine" + + - name: Touching core/web/assets/index.html + if: ${{ matrix.type.should-run == 'true' }} + run: mkdir -p core/web/assets && touch core/web/assets/index.html + + - name: Download Go vendor packages + if: ${{ matrix.type.should-run == 'true' }} + run: go mod download + + - name: Setup DB + if: ${{ matrix.type.should-run == 'true' }} + run: go run ./core/store/cmd/preparetest + env: + CL_DATABASE_URL: ${{ env.DB_URL }} + + # - name: Install LOOP Plugins + # if: ${{ matrix.type.should-run == 'true' && matrix.type.install-loopps == 'true' }} + # run: make install-plugins + + - name: Run tests + if: ${{ matrix.type.should-run == 'true' }} + timeout-minutes: ${{ github.event_name == 'schedule' && 37 || 22 }} # leave time for remaining steps + continue-on-error: ${{ matrix.type.trunk-auto-quarantine == 'true' }} + id: run-tests + shell: bash + env: + GO_TEST_TAGS: ${{ matrix.type.tags }} + CL_DATABASE_URL: ${{ env.DB_URL }} + OUTPUT_FILE: ./output.txt + PRODUCE_JUNIT_XML: ${{ matrix.type.trunk-auto-quarantine }} + JUNIT_FILE: ${{ github.workspace }}/junit.xml + RUN_QUARANTINED_TESTS: "true" # always run quarantined tests in CI + run: | + GODEBUG=goindex=0 ./tools/bin/${{ matrix.type.cmd }} ./... + # See: https://github.com/golang/go/issues/69179 + + - name: Store logs artifacts + if: ${{ always() && matrix.type.should-run == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.type.cmd }}_logs + path: | + ./output.txt + ./output-short.txt + ./race.* + ./coverage.txt + ./postgres_logs.txt + ./junit.xml + ./deployment/junit.xml + retention-days: 7 diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index c2291f46e07..3d8513b409b 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -334,7 +334,6 @@ jobs: trunk-org-slug: chainlink trunk-token: ${{ secrets.TRUNK_API_KEY }} trunk-previous-step-outcome: ${{ steps.run-tests.outcome }} - trunk-job-url: ${{ format('https://github.com/{0}/actions/runs/{1}/job/{2}/attempts/{3}', github.repository, github.run_id, job.check_run_id, github.run_attempt) }} # when auto-quarantine is enabled, allow this to determine test failures trunk-upload-only: ${{ matrix.type.trunk-auto-quarantine != 'true' }} diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_integ_test.go similarity index 99% rename from deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go rename to deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_integ_test.go index 13b509ac698..47f6cdaf8e5 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && solana + package solana_test import ( diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go index db838bcccc5..f5704cbaba7 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go @@ -1,7 +1,6 @@ package solana_test import ( - "os" "testing" "time" @@ -132,13 +131,6 @@ func TestDeployChainContractsChangesetPreload(t *testing.T) { require.NoError(t, err) } -func skipInCI(t *testing.T) { - ci := os.Getenv("CI") == "true" - if ci { - t.Skip("Skipping in CI") - } -} - // Upgrade flows must do the following: // 1. Build the original contracts. We cannot preload because the deployed buffers will be too small to handle an upgrade. // We must do a deploy with .so and keypairs locally diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_integ_test.go similarity index 87% rename from deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_test.go rename to deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_integ_test.go index ea6d8239624..cbd28d00194 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && solana + package solana_test import ( @@ -12,8 +14,6 @@ import ( cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" - "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/runtime" solTokenUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/tokens" @@ -175,27 +175,3 @@ func TestSolanaTokenOps(t *testing.T) { require.Equal(t, int(1000), outVal) require.Equal(t, 9, int(outDec)) } - -func TestDeployLinkToken(t *testing.T) { - selector := chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector - rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( - environment.WithSolanaContainer(t, []uint64{selector}, t.TempDir(), map[string]string{}), - )) - require.NoError(t, err) - - // solana test - solLinkTokenPrivKey, _ := solana.NewRandomPrivateKey() - - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonchangeset.DeploySolanaLinkToken), commonchangeset.DeploySolanaLinkTokenConfig{ - ChainSelector: selector, - TokenPrivKey: solLinkTokenPrivKey, - TokenDecimals: 9, - }), - ) - require.NoError(t, err) - - addrs, err := rt.State().AddressBook.AddressesForChain(selector) - require.NoError(t, err) - require.NotEmpty(t, addrs) -} diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_unit_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_unit_test.go new file mode 100644 index 00000000000..015eda8fd86 --- /dev/null +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_unit_test.go @@ -0,0 +1,39 @@ +package solana_test + +import ( + "testing" + + "github.com/gagliardetto/solana-go" + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/require" + + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" + "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/runtime" + + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" +) + +func TestDeployLinkToken(t *testing.T) { + selector := chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector + rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( + environment.WithSolanaContainer(t, []uint64{selector}, t.TempDir(), map[string]string{}), + )) + require.NoError(t, err) + + // solana test + solLinkTokenPrivKey, _ := solana.NewRandomPrivateKey() + + err = rt.Exec( + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonchangeset.DeploySolanaLinkToken), commonchangeset.DeploySolanaLinkTokenConfig{ + ChainSelector: selector, + TokenPrivKey: solLinkTokenPrivKey, + TokenDecimals: 9, + }), + ) + require.NoError(t, err) + + addrs, err := rt.State().AddressBook.AddressesForChain(selector) + require.NoError(t, err) + require.NotEmpty(t, addrs) +} diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_integ_test.go similarity index 99% rename from deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go rename to deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_integ_test.go index 9f0fa465a1e..8590c9330d9 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && solana + package solana_test import ( diff --git a/deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go b/deployment/ccip/changeset/solana_v0_1_1/self_serve_integ_test.go similarity index 99% rename from deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go rename to deployment/ccip/changeset/solana_v0_1_1/self_serve_integ_test.go index 859d45fdbcd..e45be600e36 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/self_serve_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && solana + package solana_test import ( diff --git a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go new file mode 100644 index 00000000000..c9239b20f0c --- /dev/null +++ b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go @@ -0,0 +1,13 @@ +package solana_test + +import ( + "os" + "testing" +) + +func skipInCI(t *testing.T) { + ci := os.Getenv("CI") == "true" + if ci && false { // test - disable + t.Skip("Skipping in CI") + } +} diff --git a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_integ_test.go similarity index 78% rename from deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go rename to deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_integ_test.go index ef1c7d8af0a..163f99158b9 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && solana + package solana_test import ( @@ -22,7 +24,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" - cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" @@ -33,161 +34,12 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) -func TestValidateContracts(t *testing.T) { - validPubkey := solana.NewWallet().PublicKey() - - zeroPubkey := solana.PublicKey{} // Zero public key - - makeState := func(router, feeQuoter solana.PublicKey) solanastateview.CCIPChainState { - return solanastateview.CCIPChainState{ - Router: router, - FeeQuoter: feeQuoter, - } - } - - tests := []struct { - name string - state solanastateview.CCIPChainState - contracts ccipChangesetSolana.CCIPContractsToTransfer - chainSelector uint64 - expectedError string - }{ - { - name: "All required contracts present", - state: makeState(validPubkey, validPubkey), - contracts: ccipChangesetSolana.CCIPContractsToTransfer{Router: true}, - chainSelector: 12345, - }, - { - name: "Missing Router contract", - state: makeState(zeroPubkey, validPubkey), - contracts: ccipChangesetSolana.CCIPContractsToTransfer{Router: true}, - chainSelector: 12345, - expectedError: "missing required contract Router on chain 12345", - }, - { - name: "Missing FeeQuoter contract", - state: makeState(validPubkey, zeroPubkey), - contracts: ccipChangesetSolana.CCIPContractsToTransfer{Router: true, FeeQuoter: true}, - chainSelector: 12345, - expectedError: "missing required contract FeeQuoter on chain 12345", - }, - { - name: "invalid pub key", - state: makeState(validPubkey, zeroPubkey), - contracts: ccipChangesetSolana.CCIPContractsToTransfer{Router: true, FeeQuoter: true}, - chainSelector: 12345, - expectedError: "missing required contract FeeQuoter on chain 12345", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := ccipChangesetSolana.ValidateContracts(tt.state, tt.chainSelector, tt.contracts) - - if tt.expectedError == "" { - require.NoError(t, err) - } else { - require.Error(t, err) - require.Equal(t, tt.expectedError, err.Error()) - } - }) - } -} - -func TestValidate(t *testing.T) { - selector := chainselectors.TEST_22222222222222222222222222222222222222222222.Selector - - tests := []struct { - name string - env func(t *testing.T) cldf.Environment - contractsByChain map[uint64]ccipChangesetSolana.CCIPContractsToTransfer - expectedError string - }{ - { - name: "No chains found in environment", - env: func(t *testing.T) cldf.Environment { - t.Helper() - - e, err := environment.New(t.Context()) - require.NoError(t, err) - - return *e - }, - expectedError: "no chains found", - }, - { - name: "Chain selector not found in environment", - env: func(t *testing.T) cldf.Environment { - t.Helper() - - e, err := environment.New(t.Context()) - require.NoError(t, err) - - e.BlockChains = cldf_chain.NewBlockChainsFromSlice([]cldf_chain.BlockChain{ - cldf_solana.Chain{ - Selector: selector, - }, - }) - - return *e - }, - contractsByChain: map[uint64]ccipChangesetSolana.CCIPContractsToTransfer{ - 99999: {Router: true, FeeQuoter: true}, - }, - expectedError: "chain 99999 not found in environment", - }, - { - name: "Invalid chain family", - env: func(t *testing.T) cldf.Environment { - t.Helper() - - e, err := environment.New(t.Context()) - require.NoError(t, err) - - e.BlockChains = cldf_chain.NewBlockChainsFromSlice([]cldf_chain.BlockChain{ - cldf_solana.Chain{ - Selector: selector, - }, - }) - - return *e - }, - contractsByChain: map[uint64]ccipChangesetSolana.CCIPContractsToTransfer{ - selector: {Router: true, FeeQuoter: true}, - }, - expectedError: "failed to load addresses for chain 12463857294658392847: chain selector 12463857294658392847: chain not found", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - cfg := ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolanaConfig{ - ContractsByChain: tt.contractsByChain, - MCMSCfg: proposalutils.TimelockConfig{ - MinDelay: 0 * time.Second, - }, - } - - err := cfg.Validate(tt.env(t)) - - if tt.expectedError == "" { - require.NoError(t, err) - } else { - require.Error(t, err) - require.Contains(t, err.Error(), tt.expectedError) - } - }) - } -} - // prepareEnvironmentForOwnershipTransfer helper that deploys the necessary contracts as pre-requisite to // the transfer ownership changeset. func prepareEnvironmentForOwnershipTransfer(t *testing.T) (cldf.Environment, stateview.CCIPOnChainState) { diff --git a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_unit_test.go b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_unit_test.go new file mode 100644 index 00000000000..5603806dfc4 --- /dev/null +++ b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_unit_test.go @@ -0,0 +1,167 @@ +package solana_test + +import ( + "testing" + "time" + + "github.com/gagliardetto/solana-go" + chainselectors "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/require" + + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" + + ccipChangesetSolana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" + solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" +) + +func TestValidateContracts(t *testing.T) { + validPubkey := solana.NewWallet().PublicKey() + + zeroPubkey := solana.PublicKey{} // Zero public key + + makeState := func(router, feeQuoter solana.PublicKey) solanastateview.CCIPChainState { + return solanastateview.CCIPChainState{ + Router: router, + FeeQuoter: feeQuoter, + } + } + + tests := []struct { + name string + state solanastateview.CCIPChainState + contracts ccipChangesetSolana.CCIPContractsToTransfer + chainSelector uint64 + expectedError string + }{ + { + name: "All required contracts present", + state: makeState(validPubkey, validPubkey), + contracts: ccipChangesetSolana.CCIPContractsToTransfer{Router: true}, + chainSelector: 12345, + }, + { + name: "Missing Router contract", + state: makeState(zeroPubkey, validPubkey), + contracts: ccipChangesetSolana.CCIPContractsToTransfer{Router: true}, + chainSelector: 12345, + expectedError: "missing required contract Router on chain 12345", + }, + { + name: "Missing FeeQuoter contract", + state: makeState(validPubkey, zeroPubkey), + contracts: ccipChangesetSolana.CCIPContractsToTransfer{Router: true, FeeQuoter: true}, + chainSelector: 12345, + expectedError: "missing required contract FeeQuoter on chain 12345", + }, + { + name: "invalid pub key", + state: makeState(validPubkey, zeroPubkey), + contracts: ccipChangesetSolana.CCIPContractsToTransfer{Router: true, FeeQuoter: true}, + chainSelector: 12345, + expectedError: "missing required contract FeeQuoter on chain 12345", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := ccipChangesetSolana.ValidateContracts(tt.state, tt.chainSelector, tt.contracts) + + if tt.expectedError == "" { + require.NoError(t, err) + } else { + require.Error(t, err) + require.Equal(t, tt.expectedError, err.Error()) + } + }) + } +} + +func TestValidate(t *testing.T) { + selector := chainselectors.TEST_22222222222222222222222222222222222222222222.Selector + + tests := []struct { + name string + env func(t *testing.T) cldf.Environment + contractsByChain map[uint64]ccipChangesetSolana.CCIPContractsToTransfer + expectedError string + }{ + { + name: "No chains found in environment", + env: func(t *testing.T) cldf.Environment { + t.Helper() + + e, err := environment.New(t.Context()) + require.NoError(t, err) + + return *e + }, + expectedError: "no chains found", + }, + { + name: "Chain selector not found in environment", + env: func(t *testing.T) cldf.Environment { + t.Helper() + + e, err := environment.New(t.Context()) + require.NoError(t, err) + + e.BlockChains = cldf_chain.NewBlockChainsFromSlice([]cldf_chain.BlockChain{ + cldf_solana.Chain{ + Selector: selector, + }, + }) + + return *e + }, + contractsByChain: map[uint64]ccipChangesetSolana.CCIPContractsToTransfer{ + 99999: {Router: true, FeeQuoter: true}, + }, + expectedError: "chain 99999 not found in environment", + }, + { + name: "Invalid chain family", + env: func(t *testing.T) cldf.Environment { + t.Helper() + + e, err := environment.New(t.Context()) + require.NoError(t, err) + + e.BlockChains = cldf_chain.NewBlockChainsFromSlice([]cldf_chain.BlockChain{ + cldf_solana.Chain{ + Selector: selector, + }, + }) + + return *e + }, + contractsByChain: map[uint64]ccipChangesetSolana.CCIPContractsToTransfer{ + selector: {Router: true, FeeQuoter: true}, + }, + expectedError: "failed to load addresses for chain 12463857294658392847: chain selector 12463857294658392847: chain not found", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + cfg := ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolanaConfig{ + ContractsByChain: tt.contractsByChain, + MCMSCfg: proposalutils.TimelockConfig{ + MinDelay: 0 * time.Second, + }, + } + + err := cfg.Validate(tt.env(t)) + + if tt.expectedError == "" { + require.NoError(t, err) + } else { + require.Error(t, err) + require.Contains(t, err.Error(), tt.expectedError) + } + }) + } +} diff --git a/tools/bin/go_core_ccip_deployment_tests b/tools/bin/go_core_ccip_deployment_tests index b453b1e17ec..437c2740762 100755 --- a/tools/bin/go_core_ccip_deployment_tests +++ b/tools/bin/go_core_ccip_deployment_tests @@ -6,6 +6,7 @@ SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"` OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"} JUNIT_FILE=${JUNIT_FILE:-"./junit.xml"} GO_TEST_TIMEOUT=${GO_TEST_TIMEOUT:-"15m"} +GO_TEST_TAGS=${GO_TEST_TAGS:-""} # Adjusting freeport port block size for tests. export CL_RESERVE_PORTS=128 @@ -18,6 +19,10 @@ export PATH echo "Running go_core_ccip_deployment_tests for event: $GITHUB_EVENT_NAME" GO_TEST_FLAGS="-timeout=${GO_TEST_TIMEOUT}" +if [[ -n "$GO_TEST_TAGS" ]]; then + GO_TEST_FLAGS="$GO_TEST_FLAGS -tags=$GO_TEST_TAGS" +fi + if [[ "$GITHUB_EVENT_NAME" == 'push' ]]; then GO_TEST_FLAGS="$GO_TEST_FLAGS -count=1" elif [[ "$GITHUB_EVENT_NAME" == 'schedule' ]]; then From 7a06fb813780ae80cb4d048011170a22f52cc5dc Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 12:46:44 -0800 Subject: [PATCH 03/22] temporarily disable e2e tests --- .github/workflows/integration-in-memory-tests.yml | 3 ++- .github/workflows/integration-tests.yml | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-in-memory-tests.yml b/.github/workflows/integration-in-memory-tests.yml index e21de702571..ebdb9fd9d6d 100644 --- a/.github/workflows/integration-in-memory-tests.yml +++ b/.github/workflows/integration-in-memory-tests.yml @@ -81,7 +81,8 @@ jobs: id-token: write contents: read needs: changes - if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + if: false + # if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@9874c1f4ab4a4c70433df6d8f862044ca18456df # 2025-11-26 with: workflow_name: Run CCIP Integration Tests For PR diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index dddaa80f231..db889c6fb7d 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -137,7 +137,8 @@ jobs: labels: name: Get PR labels and set runner labels - if: github.actor != 'dependabot[bot]' + if: false + # if: github.actor != 'dependabot[bot]' runs-on: ubuntu-latest permissions: contents: read @@ -192,7 +193,8 @@ jobs: build-chainlink: name: Build Chainlink Image ${{ matrix.image.name }} - if: github.actor != 'dependabot[bot]' + if: false + # if: github.actor != 'dependabot[bot]' environment: integration runs-on: ${{ matrix.image.runner }} needs: From 5cf1aab23327804e4c900254944b2e91aa39ce39 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 12:48:02 -0800 Subject: [PATCH 04/22] fix: dont skip tagged tests --- .github/workflows/ci-core-integration.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-core-integration.yml b/.github/workflows/ci-core-integration.yml index 7df9d624bce..922cf592604 100644 --- a/.github/workflows/ci-core-integration.yml +++ b/.github/workflows/ci-core-integration.yml @@ -62,51 +62,41 @@ jobs: uses: ./.github/actions/setup-solana # - name: Setup Aptos - # if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-aptos == 'true' }} # uses: aptos-labs/actions/install-aptos-cli@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025 # with: # CLI_VERSION: 7.10.0 # - name: Setup Sui CLI v1.57.2 - # if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-sui == 'true' }} # uses: ./.github/actions/setup-sui # with: # github-token: ${{ secrets.GITHUB_TOKEN }} # version: mainnet-1.57.2 # - name: Setup wasmd - # if: ${{ matrix.type.should-run == 'true' }} # uses: ./.github/actions/setup-wasmd - name: Setup Postgres - if: ${{ matrix.type.should-run == 'true' }} uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1 with: tmpfs: "true" image-tag: "16-alpine" - name: Touching core/web/assets/index.html - if: ${{ matrix.type.should-run == 'true' }} run: mkdir -p core/web/assets && touch core/web/assets/index.html - name: Download Go vendor packages - if: ${{ matrix.type.should-run == 'true' }} run: go mod download - name: Setup DB - if: ${{ matrix.type.should-run == 'true' }} run: go run ./core/store/cmd/preparetest env: CL_DATABASE_URL: ${{ env.DB_URL }} # - name: Install LOOP Plugins - # if: ${{ matrix.type.should-run == 'true' && matrix.type.install-loopps == 'true' }} # run: make install-plugins - name: Run tests - if: ${{ matrix.type.should-run == 'true' }} - timeout-minutes: ${{ github.event_name == 'schedule' && 37 || 22 }} # leave time for remaining steps - continue-on-error: ${{ matrix.type.trunk-auto-quarantine == 'true' }} + timeout-minutes: 22 id: run-tests shell: bash env: @@ -121,7 +111,7 @@ jobs: # See: https://github.com/golang/go/issues/69179 - name: Store logs artifacts - if: ${{ always() && matrix.type.should-run == 'true' }} + if: ${{ always() }} uses: actions/upload-artifact@v4 with: name: ${{ matrix.type.cmd }}_logs From 13b3f20128076f3cad9a5857cf0ea25f415ff9cc Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 12:56:39 -0800 Subject: [PATCH 05/22] fix: tag more tests --- ..._test.go => cs_deploy_chain_integ_test.go} | 105 +-------------- .../cs_deploy_chain_unit_test.go | 127 ++++++++++++++++++ .../{cs_ops_test.go => cs_ops_integ_test.go} | 2 + .../changeset/solana_v0_1_1/testutils_test.go | 2 +- 4 files changed, 132 insertions(+), 104 deletions(-) rename deployment/ccip/changeset/solana_v0_1_1/{cs_deploy_chain_test.go => cs_deploy_chain_integ_test.go} (80%) create mode 100644 deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go rename deployment/ccip/changeset/solana_v0_1_1/{cs_ops_test.go => cs_ops_integ_test.go} (98%) diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_integ_test.go similarity index 80% rename from deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go rename to deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_integ_test.go index f5704cbaba7..ac831bede0e 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && solana + package solana_test import ( @@ -7,7 +9,6 @@ import ( solBinary "github.com/gagliardetto/binary" "github.com/gagliardetto/solana-go" chain_selectors "github.com/smartcontractkit/chain-selectors" - "github.com/smartcontractkit/quarantine" "github.com/stretchr/testify/require" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" @@ -20,7 +21,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" ccipChangesetSolana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" @@ -30,107 +30,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) -func initialDeployCS(t *testing.T, e cldf.Environment, buildConfig *ccipChangesetSolana.BuildSolanaConfig) []commonchangeset.ConfiguredChangeSet { - evmSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM)) - homeChainSel := evmSelectors[0] - solChainSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana)) - nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) - require.NoError(t, err) - feeAggregatorPrivKey, _ := solana.NewRandomPrivateKey() - feeAggregatorPubKey := feeAggregatorPrivKey.PublicKey() - mcmsConfig := proposalutils.SingleGroupTimelockConfigV2(t) - solLinkTokenPrivKey, _ := solana.NewRandomPrivateKey() - return []commonchangeset.ConfiguredChangeSet{ - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(v1_6.DeployHomeChainChangeset), - v1_6.DeployHomeChainConfig{ - HomeChainSel: homeChainSel, - RMNStaticConfig: testhelpers.NewTestRMNStaticConfig(), - RMNDynamicConfig: testhelpers.NewTestRMNDynamicConfig(), - NodeOperators: testhelpers.NewTestNodeOperator(e.BlockChains.EVMChains()[homeChainSel].DeployerKey.From), - NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ - testhelpers.TestNodeOperator: nodes.NonBootstraps().PeerIDs(), - }, - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.DeploySolanaLinkToken), - commonchangeset.DeploySolanaLinkTokenConfig{ - ChainSelector: solChainSelectors[0], - TokenPrivKey: solLinkTokenPrivKey, - TokenDecimals: 9, - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(ccipChangesetSolana.DeployChainContractsChangeset), - ccipChangesetSolana.DeployChainContractsConfig{ - HomeChainSelector: homeChainSel, - ChainSelector: solChainSelectors[0], - ContractParamsPerChain: ccipChangesetSolana.ChainContractParams{ - FeeQuoterParams: ccipChangesetSolana.FeeQuoterParams{ - DefaultMaxFeeJuelsPerMsg: solBinary.Uint128{Lo: 300000000, Hi: 0, Endianness: nil}, - }, - OffRampParams: ccipChangesetSolana.OffRampParams{ - EnableExecutionAfter: int64(globals.PermissionLessExecutionThreshold.Seconds()), - }, - }, - MCMSWithTimelockConfig: &mcmsConfig, - BuildConfig: buildConfig, - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(ccipChangesetSolana.DeployReceiverForTest), - ccipChangesetSolana.DeployForTestConfig{ - ChainSelector: solChainSelectors[0], - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(ccipChangesetSolana.SetFeeAggregator), - ccipChangesetSolana.SetFeeAggregatorConfig{ - ChainSelector: solChainSelectors[0], - FeeAggregator: feeAggregatorPubKey.String(), - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(ccipChangesetSolana.ExtendGlobalLookupTableChangeset), - ccipChangesetSolana.ExtendGlobalLookupTableConfig{ - ChainSelector: solChainSelectors[0], - LookupTableKeys: []solana.PublicKey{feeAggregatorPubKey, solLinkTokenPrivKey.PublicKey()}, // just add some random keys - }, - ), - } -} - -// use this for a quick deploy test -func TestDeployChainContractsChangesetPreload(t *testing.T) { - quarantine.Flaky(t, "DX-1729") - t.Parallel() - - homeChainSel := chain_selectors.TEST_90000001.Selector - solSelector := chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector - programsPath := t.TempDir() - progIDs := soltestutils.LoadCCIPPrograms(t, programsPath) - env, err := environment.New(t.Context(), - environment.WithEVMSimulated(t, []uint64{homeChainSel}), - environment.WithSolanaContainer(t, []uint64{solSelector}, programsPath, progIDs), - environment.WithLogger(logger.Test(t)), - ) - require.NoError(t, err) - testhelpers.RegisterNodes(t, env, 4, homeChainSel) - - err = testhelpers.SavePreloadedSolAddresses(*env, solSelector) - require.NoError(t, err) - - e := *env - - // empty build config means, if artifacts are not present, resolve the artifact from github based on go.mod version - // for a simple local in memory test, they will always be present, because we need them to spin up the in memory chain - e, _, err = commonchangeset.ApplyChangesets(t, e, initialDeployCS(t, e, nil)) - require.NoError(t, err) - err = testhelpers.ValidateSolanaState(e, []uint64{solSelector}) - require.NoError(t, err) -} - // Upgrade flows must do the following: // 1. Build the original contracts. We cannot preload because the deployed buffers will be too small to handle an upgrade. // We must do a deploy with .so and keypairs locally diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go new file mode 100644 index 00000000000..c0de87d38f2 --- /dev/null +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go @@ -0,0 +1,127 @@ +package solana_test + +import ( + "testing" + + solBinary "github.com/gagliardetto/binary" + "github.com/gagliardetto/solana-go" + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/quarantine" + "github.com/stretchr/testify/require" + + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" + ccipChangesetSolana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" +) + +func initialDeployCS(t *testing.T, e cldf.Environment, buildConfig *ccipChangesetSolana.BuildSolanaConfig) []commonchangeset.ConfiguredChangeSet { + evmSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM)) + homeChainSel := evmSelectors[0] + solChainSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana)) + nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) + require.NoError(t, err) + feeAggregatorPrivKey, _ := solana.NewRandomPrivateKey() + feeAggregatorPubKey := feeAggregatorPrivKey.PublicKey() + mcmsConfig := proposalutils.SingleGroupTimelockConfigV2(t) + solLinkTokenPrivKey, _ := solana.NewRandomPrivateKey() + return []commonchangeset.ConfiguredChangeSet{ + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(v1_6.DeployHomeChainChangeset), + v1_6.DeployHomeChainConfig{ + HomeChainSel: homeChainSel, + RMNStaticConfig: testhelpers.NewTestRMNStaticConfig(), + RMNDynamicConfig: testhelpers.NewTestRMNDynamicConfig(), + NodeOperators: testhelpers.NewTestNodeOperator(e.BlockChains.EVMChains()[homeChainSel].DeployerKey.From), + NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ + testhelpers.TestNodeOperator: nodes.NonBootstraps().PeerIDs(), + }, + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(commonchangeset.DeploySolanaLinkToken), + commonchangeset.DeploySolanaLinkTokenConfig{ + ChainSelector: solChainSelectors[0], + TokenPrivKey: solLinkTokenPrivKey, + TokenDecimals: 9, + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(ccipChangesetSolana.DeployChainContractsChangeset), + ccipChangesetSolana.DeployChainContractsConfig{ + HomeChainSelector: homeChainSel, + ChainSelector: solChainSelectors[0], + ContractParamsPerChain: ccipChangesetSolana.ChainContractParams{ + FeeQuoterParams: ccipChangesetSolana.FeeQuoterParams{ + DefaultMaxFeeJuelsPerMsg: solBinary.Uint128{Lo: 300000000, Hi: 0, Endianness: nil}, + }, + OffRampParams: ccipChangesetSolana.OffRampParams{ + EnableExecutionAfter: int64(globals.PermissionLessExecutionThreshold.Seconds()), + }, + }, + MCMSWithTimelockConfig: &mcmsConfig, + BuildConfig: buildConfig, + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(ccipChangesetSolana.DeployReceiverForTest), + ccipChangesetSolana.DeployForTestConfig{ + ChainSelector: solChainSelectors[0], + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(ccipChangesetSolana.SetFeeAggregator), + ccipChangesetSolana.SetFeeAggregatorConfig{ + ChainSelector: solChainSelectors[0], + FeeAggregator: feeAggregatorPubKey.String(), + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(ccipChangesetSolana.ExtendGlobalLookupTableChangeset), + ccipChangesetSolana.ExtendGlobalLookupTableConfig{ + ChainSelector: solChainSelectors[0], + LookupTableKeys: []solana.PublicKey{feeAggregatorPubKey, solLinkTokenPrivKey.PublicKey()}, // just add some random keys + }, + ), + } +} + +// use this for a quick deploy test +func TestDeployChainContractsChangesetPreload(t *testing.T) { + quarantine.Flaky(t, "DX-1729") + t.Parallel() + + homeChainSel := chain_selectors.TEST_90000001.Selector + solSelector := chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector + programsPath := t.TempDir() + progIDs := soltestutils.LoadCCIPPrograms(t, programsPath) + env, err := environment.New(t.Context(), + environment.WithEVMSimulated(t, []uint64{homeChainSel}), + environment.WithSolanaContainer(t, []uint64{solSelector}, programsPath, progIDs), + environment.WithLogger(logger.Test(t)), + ) + require.NoError(t, err) + testhelpers.RegisterNodes(t, env, 4, homeChainSel) + + err = testhelpers.SavePreloadedSolAddresses(*env, solSelector) + require.NoError(t, err) + + e := *env + + // empty build config means, if artifacts are not present, resolve the artifact from github based on go.mod version + // for a simple local in memory test, they will always be present, because we need them to spin up the in memory chain + e, _, err = commonchangeset.ApplyChangesets(t, e, initialDeployCS(t, e, nil)) + require.NoError(t, err) + err = testhelpers.ValidateSolanaState(e, []uint64{solSelector}) + require.NoError(t, err) +} diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_ops_integ_test.go similarity index 98% rename from deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go rename to deployment/ccip/changeset/solana_v0_1_1/cs_ops_integ_test.go index a263184c37a..aa61bbbe5c4 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_ops_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && solana + package solana_test import ( diff --git a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go index c9239b20f0c..bff85aa5a3f 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go @@ -7,7 +7,7 @@ import ( func skipInCI(t *testing.T) { ci := os.Getenv("CI") == "true" - if ci && false { // test - disable + if ci { t.Skip("Skipping in CI") } } From 9d07c6cbbe3a6ed0f2b1c12da43030afdfb427a5 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 12:57:40 -0800 Subject: [PATCH 06/22] fix: workflow --- .github/workflows/ci-core-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-core-integration.yml b/.github/workflows/ci-core-integration.yml index 922cf592604..61d688481a9 100644 --- a/.github/workflows/ci-core-integration.yml +++ b/.github/workflows/ci-core-integration.yml @@ -26,7 +26,7 @@ jobs: matrix: type: - module: Deployment - cmd: deployment_tests + cmd: go_core_ccip_deployment_tests os: runs-on=${{ github.run_id }}-deployment/cpu=48/ram=96/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache tags: "integration solana" go-mod-directory: "deployment/" @@ -103,7 +103,7 @@ jobs: GO_TEST_TAGS: ${{ matrix.type.tags }} CL_DATABASE_URL: ${{ env.DB_URL }} OUTPUT_FILE: ./output.txt - PRODUCE_JUNIT_XML: ${{ matrix.type.trunk-auto-quarantine }} + PRODUCE_JUNIT_XML: true JUNIT_FILE: ${{ github.workspace }}/junit.xml RUN_QUARANTINED_TESTS: "true" # always run quarantined tests in CI run: | From 179af1971f8753ff3e296b9d40015d5df47e8f02 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 13:17:21 -0800 Subject: [PATCH 07/22] test: more tagging --- .github/workflows/ci-core-integration.yml | 66 +++++++++++-------- ...t_token_transfer_fee_config_integ_test.go} | 2 + ...o => cs_add_evm_solana_lane_integ_test.go} | 2 + ...est.go => deploy_data_feeds_integ_test.go} | 2 + ..._test.go => set_feed_config_integ_test.go} | 2 + .../aptos/set_workflow_config_test.go | 2 + .../aptos/transfer_ownership_test.go | 2 + 7 files changed, 51 insertions(+), 27 deletions(-) rename deployment/ccip/changeset/crossfamily/{cs_set_token_transfer_fee_config_test.go => cs_set_token_transfer_fee_config_integ_test.go} (99%) rename deployment/ccip/changeset/crossfamily/v1_6/{cs_add_evm_solana_lane_test.go => cs_add_evm_solana_lane_integ_test.go} (99%) rename deployment/data-feeds/changeset/aptos/{deploy_data_feeds_test.go => deploy_data_feeds_integ_test.go} (98%) rename deployment/data-feeds/changeset/aptos/{set_feed_config_test.go => set_feed_config_integ_test.go} (98%) diff --git a/.github/workflows/ci-core-integration.yml b/.github/workflows/ci-core-integration.yml index 61d688481a9..286a27e100c 100644 --- a/.github/workflows/ci-core-integration.yml +++ b/.github/workflows/ci-core-integration.yml @@ -27,13 +27,23 @@ jobs: type: - module: Deployment cmd: go_core_ccip_deployment_tests - os: runs-on=${{ github.run_id }}-deployment/cpu=48/ram=96/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache + os: cpu=32/ram=64/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache tags: "integration solana" go-mod-directory: "deployment/" + setup-solana: "true" + setup-plugins: "true" + + - module: Deployment + cmd: go_core_ccip_deployment_tests + os: cpu=32/ram=64/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache + tags: "integration aptos" + go-mod-directory: "deployment/" + setup-solana: "false" + aptos-cli-version: "7.10.0" name: "${{ matrix.type.module }} - Tagged Tests (${{matrix.type.tags}})" timeout-minutes: 20 - runs-on: ${{ matrix.type.os }} + runs-on: runs-on=${{ github.run_id }}-${{ strategy.job-index }}/${{ matrix.type.os }} permissions: id-token: write contents: read @@ -52,48 +62,50 @@ jobs: - name: Setup Go uses: ./.github/actions/setup-go with: - # race/fuzz tests don't benefit repeated caching, so restore from develop's build cache - restore-build-cache-only: ${{ matrix.type.cmd == 'go_core_fuzz' || matrix.type.cmd == 'go_core_race_tests' }} build-cache-version: ${{ matrix.type.cmd }} go-version-file: ${{ matrix.type.go-mod-directory }}go.mod go-module-file: ${{ matrix.type.go-mod-directory }}go.sum - - name: Setup Solana - uses: ./.github/actions/setup-solana - - # - name: Setup Aptos - # uses: aptos-labs/actions/install-aptos-cli@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025 - # with: - # CLI_VERSION: 7.10.0 - - # - name: Setup Sui CLI v1.57.2 - # uses: ./.github/actions/setup-sui - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # version: mainnet-1.57.2 - - # - name: Setup wasmd - # uses: ./.github/actions/setup-wasmd - - name: Setup Postgres uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1 with: tmpfs: "true" image-tag: "16-alpine" + - name: Setup DB + run: go run ./core/store/cmd/preparetest + env: + CL_DATABASE_URL: ${{ env.DB_URL }} + - name: Touching core/web/assets/index.html run: mkdir -p core/web/assets && touch core/web/assets/index.html - name: Download Go vendor packages run: go mod download - - name: Setup DB - run: go run ./core/store/cmd/preparetest - env: - CL_DATABASE_URL: ${{ env.DB_URL }} + - name: Setup Solana + if: matrix.type.setup-solana == 'true' + uses: ./.github/actions/setup-solana + + - name: Setup Aptos + if: ${{ matrix.type.aptos-cli-version != '' }} + uses: aptos-labs/actions/install-aptos-cli@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025 + with: + CLI_VERSION: ${{ matrix.type.aptos-cli-version }} + + # - name: Setup Sui CLI v1.57.2 + # uses: ./.github/actions/setup-sui + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # version: mainnet-1.57.2 + + - name: Setup wasmd + if: matrix.type.setup-plugins == 'true' + uses: ./.github/actions/setup-wasmd - # - name: Install LOOP Plugins - # run: make install-plugins + - name: Install LOOP Plugins + if: matrix.type.setup-plugins == 'true' + run: make install-plugins - name: Run tests timeout-minutes: 22 diff --git a/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go b/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_integ_test.go similarity index 99% rename from deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go rename to deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_integ_test.go index a14ee8b2299..22198874182 100644 --- a/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go +++ b/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && solana + package crossfamily_test import ( diff --git a/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go b/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_integ_test.go similarity index 99% rename from deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go rename to deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_integ_test.go index 60a250ac701..8f6b7d11c45 100644 --- a/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go +++ b/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && solana + package v1_6_test import ( diff --git a/deployment/data-feeds/changeset/aptos/deploy_data_feeds_test.go b/deployment/data-feeds/changeset/aptos/deploy_data_feeds_integ_test.go similarity index 98% rename from deployment/data-feeds/changeset/aptos/deploy_data_feeds_test.go rename to deployment/data-feeds/changeset/aptos/deploy_data_feeds_integ_test.go index 474bfa5131f..8941ade4916 100644 --- a/deployment/data-feeds/changeset/aptos/deploy_data_feeds_test.go +++ b/deployment/data-feeds/changeset/aptos/deploy_data_feeds_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && aptos + package aptos_test import ( diff --git a/deployment/data-feeds/changeset/aptos/set_feed_config_test.go b/deployment/data-feeds/changeset/aptos/set_feed_config_integ_test.go similarity index 98% rename from deployment/data-feeds/changeset/aptos/set_feed_config_test.go rename to deployment/data-feeds/changeset/aptos/set_feed_config_integ_test.go index 936b9cfb826..bacb85f4f5d 100644 --- a/deployment/data-feeds/changeset/aptos/set_feed_config_test.go +++ b/deployment/data-feeds/changeset/aptos/set_feed_config_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && aptos + package aptos_test import ( diff --git a/deployment/data-feeds/changeset/aptos/set_workflow_config_test.go b/deployment/data-feeds/changeset/aptos/set_workflow_config_test.go index 58142f1ca9e..6cceaf17d71 100644 --- a/deployment/data-feeds/changeset/aptos/set_workflow_config_test.go +++ b/deployment/data-feeds/changeset/aptos/set_workflow_config_test.go @@ -1,3 +1,5 @@ +//go:build integration && aptos + package aptos_test import ( diff --git a/deployment/data-feeds/changeset/aptos/transfer_ownership_test.go b/deployment/data-feeds/changeset/aptos/transfer_ownership_test.go index 39e58693fc8..19ad3251c16 100644 --- a/deployment/data-feeds/changeset/aptos/transfer_ownership_test.go +++ b/deployment/data-feeds/changeset/aptos/transfer_ownership_test.go @@ -1,3 +1,5 @@ +//go:build integration && aptos + package aptos_test import ( From 1e524a6bc9707a516f702c37e4a959193632ed17 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 13:43:57 -0800 Subject: [PATCH 08/22] test: more tagging --- ...est.go => cs_add_token_pool_integ_test.go} | 2 + ...go => cs_deploy_aptos_chain_integ_test.go} | 2 + ...t.go => cs_set_ocr3_offramp_integ_test.go} | 2 + ...go => cs_update_aptos_lanes_integ_test.go} | 2 + ...onfigure_evm_signer_registry_unit_test.go} | 2 + ...s_deploy_evm_signer_registry_unit_test.go} | 2 + .../cs_deploy_chain_unit_test.go | 2 + .../cs_solana_token_unit_test.go | 2 + .../changeset/solana_v0_1_1/testutils_test.go | 4 + ...er_ccip_to_mcms_with_timelock_unit_test.go | 2 + ...test.go => cs_add_token_e2e_integ_test.go} | 4 + .../cs_configure_token_pools_integ_test.go | 464 ++++++++++++++++++ ... => cs_configure_token_pools_unit_test.go} | 362 +------------- 13 files changed, 492 insertions(+), 360 deletions(-) rename deployment/ccip/changeset/aptos/{cs_add_token_pool_test.go => cs_add_token_pool_integ_test.go} (99%) rename deployment/ccip/changeset/aptos/{cs_deploy_aptos_chain_test.go => cs_deploy_aptos_chain_integ_test.go} (99%) rename deployment/ccip/changeset/aptos/{cs_set_ocr3_offramp_test.go => cs_set_ocr3_offramp_integ_test.go} (98%) rename deployment/ccip/changeset/aptos/{cs_update_aptos_lanes_test.go => cs_update_aptos_lanes_integ_test.go} (99%) rename deployment/ccip/changeset/ccip-attestation/{cs_configure_evm_signer_registry_test.go => cs_configure_evm_signer_registry_unit_test.go} (99%) rename deployment/ccip/changeset/ccip-attestation/{cs_deploy_evm_signer_registry_test.go => cs_deploy_evm_signer_registry_unit_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_add_token_e2e_test.go => cs_add_token_e2e_integ_test.go} (99%) create mode 100644 deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go rename deployment/ccip/changeset/v1_5_1/{cs_configure_token_pools_test.go => cs_configure_token_pools_unit_test.go} (63%) diff --git a/deployment/ccip/changeset/aptos/cs_add_token_pool_test.go b/deployment/ccip/changeset/aptos/cs_add_token_pool_integ_test.go similarity index 99% rename from deployment/ccip/changeset/aptos/cs_add_token_pool_test.go rename to deployment/ccip/changeset/aptos/cs_add_token_pool_integ_test.go index 69465d3c7be..8a2056c2366 100644 --- a/deployment/ccip/changeset/aptos/cs_add_token_pool_test.go +++ b/deployment/ccip/changeset/aptos/cs_add_token_pool_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && aptos + package aptos_test import ( diff --git a/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go b/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_integ_test.go similarity index 99% rename from deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go rename to deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_integ_test.go index 61c78d4556f..5ba94750d78 100644 --- a/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go +++ b/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && aptos + package aptos import ( diff --git a/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go b/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_integ_test.go similarity index 98% rename from deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go rename to deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_integ_test.go index 584a5d29fc9..e9020f5b30e 100644 --- a/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go +++ b/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && aptos + package aptos_test import ( diff --git a/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go b/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_integ_test.go similarity index 99% rename from deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go rename to deployment/ccip/changeset/aptos/cs_update_aptos_lanes_integ_test.go index 51b18d37a7d..ace5382820e 100644 --- a/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go +++ b/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && aptos + package aptos_test import ( diff --git a/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry_test.go b/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry_unit_test.go similarity index 99% rename from deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry_test.go rename to deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry_unit_test.go index c90b15fd136..76a23f308f4 100644 --- a/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry_test.go +++ b/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package ccip_attestation_test import ( diff --git a/deployment/ccip/changeset/ccip-attestation/cs_deploy_evm_signer_registry_test.go b/deployment/ccip/changeset/ccip-attestation/cs_deploy_evm_signer_registry_unit_test.go similarity index 99% rename from deployment/ccip/changeset/ccip-attestation/cs_deploy_evm_signer_registry_test.go rename to deployment/ccip/changeset/ccip-attestation/cs_deploy_evm_signer_registry_unit_test.go index 81e584f9966..9a9022cd105 100644 --- a/deployment/ccip/changeset/ccip-attestation/cs_deploy_evm_signer_registry_test.go +++ b/deployment/ccip/changeset/ccip-attestation/cs_deploy_evm_signer_registry_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package ccip_attestation_test import ( diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go index c0de87d38f2..cea2775d3dc 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package solana_test import ( diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_unit_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_unit_test.go index 015eda8fd86..43b9721da89 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_unit_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package solana_test import ( diff --git a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go index bff85aa5a3f..61f93041a62 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go @@ -1,3 +1,5 @@ +//go:build integration && solana + package solana_test import ( @@ -6,6 +8,8 @@ import ( ) func skipInCI(t *testing.T) { + t.Helper() + ci := os.Getenv("CI") == "true" if ci { t.Skip("Skipping in CI") diff --git a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_unit_test.go b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_unit_test.go index 5603806dfc4..d8099303afb 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_unit_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package solana_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go b/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go rename to deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_integ_test.go index 125ebea433d..60063d62847 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_integ_test.go @@ -1,3 +1,7 @@ +//go:build integration && !solana && !aptos + +// maybe? + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go new file mode 100644 index 00000000000..bed9f519e0b --- /dev/null +++ b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go @@ -0,0 +1,464 @@ +//go:build integration && solana + +package v1_5_1_test + +import ( + "bytes" + "math/big" + "slices" + "sort" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/gagliardetto/solana-go" + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/quarantine" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" + "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/burn_mint_erc677" + + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + + "github.com/smartcontractkit/chainlink/deployment" + changeset_solana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5_1" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" + + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" +) + +// createSymmetricRateLimits is a utility to quickly create a rate limiter config with equal inbound and outbound values. +func createSymmetricRateLimits(rate int64, capacity int64) v1_5_1.RateLimiterConfig { + return v1_5_1.RateLimiterConfig{ + Inbound: token_pool.RateLimiterConfig{ + IsEnabled: rate != 0 || capacity != 0, + Rate: big.NewInt(rate), + Capacity: big.NewInt(capacity), + }, + Outbound: token_pool.RateLimiterConfig{ + IsEnabled: rate != 0 || capacity != 0, + Rate: big.NewInt(rate), + Capacity: big.NewInt(capacity), + }, + } +} + +// validateMemberOfTokenPoolPair performs checks required to validate that a token pool is fully configured for cross-chain transfer. +func validateMemberOfTokenPoolPair( + t *testing.T, + state stateview.CCIPOnChainState, + tokenPool *token_pool.TokenPool, + expectedRemotePools []common.Address, + tokens map[uint64]*cldf.ContractDeploy[*burn_mint_erc677.BurnMintERC677], + tokenSymbol shared.TokenSymbol, + chainSelector uint64, + rate *big.Int, + capacity *big.Int, + expectedOwner common.Address, +) { + // Verify that the owner is expected + owner, err := tokenPool.Owner(nil) + require.NoError(t, err) + require.Equal(t, expectedOwner, owner) + + // Fetch the supported remote chains + supportedChains, err := tokenPool.GetSupportedChains(nil) + require.NoError(t, err) + + // Verify that the rate limits and remote addresses are correct + for _, supportedChain := range supportedChains { + inboundConfig, err := tokenPool.GetCurrentInboundRateLimiterState(nil, supportedChain) + require.NoError(t, err) + require.True(t, inboundConfig.IsEnabled) + require.Equal(t, capacity, inboundConfig.Capacity) + require.Equal(t, rate, inboundConfig.Rate) + + outboundConfig, err := tokenPool.GetCurrentOutboundRateLimiterState(nil, supportedChain) + require.NoError(t, err) + require.True(t, outboundConfig.IsEnabled) + require.Equal(t, capacity, outboundConfig.Capacity) + require.Equal(t, rate, outboundConfig.Rate) + + remoteTokenAddress, err := tokenPool.GetRemoteToken(nil, supportedChain) + require.NoError(t, err) + require.Equal(t, common.LeftPadBytes(tokens[supportedChain].Address.Bytes(), 32), remoteTokenAddress) + + remotePoolAddresses, err := tokenPool.GetRemotePools(nil, supportedChain) + require.NoError(t, err) + + require.Len(t, remotePoolAddresses, len(expectedRemotePools)) + expectedRemotePoolAddressesBytes := make([][]byte, len(expectedRemotePools)) + for i, remotePool := range expectedRemotePools { + expectedRemotePoolAddressesBytes[i] = common.LeftPadBytes(remotePool.Bytes(), 32) + } + sort.Slice(expectedRemotePoolAddressesBytes, func(i, j int) bool { + return bytes.Compare(expectedRemotePoolAddressesBytes[i], expectedRemotePoolAddressesBytes[j]) < 0 + }) + sort.Slice(remotePoolAddresses, func(i, j int) bool { + return bytes.Compare(remotePoolAddresses[i], remotePoolAddresses[j]) < 0 + }) + for i := range expectedRemotePoolAddressesBytes { + require.Equal(t, expectedRemotePoolAddressesBytes[i], remotePoolAddresses[i]) + } + } +} + +func validateSolanaConfig(t *testing.T, state stateview.CCIPOnChainState, solChainUpdates map[uint64]v1_5_1.SolChainUpdate, selector uint64, solanaSelector uint64) { + tokenPool := state.Chains[selector].BurnMintTokenPools[testhelpers.TestTokenSymbol][deployment.Version1_5_1] + isSupported, err := tokenPool.IsSupportedChain(nil, solanaSelector) + require.NoError(t, err) + require.True(t, isSupported) + + remoteToken, remoteTokenPool, err := solChainUpdates[solanaSelector].GetSolanaTokenAndTokenPool(state.SolChains[solanaSelector]) + require.NoError(t, err) + remoteTokenAddress, err := tokenPool.GetRemoteToken(nil, solanaSelector) + require.NoError(t, err) + require.Equal(t, remoteToken.Bytes(), remoteTokenAddress) + remotePoolAddresses, err := tokenPool.GetRemotePools(nil, solanaSelector) + require.NoError(t, err) + require.Len(t, remotePoolAddresses, 1) + require.Equal(t, remoteTokenPool.Bytes(), remotePoolAddresses[0]) + + inboundRateLimiterConfig, err := tokenPool.GetCurrentInboundRateLimiterState(nil, solanaSelector) + require.NoError(t, err) + require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Inbound.Rate.Int64(), inboundRateLimiterConfig.Rate.Int64()) + require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Inbound.Capacity.Int64(), inboundRateLimiterConfig.Capacity.Int64()) + require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Inbound.IsEnabled, inboundRateLimiterConfig.IsEnabled) + + outboundRateLimiterConfig, err := tokenPool.GetCurrentOutboundRateLimiterState(nil, solanaSelector) + require.NoError(t, err) + require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Outbound.Rate.Int64(), outboundRateLimiterConfig.Rate.Int64()) + require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Outbound.Capacity.Int64(), outboundRateLimiterConfig.Capacity.Int64()) + require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Outbound.IsEnabled, outboundRateLimiterConfig.IsEnabled) +} + +func TestValidateConfigureTokenPoolContractsForSolana(t *testing.T) { + quarantine.Flaky(t, "DX-1726") + t.Parallel() + var err error + + deployedEnvironment, _ := testhelpers.NewMemoryEnvironment(t, func(testCfg *testhelpers.TestConfigs) { + testCfg.Chains = 2 + testCfg.SolChains = 1 + }) + e := deployedEnvironment.Env + + evmSelectors := []uint64{e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))[0]} + solanaSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana)) + + addressBook := cldf.NewMemoryAddressBook() + + /////////////////////////// + // DEPLOY EVM TOKEN POOL // + /////////////////////////// + for _, selector := range evmSelectors { + token, err := cldf.DeployContract(e.Logger, e.BlockChains.EVMChains()[selector], addressBook, + func(chain cldf_evm.Chain) cldf.ContractDeploy[*burn_mint_erc677.BurnMintERC677] { + tokenAddress, tx, token, err := burn_mint_erc677.DeployBurnMintERC677( + e.BlockChains.EVMChains()[selector].DeployerKey, + e.BlockChains.EVMChains()[selector].Client, + string(testhelpers.TestTokenSymbol), + string(testhelpers.TestTokenSymbol), + testhelpers.LocalTokenDecimals, + big.NewInt(0).Mul(big.NewInt(1e9), big.NewInt(1e18)), + ) + return cldf.ContractDeploy[*burn_mint_erc677.BurnMintERC677]{ + Address: tokenAddress, + Contract: token, + Tv: cldf.NewTypeAndVersion(shared.BurnMintToken, deployment.Version1_0_0), + Tx: tx, + Err: err, + } + }, + ) + require.NoError(t, err) + e = testhelpers.DeployTestTokenPools(t, e, map[uint64]v1_5_1.DeployTokenPoolInput{ + selector: { + Type: shared.BurnMintTokenPool, + TokenAddress: token.Address, + LocalTokenDecimals: testhelpers.LocalTokenDecimals, + }, + }, false) + } + + ////////////////////////////// + // DEPLOY SOLANA TOKEN POOL // + ////////////////////////////// + for _, selector := range solanaSelectors { + e, err = commonchangeset.Apply(t, e, + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(changeset_solana.DeploySolanaToken), + changeset_solana.DeploySolanaTokenConfig{ + ChainSelector: selector, + TokenProgramName: shared.SPL2022Tokens, + TokenDecimals: testhelpers.LocalTokenDecimals, + TokenSymbol: string(testhelpers.TestTokenSymbol), + }, + ), + ) + require.NoError(t, err) + state, err := stateview.LoadOnchainState(e) + require.NoError(t, err) + tokenAddress := state.SolChains[selector].SPL2022Tokens[0] + e, _, err = commonchangeset.ApplyChangesets(t, e, []commonchangeset.ConfiguredChangeSet{ + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(changeset_solana.InitGlobalConfigTokenPoolProgram), + changeset_solana.TokenPoolConfigWithMCM{ + ChainSelector: selector, + TokenPoolConfigs: []changeset_solana.TokenPoolConfig{ + { + TokenPubKey: tokenAddress, + PoolType: shared.BurnMintTokenPool, + Metadata: shared.CLLMetadata, + }, + }, + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(changeset_solana.AddTokenPoolAndLookupTable), + changeset_solana.AddTokenPoolAndLookupTableConfig{ + ChainSelector: selector, + TokenPoolConfigs: []changeset_solana.TokenPoolConfig{ + { + TokenPubKey: tokenAddress, + PoolType: shared.BurnMintTokenPool, + Metadata: shared.CLLMetadata, + }, + }, + }, + ), + }) + require.NoError(t, err) + } + + state, err := stateview.LoadOnchainState(e) + require.NoError(t, err) + + ///////////////////////////// + // ADD SOLANA CHAIN CONFIG // + ///////////////////////////// + for _, selector := range evmSelectors { + solChainUpdates := make(map[uint64]v1_5_1.SolChainUpdate) + for _, remoteSelector := range solanaSelectors { + solChainUpdates[remoteSelector] = v1_5_1.SolChainUpdate{ + Type: shared.BurnMintTokenPool, + TokenAddress: state.SolChains[remoteSelector].SPL2022Tokens[0].String(), + RateLimiterConfig: testhelpers.CreateSymmetricRateLimits(0, 0), + Metadata: shared.CLLMetadata, + } + } + e, err = commonchangeset.Apply(t, e, + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(v1_5_1.ConfigureTokenPoolContractsChangeset), + v1_5_1.ConfigureTokenPoolContractsConfig{ + TokenSymbol: testhelpers.TestTokenSymbol, + PoolUpdates: map[uint64]v1_5_1.TokenPoolConfig{ + selector: { + Type: shared.BurnMintTokenPool, + Version: deployment.Version1_5_1, + SolChainUpdates: solChainUpdates, + }, + }, + }, + ), + ) + require.NoError(t, err) + + for _, remoteSelector := range solanaSelectors { + validateSolanaConfig(t, state, solChainUpdates, selector, remoteSelector) + } + } + + //////////////////////////////// + // UPDATE SOLANA CHAIN CONFIG // + //////////////////////////////// + for _, selector := range evmSelectors { + solChainUpdates := make(map[uint64]v1_5_1.SolChainUpdate) + for _, remoteSelector := range solanaSelectors { + solChainUpdates[remoteSelector] = v1_5_1.SolChainUpdate{ + Type: shared.BurnMintTokenPool, + TokenAddress: state.SolChains[remoteSelector].SPL2022Tokens[0].String(), + RateLimiterConfig: testhelpers.CreateSymmetricRateLimits(100, 1000), + Metadata: shared.CLLMetadata, + } + } + e.BlockChains.EVMChains()[selector].DeployerKey.GasLimit = 1_000_000 // Hack: Increase gas limit to avoid out of gas error (could this be a cause for test flakiness?) + e, err = commonchangeset.Apply(t, e, + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(v1_5_1.ConfigureTokenPoolContractsChangeset), + v1_5_1.ConfigureTokenPoolContractsConfig{ + TokenSymbol: testhelpers.TestTokenSymbol, + PoolUpdates: map[uint64]v1_5_1.TokenPoolConfig{ + selector: { + Type: shared.BurnMintTokenPool, + Version: deployment.Version1_5_1, + SolChainUpdates: solChainUpdates, + }, + }, + }, + ), + ) + require.NoError(t, err) + + for _, remoteSelector := range solanaSelectors { + validateSolanaConfig(t, state, solChainUpdates, selector, remoteSelector) + } + } + + /////////////////////////// + // REDEPLOY SOLANA TOKEN // + /////////////////////////// + remoteTokenAddresses := make(map[uint64]solana.PublicKey, len(solanaSelectors)) + for _, selector := range solanaSelectors { + tokensBefore := state.SolChains[selector].SPL2022Tokens + e, err = commonchangeset.Apply(t, e, + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(changeset_solana.DeploySolanaToken), + changeset_solana.DeploySolanaTokenConfig{ + ChainSelector: selector, + TokenProgramName: shared.SPL2022Tokens, + TokenDecimals: testhelpers.LocalTokenDecimals, + TokenSymbol: string(testhelpers.TestTokenSymbol), + }, + ), + ) + require.NoError(t, err) + onchainState, err := stateview.LoadOnchainState(e) + require.NoError(t, err) + for _, tokenAddress := range onchainState.SolChains[selector].SPL2022Tokens { + if slices.Contains(tokensBefore, tokenAddress) { + continue + } + e, _, err = commonchangeset.ApplyChangesets(t, e, []commonchangeset.ConfiguredChangeSet{ + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(changeset_solana.AddTokenPoolAndLookupTable), + changeset_solana.AddTokenPoolAndLookupTableConfig{ + ChainSelector: selector, + TokenPoolConfigs: []changeset_solana.TokenPoolConfig{ + { + TokenPubKey: tokenAddress, + PoolType: shared.BurnMintTokenPool, + Metadata: shared.CLLMetadata, + }, + }, + }, + ), + }) + require.NoError(t, err) + remoteTokenAddresses[selector] = tokenAddress + } + } + + //////////////////////////////////////////////////////////// + // REMOVE & ADD SOLANA CHAIN CONFIG (due to token change) // + //////////////////////////////////////////////////////////// + for _, selector := range evmSelectors { + solChainUpdates := make(map[uint64]v1_5_1.SolChainUpdate) + for remoteSelector, remoteTokenAddress := range remoteTokenAddresses { + solChainUpdates[remoteSelector] = v1_5_1.SolChainUpdate{ + Type: shared.BurnMintTokenPool, + TokenAddress: remoteTokenAddress.String(), + RateLimiterConfig: testhelpers.CreateSymmetricRateLimits(0, 0), + Metadata: shared.CLLMetadata, + } + } + e, err = commonchangeset.Apply(t, e, + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(v1_5_1.ConfigureTokenPoolContractsChangeset), + v1_5_1.ConfigureTokenPoolContractsConfig{ + TokenSymbol: testhelpers.TestTokenSymbol, + PoolUpdates: map[uint64]v1_5_1.TokenPoolConfig{ + selector: { + Type: shared.BurnMintTokenPool, + Version: deployment.Version1_5_1, + SolChainUpdates: solChainUpdates, + }, + }, + }, + ), + ) + require.NoError(t, err) + + for _, remoteSelector := range solanaSelectors { + validateSolanaConfig(t, state, solChainUpdates, selector, remoteSelector) + } + } + + ////////////////////////////////// + // DEPLOY NEW SOLANA TOKEN POOL // + ////////////////////////////////// + require.NoError(t, err) + for _, selector := range solanaSelectors { + for _, tokenAddress := range remoteTokenAddresses { + e, _, err = commonchangeset.ApplyChangesets(t, e, []commonchangeset.ConfiguredChangeSet{ + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(changeset_solana.InitGlobalConfigTokenPoolProgram), + changeset_solana.TokenPoolConfigWithMCM{ + ChainSelector: selector, + TokenPoolConfigs: []changeset_solana.TokenPoolConfig{ + { + TokenPubKey: tokenAddress, + PoolType: shared.LockReleaseTokenPool, + Metadata: shared.CLLMetadata, + }, + }, + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(changeset_solana.AddTokenPoolAndLookupTable), + changeset_solana.AddTokenPoolAndLookupTableConfig{ + ChainSelector: selector, + TokenPoolConfigs: []changeset_solana.TokenPoolConfig{ + { + TokenPubKey: tokenAddress, + PoolType: shared.LockReleaseTokenPool, + Metadata: shared.CLLMetadata, + }, + }, + }, + ), + }) + require.NoError(t, err) + } + } + + ///////////////////////////////////////////////////////////////// + // REMOVE & ADD SOLANA CHAIN CONFIG (due to token pool change) // + ///////////////////////////////////////////////////////////////// + for _, selector := range evmSelectors { + solChainUpdates := make(map[uint64]v1_5_1.SolChainUpdate) + for remoteSelector, remoteTokenAddress := range remoteTokenAddresses { + solChainUpdates[remoteSelector] = v1_5_1.SolChainUpdate{ + Type: shared.LockReleaseTokenPool, + TokenAddress: remoteTokenAddress.String(), + RateLimiterConfig: testhelpers.CreateSymmetricRateLimits(0, 0), + Metadata: shared.CLLMetadata, + } + } + e, err = commonchangeset.Apply(t, e, + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(v1_5_1.ConfigureTokenPoolContractsChangeset), + v1_5_1.ConfigureTokenPoolContractsConfig{ + TokenSymbol: testhelpers.TestTokenSymbol, + PoolUpdates: map[uint64]v1_5_1.TokenPoolConfig{ + selector: { + Type: shared.BurnMintTokenPool, + Version: deployment.Version1_5_1, + SolChainUpdates: solChainUpdates, + }, + }, + }, + ), + ) + require.NoError(t, err) + + for _, remoteSelector := range solanaSelectors { + validateSolanaConfig(t, state, solChainUpdates, selector, remoteSelector) + } + } +} diff --git a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_unit_test.go similarity index 63% rename from deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go rename to deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_unit_test.go index 6c49b7f6313..476b57e092f 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_unit_test.go @@ -1,17 +1,16 @@ +//go:build !integration + package v1_5_1_test import ( "bytes" "math/big" - "slices" "sort" "testing" "time" "github.com/ethereum/go-ethereum/common" - "github.com/gagliardetto/solana-go" chain_selectors "github.com/smartcontractkit/chain-selectors" - "github.com/smartcontractkit/quarantine" "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" @@ -19,12 +18,10 @@ import ( "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/burn_mint_erc677" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" - cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" "github.com/smartcontractkit/chainlink/deployment" - changeset_solana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5_1" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" @@ -110,35 +107,6 @@ func validateMemberOfTokenPoolPair( } } -func validateSolanaConfig(t *testing.T, state stateview.CCIPOnChainState, solChainUpdates map[uint64]v1_5_1.SolChainUpdate, selector uint64, solanaSelector uint64) { - tokenPool := state.Chains[selector].BurnMintTokenPools[testhelpers.TestTokenSymbol][deployment.Version1_5_1] - isSupported, err := tokenPool.IsSupportedChain(nil, solanaSelector) - require.NoError(t, err) - require.True(t, isSupported) - - remoteToken, remoteTokenPool, err := solChainUpdates[solanaSelector].GetSolanaTokenAndTokenPool(state.SolChains[solanaSelector]) - require.NoError(t, err) - remoteTokenAddress, err := tokenPool.GetRemoteToken(nil, solanaSelector) - require.NoError(t, err) - require.Equal(t, remoteToken.Bytes(), remoteTokenAddress) - remotePoolAddresses, err := tokenPool.GetRemotePools(nil, solanaSelector) - require.NoError(t, err) - require.Len(t, remotePoolAddresses, 1) - require.Equal(t, remoteTokenPool.Bytes(), remotePoolAddresses[0]) - - inboundRateLimiterConfig, err := tokenPool.GetCurrentInboundRateLimiterState(nil, solanaSelector) - require.NoError(t, err) - require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Inbound.Rate.Int64(), inboundRateLimiterConfig.Rate.Int64()) - require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Inbound.Capacity.Int64(), inboundRateLimiterConfig.Capacity.Int64()) - require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Inbound.IsEnabled, inboundRateLimiterConfig.IsEnabled) - - outboundRateLimiterConfig, err := tokenPool.GetCurrentOutboundRateLimiterState(nil, solanaSelector) - require.NoError(t, err) - require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Outbound.Rate.Int64(), outboundRateLimiterConfig.Rate.Int64()) - require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Outbound.Capacity.Int64(), outboundRateLimiterConfig.Capacity.Int64()) - require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Outbound.IsEnabled, outboundRateLimiterConfig.IsEnabled) -} - func TestValidateRemoteChains(t *testing.T) { t.Parallel() @@ -718,329 +686,3 @@ func TestValidateConfigureTokenPoolContracts(t *testing.T) { } } } - -func TestValidateConfigureTokenPoolContractsForSolana(t *testing.T) { - quarantine.Flaky(t, "DX-1726") - t.Parallel() - var err error - - deployedEnvironment, _ := testhelpers.NewMemoryEnvironment(t, func(testCfg *testhelpers.TestConfigs) { - testCfg.Chains = 2 - testCfg.SolChains = 1 - }) - e := deployedEnvironment.Env - - evmSelectors := []uint64{e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))[0]} - solanaSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana)) - - addressBook := cldf.NewMemoryAddressBook() - - /////////////////////////// - // DEPLOY EVM TOKEN POOL // - /////////////////////////// - for _, selector := range evmSelectors { - token, err := cldf.DeployContract(e.Logger, e.BlockChains.EVMChains()[selector], addressBook, - func(chain cldf_evm.Chain) cldf.ContractDeploy[*burn_mint_erc677.BurnMintERC677] { - tokenAddress, tx, token, err := burn_mint_erc677.DeployBurnMintERC677( - e.BlockChains.EVMChains()[selector].DeployerKey, - e.BlockChains.EVMChains()[selector].Client, - string(testhelpers.TestTokenSymbol), - string(testhelpers.TestTokenSymbol), - testhelpers.LocalTokenDecimals, - big.NewInt(0).Mul(big.NewInt(1e9), big.NewInt(1e18)), - ) - return cldf.ContractDeploy[*burn_mint_erc677.BurnMintERC677]{ - Address: tokenAddress, - Contract: token, - Tv: cldf.NewTypeAndVersion(shared.BurnMintToken, deployment.Version1_0_0), - Tx: tx, - Err: err, - } - }, - ) - require.NoError(t, err) - e = testhelpers.DeployTestTokenPools(t, e, map[uint64]v1_5_1.DeployTokenPoolInput{ - selector: { - Type: shared.BurnMintTokenPool, - TokenAddress: token.Address, - LocalTokenDecimals: testhelpers.LocalTokenDecimals, - }, - }, false) - } - - ////////////////////////////// - // DEPLOY SOLANA TOKEN POOL // - ////////////////////////////// - for _, selector := range solanaSelectors { - e, err = commonchangeset.Apply(t, e, - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(changeset_solana.DeploySolanaToken), - changeset_solana.DeploySolanaTokenConfig{ - ChainSelector: selector, - TokenProgramName: shared.SPL2022Tokens, - TokenDecimals: testhelpers.LocalTokenDecimals, - TokenSymbol: string(testhelpers.TestTokenSymbol), - }, - ), - ) - require.NoError(t, err) - state, err := stateview.LoadOnchainState(e) - require.NoError(t, err) - tokenAddress := state.SolChains[selector].SPL2022Tokens[0] - e, _, err = commonchangeset.ApplyChangesets(t, e, []commonchangeset.ConfiguredChangeSet{ - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(changeset_solana.InitGlobalConfigTokenPoolProgram), - changeset_solana.TokenPoolConfigWithMCM{ - ChainSelector: selector, - TokenPoolConfigs: []changeset_solana.TokenPoolConfig{ - { - TokenPubKey: tokenAddress, - PoolType: shared.BurnMintTokenPool, - Metadata: shared.CLLMetadata, - }, - }, - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(changeset_solana.AddTokenPoolAndLookupTable), - changeset_solana.AddTokenPoolAndLookupTableConfig{ - ChainSelector: selector, - TokenPoolConfigs: []changeset_solana.TokenPoolConfig{ - { - TokenPubKey: tokenAddress, - PoolType: shared.BurnMintTokenPool, - Metadata: shared.CLLMetadata, - }, - }, - }, - ), - }) - require.NoError(t, err) - } - - state, err := stateview.LoadOnchainState(e) - require.NoError(t, err) - - ///////////////////////////// - // ADD SOLANA CHAIN CONFIG // - ///////////////////////////// - for _, selector := range evmSelectors { - solChainUpdates := make(map[uint64]v1_5_1.SolChainUpdate) - for _, remoteSelector := range solanaSelectors { - solChainUpdates[remoteSelector] = v1_5_1.SolChainUpdate{ - Type: shared.BurnMintTokenPool, - TokenAddress: state.SolChains[remoteSelector].SPL2022Tokens[0].String(), - RateLimiterConfig: testhelpers.CreateSymmetricRateLimits(0, 0), - Metadata: shared.CLLMetadata, - } - } - e, err = commonchangeset.Apply(t, e, - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(v1_5_1.ConfigureTokenPoolContractsChangeset), - v1_5_1.ConfigureTokenPoolContractsConfig{ - TokenSymbol: testhelpers.TestTokenSymbol, - PoolUpdates: map[uint64]v1_5_1.TokenPoolConfig{ - selector: { - Type: shared.BurnMintTokenPool, - Version: deployment.Version1_5_1, - SolChainUpdates: solChainUpdates, - }, - }, - }, - ), - ) - require.NoError(t, err) - - for _, remoteSelector := range solanaSelectors { - validateSolanaConfig(t, state, solChainUpdates, selector, remoteSelector) - } - } - - //////////////////////////////// - // UPDATE SOLANA CHAIN CONFIG // - //////////////////////////////// - for _, selector := range evmSelectors { - solChainUpdates := make(map[uint64]v1_5_1.SolChainUpdate) - for _, remoteSelector := range solanaSelectors { - solChainUpdates[remoteSelector] = v1_5_1.SolChainUpdate{ - Type: shared.BurnMintTokenPool, - TokenAddress: state.SolChains[remoteSelector].SPL2022Tokens[0].String(), - RateLimiterConfig: testhelpers.CreateSymmetricRateLimits(100, 1000), - Metadata: shared.CLLMetadata, - } - } - e.BlockChains.EVMChains()[selector].DeployerKey.GasLimit = 1_000_000 // Hack: Increase gas limit to avoid out of gas error (could this be a cause for test flakiness?) - e, err = commonchangeset.Apply(t, e, - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(v1_5_1.ConfigureTokenPoolContractsChangeset), - v1_5_1.ConfigureTokenPoolContractsConfig{ - TokenSymbol: testhelpers.TestTokenSymbol, - PoolUpdates: map[uint64]v1_5_1.TokenPoolConfig{ - selector: { - Type: shared.BurnMintTokenPool, - Version: deployment.Version1_5_1, - SolChainUpdates: solChainUpdates, - }, - }, - }, - ), - ) - require.NoError(t, err) - - for _, remoteSelector := range solanaSelectors { - validateSolanaConfig(t, state, solChainUpdates, selector, remoteSelector) - } - } - - /////////////////////////// - // REDEPLOY SOLANA TOKEN // - /////////////////////////// - remoteTokenAddresses := make(map[uint64]solana.PublicKey, len(solanaSelectors)) - for _, selector := range solanaSelectors { - tokensBefore := state.SolChains[selector].SPL2022Tokens - e, err = commonchangeset.Apply(t, e, - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(changeset_solana.DeploySolanaToken), - changeset_solana.DeploySolanaTokenConfig{ - ChainSelector: selector, - TokenProgramName: shared.SPL2022Tokens, - TokenDecimals: testhelpers.LocalTokenDecimals, - TokenSymbol: string(testhelpers.TestTokenSymbol), - }, - ), - ) - require.NoError(t, err) - onchainState, err := stateview.LoadOnchainState(e) - require.NoError(t, err) - for _, tokenAddress := range onchainState.SolChains[selector].SPL2022Tokens { - if slices.Contains(tokensBefore, tokenAddress) { - continue - } - e, _, err = commonchangeset.ApplyChangesets(t, e, []commonchangeset.ConfiguredChangeSet{ - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(changeset_solana.AddTokenPoolAndLookupTable), - changeset_solana.AddTokenPoolAndLookupTableConfig{ - ChainSelector: selector, - TokenPoolConfigs: []changeset_solana.TokenPoolConfig{ - { - TokenPubKey: tokenAddress, - PoolType: shared.BurnMintTokenPool, - Metadata: shared.CLLMetadata, - }, - }, - }, - ), - }) - require.NoError(t, err) - remoteTokenAddresses[selector] = tokenAddress - } - } - - //////////////////////////////////////////////////////////// - // REMOVE & ADD SOLANA CHAIN CONFIG (due to token change) // - //////////////////////////////////////////////////////////// - for _, selector := range evmSelectors { - solChainUpdates := make(map[uint64]v1_5_1.SolChainUpdate) - for remoteSelector, remoteTokenAddress := range remoteTokenAddresses { - solChainUpdates[remoteSelector] = v1_5_1.SolChainUpdate{ - Type: shared.BurnMintTokenPool, - TokenAddress: remoteTokenAddress.String(), - RateLimiterConfig: testhelpers.CreateSymmetricRateLimits(0, 0), - Metadata: shared.CLLMetadata, - } - } - e, err = commonchangeset.Apply(t, e, - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(v1_5_1.ConfigureTokenPoolContractsChangeset), - v1_5_1.ConfigureTokenPoolContractsConfig{ - TokenSymbol: testhelpers.TestTokenSymbol, - PoolUpdates: map[uint64]v1_5_1.TokenPoolConfig{ - selector: { - Type: shared.BurnMintTokenPool, - Version: deployment.Version1_5_1, - SolChainUpdates: solChainUpdates, - }, - }, - }, - ), - ) - require.NoError(t, err) - - for _, remoteSelector := range solanaSelectors { - validateSolanaConfig(t, state, solChainUpdates, selector, remoteSelector) - } - } - - ////////////////////////////////// - // DEPLOY NEW SOLANA TOKEN POOL // - ////////////////////////////////// - require.NoError(t, err) - for _, selector := range solanaSelectors { - for _, tokenAddress := range remoteTokenAddresses { - e, _, err = commonchangeset.ApplyChangesets(t, e, []commonchangeset.ConfiguredChangeSet{ - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(changeset_solana.InitGlobalConfigTokenPoolProgram), - changeset_solana.TokenPoolConfigWithMCM{ - ChainSelector: selector, - TokenPoolConfigs: []changeset_solana.TokenPoolConfig{ - { - TokenPubKey: tokenAddress, - PoolType: shared.LockReleaseTokenPool, - Metadata: shared.CLLMetadata, - }, - }, - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(changeset_solana.AddTokenPoolAndLookupTable), - changeset_solana.AddTokenPoolAndLookupTableConfig{ - ChainSelector: selector, - TokenPoolConfigs: []changeset_solana.TokenPoolConfig{ - { - TokenPubKey: tokenAddress, - PoolType: shared.LockReleaseTokenPool, - Metadata: shared.CLLMetadata, - }, - }, - }, - ), - }) - require.NoError(t, err) - } - } - - ///////////////////////////////////////////////////////////////// - // REMOVE & ADD SOLANA CHAIN CONFIG (due to token pool change) // - ///////////////////////////////////////////////////////////////// - for _, selector := range evmSelectors { - solChainUpdates := make(map[uint64]v1_5_1.SolChainUpdate) - for remoteSelector, remoteTokenAddress := range remoteTokenAddresses { - solChainUpdates[remoteSelector] = v1_5_1.SolChainUpdate{ - Type: shared.LockReleaseTokenPool, - TokenAddress: remoteTokenAddress.String(), - RateLimiterConfig: testhelpers.CreateSymmetricRateLimits(0, 0), - Metadata: shared.CLLMetadata, - } - } - e, err = commonchangeset.Apply(t, e, - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(v1_5_1.ConfigureTokenPoolContractsChangeset), - v1_5_1.ConfigureTokenPoolContractsConfig{ - TokenSymbol: testhelpers.TestTokenSymbol, - PoolUpdates: map[uint64]v1_5_1.TokenPoolConfig{ - selector: { - Type: shared.BurnMintTokenPool, - Version: deployment.Version1_5_1, - SolChainUpdates: solChainUpdates, - }, - }, - }, - ), - ) - require.NoError(t, err) - - for _, remoteSelector := range solanaSelectors { - validateSolanaConfig(t, state, solChainUpdates, selector, remoteSelector) - } - } -} From f006fd252eaa9c2c54dddb8810bb202d38292a22 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 14:18:46 -0800 Subject: [PATCH 09/22] fix: shared helpers --- .../cs_configure_token_pools_integ_test.go | 16 --- .../cs_configure_token_pools_unit_test.go | 115 +++--------------- .../ccip/changeset/v1_5_1/testutils_test.go | 76 ++++++++++++ 3 files changed, 94 insertions(+), 113 deletions(-) create mode 100644 deployment/ccip/changeset/v1_5_1/testutils_test.go diff --git a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go index bed9f519e0b..4e975ae35dd 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go @@ -32,22 +32,6 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) -// createSymmetricRateLimits is a utility to quickly create a rate limiter config with equal inbound and outbound values. -func createSymmetricRateLimits(rate int64, capacity int64) v1_5_1.RateLimiterConfig { - return v1_5_1.RateLimiterConfig{ - Inbound: token_pool.RateLimiterConfig{ - IsEnabled: rate != 0 || capacity != 0, - Rate: big.NewInt(rate), - Capacity: big.NewInt(capacity), - }, - Outbound: token_pool.RateLimiterConfig{ - IsEnabled: rate != 0 || capacity != 0, - Rate: big.NewInt(rate), - Capacity: big.NewInt(capacity), - }, - } -} - // validateMemberOfTokenPoolPair performs checks required to validate that a token pool is fully configured for cross-chain transfer. func validateMemberOfTokenPoolPair( t *testing.T, diff --git a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_unit_test.go b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_unit_test.go index 476b57e092f..006b545e79b 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_unit_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_unit_test.go @@ -3,9 +3,7 @@ package v1_5_1_test import ( - "bytes" "math/big" - "sort" "testing" "time" @@ -15,7 +13,6 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/burn_mint_erc677" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" @@ -31,82 +28,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) -// createSymmetricRateLimits is a utility to quickly create a rate limiter config with equal inbound and outbound values. -func createSymmetricRateLimits(rate int64, capacity int64) v1_5_1.RateLimiterConfig { - return v1_5_1.RateLimiterConfig{ - Inbound: token_pool.RateLimiterConfig{ - IsEnabled: rate != 0 || capacity != 0, - Rate: big.NewInt(rate), - Capacity: big.NewInt(capacity), - }, - Outbound: token_pool.RateLimiterConfig{ - IsEnabled: rate != 0 || capacity != 0, - Rate: big.NewInt(rate), - Capacity: big.NewInt(capacity), - }, - } -} - -// validateMemberOfTokenPoolPair performs checks required to validate that a token pool is fully configured for cross-chain transfer. -func validateMemberOfTokenPoolPair( - t *testing.T, - state stateview.CCIPOnChainState, - tokenPool *token_pool.TokenPool, - expectedRemotePools []common.Address, - tokens map[uint64]*cldf.ContractDeploy[*burn_mint_erc677.BurnMintERC677], - tokenSymbol shared.TokenSymbol, - chainSelector uint64, - rate *big.Int, - capacity *big.Int, - expectedOwner common.Address, -) { - // Verify that the owner is expected - owner, err := tokenPool.Owner(nil) - require.NoError(t, err) - require.Equal(t, expectedOwner, owner) - - // Fetch the supported remote chains - supportedChains, err := tokenPool.GetSupportedChains(nil) - require.NoError(t, err) - - // Verify that the rate limits and remote addresses are correct - for _, supportedChain := range supportedChains { - inboundConfig, err := tokenPool.GetCurrentInboundRateLimiterState(nil, supportedChain) - require.NoError(t, err) - require.True(t, inboundConfig.IsEnabled) - require.Equal(t, capacity, inboundConfig.Capacity) - require.Equal(t, rate, inboundConfig.Rate) - - outboundConfig, err := tokenPool.GetCurrentOutboundRateLimiterState(nil, supportedChain) - require.NoError(t, err) - require.True(t, outboundConfig.IsEnabled) - require.Equal(t, capacity, outboundConfig.Capacity) - require.Equal(t, rate, outboundConfig.Rate) - - remoteTokenAddress, err := tokenPool.GetRemoteToken(nil, supportedChain) - require.NoError(t, err) - require.Equal(t, common.LeftPadBytes(tokens[supportedChain].Address.Bytes(), 32), remoteTokenAddress) - - remotePoolAddresses, err := tokenPool.GetRemotePools(nil, supportedChain) - require.NoError(t, err) - - require.Len(t, remotePoolAddresses, len(expectedRemotePools)) - expectedRemotePoolAddressesBytes := make([][]byte, len(expectedRemotePools)) - for i, remotePool := range expectedRemotePools { - expectedRemotePoolAddressesBytes[i] = common.LeftPadBytes(remotePool.Bytes(), 32) - } - sort.Slice(expectedRemotePoolAddressesBytes, func(i, j int) bool { - return bytes.Compare(expectedRemotePoolAddressesBytes[i], expectedRemotePoolAddressesBytes[j]) < 0 - }) - sort.Slice(remotePoolAddresses, func(i, j int) bool { - return bytes.Compare(remotePoolAddresses[i], remotePoolAddresses[j]) < 0 - }) - for i := range expectedRemotePoolAddressesBytes { - require.Equal(t, expectedRemotePoolAddressesBytes[i], remotePoolAddresses[i]) - } - } -} - func TestValidateRemoteChains(t *testing.T) { t.Parallel() @@ -344,60 +265,60 @@ func TestValidateConfigureTokenPoolContracts(t *testing.T) { { Msg: "Configure new pools on registry", RegistrationPass: ®Pass{ - SelectorA2B: createSymmetricRateLimits(100, 1000), - SelectorB2A: createSymmetricRateLimits(100, 1000), + SelectorA2B: testhelpers.CreateSymmetricRateLimits(100, 1000), + SelectorB2A: testhelpers.CreateSymmetricRateLimits(100, 1000), }, }, { Msg: "Configure new pools on registry, update their rate limits", RegistrationPass: ®Pass{ - SelectorA2B: createSymmetricRateLimits(100, 1000), - SelectorB2A: createSymmetricRateLimits(100, 1000), + SelectorA2B: testhelpers.CreateSymmetricRateLimits(100, 1000), + SelectorB2A: testhelpers.CreateSymmetricRateLimits(100, 1000), }, UpdatePass: &updatePass{ UpdatePoolOnA: false, UpdatePoolOnB: false, - SelectorA2B: createSymmetricRateLimits(200, 2000), - SelectorB2A: createSymmetricRateLimits(200, 2000), + SelectorA2B: testhelpers.CreateSymmetricRateLimits(200, 2000), + SelectorB2A: testhelpers.CreateSymmetricRateLimits(200, 2000), }, }, { Msg: "Configure new pools on registry, update both pools", RegistrationPass: ®Pass{ - SelectorA2B: createSymmetricRateLimits(100, 1000), - SelectorB2A: createSymmetricRateLimits(100, 1000), + SelectorA2B: testhelpers.CreateSymmetricRateLimits(100, 1000), + SelectorB2A: testhelpers.CreateSymmetricRateLimits(100, 1000), }, UpdatePass: &updatePass{ UpdatePoolOnA: true, UpdatePoolOnB: true, - SelectorA2B: createSymmetricRateLimits(100, 1000), - SelectorB2A: createSymmetricRateLimits(100, 1000), + SelectorA2B: testhelpers.CreateSymmetricRateLimits(100, 1000), + SelectorB2A: testhelpers.CreateSymmetricRateLimits(100, 1000), }, }, { Msg: "Configure new pools on registry, update only one pool", RegistrationPass: ®Pass{ - SelectorA2B: createSymmetricRateLimits(100, 1000), - SelectorB2A: createSymmetricRateLimits(100, 1000), + SelectorA2B: testhelpers.CreateSymmetricRateLimits(100, 1000), + SelectorB2A: testhelpers.CreateSymmetricRateLimits(100, 1000), }, UpdatePass: &updatePass{ UpdatePoolOnA: false, UpdatePoolOnB: true, - SelectorA2B: createSymmetricRateLimits(200, 2000), - SelectorB2A: createSymmetricRateLimits(200, 2000), + SelectorA2B: testhelpers.CreateSymmetricRateLimits(200, 2000), + SelectorB2A: testhelpers.CreateSymmetricRateLimits(200, 2000), }, }, { Msg: "Configure new pools on registry with multiple token CS", RegistrationPass: ®Pass{ - SelectorA2B: createSymmetricRateLimits(100, 1000), - SelectorB2A: createSymmetricRateLimits(100, 1000), + SelectorA2B: testhelpers.CreateSymmetricRateLimits(100, 1000), + SelectorB2A: testhelpers.CreateSymmetricRateLimits(100, 1000), }, UpdatePass: &updatePass{ UpdatePoolOnA: false, UpdatePoolOnB: true, - SelectorA2B: createSymmetricRateLimits(200, 2000), - SelectorB2A: createSymmetricRateLimits(200, 2000), + SelectorA2B: testhelpers.CreateSymmetricRateLimits(200, 2000), + SelectorB2A: testhelpers.CreateSymmetricRateLimits(200, 2000), }, runWithMultipleTokenCS: true, }, diff --git a/deployment/ccip/changeset/v1_5_1/testutils_test.go b/deployment/ccip/changeset/v1_5_1/testutils_test.go new file mode 100644 index 00000000000..ee06211759c --- /dev/null +++ b/deployment/ccip/changeset/v1_5_1/testutils_test.go @@ -0,0 +1,76 @@ +package v1_5_1_test + +import ( + "bytes" + "math/big" + "sort" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/burn_mint_erc677" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" + "github.com/stretchr/testify/require" +) + +// validateMemberOfTokenPoolPair performs checks required to validate that a token pool is fully configured for cross-chain transfer. +func validateMemberOfTokenPoolPair( + t *testing.T, + state stateview.CCIPOnChainState, + tokenPool *token_pool.TokenPool, + expectedRemotePools []common.Address, + tokens map[uint64]*cldf.ContractDeploy[*burn_mint_erc677.BurnMintERC677], + tokenSymbol shared.TokenSymbol, + chainSelector uint64, + rate *big.Int, + capacity *big.Int, + expectedOwner common.Address, +) { + // Verify that the owner is expected + owner, err := tokenPool.Owner(nil) + require.NoError(t, err) + require.Equal(t, expectedOwner, owner) + + // Fetch the supported remote chains + supportedChains, err := tokenPool.GetSupportedChains(nil) + require.NoError(t, err) + + // Verify that the rate limits and remote addresses are correct + for _, supportedChain := range supportedChains { + inboundConfig, err := tokenPool.GetCurrentInboundRateLimiterState(nil, supportedChain) + require.NoError(t, err) + require.True(t, inboundConfig.IsEnabled) + require.Equal(t, capacity, inboundConfig.Capacity) + require.Equal(t, rate, inboundConfig.Rate) + + outboundConfig, err := tokenPool.GetCurrentOutboundRateLimiterState(nil, supportedChain) + require.NoError(t, err) + require.True(t, outboundConfig.IsEnabled) + require.Equal(t, capacity, outboundConfig.Capacity) + require.Equal(t, rate, outboundConfig.Rate) + + remoteTokenAddress, err := tokenPool.GetRemoteToken(nil, supportedChain) + require.NoError(t, err) + require.Equal(t, common.LeftPadBytes(tokens[supportedChain].Address.Bytes(), 32), remoteTokenAddress) + + remotePoolAddresses, err := tokenPool.GetRemotePools(nil, supportedChain) + require.NoError(t, err) + + require.Len(t, remotePoolAddresses, len(expectedRemotePools)) + expectedRemotePoolAddressesBytes := make([][]byte, len(expectedRemotePools)) + for i, remotePool := range expectedRemotePools { + expectedRemotePoolAddressesBytes[i] = common.LeftPadBytes(remotePool.Bytes(), 32) + } + sort.Slice(expectedRemotePoolAddressesBytes, func(i, j int) bool { + return bytes.Compare(expectedRemotePoolAddressesBytes[i], expectedRemotePoolAddressesBytes[j]) < 0 + }) + sort.Slice(remotePoolAddresses, func(i, j int) bool { + return bytes.Compare(remotePoolAddresses[i], remotePoolAddresses[j]) < 0 + }) + for i := range expectedRemotePoolAddressesBytes { + require.Equal(t, expectedRemotePoolAddressesBytes[i], remotePoolAddresses[i]) + } + } +} From 3dc22a1be9ff8590862e25bcf7ed40e85e0523c0 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 14:19:02 -0800 Subject: [PATCH 10/22] test: list all tags --- .github/workflows/ci-core-integration.yml | 36 ++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-core-integration.yml b/.github/workflows/ci-core-integration.yml index 286a27e100c..8c5b8ef55dd 100644 --- a/.github/workflows/ci-core-integration.yml +++ b/.github/workflows/ci-core-integration.yml @@ -16,7 +16,41 @@ on: jobs: - core: + list-all-tag-combinations: + name: List all tag combinations + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 1 + + - name: List all tags (./core/) + working-directory: ./core + run: | + find . -name '*.go' -print0 \ + | xargs -0 grep -hE '^[[:space:]]*//(go:build|\+build)' 2>/dev/null \ + | sed -E ' + s|^[[:space:]]*//go:build[[:space:]]+||; + s|^[[:space:]]*//\+build[[:space:]]+||; + s/[[:space:]]+$// + ' \ + | sed -E '/^[[:space:]]*$/d' \ + | sort -u + + - name: List all tags (./deployment/) + working-directory: ./deployment + run: | + find . -name '*.go' -print0 \ + | xargs -0 grep -hE '^[[:space:]]*//(go:build|\+build)' 2>/dev/null \ + | sed -E ' + s|^[[:space:]]*//go:build[[:space:]]+||; + s|^[[:space:]]*//\+build[[:space:]]+||; + s/[[:space:]]+$// + ' \ + | sed -E '/^[[:space:]]*$/d' \ + | sort -u + + tagged-tests: env: # We explicitly have this env var not be "CL_DATABASE_URL" to avoid having it be used by core related tests # when they should not be using it, while still allowing us to DRY up the setup From 46c5478deb3aa102b6f4531ab25be743d2e476c9 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 14:27:47 -0800 Subject: [PATCH 11/22] fix --- .../v1_5_1/cs_add_token_e2e_integ_test.go | 4 ++-- tools/bin/go_core_ccip_deployment_tests | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_integ_test.go b/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_integ_test.go index 60063d62847..41c613f337a 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_integ_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_integ_test.go @@ -132,8 +132,8 @@ func TestAddTokenE2E(t *testing.T) { externalAdmin = utils.RandomAddress() } - SelectorA2B := createSymmetricRateLimits(100, 1000) - SelectorB2A := createSymmetricRateLimits(100, 1000) + SelectorA2B := testhelpers.CreateSymmetricRateLimits(100, 1000) + SelectorB2A := testhelpers.CreateSymmetricRateLimits(100, 1000) addTokenE2EConfig := v1_5_1.AddTokensE2EConfig{ MCMS: mcmsConfig, } diff --git a/tools/bin/go_core_ccip_deployment_tests b/tools/bin/go_core_ccip_deployment_tests index 437c2740762..b1dd7e951db 100755 --- a/tools/bin/go_core_ccip_deployment_tests +++ b/tools/bin/go_core_ccip_deployment_tests @@ -18,15 +18,20 @@ PATH=$PATH:$(go env GOPATH)/bin export PATH echo "Running go_core_ccip_deployment_tests for event: $GITHUB_EVENT_NAME" -GO_TEST_FLAGS="-timeout=${GO_TEST_TIMEOUT}" + +# Use an array so tags with spaces are preserved as a single argument +GO_TEST_FLAGS=( "-timeout=${GO_TEST_TIMEOUT}" ) + if [[ -n "$GO_TEST_TAGS" ]]; then - GO_TEST_FLAGS="$GO_TEST_FLAGS -tags=$GO_TEST_TAGS" + # This will produce a single argument: -tags=, + # even if GO_TEST_TAGS contains spaces. + GO_TEST_FLAGS+=( "-tags=${GO_TEST_TAGS}" ) fi if [[ "$GITHUB_EVENT_NAME" == 'push' ]]; then - GO_TEST_FLAGS="$GO_TEST_FLAGS -count=1" + GO_TEST_FLAGS+=( "-count=1" ) elif [[ "$GITHUB_EVENT_NAME" == 'schedule' ]]; then - GO_TEST_FLAGS="$GO_TEST_FLAGS -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt" + GO_TEST_FLAGS+=( "-covermode=atomic" "-coverpkg=./..." "-coverprofile=coverage.txt" ) elif [[ "$GITHUB_EVENT_NAME" == 'pull_request' || "$GITHUB_EVENT_NAME" == 'merge_group' ]]; then RERUN_FLAGS="" if [[ "$TRUNK_AUTO_QUARANTINE" != "true" ]]; then @@ -41,7 +46,8 @@ if [[ "$PRODUCE_JUNIT_XML" == "true" ]]; then JUNIT_FLAG="--junitfile=$JUNIT_FILE" fi -echo "Using GO_TEST_FLAGS: $GO_TEST_FLAGS" +echo "Using GO_TEST_FLAGS: ${GO_TEST_FLAGS[*]}" +echo "Using GO_TEST_TAGS: $GO_TEST_TAGS" echo "Using RERUN_FLAGS: $RERUN_FLAGS" echo "Using JUNIT_FLAG: $JUNIT_FLAG" @@ -57,7 +63,7 @@ gotestsum \ --packages='./...' \ --jsonfile "$OUTPUT_FILE" \ "$JUNIT_FLAG" \ - -- $GO_TEST_FLAGS + -- "${GO_TEST_FLAGS[@]}" EXITCODE=${PIPESTATUS[0]} From c65d525ac3cbaa2ab9ed631106a06fcbddba9f75 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 14:43:24 -0800 Subject: [PATCH 12/22] more tagging --- .../changeset/solana_v0_1_1/testutils_test.go | 2 - .../ccip/shared/stateview/state_integ_test.go | 63 +++++++++ .../{state_test.go => state_unit_test.go} | 44 +----- .../{view_test.go => view_integ_test.go} | 2 + deployment/common/opsutils/evm_integ_test.go | 132 ++++++++++++++++++ .../{evm_test.go => evm_unit_test.go} | 117 +--------------- .../{client_test.go => client_integ_test.go} | 2 + .../{node_test.go => node_integ_test.go} | 2 + 8 files changed, 205 insertions(+), 159 deletions(-) create mode 100644 deployment/ccip/shared/stateview/state_integ_test.go rename deployment/ccip/shared/stateview/{state_test.go => state_unit_test.go} (79%) rename deployment/ccip/shared/stateview/{view_test.go => view_integ_test.go} (94%) create mode 100644 deployment/common/opsutils/evm_integ_test.go rename deployment/common/opsutils/{evm_test.go => evm_unit_test.go} (82%) rename deployment/internal/jdtestutils/{client_test.go => client_integ_test.go} (99%) rename deployment/utils/nodetestutils/{node_test.go => node_integ_test.go} (98%) diff --git a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go index 61f93041a62..ab5467e7d11 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go @@ -1,5 +1,3 @@ -//go:build integration && solana - package solana_test import ( diff --git a/deployment/ccip/shared/stateview/state_integ_test.go b/deployment/ccip/shared/stateview/state_integ_test.go new file mode 100644 index 00000000000..ea2e1f9a035 --- /dev/null +++ b/deployment/ccip/shared/stateview/state_integ_test.go @@ -0,0 +1,63 @@ +//go:build integration && db + +package stateview_test + +import ( + "context" + "testing" + + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-evm/pkg/utils" + + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" + "github.com/smartcontractkit/chainlink/deployment/common/types" +) + +func TestLoadChainState_MultipleFeeQuoters(t *testing.T) { + tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) + fq1 := utils.RandomAddress().Hex() + fq2 := utils.RandomAddress().Hex() + state, err := stateview.LoadChainState(context.Background(), tenv.Env.BlockChains.EVMChains()[tenv.HomeChainSel], map[string]cldf.TypeAndVersion{ + fq1: cldf.NewTypeAndVersion(shared.FeeQuoter, deployment.Version1_0_0), + fq2: cldf.NewTypeAndVersion(shared.FeeQuoter, deployment.Version1_2_0), + }) + require.NoError(t, err) + + require.Equal(t, fq2, state.FeeQuoter.Address().Hex(), "expected latest fee quoter to be selected") + require.Equal(t, deployment.Version1_2_0, *state.FeeQuoterVersion, "expected latest fee quoter version to be selected") +} + +func TestSmokeState(t *testing.T) { + tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) + state, err := stateview.LoadOnchainState(tenv.Env) + require.NoError(t, err) + _, err = state.View(&tenv.Env, tenv.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))) + require.NoError(t, err) +} + +func TestMCMSState(t *testing.T) { + tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNoJobsAndContracts()) + addressbook := cldf.NewMemoryAddressBook() + newTv := cldf.NewTypeAndVersion(types.ManyChainMultisig, deployment.Version1_0_0) + newTv.AddLabel(types.BypasserRole.String()) + newTv.AddLabel(types.CancellerRole.String()) + newTv.AddLabel(types.ProposerRole.String()) + addr := utils.RandomAddress() + require.NoError(t, addressbook.Save(tenv.HomeChainSel, addr.String(), newTv)) + require.NoError(t, tenv.Env.ExistingAddresses.Merge(addressbook)) + state, err := stateview.LoadOnchainState(tenv.Env) + require.NoError(t, err) + require.Equal(t, addr.String(), state.Chains[tenv.HomeChainSel].BypasserMcm.Address().String()) + require.Equal(t, addr.String(), state.Chains[tenv.HomeChainSel].ProposerMcm.Address().String()) + require.Equal(t, addr.String(), state.Chains[tenv.HomeChainSel].CancellerMcm.Address().String()) +} + +// TODO: add solana state test diff --git a/deployment/ccip/shared/stateview/state_test.go b/deployment/ccip/shared/stateview/state_unit_test.go similarity index 79% rename from deployment/ccip/shared/stateview/state_test.go rename to deployment/ccip/shared/stateview/state_unit_test.go index 121805eb7e9..ab1fddcdf54 100644 --- a/deployment/ccip/shared/stateview/state_test.go +++ b/deployment/ccip/shared/stateview/state_unit_test.go @@ -1,7 +1,8 @@ +//go:build !integration + package stateview_test import ( - "context" "crypto/ecdsa" "testing" "time" @@ -15,14 +16,12 @@ import ( capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink-evm/pkg/utils" - cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/runtime" "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" @@ -30,45 +29,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestLoadChainState_MultipleFeeQuoters(t *testing.T) { - tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) - fq1 := utils.RandomAddress().Hex() - fq2 := utils.RandomAddress().Hex() - state, err := stateview.LoadChainState(context.Background(), tenv.Env.BlockChains.EVMChains()[tenv.HomeChainSel], map[string]cldf.TypeAndVersion{ - fq1: cldf.NewTypeAndVersion(shared.FeeQuoter, deployment.Version1_0_0), - fq2: cldf.NewTypeAndVersion(shared.FeeQuoter, deployment.Version1_2_0), - }) - require.NoError(t, err) - - require.Equal(t, fq2, state.FeeQuoter.Address().Hex(), "expected latest fee quoter to be selected") - require.Equal(t, deployment.Version1_2_0, *state.FeeQuoterVersion, "expected latest fee quoter version to be selected") -} - -func TestSmokeState(t *testing.T) { - tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) - state, err := stateview.LoadOnchainState(tenv.Env) - require.NoError(t, err) - _, err = state.View(&tenv.Env, tenv.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))) - require.NoError(t, err) -} - -func TestMCMSState(t *testing.T) { - tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNoJobsAndContracts()) - addressbook := cldf.NewMemoryAddressBook() - newTv := cldf.NewTypeAndVersion(types.ManyChainMultisig, deployment.Version1_0_0) - newTv.AddLabel(types.BypasserRole.String()) - newTv.AddLabel(types.CancellerRole.String()) - newTv.AddLabel(types.ProposerRole.String()) - addr := utils.RandomAddress() - require.NoError(t, addressbook.Save(tenv.HomeChainSel, addr.String(), newTv)) - require.NoError(t, tenv.Env.ExistingAddresses.Merge(addressbook)) - state, err := stateview.LoadOnchainState(tenv.Env) - require.NoError(t, err) - require.Equal(t, addr.String(), state.Chains[tenv.HomeChainSel].BypasserMcm.Address().String()) - require.Equal(t, addr.String(), state.Chains[tenv.HomeChainSel].ProposerMcm.Address().String()) - require.Equal(t, addr.String(), state.Chains[tenv.HomeChainSel].CancellerMcm.Address().String()) -} - func TestEnforceMCMSUsageIfProd(t *testing.T) { t.Parallel() diff --git a/deployment/ccip/shared/stateview/view_test.go b/deployment/ccip/shared/stateview/view_integ_test.go similarity index 94% rename from deployment/ccip/shared/stateview/view_test.go rename to deployment/ccip/shared/stateview/view_integ_test.go index c8980aa76cb..646b8d2457d 100644 --- a/deployment/ccip/shared/stateview/view_test.go +++ b/deployment/ccip/shared/stateview/view_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package stateview_test import ( diff --git a/deployment/common/opsutils/evm_integ_test.go b/deployment/common/opsutils/evm_integ_test.go new file mode 100644 index 00000000000..0689cc057e8 --- /dev/null +++ b/deployment/common/opsutils/evm_integ_test.go @@ -0,0 +1,132 @@ +//go:build integration && db + +package opsutils_test + +import ( + "encoding/json" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + chain_selectors "github.com/smartcontractkit/chain-selectors" + mcmslib "github.com/smartcontractkit/mcms" + mcmstypes "github.com/smartcontractkit/mcms/types" + + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-deployments-framework/operations" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" + "github.com/smartcontractkit/chainlink/deployment/common/opsutils" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" +) + +func TestAddEVMCallSequenceToCSOutput_ProposalCombination(t *testing.T) { + t.Parallel() + deployedEnvironment, _ := testhelpers.NewMemoryEnvironment( + t, + ) + env := deployedEnvironment.Env + + // Create initial changeset output with existing proposals to test combination logic + existingProposal1 := mcmslib.TimelockProposal{ + BaseProposal: mcmslib.BaseProposal{ + Description: "First proposal", + }, + Operations: []mcmstypes.BatchOperation{ + { + ChainSelector: mcmstypes.ChainSelector(env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))[0]), + Transactions: []mcmstypes.Transaction{ + { + To: common.HexToAddress("0x1111111111111111111111111111111111111111").String(), + Data: []byte("data1"), + AdditionalFields: json.RawMessage(`{"value": 0}`), // JSON-encoded `{"value": 0}` + }, + }, + }, + }, + } + + existingProposal2 := mcmslib.TimelockProposal{ + BaseProposal: mcmslib.BaseProposal{ + Description: "Second proposal", + }, + Operations: []mcmstypes.BatchOperation{ + { + ChainSelector: mcmstypes.ChainSelector(env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))[1]), + Transactions: []mcmstypes.Transaction{ + { + To: common.HexToAddress("0x1111112222222222222222222222222222222222").String(), + Data: []byte("data2"), + AdditionalFields: json.RawMessage(`{"value": 0}`), // JSON-encoded `{"value": 0}` + }, + }, + }, + }, + } + + csOutput := cldf.ChangesetOutput{ + MCMSTimelockProposals: []mcmslib.TimelockProposal{ + existingProposal1, + existingProposal2, + }, + } + + // Create sequence report with unconfirmed calls to generate a new proposal + chainSel := env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))[1] + seqReport := operations.SequenceReport[string, map[uint64][]opsutils.EVMCallOutput]{ + Report: operations.Report[string, map[uint64][]opsutils.EVMCallOutput]{ + Output: map[uint64][]opsutils.EVMCallOutput{ + chainSel: { + { + To: common.HexToAddress("0x3333333333333333333333333333333333333333"), + Data: []byte("new_call_data"), + ContractType: "TestContract", + Confirmed: false, // This will create a new proposal + }, + }, + }, + }, + } + + mcmsCfg := &proposalutils.TimelockConfig{ + MinDelay: 0 * time.Second, // No delay for testing + MCMSAction: mcmstypes.TimelockActionSchedule, + } + + mcmsDescription := "Third proposal" + // Load onchain state + chainState, err := stateview.LoadOnchainState(env) + require.NoError(t, err) + t.Logf("mcms state: %+v", chainState.EVMMCMSStateByChain()) + + result, err := opsutils.AddEVMCallSequenceToCSOutput( + env, + csOutput, + seqReport, + nil, + chainState.EVMMCMSStateByChain(), + mcmsCfg, + mcmsDescription, + ) + + require.NoError(t, err) + assert.Equal(t, seqReport.ExecutionReports, result.Reports) + + // Test the key combination logic: + // 1. Should have exactly 1 proposal after aggregation + assert.Len(t, result.MCMSTimelockProposals, 1, "Expected exactly 1 aggregated proposal") + + // 2. Description should be comma-separated combination of all proposals + aggregatedProposal := result.MCMSTimelockProposals[0] + expectedDescription := "First proposal, Second proposal, Third proposal" + assert.Equal(t, expectedDescription, aggregatedProposal.Description, + "Aggregated proposal should have comma-separated descriptions") + + // 3. Operations should be combined from all proposals + assert.NotEmpty(t, aggregatedProposal.Operations, + "Aggregated proposal should contain operations") +} diff --git a/deployment/common/opsutils/evm_test.go b/deployment/common/opsutils/evm_unit_test.go similarity index 82% rename from deployment/common/opsutils/evm_test.go rename to deployment/common/opsutils/evm_unit_test.go index 4e170841019..f0f660f6f19 100644 --- a/deployment/common/opsutils/evm_test.go +++ b/deployment/common/opsutils/evm_unit_test.go @@ -1,11 +1,11 @@ +//go:build !integration + package opsutils_test import ( - "encoding/json" "errors" "math/big" "testing" - "time" "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -14,10 +14,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - chain_selectors "github.com/smartcontractkit/chain-selectors" - mcmslib "github.com/smartcontractkit/mcms" - mcmstypes "github.com/smartcontractkit/mcms/types" - cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf_evm_provider "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/provider" @@ -25,8 +21,6 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" "github.com/smartcontractkit/chainlink-deployments-framework/operations" "github.com/smartcontractkit/chainlink-deployments-framework/operations/optest" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" - "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" "github.com/smartcontractkit/chainlink/deployment/common/opsutils" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" @@ -183,113 +177,6 @@ func TestAddEVMCallSequenceToCSOutput_AllConfirmed(t *testing.T) { assert.Nil(t, result.MCMSTimelockProposals) } -func TestAddEVMCallSequenceToCSOutput_ProposalCombination(t *testing.T) { - t.Parallel() - deployedEnvironment, _ := testhelpers.NewMemoryEnvironment( - t, - ) - env := deployedEnvironment.Env - - // Create initial changeset output with existing proposals to test combination logic - existingProposal1 := mcmslib.TimelockProposal{ - BaseProposal: mcmslib.BaseProposal{ - Description: "First proposal", - }, - Operations: []mcmstypes.BatchOperation{ - { - ChainSelector: mcmstypes.ChainSelector(env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))[0]), - Transactions: []mcmstypes.Transaction{ - { - To: common.HexToAddress("0x1111111111111111111111111111111111111111").String(), - Data: []byte("data1"), - AdditionalFields: json.RawMessage(`{"value": 0}`), // JSON-encoded `{"value": 0}` - }, - }, - }, - }, - } - - existingProposal2 := mcmslib.TimelockProposal{ - BaseProposal: mcmslib.BaseProposal{ - Description: "Second proposal", - }, - Operations: []mcmstypes.BatchOperation{ - { - ChainSelector: mcmstypes.ChainSelector(env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))[1]), - Transactions: []mcmstypes.Transaction{ - { - To: common.HexToAddress("0x1111112222222222222222222222222222222222").String(), - Data: []byte("data2"), - AdditionalFields: json.RawMessage(`{"value": 0}`), // JSON-encoded `{"value": 0}` - }, - }, - }, - }, - } - - csOutput := cldf.ChangesetOutput{ - MCMSTimelockProposals: []mcmslib.TimelockProposal{ - existingProposal1, - existingProposal2, - }, - } - - // Create sequence report with unconfirmed calls to generate a new proposal - chainSel := env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))[1] - seqReport := operations.SequenceReport[string, map[uint64][]opsutils.EVMCallOutput]{ - Report: operations.Report[string, map[uint64][]opsutils.EVMCallOutput]{ - Output: map[uint64][]opsutils.EVMCallOutput{ - chainSel: { - { - To: common.HexToAddress("0x3333333333333333333333333333333333333333"), - Data: []byte("new_call_data"), - ContractType: "TestContract", - Confirmed: false, // This will create a new proposal - }, - }, - }, - }, - } - - mcmsCfg := &proposalutils.TimelockConfig{ - MinDelay: 0 * time.Second, // No delay for testing - MCMSAction: mcmstypes.TimelockActionSchedule, - } - - mcmsDescription := "Third proposal" - // Load onchain state - chainState, err := stateview.LoadOnchainState(env) - require.NoError(t, err) - t.Logf("mcms state: %+v", chainState.EVMMCMSStateByChain()) - - result, err := opsutils.AddEVMCallSequenceToCSOutput( - env, - csOutput, - seqReport, - nil, - chainState.EVMMCMSStateByChain(), - mcmsCfg, - mcmsDescription, - ) - - require.NoError(t, err) - assert.Equal(t, seqReport.ExecutionReports, result.Reports) - - // Test the key combination logic: - // 1. Should have exactly 1 proposal after aggregation - assert.Len(t, result.MCMSTimelockProposals, 1, "Expected exactly 1 aggregated proposal") - - // 2. Description should be comma-separated combination of all proposals - aggregatedProposal := result.MCMSTimelockProposals[0] - expectedDescription := "First proposal, Second proposal, Third proposal" - assert.Equal(t, expectedDescription, aggregatedProposal.Description, - "Aggregated proposal should have comma-separated descriptions") - - // 3. Operations should be combined from all proposals - assert.NotEmpty(t, aggregatedProposal.Operations, - "Aggregated proposal should contain operations") -} - func TestNewEVMCallOperation(t *testing.T) { t.Parallel() version, _ := semver.NewVersion("1.0.0") diff --git a/deployment/internal/jdtestutils/client_test.go b/deployment/internal/jdtestutils/client_integ_test.go similarity index 99% rename from deployment/internal/jdtestutils/client_test.go rename to deployment/internal/jdtestutils/client_integ_test.go index 06f4da96d01..a70b8bfe436 100644 --- a/deployment/internal/jdtestutils/client_test.go +++ b/deployment/internal/jdtestutils/client_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package jdtestutils import ( diff --git a/deployment/utils/nodetestutils/node_test.go b/deployment/utils/nodetestutils/node_integ_test.go similarity index 98% rename from deployment/utils/nodetestutils/node_test.go rename to deployment/utils/nodetestutils/node_integ_test.go index 51d24744ddd..19226f96218 100644 --- a/deployment/utils/nodetestutils/node_test.go +++ b/deployment/utils/nodetestutils/node_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package nodetestutils import ( From 7fef6eb4ed2259ea2b467ebf55c129f13d7a5dd2 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 14:43:37 -0800 Subject: [PATCH 13/22] more matrix --- .github/workflows/ci-core-integration.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-core-integration.yml b/.github/workflows/ci-core-integration.yml index 8c5b8ef55dd..f0f456f8c2f 100644 --- a/.github/workflows/ci-core-integration.yml +++ b/.github/workflows/ci-core-integration.yml @@ -61,7 +61,7 @@ jobs: type: - module: Deployment cmd: go_core_ccip_deployment_tests - os: cpu=32/ram=64/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache + os: cpu=16/ram=32/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache tags: "integration solana" go-mod-directory: "deployment/" setup-solana: "true" @@ -69,12 +69,17 @@ jobs: - module: Deployment cmd: go_core_ccip_deployment_tests - os: cpu=32/ram=64/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache + os: cpu=16/ram=32/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache tags: "integration aptos" go-mod-directory: "deployment/" - setup-solana: "false" aptos-cli-version: "7.10.0" + - module: Deployment + cmd: go_core_ccip_deployment_tests + os: cpu=16/ram=32/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache + tags: "integration db" + go-mod-directory: "deployment/" + name: "${{ matrix.type.module }} - Tagged Tests (${{matrix.type.tags}})" timeout-minutes: 20 runs-on: runs-on=${{ github.run_id }}-${{ strategy.job-index }}/${{ matrix.type.os }} From 0e590d626407b4c5a3ae8a9a7548024d0e601b56 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 14:46:21 -0800 Subject: [PATCH 14/22] fix build errors --- .../cs_deploy_chain_unit_test.go | 80 ----------------- .../changeset/solana_v0_1_1/testutils_test.go | 85 +++++++++++++++++++ .../cs_configure_token_pools_integ_test.go | 64 -------------- 3 files changed, 85 insertions(+), 144 deletions(-) diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go index cea2775d3dc..32be7afba97 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_unit_test.go @@ -5,99 +5,19 @@ package solana_test import ( "testing" - solBinary "github.com/gagliardetto/binary" - "github.com/gagliardetto/solana-go" chain_selectors "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/quarantine" "github.com/stretchr/testify/require" - cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" - ccipChangesetSolana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) -func initialDeployCS(t *testing.T, e cldf.Environment, buildConfig *ccipChangesetSolana.BuildSolanaConfig) []commonchangeset.ConfiguredChangeSet { - evmSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM)) - homeChainSel := evmSelectors[0] - solChainSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana)) - nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) - require.NoError(t, err) - feeAggregatorPrivKey, _ := solana.NewRandomPrivateKey() - feeAggregatorPubKey := feeAggregatorPrivKey.PublicKey() - mcmsConfig := proposalutils.SingleGroupTimelockConfigV2(t) - solLinkTokenPrivKey, _ := solana.NewRandomPrivateKey() - return []commonchangeset.ConfiguredChangeSet{ - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(v1_6.DeployHomeChainChangeset), - v1_6.DeployHomeChainConfig{ - HomeChainSel: homeChainSel, - RMNStaticConfig: testhelpers.NewTestRMNStaticConfig(), - RMNDynamicConfig: testhelpers.NewTestRMNDynamicConfig(), - NodeOperators: testhelpers.NewTestNodeOperator(e.BlockChains.EVMChains()[homeChainSel].DeployerKey.From), - NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ - testhelpers.TestNodeOperator: nodes.NonBootstraps().PeerIDs(), - }, - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.DeploySolanaLinkToken), - commonchangeset.DeploySolanaLinkTokenConfig{ - ChainSelector: solChainSelectors[0], - TokenPrivKey: solLinkTokenPrivKey, - TokenDecimals: 9, - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(ccipChangesetSolana.DeployChainContractsChangeset), - ccipChangesetSolana.DeployChainContractsConfig{ - HomeChainSelector: homeChainSel, - ChainSelector: solChainSelectors[0], - ContractParamsPerChain: ccipChangesetSolana.ChainContractParams{ - FeeQuoterParams: ccipChangesetSolana.FeeQuoterParams{ - DefaultMaxFeeJuelsPerMsg: solBinary.Uint128{Lo: 300000000, Hi: 0, Endianness: nil}, - }, - OffRampParams: ccipChangesetSolana.OffRampParams{ - EnableExecutionAfter: int64(globals.PermissionLessExecutionThreshold.Seconds()), - }, - }, - MCMSWithTimelockConfig: &mcmsConfig, - BuildConfig: buildConfig, - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(ccipChangesetSolana.DeployReceiverForTest), - ccipChangesetSolana.DeployForTestConfig{ - ChainSelector: solChainSelectors[0], - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(ccipChangesetSolana.SetFeeAggregator), - ccipChangesetSolana.SetFeeAggregatorConfig{ - ChainSelector: solChainSelectors[0], - FeeAggregator: feeAggregatorPubKey.String(), - }, - ), - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(ccipChangesetSolana.ExtendGlobalLookupTableChangeset), - ccipChangesetSolana.ExtendGlobalLookupTableConfig{ - ChainSelector: solChainSelectors[0], - LookupTableKeys: []solana.PublicKey{feeAggregatorPubKey, solLinkTokenPrivKey.PublicKey()}, // just add some random keys - }, - ), - } -} - // use this for a quick deploy test func TestDeployChainContractsChangesetPreload(t *testing.T) { quarantine.Flaky(t, "DX-1729") diff --git a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go index ab5467e7d11..cdb6b0f224f 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go @@ -3,6 +3,20 @@ package solana_test import ( "os" "testing" + + solBinary "github.com/gagliardetto/binary" + "github.com/gagliardetto/solana-go" + chain_selectors "github.com/smartcontractkit/chain-selectors" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" + ccipChangesetSolana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + "github.com/stretchr/testify/require" ) func skipInCI(t *testing.T) { @@ -13,3 +27,74 @@ func skipInCI(t *testing.T) { t.Skip("Skipping in CI") } } + +func initialDeployCS(t *testing.T, e cldf.Environment, buildConfig *ccipChangesetSolana.BuildSolanaConfig) []commonchangeset.ConfiguredChangeSet { + evmSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM)) + homeChainSel := evmSelectors[0] + solChainSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana)) + nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) + require.NoError(t, err) + feeAggregatorPrivKey, _ := solana.NewRandomPrivateKey() + feeAggregatorPubKey := feeAggregatorPrivKey.PublicKey() + mcmsConfig := proposalutils.SingleGroupTimelockConfigV2(t) + solLinkTokenPrivKey, _ := solana.NewRandomPrivateKey() + return []commonchangeset.ConfiguredChangeSet{ + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(v1_6.DeployHomeChainChangeset), + v1_6.DeployHomeChainConfig{ + HomeChainSel: homeChainSel, + RMNStaticConfig: testhelpers.NewTestRMNStaticConfig(), + RMNDynamicConfig: testhelpers.NewTestRMNDynamicConfig(), + NodeOperators: testhelpers.NewTestNodeOperator(e.BlockChains.EVMChains()[homeChainSel].DeployerKey.From), + NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ + testhelpers.TestNodeOperator: nodes.NonBootstraps().PeerIDs(), + }, + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(commonchangeset.DeploySolanaLinkToken), + commonchangeset.DeploySolanaLinkTokenConfig{ + ChainSelector: solChainSelectors[0], + TokenPrivKey: solLinkTokenPrivKey, + TokenDecimals: 9, + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(ccipChangesetSolana.DeployChainContractsChangeset), + ccipChangesetSolana.DeployChainContractsConfig{ + HomeChainSelector: homeChainSel, + ChainSelector: solChainSelectors[0], + ContractParamsPerChain: ccipChangesetSolana.ChainContractParams{ + FeeQuoterParams: ccipChangesetSolana.FeeQuoterParams{ + DefaultMaxFeeJuelsPerMsg: solBinary.Uint128{Lo: 300000000, Hi: 0, Endianness: nil}, + }, + OffRampParams: ccipChangesetSolana.OffRampParams{ + EnableExecutionAfter: int64(globals.PermissionLessExecutionThreshold.Seconds()), + }, + }, + MCMSWithTimelockConfig: &mcmsConfig, + BuildConfig: buildConfig, + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(ccipChangesetSolana.DeployReceiverForTest), + ccipChangesetSolana.DeployForTestConfig{ + ChainSelector: solChainSelectors[0], + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(ccipChangesetSolana.SetFeeAggregator), + ccipChangesetSolana.SetFeeAggregatorConfig{ + ChainSelector: solChainSelectors[0], + FeeAggregator: feeAggregatorPubKey.String(), + }, + ), + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(ccipChangesetSolana.ExtendGlobalLookupTableChangeset), + ccipChangesetSolana.ExtendGlobalLookupTableConfig{ + ChainSelector: solChainSelectors[0], + LookupTableKeys: []solana.PublicKey{feeAggregatorPubKey, solLinkTokenPrivKey.PublicKey()}, // just add some random keys + }, + ), + } +} diff --git a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go index 4e975ae35dd..504ab93e59f 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_integ_test.go @@ -3,19 +3,15 @@ package v1_5_1_test import ( - "bytes" "math/big" "slices" - "sort" "testing" - "github.com/ethereum/go-ethereum/common" "github.com/gagliardetto/solana-go" chain_selectors "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/quarantine" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/burn_mint_erc677" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" @@ -32,66 +28,6 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) -// validateMemberOfTokenPoolPair performs checks required to validate that a token pool is fully configured for cross-chain transfer. -func validateMemberOfTokenPoolPair( - t *testing.T, - state stateview.CCIPOnChainState, - tokenPool *token_pool.TokenPool, - expectedRemotePools []common.Address, - tokens map[uint64]*cldf.ContractDeploy[*burn_mint_erc677.BurnMintERC677], - tokenSymbol shared.TokenSymbol, - chainSelector uint64, - rate *big.Int, - capacity *big.Int, - expectedOwner common.Address, -) { - // Verify that the owner is expected - owner, err := tokenPool.Owner(nil) - require.NoError(t, err) - require.Equal(t, expectedOwner, owner) - - // Fetch the supported remote chains - supportedChains, err := tokenPool.GetSupportedChains(nil) - require.NoError(t, err) - - // Verify that the rate limits and remote addresses are correct - for _, supportedChain := range supportedChains { - inboundConfig, err := tokenPool.GetCurrentInboundRateLimiterState(nil, supportedChain) - require.NoError(t, err) - require.True(t, inboundConfig.IsEnabled) - require.Equal(t, capacity, inboundConfig.Capacity) - require.Equal(t, rate, inboundConfig.Rate) - - outboundConfig, err := tokenPool.GetCurrentOutboundRateLimiterState(nil, supportedChain) - require.NoError(t, err) - require.True(t, outboundConfig.IsEnabled) - require.Equal(t, capacity, outboundConfig.Capacity) - require.Equal(t, rate, outboundConfig.Rate) - - remoteTokenAddress, err := tokenPool.GetRemoteToken(nil, supportedChain) - require.NoError(t, err) - require.Equal(t, common.LeftPadBytes(tokens[supportedChain].Address.Bytes(), 32), remoteTokenAddress) - - remotePoolAddresses, err := tokenPool.GetRemotePools(nil, supportedChain) - require.NoError(t, err) - - require.Len(t, remotePoolAddresses, len(expectedRemotePools)) - expectedRemotePoolAddressesBytes := make([][]byte, len(expectedRemotePools)) - for i, remotePool := range expectedRemotePools { - expectedRemotePoolAddressesBytes[i] = common.LeftPadBytes(remotePool.Bytes(), 32) - } - sort.Slice(expectedRemotePoolAddressesBytes, func(i, j int) bool { - return bytes.Compare(expectedRemotePoolAddressesBytes[i], expectedRemotePoolAddressesBytes[j]) < 0 - }) - sort.Slice(remotePoolAddresses, func(i, j int) bool { - return bytes.Compare(remotePoolAddresses[i], remotePoolAddresses[j]) < 0 - }) - for i := range expectedRemotePoolAddressesBytes { - require.Equal(t, expectedRemotePoolAddressesBytes[i], remotePoolAddresses[i]) - } - } -} - func validateSolanaConfig(t *testing.T, state stateview.CCIPOnChainState, solChainUpdates map[uint64]v1_5_1.SolChainUpdate, selector uint64, solanaSelector uint64) { tokenPool := state.Chains[selector].BurnMintTokenPools[testhelpers.TestTokenSymbol][deployment.Version1_5_1] isSupported, err := tokenPool.IsSupportedChain(nil, solanaSelector) From 5f0d1c2653d20745dd1ae2b64719199275869e86 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 15:02:10 -0800 Subject: [PATCH 15/22] more tagging --- ...ept_admin_role_test.go => cs_accept_admin_role_unit_test.go} | 2 ++ ...actory_test.go => cs_deploy_token_pool_factory_unit_test.go} | 2 ++ ...en_pools_test.go => cs_deploy_usdc_token_pools_unit_test.go} | 2 ++ ..._pools_test.go => cs_fast_transfer_token_pools_unit_test.go} | 2 ++ ..._groups_test.go => cs_hybrid_token_pool_groups_unit_test.go} | 2 ++ ...se_admin_role_test.go => cs_propose_admin_role_unit_test.go} | 2 ++ .../v1_5_1/{cs_set_pool_test.go => cs_set_pool_unit_test.go} | 2 ++ ...g_test.go => cs_set_token_transfer_fee_config_integ_test.go} | 2 ++ ...s_test.go => cs_sync_usdc_domains_with_chains_integ_test.go} | 2 ++ ...r_admin_role_test.go => cs_transfer_admin_role_unit_test.go} | 2 ++ ...ate_admin_role_test.go => cs_update_admin_role_unit_test.go} | 2 ++ 11 files changed, 22 insertions(+) rename deployment/ccip/changeset/v1_5_1/{cs_accept_admin_role_test.go => cs_accept_admin_role_unit_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_deploy_token_pool_factory_test.go => cs_deploy_token_pool_factory_unit_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_deploy_usdc_token_pools_test.go => cs_deploy_usdc_token_pools_unit_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_fast_transfer_token_pools_test.go => cs_fast_transfer_token_pools_unit_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_hybrid_token_pool_groups_test.go => cs_hybrid_token_pool_groups_unit_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_propose_admin_role_test.go => cs_propose_admin_role_unit_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_set_pool_test.go => cs_set_pool_unit_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_set_token_transfer_fee_config_test.go => cs_set_token_transfer_fee_config_integ_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_sync_usdc_domains_with_chains_test.go => cs_sync_usdc_domains_with_chains_integ_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_transfer_admin_role_test.go => cs_transfer_admin_role_unit_test.go} (99%) rename deployment/ccip/changeset/v1_5_1/{cs_update_admin_role_test.go => cs_update_admin_role_unit_test.go} (99%) diff --git a/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go rename to deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_unit_test.go index ffcec8a6de7..9099d1c4efb 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory_test.go b/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory_test.go rename to deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory_unit_test.go index b36e699c492..eadaa69ff95 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_deploy_usdc_token_pools_test.go b/deployment/ccip/changeset/v1_5_1/cs_deploy_usdc_token_pools_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_deploy_usdc_token_pools_test.go rename to deployment/ccip/changeset/v1_5_1/cs_deploy_usdc_token_pools_unit_test.go index 7fc132284bc..258dfb9e944 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_deploy_usdc_token_pools_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_deploy_usdc_token_pools_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go b/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go rename to deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_unit_test.go index 46234224bd3..61af0c6b59b 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go b/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go rename to deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_unit_test.go index dfb4f579fad..a64f42609bf 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go rename to deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_unit_test.go index 69f45a35154..b4f8ee734e7 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go b/deployment/ccip/changeset/v1_5_1/cs_set_pool_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go rename to deployment/ccip/changeset/v1_5_1/cs_set_pool_unit_test.go index 36e5f55beca..a7fe7df2ecd 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_set_pool_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go b/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go rename to deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_integ_test.go index 1a6d8f0515e..055e1e3d571 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_integ_test.go @@ -1,3 +1,5 @@ +// go:build integration && db + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go b/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go rename to deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_integ_test.go index 1435bbd88ea..1db16c73250 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_integ_test.go @@ -1,3 +1,5 @@ +// go:build integration && db + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go rename to deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_unit_test.go index 0a24ed57a02..81c5105ed09 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_unit_test.go @@ -1,3 +1,5 @@ +// go:build !integration + package v1_5_1_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go rename to deployment/ccip/changeset/v1_5_1/cs_update_admin_role_unit_test.go index fb91dbcf5ea..f33104c9621 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_unit_test.go @@ -1,3 +1,5 @@ +// go:build !integration + package v1_5_1_test import ( From d48b50b801be62db6f086f7da993f0e6b4758850 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 15:02:26 -0800 Subject: [PATCH 16/22] always install plugins? --- .github/workflows/ci-core-integration.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-core-integration.yml b/.github/workflows/ci-core-integration.yml index f0f456f8c2f..c6c21af5879 100644 --- a/.github/workflows/ci-core-integration.yml +++ b/.github/workflows/ci-core-integration.yml @@ -73,12 +73,14 @@ jobs: tags: "integration aptos" go-mod-directory: "deployment/" aptos-cli-version: "7.10.0" + setup-plugins: "true" - module: Deployment cmd: go_core_ccip_deployment_tests os: cpu=16/ram=32/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache tags: "integration db" go-mod-directory: "deployment/" + setup-plugins: "true" name: "${{ matrix.type.module }} - Tagged Tests (${{matrix.type.tags}})" timeout-minutes: 20 From 9f300c39c3ed1e8f044f7ab4bba6ab49366d8fbf Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 15:15:24 -0800 Subject: [PATCH 17/22] fix: tagging --- deployment/ccip/changeset/v1_5/e2e_test.go | 2 ++ .../v1_5_1/cs_set_token_transfer_fee_config_integ_test.go | 2 +- .../v1_5_1/cs_sync_usdc_domains_with_chains_integ_test.go | 2 +- .../ccip/changeset/v1_5_1/cs_transfer_admin_role_unit_test.go | 2 +- .../ccip/changeset/v1_5_1/cs_update_admin_role_unit_test.go | 2 +- deployment/{environment_test.go => environment_unit_test.go} | 2 ++ .../{evm_kmsclient_test.go => evm_kmsclient_unit_test.go} | 2 ++ ...labeled_addresses_test.go => labeled_addresses_unit_test.go} | 2 ++ 8 files changed, 12 insertions(+), 4 deletions(-) rename deployment/{environment_test.go => environment_unit_test.go} (99%) rename deployment/{evm_kmsclient_test.go => evm_kmsclient_unit_test.go} (97%) rename deployment/{labeled_addresses_test.go => labeled_addresses_unit_test.go} (99%) diff --git a/deployment/ccip/changeset/v1_5/e2e_test.go b/deployment/ccip/changeset/v1_5/e2e_test.go index cd84a452282..73646a174c2 100644 --- a/deployment/ccip/changeset/v1_5/e2e_test.go +++ b/deployment/ccip/changeset/v1_5/e2e_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_5_test import ( diff --git a/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_integ_test.go b/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_integ_test.go index 055e1e3d571..37732595195 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_integ_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_integ_test.go @@ -1,4 +1,4 @@ -// go:build integration && db +//go:build integration && db package v1_5_1_test diff --git a/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_integ_test.go b/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_integ_test.go index 1db16c73250..55d98a0bde9 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_integ_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_integ_test.go @@ -1,4 +1,4 @@ -// go:build integration && db +//go:build integration && db package v1_5_1_test diff --git a/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_unit_test.go b/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_unit_test.go index 81c5105ed09..5e70fc5f4aa 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_unit_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_unit_test.go @@ -1,4 +1,4 @@ -// go:build !integration +//go:build !integration package v1_5_1_test diff --git a/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_unit_test.go b/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_unit_test.go index f33104c9621..418f39151e7 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_unit_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_unit_test.go @@ -1,4 +1,4 @@ -// go:build !integration +//go:build !integration package v1_5_1_test diff --git a/deployment/environment_test.go b/deployment/environment_unit_test.go similarity index 99% rename from deployment/environment_test.go rename to deployment/environment_unit_test.go index a1f61a1f589..d7a13e4ad34 100644 --- a/deployment/environment_test.go +++ b/deployment/environment_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package deployment import ( diff --git a/deployment/evm_kmsclient_test.go b/deployment/evm_kmsclient_unit_test.go similarity index 97% rename from deployment/evm_kmsclient_test.go rename to deployment/evm_kmsclient_unit_test.go index f4917722839..635539c2e9d 100644 --- a/deployment/evm_kmsclient_test.go +++ b/deployment/evm_kmsclient_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package deployment import ( diff --git a/deployment/labeled_addresses_test.go b/deployment/labeled_addresses_unit_test.go similarity index 99% rename from deployment/labeled_addresses_test.go rename to deployment/labeled_addresses_unit_test.go index c4c4fe0b2ab..86fb2206582 100644 --- a/deployment/labeled_addresses_test.go +++ b/deployment/labeled_addresses_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package deployment import ( From e82a2040daeb7fea8c7ec283128f1e39f74a99b1 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 15:15:41 -0800 Subject: [PATCH 18/22] more resources --- .github/workflows/ci-core-integration.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-core-integration.yml b/.github/workflows/ci-core-integration.yml index c6c21af5879..8cdcbd64a8c 100644 --- a/.github/workflows/ci-core-integration.yml +++ b/.github/workflows/ci-core-integration.yml @@ -61,7 +61,7 @@ jobs: type: - module: Deployment cmd: go_core_ccip_deployment_tests - os: cpu=16/ram=32/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache + os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache tags: "integration solana" go-mod-directory: "deployment/" setup-solana: "true" @@ -69,7 +69,7 @@ jobs: - module: Deployment cmd: go_core_ccip_deployment_tests - os: cpu=16/ram=32/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache + os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache tags: "integration aptos" go-mod-directory: "deployment/" aptos-cli-version: "7.10.0" @@ -77,7 +77,7 @@ jobs: - module: Deployment cmd: go_core_ccip_deployment_tests - os: cpu=16/ram=32/family=c6id/spot=false/image=ubuntu24-full-x64/extras=s3-cache + os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache tags: "integration db" go-mod-directory: "deployment/" setup-plugins: "true" From 90ee329849c1953b9a464c9f04da529f7276b4e9 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 15:38:42 -0800 Subject: [PATCH 19/22] even more tagging --- .../{lane_test.go => lane_unit_test.go} | 2 + ...cs_grant_and_mint_link_token_unit_test.go} | 2 + ...=> cs_orchestrate_changesets_unit_test.go} | 2 + ..._test.go => cs_prerequisites_unit_test.go} | 2 + .../{ocr3_test.go => ocr3_unit_test.go} | 2 + ...ing_test.go => save_existing_unit_test.go} | 2 + .../cs_chain_contracts_integ_test.go | 10 +-- .../cs_deploy_chain_integ_test.go | 6 +- .../solana_v0_1_1/cs_ops_integ_test.go | 4 +- .../solana_v0_1_1/cs_token_pool_integ_test.go | 8 +-- .../solana_v0_1_1/self_serve_integ_test.go | 4 +- .../changeset/solana_v0_1_1/testutils_test.go | 10 --- ...r_ccip_to_mcms_with_timelock_integ_test.go | 4 +- .../cciptesthelpertypes/types_test.go | 2 + .../testhelpers/test_helpers_solana_v0_1_1.go | 10 +++ ...ome_test.go => cs_ccip_home_integ_test.go} | 2 + ...st.go => cs_chain_contracts_integ_test.go} | 2 + ...in_test.go => cs_home_chain_integ_test.go} | 2 + .../changeset/v1_6/cs_home_chain_unit_test.go | 71 +++++++++++++++++++ ...anslate_onramp_to_feequoter_integ_test.go} | 2 + ...s_update_bidirectional_lanes_unit_test.go} | 2 + 21 files changed, 123 insertions(+), 28 deletions(-) rename deployment/ccip/changeset/aptos/config/{lane_test.go => lane_unit_test.go} (99%) rename deployment/ccip/changeset/{cs_grant_and_mint_link_token_test.go => cs_grant_and_mint_link_token_unit_test.go} (99%) rename deployment/ccip/changeset/{cs_orchestrate_changesets_test.go => cs_orchestrate_changesets_unit_test.go} (99%) rename deployment/ccip/changeset/{cs_prerequisites_test.go => cs_prerequisites_unit_test.go} (99%) rename deployment/ccip/changeset/globals/{ocr3_test.go => ocr3_unit_test.go} (98%) rename deployment/ccip/changeset/{save_existing_test.go => save_existing_unit_test.go} (99%) rename deployment/ccip/changeset/v1_6/{cs_ccip_home_test.go => cs_ccip_home_integ_test.go} (99%) rename deployment/ccip/changeset/v1_6/{cs_chain_contracts_test.go => cs_chain_contracts_integ_test.go} (99%) rename deployment/ccip/changeset/v1_6/{cs_home_chain_test.go => cs_home_chain_integ_test.go} (99%) create mode 100644 deployment/ccip/changeset/v1_6/cs_home_chain_unit_test.go rename deployment/ccip/changeset/v1_6/{cs_translate_onramp_to_feequoter_test.go => cs_translate_onramp_to_feequoter_integ_test.go} (99%) rename deployment/ccip/changeset/v1_6/{cs_update_bidirectional_lanes_test.go => cs_update_bidirectional_lanes_unit_test.go} (99%) diff --git a/deployment/ccip/changeset/aptos/config/lane_test.go b/deployment/ccip/changeset/aptos/config/lane_unit_test.go similarity index 99% rename from deployment/ccip/changeset/aptos/config/lane_test.go rename to deployment/ccip/changeset/aptos/config/lane_unit_test.go index b2272795d50..288b60a9219 100644 --- a/deployment/ccip/changeset/aptos/config/lane_test.go +++ b/deployment/ccip/changeset/aptos/config/lane_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package config import ( diff --git a/deployment/ccip/changeset/cs_grant_and_mint_link_token_test.go b/deployment/ccip/changeset/cs_grant_and_mint_link_token_unit_test.go similarity index 99% rename from deployment/ccip/changeset/cs_grant_and_mint_link_token_test.go rename to deployment/ccip/changeset/cs_grant_and_mint_link_token_unit_test.go index 18a416d89cc..0aeefad48b9 100644 --- a/deployment/ccip/changeset/cs_grant_and_mint_link_token_test.go +++ b/deployment/ccip/changeset/cs_grant_and_mint_link_token_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package changeset_test import ( diff --git a/deployment/ccip/changeset/cs_orchestrate_changesets_test.go b/deployment/ccip/changeset/cs_orchestrate_changesets_unit_test.go similarity index 99% rename from deployment/ccip/changeset/cs_orchestrate_changesets_test.go rename to deployment/ccip/changeset/cs_orchestrate_changesets_unit_test.go index f52b4526198..41de078eb1f 100644 --- a/deployment/ccip/changeset/cs_orchestrate_changesets_test.go +++ b/deployment/ccip/changeset/cs_orchestrate_changesets_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package changeset_test import ( diff --git a/deployment/ccip/changeset/cs_prerequisites_test.go b/deployment/ccip/changeset/cs_prerequisites_unit_test.go similarity index 99% rename from deployment/ccip/changeset/cs_prerequisites_test.go rename to deployment/ccip/changeset/cs_prerequisites_unit_test.go index 1329b5dd842..96edb9ecd05 100644 --- a/deployment/ccip/changeset/cs_prerequisites_test.go +++ b/deployment/ccip/changeset/cs_prerequisites_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package changeset_test import ( diff --git a/deployment/ccip/changeset/globals/ocr3_test.go b/deployment/ccip/changeset/globals/ocr3_unit_test.go similarity index 98% rename from deployment/ccip/changeset/globals/ocr3_test.go rename to deployment/ccip/changeset/globals/ocr3_unit_test.go index 8c45f748987..3831d46908c 100644 --- a/deployment/ccip/changeset/globals/ocr3_test.go +++ b/deployment/ccip/changeset/globals/ocr3_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package globals import ( diff --git a/deployment/ccip/changeset/save_existing_test.go b/deployment/ccip/changeset/save_existing_unit_test.go similarity index 99% rename from deployment/ccip/changeset/save_existing_test.go rename to deployment/ccip/changeset/save_existing_unit_test.go index 1469326a6fd..0c5a657264e 100644 --- a/deployment/ccip/changeset/save_existing_test.go +++ b/deployment/ccip/changeset/save_existing_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package changeset_test import ( diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_integ_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_integ_test.go index 47f6cdaf8e5..e1a42327086 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_integ_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_integ_test.go @@ -88,7 +88,7 @@ func TestAddRemoteChainWithMcms(t *testing.T) { func TestAddRemoteChainWithoutMcms(t *testing.T) { t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) doTestAddRemoteChain(t, false) } @@ -652,7 +652,7 @@ func TestBillingWithMcms(t *testing.T) { func TestBillingWithoutMcms(t *testing.T) { t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) doTestBilling(t, false) } @@ -886,7 +886,7 @@ func TestTokenAdminRegistryWithMcms(t *testing.T) { func TestTokenAdminRegistryWithoutMcms(t *testing.T) { t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) doTestTokenAdminRegistry(t, false) } @@ -998,7 +998,7 @@ func TestPoolLookupTableWithMcms(t *testing.T) { func TestPoolLookupTableWithoutMcms(t *testing.T) { t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) doTestPoolLookupTable(t, tenv.Env, false, shared.CLLMetadata) } @@ -1006,7 +1006,7 @@ func TestPoolLookupTableWithoutMcms(t *testing.T) { func TestDeployCCIPContracts(t *testing.T) { // TODO: Fix this test to use the new changeset t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) testhelpers.DeployCCIPContractsTest(t, 1, 1) } diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_integ_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_integ_test.go index ac831bede0e..bfc0bb8defc 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_integ_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_integ_test.go @@ -38,7 +38,7 @@ import ( // Doing this in CI is expensive, so we skip it for now. func TestUpgrade(t *testing.T) { t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) homeChainSel := chain_selectors.TEST_90000001.Selector solSelector := chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector @@ -238,7 +238,7 @@ func TestUpgrade(t *testing.T) { func TestClose(t *testing.T) { t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) homeChainSel := chain_selectors.TEST_90000001.Selector solSelector := chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector @@ -314,7 +314,7 @@ func TestClose(t *testing.T) { } func TestIDL(t *testing.T) { - skipInCI(t) + testhelpers.SkipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) solChain := tenv.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana))[0] e, _, err := commonchangeset.ApplyChangesets(t, tenv.Env, []commonchangeset.ConfiguredChangeSet{ diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_ops_integ_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_ops_integ_test.go index aa61bbbe5c4..090ddcfd965 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_ops_integ_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_ops_integ_test.go @@ -22,13 +22,13 @@ import ( func TestGenericOpsWithMcms(t *testing.T) { t.Parallel() - skipInCI(t) // takes too long in CI + testhelpers.SkipInCI(t) doTestGenericOps(t, true) } func TestGenericOpsWithoutMcms(t *testing.T) { t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) doTestGenericOps(t, false) } diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_integ_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_integ_test.go index 8590c9330d9..75a863e115e 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_integ_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_integ_test.go @@ -53,7 +53,7 @@ const ( func TestAddTokenPoolWithoutMcms(t *testing.T) { t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) doTestTokenPool(t, tenv.Env, TokenPoolTestConfig{MCMS: false, TokenMetadata: shared.CLLMetadata}) @@ -767,7 +767,7 @@ func TestAddTokenPoolE2EWithMcms(t *testing.T) { } func TestPartnerTokenPools(t *testing.T) { - skipInCI(t) + testhelpers.SkipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) e := tenv.Env solChainSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana)) @@ -797,7 +797,7 @@ func TestPartnerTokenPools(t *testing.T) { } func TestPartnerTokenPoolsWithUpgrades(t *testing.T) { - skipInCI(t) + testhelpers.SkipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) e := tenv.Env var err error @@ -890,7 +890,7 @@ func getTokenPoolBaseChainConfig(t *testing.T, e cldf.Environment, solChain uint } func TestCreatingMultisig(t *testing.T) { - skipInCI(t) + testhelpers.SkipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) solChain := tenv.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana))[0] deployerKey := tenv.Env.BlockChains.SolanaChains()[solChain].DeployerKey.PublicKey() diff --git a/deployment/ccip/changeset/solana_v0_1_1/self_serve_integ_test.go b/deployment/ccip/changeset/solana_v0_1_1/self_serve_integ_test.go index e45be600e36..b1e056ad534 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/self_serve_integ_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/self_serve_integ_test.go @@ -38,9 +38,9 @@ import ( ) func TestOnboardTokenPoolForSelfServeWithMCMs(t *testing.T) { - // TODO: Fix this test - skipInCI(t) t.Parallel() + // TODO: Fix this test + testhelpers.SkipInCI(t) doTestOnboardTokenPoolForSelfServe(t, true) } diff --git a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go index cdb6b0f224f..7e082295d9a 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/testutils_test.go @@ -1,7 +1,6 @@ package solana_test import ( - "os" "testing" solBinary "github.com/gagliardetto/binary" @@ -19,15 +18,6 @@ import ( "github.com/stretchr/testify/require" ) -func skipInCI(t *testing.T) { - t.Helper() - - ci := os.Getenv("CI") == "true" - if ci { - t.Skip("Skipping in CI") - } -} - func initialDeployCS(t *testing.T, e cldf.Environment, buildConfig *ccipChangesetSolana.BuildSolanaConfig) []commonchangeset.ConfiguredChangeSet { evmSelectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM)) homeChainSel := evmSelectors[0] diff --git a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_integ_test.go b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_integ_test.go index 163f99158b9..92ae67fa236 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_integ_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_integ_test.go @@ -197,7 +197,7 @@ func prepareEnvironmentForOwnershipTransfer(t *testing.T) (cldf.Environment, sta func TestTransferCCIPToMCMSWithTimelockSolana(t *testing.T) { t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) e, state := prepareEnvironmentForOwnershipTransfer(t) solSelector := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chainselectors.FamilySolana))[0] @@ -289,7 +289,7 @@ func TestTransferCCIPToMCMSWithTimelockSolana(t *testing.T) { func TestTransferCCIPFromMCMSWithTimelockSolana(t *testing.T) { t.Parallel() - skipInCI(t) + testhelpers.SkipInCI(t) e, state := prepareEnvironmentForOwnershipTransfer(t) solSelector := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chainselectors.FamilySolana))[0] diff --git a/deployment/ccip/changeset/testhelpers/cciptesthelpertypes/types_test.go b/deployment/ccip/changeset/testhelpers/cciptesthelpertypes/types_test.go index b709adb9e2a..9811ba66d74 100644 --- a/deployment/ccip/changeset/testhelpers/cciptesthelpertypes/types_test.go +++ b/deployment/ccip/changeset/testhelpers/cciptesthelpertypes/types_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package cciptesthelpertypes import ( diff --git a/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_1.go b/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_1.go index e321cc6b2dc..de1d205f083 100644 --- a/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_1.go +++ b/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_1.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "math/big" + "os" "regexp" "testing" "time" @@ -49,6 +50,15 @@ import ( "github.com/smartcontractkit/chainlink/deployment/utils/solutils" ) +func SkipInCI(t *testing.T) { + t.Helper() + + ci := os.Getenv("CI") == "true" + if ci { + t.Skip("Skipping in CI") + } +} + func TransferOwnershipSolanaV0_1_1( t *testing.T, e *cldf.Environment, diff --git a/deployment/ccip/changeset/v1_6/cs_ccip_home_test.go b/deployment/ccip/changeset/v1_6/cs_ccip_home_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_6/cs_ccip_home_test.go rename to deployment/ccip/changeset/v1_6/cs_ccip_home_integ_test.go index adc41800853..fce7950a6dd 100644 --- a/deployment/ccip/changeset/v1_6/cs_ccip_home_test.go +++ b/deployment/ccip/changeset/v1_6/cs_ccip_home_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_6_test import ( diff --git a/deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go b/deployment/ccip/changeset/v1_6/cs_chain_contracts_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go rename to deployment/ccip/changeset/v1_6/cs_chain_contracts_integ_test.go index 6d8af23e446..07a70834a60 100644 --- a/deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go +++ b/deployment/ccip/changeset/v1_6/cs_chain_contracts_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_6_test import ( diff --git a/deployment/ccip/changeset/v1_6/cs_home_chain_test.go b/deployment/ccip/changeset/v1_6/cs_home_chain_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_6/cs_home_chain_test.go rename to deployment/ccip/changeset/v1_6/cs_home_chain_integ_test.go index f6363f65cf5..aa13945caad 100644 --- a/deployment/ccip/changeset/v1_6/cs_home_chain_test.go +++ b/deployment/ccip/changeset/v1_6/cs_home_chain_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_6_test import ( diff --git a/deployment/ccip/changeset/v1_6/cs_home_chain_unit_test.go b/deployment/ccip/changeset/v1_6/cs_home_chain_unit_test.go new file mode 100644 index 00000000000..40752433e3e --- /dev/null +++ b/deployment/ccip/changeset/v1_6/cs_home_chain_unit_test.go @@ -0,0 +1,71 @@ +//go:build !integration + +package v1_6_test + +import ( + "testing" + + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" + "github.com/smartcontractkit/chainlink/deployment/common/view/v1_0" +) + +func TestDeployHomeChain(t *testing.T) { + t.Parallel() + + homeChainSel := chain_selectors.TEST_90000001.Selector + env, err := environment.New(t.Context(), + environment.WithEVMSimulated(t, []uint64{homeChainSel}), + environment.WithLogger(logger.Test(t)), + ) + require.NoError(t, err) + + testhelpers.RegisterNodes(t, env, 4, homeChainSel) + + e := *env + + nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) + require.NoError(t, err) + p2pIds := nodes.NonBootstraps().PeerIDs() + homeChainCfg := v1_6.DeployHomeChainConfig{ + HomeChainSel: homeChainSel, + RMNStaticConfig: testhelpers.NewTestRMNStaticConfig(), + RMNDynamicConfig: testhelpers.NewTestRMNDynamicConfig(), + NodeOperators: testhelpers.NewTestNodeOperator(e.BlockChains.EVMChains()[homeChainSel].DeployerKey.From), + NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ + "NodeOperator": p2pIds, + }, + } + output, err := v1_6.DeployHomeChainChangeset(e, homeChainCfg) + require.NoError(t, err) + require.NoError(t, e.ExistingAddresses.Merge(output.AddressBook)) + state, err := stateview.LoadOnchainState(e) + require.NoError(t, err) + require.NotNil(t, state.Chains[homeChainSel].CapabilityRegistry) + require.NotNil(t, state.Chains[homeChainSel].CCIPHome) + require.NotNil(t, state.Chains[homeChainSel].RMNHome) + view, err := state.View(&e, []uint64{homeChainSel}) + require.NoError(t, err) + chainName := e.BlockChains.EVMChains()[homeChainSel].Name() + _, ok := view.Chains[chainName] + require.True(t, ok) + capRegSnap, ok := view.Chains[chainName].CapabilityRegistry[state.Chains[homeChainSel].CapabilityRegistry.Address().String()] + require.True(t, ok) + require.NotNil(t, capRegSnap) + require.Equal(t, []v1_0.NopView{ + { + Admin: e.BlockChains.EVMChains()[homeChainSel].DeployerKey.From, + Name: "NodeOperator", + }, + }, capRegSnap.Nops) + require.Len(t, capRegSnap.Nodes, len(p2pIds)) +} diff --git a/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go b/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go rename to deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_integ_test.go index 331ced603b6..5cf9f23f41f 100644 --- a/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go +++ b/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_6_test import ( diff --git a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go rename to deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_unit_test.go index 39db02547e2..c6ed64c5501 100644 --- a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go +++ b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package v1_6_test import ( From 6f0397cac117d24aae88ff84d057fd447084c311 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 15:44:46 -0800 Subject: [PATCH 20/22] fix: artifact naming for tests --- .github/workflows/ci-core-integration.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-core-integration.yml b/.github/workflows/ci-core-integration.yml index 8cdcbd64a8c..7ff52dd072c 100644 --- a/.github/workflows/ci-core-integration.yml +++ b/.github/workflows/ci-core-integration.yml @@ -163,11 +163,22 @@ jobs: GODEBUG=goindex=0 ./tools/bin/${{ matrix.type.cmd }} ./... # See: https://github.com/golang/go/issues/69179 + - name: Artifact name + id: artifact-name + if: ${{ always() }} + env: + CMD: ${{ matrix.type.cmd }} + TAGS: ${{ matrix.type.tags }} + run: | + # replace spaces with underscores for artifact names + TAGS_UNDERSCORED=${TAGS// /_} + echo "artifact-name=${CMD}_${TAGS_UNDERSCORED}_logs" | tee -a "$GITHUB_OUTPUT" + - name: Store logs artifacts if: ${{ always() }} uses: actions/upload-artifact@v4 with: - name: ${{ matrix.type.cmd }}_logs + name: ${{ steps.artifact-name.outputs.artifact-name }} path: | ./output.txt ./output-short.txt From cdf4c173fb3b6566b06dfd4ad2c26c3050b44b76 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 16:00:39 -0800 Subject: [PATCH 21/22] more tagging --- ...test.go => accept_ownership_integ_test.go} | 2 + ...t.go => cs_active_candidate_integ_test.go} | 2 + ...lane_test.go => cs_add_lane_integ_test.go} | 2 + ....go => cs_add_new_chain_e2e_integ_test.go} | 2 + .../v1_6/cs_deploy_chain_integ_test.go | 32 ++ ...n_test.go => cs_deploy_chain_unit_test.go} | 18 +- ...bspec_test.go => cs_jobspec_integ_test.go} | 2 + ...s_update_bidirectional_lanes_integ_test.go | 289 ++++++++++++++++++ ...cs_update_bidirectional_lanes_unit_test.go | 235 -------------- ...tp_message_transmitter_proxy_unit_test.go} | 2 + ...p_test.go => deployer_group_integ_test.go} | 2 + 11 files changed, 337 insertions(+), 251 deletions(-) rename deployment/ccip/changeset/v1_6/{accept_ownership_test.go => accept_ownership_integ_test.go} (97%) rename deployment/ccip/changeset/v1_6/{cs_active_candidate_test.go => cs_active_candidate_integ_test.go} (99%) rename deployment/ccip/changeset/v1_6/{cs_add_lane_test.go => cs_add_lane_integ_test.go} (99%) rename deployment/ccip/changeset/v1_6/{cs_add_new_chain_e2e_test.go => cs_add_new_chain_e2e_integ_test.go} (99%) create mode 100644 deployment/ccip/changeset/v1_6/cs_deploy_chain_integ_test.go rename deployment/ccip/changeset/v1_6/{cs_deploy_chain_test.go => cs_deploy_chain_unit_test.go} (93%) rename deployment/ccip/changeset/v1_6/{cs_jobspec_test.go => cs_jobspec_integ_test.go} (98%) create mode 100644 deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_integ_test.go rename deployment/ccip/changeset/v1_6_2/{cs_configure_cctp_message_transmitter_proxy_test.go => cs_configure_cctp_message_transmitter_proxy_unit_test.go} (99%) rename deployment/ccip/shared/deployergroup/{deployer_group_test.go => deployer_group_integ_test.go} (99%) diff --git a/deployment/ccip/changeset/v1_6/accept_ownership_test.go b/deployment/ccip/changeset/v1_6/accept_ownership_integ_test.go similarity index 97% rename from deployment/ccip/changeset/v1_6/accept_ownership_test.go rename to deployment/ccip/changeset/v1_6/accept_ownership_integ_test.go index b75a3fa19d7..c1101929975 100644 --- a/deployment/ccip/changeset/v1_6/accept_ownership_test.go +++ b/deployment/ccip/changeset/v1_6/accept_ownership_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_6_test import ( diff --git a/deployment/ccip/changeset/v1_6/cs_active_candidate_test.go b/deployment/ccip/changeset/v1_6/cs_active_candidate_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_6/cs_active_candidate_test.go rename to deployment/ccip/changeset/v1_6/cs_active_candidate_integ_test.go index 33ebd1b7b45..242e998b90e 100644 --- a/deployment/ccip/changeset/v1_6/cs_active_candidate_test.go +++ b/deployment/ccip/changeset/v1_6/cs_active_candidate_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_6_test import ( diff --git a/deployment/ccip/changeset/v1_6/cs_add_lane_test.go b/deployment/ccip/changeset/v1_6/cs_add_lane_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_6/cs_add_lane_test.go rename to deployment/ccip/changeset/v1_6/cs_add_lane_integ_test.go index 80beb5a4cc0..7e15f4887c9 100644 --- a/deployment/ccip/changeset/v1_6/cs_add_lane_test.go +++ b/deployment/ccip/changeset/v1_6/cs_add_lane_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_6_test import ( diff --git a/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go b/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go rename to deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_integ_test.go index a53b0badc16..6866ed6248b 100644 --- a/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go +++ b/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_6_test import ( diff --git a/deployment/ccip/changeset/v1_6/cs_deploy_chain_integ_test.go b/deployment/ccip/changeset/v1_6/cs_deploy_chain_integ_test.go new file mode 100644 index 00000000000..a37d4d68855 --- /dev/null +++ b/deployment/ccip/changeset/v1_6/cs_deploy_chain_integ_test.go @@ -0,0 +1,32 @@ +//go:build integration && db + +package v1_6_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + chain_selectors "github.com/smartcontractkit/chain-selectors" + + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" +) + +func TestDeployCCIPContracts(t *testing.T) { + t.Parallel() + testhelpers.DeployCCIPContractsTest(t, 0, 0) +} + +func TestDeployStaticLinkToken(t *testing.T) { + t.Parallel() + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithStaticLink()) + // load onchain state + state, err := stateview.LoadOnchainState(e.Env) + require.NoError(t, err) + for _, chain := range e.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM)) { + require.NotNil(t, state.Chains[chain].StaticLinkToken) + } +} diff --git a/deployment/ccip/changeset/v1_6/cs_deploy_chain_test.go b/deployment/ccip/changeset/v1_6/cs_deploy_chain_unit_test.go similarity index 93% rename from deployment/ccip/changeset/v1_6/cs_deploy_chain_test.go rename to deployment/ccip/changeset/v1_6/cs_deploy_chain_unit_test.go index 429a0744f61..3e5855635fb 100644 --- a/deployment/ccip/changeset/v1_6/cs_deploy_chain_test.go +++ b/deployment/ccip/changeset/v1_6/cs_deploy_chain_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package v1_6_test import ( @@ -175,19 +177,3 @@ func testDeployChainContractsChangesetWithEnv(t *testing.T, e cldf.Environment, require.Equal(t, state.Chains[sel].OnRamp, postState.Chains[sel].OnRamp) } } - -func TestDeployCCIPContracts(t *testing.T) { - t.Parallel() - testhelpers.DeployCCIPContractsTest(t, 0, 0) -} - -func TestDeployStaticLinkToken(t *testing.T) { - t.Parallel() - e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithStaticLink()) - // load onchain state - state, err := stateview.LoadOnchainState(e.Env) - require.NoError(t, err) - for _, chain := range e.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM)) { - require.NotNil(t, state.Chains[chain].StaticLinkToken) - } -} diff --git a/deployment/ccip/changeset/v1_6/cs_jobspec_test.go b/deployment/ccip/changeset/v1_6/cs_jobspec_integ_test.go similarity index 98% rename from deployment/ccip/changeset/v1_6/cs_jobspec_test.go rename to deployment/ccip/changeset/v1_6/cs_jobspec_integ_test.go index 5c7e008903c..58bb4c15857 100644 --- a/deployment/ccip/changeset/v1_6/cs_jobspec_test.go +++ b/deployment/ccip/changeset/v1_6/cs_jobspec_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_6_test import ( diff --git a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_integ_test.go b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_integ_test.go new file mode 100644 index 00000000000..71fff04eddd --- /dev/null +++ b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_integ_test.go @@ -0,0 +1,289 @@ +//go:build integration && db + +package v1_6_test + +import ( + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/mcms/types" + "github.com/stretchr/testify/require" + + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" +) + +type laneDefinition struct { + Source v1_6.ChainDefinition + Dest v1_6.ChainDefinition +} + +func getAllPossibleLanes(chains []v1_6.ChainDefinition, disable bool) []v1_6.BidirectionalLaneDefinition { + lanes := make([]v1_6.BidirectionalLaneDefinition, 0) + paired := make(map[uint64]map[uint64]bool) + + for i, chainA := range chains { + for j, chainB := range chains { + if i == j { + continue + } + if paired[chainA.Selector] != nil && paired[chainA.Selector][chainB.Selector] { + continue + } + if paired[chainB.Selector] != nil && paired[chainB.Selector][chainA.Selector] { + continue + } + + lanes = append(lanes, v1_6.BidirectionalLaneDefinition{ + Chains: [2]v1_6.ChainDefinition{chainA, chainB}, + IsDisabled: disable, + }) + if paired[chainA.Selector] == nil { + paired[chainA.Selector] = make(map[uint64]bool) + } + paired[chainA.Selector][chainB.Selector] = true + if paired[chainB.Selector] == nil { + paired[chainB.Selector] = make(map[uint64]bool) + } + paired[chainB.Selector][chainA.Selector] = true + } + } + + return lanes +} + +func getRemoteChains(chains []v1_6.ChainDefinition, currentIndex int) []v1_6.ChainDefinition { + remoteChains := make([]v1_6.ChainDefinition, 0, len(chains)-1) + for i, chain := range chains { + if i == currentIndex { + continue + } + remoteChains = append(remoteChains, chain) + } + return remoteChains +} + +func checkBidirectionalLaneConnectivity( + t *testing.T, + e cldf.Environment, + state stateview.CCIPOnChainState, + chainOne v1_6.ChainDefinition, + chainTwo v1_6.ChainDefinition, + testRouter bool, + disable bool, +) { + lanes := []laneDefinition{ + { + Source: chainOne, + Dest: chainTwo, + }, + { + Source: chainTwo, + Dest: chainOne, + }, + } + for _, lane := range lanes { + onRamp := state.Chains[lane.Source.Selector].OnRamp + offRamp := state.Chains[lane.Dest.Selector].OffRamp + feeQuoterOnSrc := state.Chains[lane.Source.Selector].FeeQuoter + routerOnSrc := state.Chains[lane.Source.Selector].Router + routerOnDest := state.Chains[lane.Dest.Selector].Router + if testRouter { + routerOnSrc = state.Chains[lane.Source.Selector].TestRouter + routerOnDest = state.Chains[lane.Dest.Selector].TestRouter + } + + destChainConfig, err := onRamp.GetDestChainConfig(nil, lane.Dest.Selector) + require.NoError(t, err, "must get dest chain config from onRamp") + routerAddr := routerOnSrc.Address().Hex() + if disable { + routerAddr = common.HexToAddress("0x0").Hex() + } + require.Equal(t, routerAddr, destChainConfig.Router.Hex(), "router must equal expected") + require.Equal(t, lane.Dest.AllowListEnabled, destChainConfig.AllowlistEnabled, "allowListEnabled must equal expected") + + srcChainConfig, err := offRamp.GetSourceChainConfig(nil, lane.Source.Selector) + require.NoError(t, err, "must get src chain config from offRamp") + require.Equal(t, !disable, srcChainConfig.IsEnabled, "isEnabled must be expected") + require.Equal(t, lane.Source.RMNVerificationDisabled, srcChainConfig.IsRMNVerificationDisabled, "rmnVerificationDisabled must equal expected") + require.Equal(t, common.LeftPadBytes(state.Chains[lane.Source.Selector].OnRamp.Address().Bytes(), 32), srcChainConfig.OnRamp, "remote onRamp must be set on offRamp") + require.Equal(t, routerOnDest.Address().Hex(), srcChainConfig.Router.Hex(), "router must equal expected") + + isOffRamp, err := routerOnSrc.IsOffRamp(nil, lane.Dest.Selector, state.Chains[lane.Source.Selector].OffRamp.Address()) + require.NoError(t, err, "must check if router has offRamp") + require.Equal(t, !disable, isOffRamp, "isOffRamp result must equal expected") + onRampOnRouter, err := routerOnSrc.GetOnRamp(nil, lane.Dest.Selector) + require.NoError(t, err, "must get onRamp from router") + onRampAddr := state.Chains[lane.Source.Selector].OnRamp.Address().Hex() + if disable { + onRampAddr = common.HexToAddress("0x0").Hex() + } + require.Equal(t, onRampAddr, onRampOnRouter.Hex(), "onRamp must equal expected") + + isOffRamp, err = routerOnDest.IsOffRamp(nil, lane.Source.Selector, state.Chains[lane.Dest.Selector].OffRamp.Address()) + require.NoError(t, err, "must check if router has offRamp") + require.Equal(t, !disable, isOffRamp, "isOffRamp result must equal expected") + onRampOnRouter, err = routerOnDest.GetOnRamp(nil, lane.Source.Selector) + require.NoError(t, err, "must get onRamp from router") + onRampAddr = state.Chains[lane.Dest.Selector].OnRamp.Address().Hex() + if disable { + onRampAddr = common.HexToAddress("0x0").Hex() + } + require.Equal(t, onRampAddr, onRampOnRouter.Hex(), "onRamp must equal expected") + + feeQuoterDestConfig, err := feeQuoterOnSrc.GetDestChainConfig(nil, lane.Dest.Selector) + require.NoError(t, err, "must get dest chain config from feeQuoter") + require.Equal(t, lane.Dest.FeeQuoterDestChainConfig, feeQuoterDestConfig, "feeQuoter dest chain config must equal expected") + + price, err := feeQuoterOnSrc.GetDestinationChainGasPrice(nil, lane.Dest.Selector) + require.NoError(t, err, "must get price from feeQuoter") + require.Equal(t, lane.Dest.GasPrice, price.Value, "price must equal expected") + } +} + +func TestUpdateBidirectionalLanesChangeset(t *testing.T) { + t.Parallel() + + type test struct { + Msg string + TestRouter bool + MCMS *proposalutils.TimelockConfig + Disable bool + } + + mcmsConfig := &proposalutils.TimelockConfig{ + MinDelay: 0 * time.Second, + MCMSAction: types.TimelockActionSchedule, + } + + tests := []test{ + { + Msg: "Use production router (with MCMS) & disable afterwards", + TestRouter: false, + MCMS: mcmsConfig, + Disable: true, + }, + { + Msg: "Use production router (with MCMS)", + TestRouter: false, + MCMS: mcmsConfig, + }, + { + Msg: "Use test router (without MCMS)", + TestRouter: true, + MCMS: nil, + }, + { + Msg: "Use test router (with MCMS for other contracts)", + TestRouter: true, + MCMS: mcmsConfig, + }, + } + + for _, test := range tests { + t.Run(test.Msg, func(t *testing.T) { + deployedEnvironment, _ := testhelpers.NewMemoryEnvironment(t, func(testCfg *testhelpers.TestConfigs) { + testCfg.Chains = 3 + }) + e := deployedEnvironment.Env + + state, err := stateview.LoadOnchainState(e) + require.NoError(t, err, "must load onchain state") + + selectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM)) + + if test.MCMS != nil { + contractsToTransfer := make(map[uint64][]common.Address, len(selectors)) + for _, selector := range selectors { + contractsToTransfer[selector] = []common.Address{ + state.Chains[selector].OnRamp.Address(), + state.Chains[selector].OffRamp.Address(), + state.Chains[selector].Router.Address(), + state.Chains[selector].FeeQuoter.Address(), + state.Chains[selector].TokenAdminRegistry.Address(), + state.Chains[selector].RMNRemote.Address(), + state.Chains[selector].RMNProxy.Address(), + state.Chains[selector].NonceManager.Address(), + } + } + e, err = commonchangeset.Apply(t, e, + commonchangeset.Configure( + cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), + commoncs.TransferToMCMSWithTimelockConfig{ + ContractsByChain: contractsToTransfer, + MCMSConfig: proposalutils.TimelockConfig{ + MinDelay: 0 * time.Second, + MCMSAction: types.TimelockActionSchedule, + }, + }, + ), + ) + require.NoError(t, err, "must apply TransferToMCMSWithTimelock") + } + + chains := make([]v1_6.ChainDefinition, len(selectors)) + for i, selector := range selectors { + chains[i] = v1_6.ChainDefinition{ + ConnectionConfig: v1_6.ConnectionConfig{ + RMNVerificationDisabled: true, + AllowListEnabled: false, + }, + Selector: selector, + GasPrice: big.NewInt(1e17), + FeeQuoterDestChainConfig: v1_6.DefaultFeeQuoterDestChainConfig(true), + } + } + + e, err = commonchangeset.Apply(t, e, + commonchangeset.Configure( + v1_6.UpdateBidirectionalLanesChangeset, + v1_6.UpdateBidirectionalLanesConfig{ + TestRouter: test.TestRouter, + MCMSConfig: test.MCMS, + Lanes: getAllPossibleLanes(chains, false), + }, + ), + ) + require.NoError(t, err, "must apply AddBidirectionalLanesChangeset") + + for i, chain := range chains { + remoteChains := getRemoteChains(chains, i) + for _, remoteChain := range remoteChains { + checkBidirectionalLaneConnectivity(t, e, state, chain, remoteChain, test.TestRouter, false) + } + } + + if test.Disable { + e, err = commonchangeset.Apply(t, e, + commonchangeset.Configure( + v1_6.UpdateBidirectionalLanesChangeset, + v1_6.UpdateBidirectionalLanesConfig{ + TestRouter: test.TestRouter, + MCMSConfig: test.MCMS, + Lanes: getAllPossibleLanes(chains, true), + }, + ), + ) + require.NoError(t, err, "must apply AddBidirectionalLanesChangeset") + + for i, chain := range chains { + remoteChains := getRemoteChains(chains, i) + for _, remoteChain := range remoteChains { + checkBidirectionalLaneConnectivity(t, e, state, chain, remoteChain, test.TestRouter, true) + } + } + } + }) + } +} diff --git a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_unit_test.go b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_unit_test.go index c6ed64c5501..c90289fc214 100644 --- a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_unit_test.go +++ b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_unit_test.go @@ -7,22 +7,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - chain_selectors "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" - cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" - "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) @@ -65,95 +55,6 @@ func getAllPossibleLanes(chains []v1_6.ChainDefinition, disable bool) []v1_6.Bid return lanes } -func getRemoteChains(chains []v1_6.ChainDefinition, currentIndex int) []v1_6.ChainDefinition { - remoteChains := make([]v1_6.ChainDefinition, 0, len(chains)-1) - for i, chain := range chains { - if i == currentIndex { - continue - } - remoteChains = append(remoteChains, chain) - } - return remoteChains -} - -func checkBidirectionalLaneConnectivity( - t *testing.T, - e cldf.Environment, - state stateview.CCIPOnChainState, - chainOne v1_6.ChainDefinition, - chainTwo v1_6.ChainDefinition, - testRouter bool, - disable bool, -) { - lanes := []laneDefinition{ - { - Source: chainOne, - Dest: chainTwo, - }, - { - Source: chainTwo, - Dest: chainOne, - }, - } - for _, lane := range lanes { - onRamp := state.Chains[lane.Source.Selector].OnRamp - offRamp := state.Chains[lane.Dest.Selector].OffRamp - feeQuoterOnSrc := state.Chains[lane.Source.Selector].FeeQuoter - routerOnSrc := state.Chains[lane.Source.Selector].Router - routerOnDest := state.Chains[lane.Dest.Selector].Router - if testRouter { - routerOnSrc = state.Chains[lane.Source.Selector].TestRouter - routerOnDest = state.Chains[lane.Dest.Selector].TestRouter - } - - destChainConfig, err := onRamp.GetDestChainConfig(nil, lane.Dest.Selector) - require.NoError(t, err, "must get dest chain config from onRamp") - routerAddr := routerOnSrc.Address().Hex() - if disable { - routerAddr = common.HexToAddress("0x0").Hex() - } - require.Equal(t, routerAddr, destChainConfig.Router.Hex(), "router must equal expected") - require.Equal(t, lane.Dest.AllowListEnabled, destChainConfig.AllowlistEnabled, "allowListEnabled must equal expected") - - srcChainConfig, err := offRamp.GetSourceChainConfig(nil, lane.Source.Selector) - require.NoError(t, err, "must get src chain config from offRamp") - require.Equal(t, !disable, srcChainConfig.IsEnabled, "isEnabled must be expected") - require.Equal(t, lane.Source.RMNVerificationDisabled, srcChainConfig.IsRMNVerificationDisabled, "rmnVerificationDisabled must equal expected") - require.Equal(t, common.LeftPadBytes(state.Chains[lane.Source.Selector].OnRamp.Address().Bytes(), 32), srcChainConfig.OnRamp, "remote onRamp must be set on offRamp") - require.Equal(t, routerOnDest.Address().Hex(), srcChainConfig.Router.Hex(), "router must equal expected") - - isOffRamp, err := routerOnSrc.IsOffRamp(nil, lane.Dest.Selector, state.Chains[lane.Source.Selector].OffRamp.Address()) - require.NoError(t, err, "must check if router has offRamp") - require.Equal(t, !disable, isOffRamp, "isOffRamp result must equal expected") - onRampOnRouter, err := routerOnSrc.GetOnRamp(nil, lane.Dest.Selector) - require.NoError(t, err, "must get onRamp from router") - onRampAddr := state.Chains[lane.Source.Selector].OnRamp.Address().Hex() - if disable { - onRampAddr = common.HexToAddress("0x0").Hex() - } - require.Equal(t, onRampAddr, onRampOnRouter.Hex(), "onRamp must equal expected") - - isOffRamp, err = routerOnDest.IsOffRamp(nil, lane.Source.Selector, state.Chains[lane.Dest.Selector].OffRamp.Address()) - require.NoError(t, err, "must check if router has offRamp") - require.Equal(t, !disable, isOffRamp, "isOffRamp result must equal expected") - onRampOnRouter, err = routerOnDest.GetOnRamp(nil, lane.Source.Selector) - require.NoError(t, err, "must get onRamp from router") - onRampAddr = state.Chains[lane.Dest.Selector].OnRamp.Address().Hex() - if disable { - onRampAddr = common.HexToAddress("0x0").Hex() - } - require.Equal(t, onRampAddr, onRampOnRouter.Hex(), "onRamp must equal expected") - - feeQuoterDestConfig, err := feeQuoterOnSrc.GetDestChainConfig(nil, lane.Dest.Selector) - require.NoError(t, err, "must get dest chain config from feeQuoter") - require.Equal(t, lane.Dest.FeeQuoterDestChainConfig, feeQuoterDestConfig, "feeQuoter dest chain config must equal expected") - - price, err := feeQuoterOnSrc.GetDestinationChainGasPrice(nil, lane.Dest.Selector) - require.NoError(t, err, "must get price from feeQuoter") - require.Equal(t, lane.Dest.GasPrice, price.Value, "price must equal expected") - } -} - func TestBuildConfigs(t *testing.T) { selectors := []uint64{1, 2} @@ -267,139 +168,3 @@ func TestBuildConfigs(t *testing.T) { MCMS: cfg.MCMSConfig, }, configs.UpdateRouterRampsConfig) } - -func TestUpdateBidirectionalLanesChangeset(t *testing.T) { - t.Parallel() - - type test struct { - Msg string - TestRouter bool - MCMS *proposalutils.TimelockConfig - Disable bool - } - - mcmsConfig := &proposalutils.TimelockConfig{ - MinDelay: 0 * time.Second, - MCMSAction: types.TimelockActionSchedule, - } - - tests := []test{ - { - Msg: "Use production router (with MCMS) & disable afterwards", - TestRouter: false, - MCMS: mcmsConfig, - Disable: true, - }, - { - Msg: "Use production router (with MCMS)", - TestRouter: false, - MCMS: mcmsConfig, - }, - { - Msg: "Use test router (without MCMS)", - TestRouter: true, - MCMS: nil, - }, - { - Msg: "Use test router (with MCMS for other contracts)", - TestRouter: true, - MCMS: mcmsConfig, - }, - } - - for _, test := range tests { - t.Run(test.Msg, func(t *testing.T) { - deployedEnvironment, _ := testhelpers.NewMemoryEnvironment(t, func(testCfg *testhelpers.TestConfigs) { - testCfg.Chains = 3 - }) - e := deployedEnvironment.Env - - state, err := stateview.LoadOnchainState(e) - require.NoError(t, err, "must load onchain state") - - selectors := e.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM)) - - if test.MCMS != nil { - contractsToTransfer := make(map[uint64][]common.Address, len(selectors)) - for _, selector := range selectors { - contractsToTransfer[selector] = []common.Address{ - state.Chains[selector].OnRamp.Address(), - state.Chains[selector].OffRamp.Address(), - state.Chains[selector].Router.Address(), - state.Chains[selector].FeeQuoter.Address(), - state.Chains[selector].TokenAdminRegistry.Address(), - state.Chains[selector].RMNRemote.Address(), - state.Chains[selector].RMNProxy.Address(), - state.Chains[selector].NonceManager.Address(), - } - } - e, err = commonchangeset.Apply(t, e, - commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), - commoncs.TransferToMCMSWithTimelockConfig{ - ContractsByChain: contractsToTransfer, - MCMSConfig: proposalutils.TimelockConfig{ - MinDelay: 0 * time.Second, - MCMSAction: types.TimelockActionSchedule, - }, - }, - ), - ) - require.NoError(t, err, "must apply TransferToMCMSWithTimelock") - } - - chains := make([]v1_6.ChainDefinition, len(selectors)) - for i, selector := range selectors { - chains[i] = v1_6.ChainDefinition{ - ConnectionConfig: v1_6.ConnectionConfig{ - RMNVerificationDisabled: true, - AllowListEnabled: false, - }, - Selector: selector, - GasPrice: big.NewInt(1e17), - FeeQuoterDestChainConfig: v1_6.DefaultFeeQuoterDestChainConfig(true), - } - } - - e, err = commonchangeset.Apply(t, e, - commonchangeset.Configure( - v1_6.UpdateBidirectionalLanesChangeset, - v1_6.UpdateBidirectionalLanesConfig{ - TestRouter: test.TestRouter, - MCMSConfig: test.MCMS, - Lanes: getAllPossibleLanes(chains, false), - }, - ), - ) - require.NoError(t, err, "must apply AddBidirectionalLanesChangeset") - - for i, chain := range chains { - remoteChains := getRemoteChains(chains, i) - for _, remoteChain := range remoteChains { - checkBidirectionalLaneConnectivity(t, e, state, chain, remoteChain, test.TestRouter, false) - } - } - - if test.Disable { - e, err = commonchangeset.Apply(t, e, - commonchangeset.Configure( - v1_6.UpdateBidirectionalLanesChangeset, - v1_6.UpdateBidirectionalLanesConfig{ - TestRouter: test.TestRouter, - MCMSConfig: test.MCMS, - Lanes: getAllPossibleLanes(chains, true), - }, - ), - ) - require.NoError(t, err, "must apply AddBidirectionalLanesChangeset") - - for i, chain := range chains { - remoteChains := getRemoteChains(chains, i) - for _, remoteChain := range remoteChains { - checkBidirectionalLaneConnectivity(t, e, state, chain, remoteChain, test.TestRouter, true) - } - } - } - }) - } -} diff --git a/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy_test.go b/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy_unit_test.go similarity index 99% rename from deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy_test.go rename to deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy_unit_test.go index 114a36be2f8..38844cfa157 100644 --- a/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy_test.go +++ b/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy_unit_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package v1_6_2_test import ( diff --git a/deployment/ccip/shared/deployergroup/deployer_group_test.go b/deployment/ccip/shared/deployergroup/deployer_group_integ_test.go similarity index 99% rename from deployment/ccip/shared/deployergroup/deployer_group_test.go rename to deployment/ccip/shared/deployergroup/deployer_group_integ_test.go index b47a377c747..c0a45b79f01 100644 --- a/deployment/ccip/shared/deployergroup/deployer_group_test.go +++ b/deployment/ccip/shared/deployergroup/deployer_group_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package deployergroup_test import ( From f90ebf820741ad4e419960a9a82dcd1ebe756240 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 5 Dec 2025 16:07:53 -0800 Subject: [PATCH 22/22] last one? --- ...n_from_v1_5_test.go => cs_migration_from_v1_5_integ_test.go} | 2 ++ 1 file changed, 2 insertions(+) rename deployment/ccip/changeset/v1_6/{cs_migration_from_v1_5_test.go => cs_migration_from_v1_5_integ_test.go} (99%) diff --git a/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go b/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_integ_test.go similarity index 99% rename from deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go rename to deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_integ_test.go index eb392ea9458..a51f73d6d70 100644 --- a/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go +++ b/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_integ_test.go @@ -1,3 +1,5 @@ +//go:build integration && db + package v1_6_test import (