chore: swap contract_state.go usages with cld-changesets#22282
chore: swap contract_state.go usages with cld-changesets#22282
Conversation
CORA - Pending Reviewers
Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown For more details, see the full review summary. |
|
✅ No conflicts with other open PRs targeting |
There was a problem hiding this comment.
Pull request overview
Risk Rating: MEDIUM
This PR refactors contract metadata handling in deployment “view” packages by replacing the local deployment/common/view/types contract metadata implementation with the shared github.com/smartcontractkit/cld-changesets/pkg/common implementation, and removing the now-redundant local file.
Changes:
- Replaced embedded
types.ContractMetaDatausages withcommoncldchangesets.ContractMetaDataacross CCIP, common, and data-feeds view packages. - Replaced calls to
types.NewContractMetaData(...)withcommoncldchangesets.NewContractMetaData(...). - Deleted
deployment/common/view/types/contract_state.go.
Scrupulous human review recommended (behavioral compatibility):
- Confirm
cld-changesetsContractMetaDataJSON shape/omitempty behavior matches the removed local struct, since these views are serialized. - Confirm
NewContractMetaDatahas identical semantics (e.g., same call opts / error wrapping expectations) for all wrapper interfaces used here.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| deployment/data-feeds/view/v1_0/cache_contract.go | Switches cache view metadata to cld-changesets common type/constructor. |
| deployment/common/view/v2_0/capreg_test.go | Updates tests to use cld-changesets ContractMetaData type. |
| deployment/common/view/v2_0/capreg.go | Updates capreg v2 view structs/JSON marshal helpers to embed cld-changesets metadata. |
| deployment/common/view/v1_0/workflowreg.go | Switches workflow registry view metadata to cld-changesets. |
| deployment/common/view/v1_0/mcms.go | Switches MCMS/timelock/callproxy view metadata structs to cld-changesets. |
| deployment/common/view/v1_0/capreg_test.go | Updates capreg v1 tests to use cld-changesets metadata type. |
| deployment/common/view/v1_0/capreg.go | Updates capreg v1 view structs/JSON marshal helpers to embed cld-changesets metadata. |
| deployment/common/view/types/contract_state.go | Removes local contract metadata implementation now replaced by cld-changesets. |
| deployment/ccip/view/v1_6/rmnremote.go | Switches RMNRemote view metadata to cld-changesets. |
| deployment/ccip/view/v1_6/rmnhome.go | Switches RMNHome view metadata to cld-changesets. |
| deployment/ccip/view/v1_6/onramp.go | Switches v1.6 onramp view metadata to cld-changesets. |
| deployment/ccip/view/v1_6/offramp.go | Switches v1.6 offramp view metadata to cld-changesets. |
| deployment/ccip/view/v1_6/noncemanager.go | Switches nonce manager view metadata to cld-changesets. |
| deployment/ccip/view/v1_6/feequoter.go | Switches fee quoter view metadata to cld-changesets. |
| deployment/ccip/view/v1_6/ccip_home.go | Switches CCIPHome view metadata to cld-changesets. |
| deployment/ccip/view/v1_5_1/token_pool.go | Switches token pool view metadata struct literal to cld-changesets. |
| deployment/ccip/view/v1_5/tokenadminregistry.go | Switches token admin registry view metadata to cld-changesets. |
| deployment/ccip/view/v1_5/token_pool.go | Switches token pool view metadata struct literal to cld-changesets. |
| deployment/ccip/view/v1_5/rmn.go | Switches RMN view metadata to cld-changesets. |
| deployment/ccip/view/v1_5/onramp.go | Switches v1.5 onramp view metadata to cld-changesets. |
| deployment/ccip/view/v1_5/offramp.go | Switches v1.5 offramp view metadata to cld-changesets. |
| deployment/ccip/view/v1_5/commit_store.go | Switches commit store view metadata to cld-changesets. |
| deployment/ccip/view/v1_2/router.go | Switches router view metadata to cld-changesets. |
| deployment/ccip/view/v1_2/price_registry.go | Switches price registry view metadata to cld-changesets. |
| deployment/ccip/view/v1_0/rmn_proxy_contract.go | Switches RMN proxy view metadata to cld-changesets. |
|
|
||
| "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_0_0/rmn_proxy_contract" | ||
| "github.com/smartcontractkit/chainlink/deployment/common/view/types" | ||
| commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" |
|




swap contract_state.go usages with cld-changesets and remove file from repo
AI Summary
This pull request refactors how contract metadata is handled across multiple CCIP deployment view packages. The main change is to replace the usage of the local
types.ContractMetaDataandtypes.NewContractMetaDatafromdeployment/common/view/typeswith the equivalent types and constructors from the sharedcld-changesets/pkg/commonpackage. This unifies contract metadata handling and reduces code duplication.Refactoring to use shared contract metadata implementation:
types.ContractMetaDataandtypes.NewContractMetaDatain the following view files are replaced withcommoncldchangesets.ContractMetaDataandcommoncldchangesets.NewContractMetaData:deployment/ccip/view/v1_0/rmn_proxy_contract.godeployment/ccip/view/v1_2/price_registry.go[1] [2]deployment/ccip/view/v1_2/router.go[1] [2]deployment/ccip/view/v1_5/commit_store.godeployment/ccip/view/v1_5/offramp.go[1] [2]deployment/ccip/view/v1_5/onramp.go[1] [2]deployment/ccip/view/v1_5/rmn.godeployment/ccip/view/v1_5/token_pool.go[1] [2]deployment/ccip/view/v1_5/tokenadminregistry.go[1] [2]deployment/ccip/view/v1_5_1/token_pool.go[1] [2] [3]deployment/ccip/view/v1_6/ccip_home.go[1] [2] [3]deployment/ccip/view/v1_6/feequoter.go[1] [2]deployment/ccip/view/v1_6/noncemanager.go[1] [2]deployment/ccip/view/v1_6/offramp.go[1] [2]deployment/ccip/view/v1_6/onramp.goThis update ensures all contract metadata is consistently sourced from the shared
cld-changesetspackage, improving maintainability and reducing the risk of inconsistencies.