Skip to content

fix(ccip): LoadChainState handles EVM2EVMOnRamp/EVM2EVMOffRamp v1.5 address-book entries#22339

Merged
joaoluisam merged 9 commits into
developfrom
fix/stateview-recognize-evm2evm-address-book
May 8, 2026
Merged

fix(ccip): LoadChainState handles EVM2EVMOnRamp/EVM2EVMOffRamp v1.5 address-book entries#22339
joaoluisam merged 9 commits into
developfrom
fix/stateview-recognize-evm2evm-address-book

Conversation

@joaoluisam
Copy link
Copy Markdown
Contributor

This pull request adds support for recognizing and loading legacy v1.5 EVM2EVMOnRamp and EVM2EVMOffRamp contract types in the chain state loader, ensuring backward compatibility for migrations and legacy deployments. It also introduces a comprehensive test to verify the correct handling of these legacy contract keys and their mapping to the appropriate contract ABIs.

Legacy contract support and test coverage:

  • Updated LoadChainState in state.go to recognize both legacy and standard type/version keys for EVM2EVMOnRamp and EVM2EVMOffRamp contracts, allowing them to be loaded when the loadLegacyContracts flag is set. [1] [2]
  • Added new contract type constants EVM2EVMOnRamp and EVM2EVMOffRamp to types.go for legacy v1.5 datastore aliases, matching on-chain typeAndVersion values.

Testing enhancements:

  • Introduced TestLoadChainState_LegacyV15EVM2EVMDatastoreKeys in state_test.go to deploy v1.5 onramp/offramp contracts, verify their loading behavior with and without the legacy flag, and check correct ABI assignments.
  • Added necessary imports for v1.5.0 contract bindings in state_test.go to support the new tests.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 7, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@joaoluisam joaoluisam marked this pull request as ready for review May 8, 2026 09:16
Copilot AI review requested due to automatic review settings May 8, 2026 09:16
@joaoluisam joaoluisam requested review from a team as code owners May 8, 2026 09:16
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

Adds backward-compatible handling for legacy contract identifiers in deployment/on-chain state loading, primarily for CCIP v1.5 EVM2EVM ramp address-book/datastore keys, and additionally for a legacy MCMS datastore label (prodTestnetMCM).

Changes:

  • Extend CCIP LoadChainState to recognize legacy v1.5 datastore aliases (EVM2EVMOnRamp / EVM2EVMOffRamp) when loadLegacyContracts is enabled.
  • Introduce ProdTestnetMCM as a legacy contract type alias for MCMS (same ABI as ManyChainMultiSig) and update MCMS loading + ABI mapping to accept it.
  • Add tests covering legacy v1.5 ramp keys and legacy prodTestnetMCM behavior.

Scrupulous human review recommended (high impact / easy-to-miss):

  • deployment/common/changeset/state/evm.go DataStore refs loading path for MCMS roles (label propagation and role assignment).
  • deployment/ccip/shared/stateview/state.go legacy-contract gating logic to ensure legacy addresses are only loaded when intended (and ABI mappings remain correct for labeled entries).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
deployment/common/types/types.go Adds ProdTestnetMCM legacy contract type constant for MCMS.
deployment/common/changeset/state/evm.go Updates MCMS loaders to accept prodTestnetMCM as an alias (and adds DataStore-refs branch).
deployment/common/changeset/state/evm_prod_testnet_mcm_test.go Adds tests for prodTestnetMCM address-map and DataStore-ref loading.
deployment/common/changeset/state.go Mirrors prodTestnetMCM alias handling in deprecated MCMS loader.
deployment/ccip/shared/types.go Adds legacy v1.5 datastore aliases EVM2EVMOnRamp / EVM2EVMOffRamp.
deployment/ccip/shared/stateview/state.go Extends ABI mapping and legacy loading switch cases for the new aliases + prodTestnetMCM.
deployment/ccip/shared/stateview/state_test.go Adds a test validating legacy v1.5 ramp key handling with/without the legacy flag.

Comment on lines +397 to +411
case tv.Type == types.ProdTestnetMCM && tv.Version.String() == deployment.Version1_0_0.String():
// Legacy prodTestnetMCM (same ABI as ManyChainMultiSig); roles via labels (see MaybeLoadMCMSWithTimelockChainState).
mcms, err := bindings.NewManyChainMultiSig(addr, chain.Client)
if err != nil {
return nil, err
}
if tv.Labels.Contains(types.ProposerRole.String()) && state.ProposerMcm == nil {
state.ProposerMcm = mcms
}
if tv.Labels.Contains(types.BypasserRole.String()) && state.BypasserMcm == nil {
state.BypasserMcm = mcms
}
if tv.Labels.Contains(types.CancellerRole.String()) && state.CancellerMcm == nil {
state.CancellerMcm = mcms
}
Comment on lines 1507 to 1511
// legacy addresses below are commented out to avoid loading them by default, to be uncommented for migrations
case cldf.NewTypeAndVersion(ccipshared.OnRamp, deployment.Version1_5_0).String():
case cldf.NewTypeAndVersion(ccipshared.OnRamp, deployment.Version1_5_0).String(),
cldf.NewTypeAndVersion(ccipshared.EVM2EVMOnRamp, deployment.Version1_5_0).String():
if !config.loadLegacyContracts {
continue
Comment thread deployment/common/types/types.go Outdated
Comment on lines 21 to 25
// ProdTestnetMCM is a legacy RDD label still present on CCIP testnet datastore / address-book entries.
// It denotes the same ManyChainMultiSig ABI as ManyChainMultiSig @ v1.0.0; role disambiguation uses
// the same PROPOSER / BYPASSER / CANCELLER labels as ManyChainMultiSig entries.
ProdTestnetMCM cldf.ContractType = "prodTestnetMCM"
RBACTimelock cldf.ContractType = "RBACTimelock"
simsonraj
simsonraj previously approved these changes May 8, 2026
@cl-sonarqube-production
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)
9.52% Technical Debt Ratio on New Code (required ≤ 4%)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube IDE SonarQube IDE

@joaoluisam joaoluisam added this pull request to the merge queue May 8, 2026
Merged via the queue into develop with commit 38ae628 May 8, 2026
221 of 223 checks passed
@joaoluisam joaoluisam deleted the fix/stateview-recognize-evm2evm-address-book branch May 8, 2026 18:09
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.

5 participants