chore: move save_existing.go changeset out of common [CLD-2109]#22289
Merged
ChrisAmora merged 2 commits intodevelopfrom May 5, 2026
Merged
chore: move save_existing.go changeset out of common [CLD-2109]#22289ChrisAmora merged 2 commits intodevelopfrom
ChrisAmora merged 2 commits intodevelopfrom
Conversation
Contributor
|
✅ No conflicts with other open PRs targeting |
|
Contributor
There was a problem hiding this comment.
Pull request overview
Risk Rating: MEDIUM — introduces a new SaveExistingContractsChangeset implementation under deployment/ccip/changeset (including address validation logic) and rewires CCIP v1.6 E2E logic/tests to use the new types; mistakes here can break deployment-time config handling.
Changes:
- Moved the “save existing contracts” changeset API into
deployment/ccip/changesetand updated CCIP v1.6 codepaths to use it. - Refactored tests: migrated former common tests into CCIP changeset tests and added an integration-style CCIP state-loading test.
- Updated Solana and v1.6 E2E test/config code to reference the new
ExistingContractsConfig/Contracttypes.
Scrupulous human review recommended (targeted areas):
deployment/ccip/changeset/save_existing.go: address validation semantics (EVM vs Solana) and error wrapping/diagnostics.deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e.go:RemoveLinkTokenAddressIfExistsmutation behavior and whether config validation expectations changed.deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go: import block correctness and CI/lint compliance for tests.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| deployment/common/changeset/save_existing_test.go | Removed tests from common package as part of moving functionality to CCIP. |
| deployment/ccip/changeset/save_existing.go | New CCIP-scoped changeset implementation with per-family address validation. |
| deployment/ccip/changeset/save_existing_test.go | Unit tests for saving existing contracts, including label handling and MCMS label loading. |
| deployment/ccip/changeset/save_existing_ccip_test.go | Added integration-style test verifying CCIP state loads correctly after saving addresses. |
| deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e.go | Switched new-chain config and save-existing invocation to CCIP changeset types. |
| deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go | Updated tests to build ExistingContractsConfig using the CCIP changeset package. |
| deployment/ccip/changeset/solana_v0_1_1/save_existing_test.go | Updated Solana tests to use the CCIP changeset package location. |
Comment on lines
22
to
28
| mcmstypes "github.com/smartcontractkit/mcms/types" | ||
|
|
||
| "github.com/smartcontractkit/chainlink/deployment" | ||
| "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" | ||
| "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" | ||
| "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" | ||
| "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" |
Comment on lines
+139
to
142
| require.Len(t, addressForChain1, 1) | ||
| // load mcms state | ||
| mcmsState, err := changeset2.MaybeLoadMCMSWithTimelockChainState(dummyEnv.BlockChains.EVMChains()[chainsel.TEST_90000001.Selector], addressForChain1) | ||
| require.NoError(t, err) |
gustavogama-cll
approved these changes
May 4, 2026
ajaskolski
approved these changes
May 5, 2026
ChrisAmora
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Moving save existing changeset to ccip pkg. CCIP is the only user of these functions and they are using the address book which is deprecated.
AI Summary
This pull request refactors and reorganizes the tests for saving existing contract addresses in the deployment system. The main changes involve moving and updating test files, consolidating logic, and ensuring consistent usage of types and imports across the codebase. The tests are now better aligned with the new structure and more clearly separated between the
ccipandcommonmodules.Key changes include:
Test Refactoring and Consolidation
save_existing_test.gotest file fromdeployment/common/changesetand moved its tests todeployment/ccip/changeset/save_existing_test.go, updating them to use theccip/changesettypes and structure. [1] [2]deployment/ccip/changeset/save_existing_test.goto cover saving existing contracts, addresses with labels, and MCMS addresses, ensuring they use the correct environment and imports. [1] [2]Imports and Type Consistency
ccip/changesetpackage forExistingContractsConfigand related types, replacing previous references to thecommon/changesetpackage. [1] [2] [3] [4] [5] [6] [7] [8]Test Coverage Improvements
deployment/ccip/changeset/save_existing_ccip_test.go, which verifies the correct state is loaded after saving multiple contract types across multiple chains.These changes improve maintainability and clarity of the test suite for contract address management in the deployment framework, and ensure all tests use the latest structure and conventions.