Skip to content

chore: swap contract_state.go usages with cld-changesets#22282

Draft
ecPablo wants to merge 1 commit intodevelopfrom
ecpablo/remove-contract-state-files
Draft

chore: swap contract_state.go usages with cld-changesets#22282
ecPablo wants to merge 1 commit intodevelopfrom
ecpablo/remove-contract-state-files

Conversation

@ecPablo
Copy link
Copy Markdown
Contributor

@ecPablo ecPablo commented May 1, 2026

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.ContractMetaData and types.NewContractMetaData from deployment/common/view/types with the equivalent types and constructors from the shared cld-changesets/pkg/common package. This unifies contract metadata handling and reduces code duplication.

Refactoring to use shared contract metadata implementation:

  • All instances of types.ContractMetaData and types.NewContractMetaData in the following view files are replaced with commoncldchangesets.ContractMetaData and commoncldchangesets.NewContractMetaData:
    • deployment/ccip/view/v1_0/rmn_proxy_contract.go
    • deployment/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.go
    • deployment/ccip/view/v1_5/offramp.go [1] [2]
    • deployment/ccip/view/v1_5/onramp.go [1] [2]
    • deployment/ccip/view/v1_5/rmn.go
    • deployment/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.go

This update ensures all contract metadata is consistently sourced from the shared cld-changesets package, improving maintainability and reducing the risk of inconsistencies.

@ecPablo ecPablo requested a review from Copilot May 1, 2026 22:01
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
/deployment/ccip/ 17 @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/operations-platform, @smartcontractkit/core
/deployment/common/ 7 @smartcontractkit/operations-platform
/deployment/data-feeds/ 1 @smartcontractkit/data-feeds-engineers, @smartcontractkit/operations-platform, @smartcontractkit/core

Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown

For more details, see the full review summary.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

✅ No conflicts with other open PRs targeting develop

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ContractMetaData usages with commoncldchangesets.ContractMetaData across CCIP, common, and data-feeds view packages.
  • Replaced calls to types.NewContractMetaData(...) with commoncldchangesets.NewContractMetaData(...).
  • Deleted deployment/common/view/types/contract_state.go.

Scrupulous human review recommended (behavioral compatibility):

  • Confirm cld-changesets ContractMetaData JSON shape/omitempty behavior matches the removed local struct, since these views are serialized.
  • Confirm NewContractMetaData has 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"
@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 1, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@cl-sonarqube-production
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants