Skip to content

Comments

[WIP] Timelock#624

Draft
JohnChangUK wants to merge 10 commits intocanton-mainfrom
canton-timelock
Draft

[WIP] Timelock#624
JohnChangUK wants to merge 10 commits intocanton-mainfrom
canton-timelock

Conversation

@JohnChangUK
Copy link
Contributor

No description provided.

gustavogama-cll and others added 5 commits February 6, 2026 17:54
Add support for the Sui and Ton chain families to the BuildInspectors
and BuildConverters helper functions defined in the `chainwrappers`
package.

---
OPT-398

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @smartcontractkit/mcms@0.35.0

### Minor Changes

- [#586](#586)
[`19074d4`](19074d4)
Thanks [@krebernisak](https://github.com/krebernisak)! - Update to
latest chainlink-ton MCMS contracts version + misc fixes/improvements

### Patch Changes

- [#603](#603)
[`2cd7db1`](2cd7db1)
Thanks [@krebernisak](https://github.com/krebernisak)! - Add wait
(pending op) support for TON executors

- [#610](#610)
[`95b0666`](95b0666)
Thanks [@gustavogama-cll](https://github.com/gustavogama-cll)! - chore:
add sui and ton to chainwrappers helpers

- [#611](#611)
[`94f50e5`](94f50e5)
Thanks [@RodrigoAD](https://github.com/RodrigoAD)! - Bumps chainlink-sui
version

- [#607](#607)
[`40f2af0`](40f2af0)
Thanks [@patricios-space](https://github.com/patricios-space)! - Bump
chainlink-ton version to latest (642f6eb)

Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
Updates the CODEOWNERS to be the entire Operations Platform team.
@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

⚠️ No Changeset found

Latest commit: 9cedc26

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

}

// deployCounterContract deploys a Counter contract for testing
func (s *MCMSTimelockTestSuite) deployCounterContract() {
Copy link
Member

Choose a reason for hiding this comment

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

This should be already available in common.go

Copy link
Member

Choose a reason for hiding this comment

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

I also see it also exists in timelock_inspection.go and timelock_errors.go, let's remove it from where it's duplicated

ChainSelector: s.chainSelector,
Transactions: []mcmstypes.Transaction{{
To: s.counterCID,
Data: []byte("increment"),
Copy link
Member

Choose a reason for hiding this comment

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

Is this doing anything? If not, let's remove it to avoid confusions

Suggested change
Data: []byte("increment"),
Data: []byte(""),

ChainSelector: s.chainSelector,
Transactions: []mcmstypes.Transaction{{
To: s.counterCID,
Data: []byte("increment"),
Copy link
Member

Choose a reason for hiding this comment

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

Same as before here

Suggested change
Data: []byte("increment"),
Data: []byte(""),

@@ -0,0 +1,540 @@
//go:build e2e
Copy link
Member

Choose a reason for hiding this comment

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

This looks exactly the same as timelock.go, let's remove it

}

// SetupSuite runs before the test suite
func (s *MCMSTimelockErrorTestSuite) SetupSuite() {
Copy link
Member

Choose a reason for hiding this comment

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

This is the same in every Timelock test, let's create a common TimelockTestSuite that specific tests inherit (timelock_proposal/cancel/errors.go) and can use the same SetupSuite

minDelay, err := inspector.GetMinDelay(ctx, s.mcmsContractID)
s.Require().NoError(err, "GetMinDelay should not return an error")
// The default minDelay is 0 (we set it to 0 microseconds in the test setup)
s.T().Logf("GetMinDelay returned: %d seconds", minDelay)
Copy link
Member

Choose a reason for hiding this comment

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

Let's check that the actual value is the expected

Salt: cantontypes.TEXT(saltHex),
DelaySecs: cantontypes.INT64(delay.Seconds()),
}
operationDataEncoded, err = params.MarshalHex()
Copy link
Member

Choose a reason for hiding this comment

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

Make sure the godaml version in go.mod is updated, I don't think this is available in the current version

}

// getMCMSContract queries the active MCMS contract by contract ID.
func (t *TimelockInspector) getMCMSContract(ctx context.Context, mcmsAddr string) (*mcms.MCMS, error) {
Copy link
Member

Choose a reason for hiding this comment

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

This is almost the same as in inspector.go, let's reuse it 👍

Copy link
Member

Choose a reason for hiding this comment

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

Also, let's rename it to setMCMSContract

return &TimelockExecutor{
TimelockInspector: NewTimelockInspector(stateClient, client, userId, party),
client: client,
userId: userId,
Copy link
Member

Choose a reason for hiding this comment

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

I don't see userId used anywhere, can we remove it?

// Build batch operation to increment counter
opAdditionalFields := cantonsdk.AdditionalFields{
TargetInstanceId: s.counterInstanceID, // Already includes the party from deployCounterContract
FunctionName: "Increment", // Must match Daml choice name (capital I)
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a test to set the MCMS config through a proposal?

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