-
Notifications
You must be signed in to change notification settings - Fork 4
NONEVM-3217/tooling api fast curse #498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| // 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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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
TonAdapterwith 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.modfiles 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.
| 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
krebernisak
left a comment
There was a problem hiding this 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.
| // 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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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).
Step 2, implement fast curser adapter.