Skip to content

Conversation

@huangzhen1997
Copy link
Contributor

@huangzhen1997 huangzhen1997 commented Jan 25, 2026

@huangzhen1997 huangzhen1997 changed the base branch from main to NONEVM-3443/separate-tooling-api-adaptor January 25, 2026 20:57
@huangzhen1997 huangzhen1997 marked this pull request as ready for review January 25, 2026 21:01
@huangzhen1997 huangzhen1997 requested a review from a team as a code owner January 25, 2026 21:01
krebernisak
krebernisak previously approved these changes Jan 26, 2026
Copy link
Collaborator

@krebernisak krebernisak left a comment

Choose a reason for hiding this comment

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

Looks good! (with comments)

But also, this adapter feels very thin and makes me wonder can we generalize this across chains...

"github.com/smartcontractkit/chainlink-ton/deployment/state"
)

type MCMSReaderAdapter struct{}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: implement a constructor and return a CCIP shared type. This allows the compiler to show errors and the reader to understand which type is getting implemented here.

Or can use a pattern like:

var _ sdk.X = (*MCMSReaderAdapter)(nil)

@@ -0,0 +1,70 @@
package sequences
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure this fits the sequences pkg. Let's figure out a better structure eventually.

e.DataStore.Addresses().Filter(),
chainSelector,
deployment.ContractType(state.MCMS),
&state.Version1_6_0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Version 1.6 is not correct for MCMS, right?

Also, what's the point of matching a version here, why do we need an address for a specific version of MCMS per env?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it, the version is a required param for the datastore GetAddressRef function

Base automatically changed from NONEVM-3443/separate-tooling-api-adaptor to main January 27, 2026 21:41
@huangzhen1997 huangzhen1997 dismissed krebernisak’s stale review January 27, 2026 21:41

The base branch was changed.

Copilot AI review requested due to automatic review settings January 28, 2026 15:13
Copy link
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

This PR implements an MCMS (Multi-Chain Management System) reader adapter for Chainlink-CCIP on TON blockchain, enabling interaction with MCMS and Timelock contracts through a standardized interface.

Changes:

  • Centralized MCMS and Timelock contract version definitions in the state package
  • Created MCMSReaderAdapter implementing the MCMSReader interface for TON chains
  • Refactored MCMS deployment to use centralized version constants

Reviewed changes

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

File Description
deployment/state/state.go Added centralized version constants for MCMS (0.0.4) and Timelock (0.0.3) contracts
deployment/ccip/1_6_0/sequences/mcms_reader.go New adapter implementing MCMSReader interface with methods to retrieve chain metadata and contract references
deployment/ccip/1_6_0/sequences/mcms.go Refactored to use centralized version constants instead of local semver parsing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Duplicates of chainlink/deployment/ccip/ to avoid import loops
var (
Version1_6_0 = *semver.MustParse("1.6.0")
// MCMS contract versions
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The variable names TimelockVersion and MCMSVersion are inconsistent with the existing naming pattern. The existing version constant is named Version1_6_0 which includes the version number in the name. Consider renaming to TimelockVersion0_0_3 and MCMSVersion0_0_4 for consistency, or update the comment to be more descriptive of what these versions represent.

Suggested change
// MCMS contract versions
// MCMS-related contract versions (Timelock v0.0.3 and MCMS v0.0.4)

Copilot uses AI. Check for mistakes.

"github.com/smartcontractkit/chainlink-ton/deployment/state"
)

Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The MCMSReaderAdapter struct lacks documentation. Add a comment explaining its purpose as an adapter for reading MCMS contract information from TON chains.

Suggested change
// MCMSReaderAdapter is an adapter for reading MCMS contract information from TON chains.

Copilot uses AI. Check for mistakes.
ref := datastore_utils.GetAddressRef(
e.DataStore.Addresses().Filter(),
chainSelector,
deployment.ContractType(state.Timelock),
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The code references state.Timelock which is not defined in the provided state.go diff. Verify that the Timelock constant is properly defined in the state package.

Copilot uses AI. Check for mistakes.
ref := datastore_utils.GetAddressRef(
e.DataStore.Addresses().Filter(),
chainSelector,
deployment.ContractType(state.MCMS),
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The code references state.MCMS which is not defined in the provided state.go diff. Verify that the MCMS constant is properly defined in the state package.

Copilot uses AI. Check for mistakes.
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