Skip to content

Conversation

@huangzhen1997
Copy link
Contributor

@huangzhen1997 huangzhen1997 commented Jan 5, 2026

Step 2, implement fast curser adapter.

@huangzhen1997 huangzhen1997 changed the title Nonevm 3217/tooling api fast curse NONEVM-3217/tooling api fast curse Jan 5, 2026
@huangzhen1997 huangzhen1997 changed the base branch from main to NONEVM-1651/implement-curse-uncurse-operation-prerequisites-for-curseAdaptor January 5, 2026 04:51
// IsCurseEnabledForChain returns true if the chain supports cursing subjects.
// For TON, we assume all chains support cursing. TODO double check this
func (a *TonAdapter) IsCurseEnabledForChain(e cldf.Environment, selector uint64) (bool, error) {
return true, nil
Copy link

Choose a reason for hiding this comment

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

for other chains, we basically just ensure RMNRemote is deployed. I understand TON has that as part of another contract, so maybe just verifying that is deployed will be enough

}

// Execute CurseOp operation
_, err = cldf_ops.ExecuteOperation(b, operation.CurseOp, deps, opInput)
Copy link

Choose a reason for hiding this comment

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

shouldn't this be either executing what's returned or creating an MCMS batch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks good catch. We need to execute the operation output in the sequences. The MCMS proposal support is still in progress

Base automatically changed from NONEVM-1651/implement-curse-uncurse-operation-prerequisites-for-curseAdaptor to main January 5, 2026 22:25
@huangzhen1997 huangzhen1997 marked this pull request as ready for review January 6, 2026 02:44
@huangzhen1997 huangzhen1997 requested a review from a team as a code owner January 6, 2026 02:44
Copilot AI review requested due to automatic review settings January 6, 2026 02:44
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 the fast curse adapter for TON chains, enabling curse/uncurse operations through the tooling API. The implementation adds support for cursing and uncursing subjects on TON Router contracts via RMN Remote.

Key Changes:

  • Implemented TonAdapter with fast curse capabilities including subject-to-selector conversion and curse state checking
  • Added comprehensive test coverage for curse operations in cs_fast_curse_test.go
  • Updated dependency versions across multiple go.mod files to support the new fast curse functionality

Reviewed changes

Copilot reviewed 14 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
deployment/ccip/1_6_0/sequences/fastcurse.go New file implementing fast curse adapter interface methods for TON
deployment/ccip/1_6_0/sequences/adapter.go Registered fast curse adapter and added address caching fields to TonAdapter
integration-tests/deployment/ccip/cs_fast_curse_test.go Comprehensive test suite for fast curse operations
deployment/ccip/operation/router.go Updated curse/uncurse operations to use new Transactions type
deployment/ccip/helpers/utils.go Added Transactions wrapper type for type-safe transaction handling
contracts/contracts/ccip/router/contract.tolk Fixed verifyNotCursed logic by negating isCursed result
go.mod, deployment/go.mod, integration-tests/go.mod, staging-monitor/go.mod Updated chainlink-common and related dependencies
integration-tests/deployment/ccip/cs_add_lanes_test.go Updated to use GetRegistry() instead of deprecated NewMCMSReaderRegistry()
scripts/oplint/lock.nix, cmd/chainlink-ton/lock.nix, cmd/chainlink-ton-extras/lock.nix Updated Nix hashes

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

@huangzhen1997 huangzhen1997 requested a review from tt-cll January 6, 2026 02:48
return sequences.OnChainOutput{}, fmt.Errorf("failed to execute curse operation: %w", err)
}

err = helpers.ExecuteTransactions(b.GetContext(), b.Logger, chain.Client, chain.Wallet, report.Output.Serialized)
Copy link

Choose a reason for hiding this comment

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

does this work with mcms as the owner of router? Or is this broadly a TODO once ready?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not currently, this is executing transactions directly.

All this will get refactored and support added once #467 is ready

tt-cll
tt-cll previously approved these changes Jan 6, 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 for now, let's merge it.

Should get restructured slightly and MCMS support added once #467 is merged.

Comment on lines +80 to +95
// Call verifyNotCursed on router contract
// Returns true if NOT cursed, so we need to negate
result, err := chain.Client.RunGetMethod(e.GetContext(), block, &router, "verifyNotCursed", subjectBigInt)
if err != nil {
return false, fmt.Errorf("failed to call verifyNotCursed: %w", err)
}

// Parse result as bool
notCursed, err := result.Int(0)
if err != nil {
return false, fmt.Errorf("failed to parse verifyNotCursed result: %w", err)
}

// verifyNotCursed returns 0 (false) if cursed, -1 (true) if not cursed
// We want to return true if cursed
isCursed := notCursed.Cmp(big.NewInt(0)) == 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please follow up on "getters" and refactor them out of tooling, mv to binding code using our Getter type.

)

// Transactions encapsulates serialized TON internal messages with type safety.
type Transactions struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for typing it. But hope to get rid of this once we have #467 merged (should not be necessary anymore).

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.

3 participants