Skip to content

feat: [NONEVM-4520] ContractTypeAndVersion in OperationMetadata#751

Merged
patricios-space merged 11 commits into
mainfrom
feat/OperationMetadata.ContractTypeAndVersion
May 15, 2026
Merged

feat: [NONEVM-4520] ContractTypeAndVersion in OperationMetadata#751
patricios-space merged 11 commits into
mainfrom
feat/OperationMetadata.ContractTypeAndVersion

Conversation

@patricios-space
Copy link
Copy Markdown
Contributor

@patricios-space patricios-space commented May 14, 2026

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

Adds a new ContractTypeAndVersion field to OperationMetadata so the TON SDK can carry a fully-qualified contract type-and-version string alongside the existing short ContractType. Call sites in the TON SDK (transaction creation, timelock converter/configurer, MCMS configurer) and tests are updated to populate it, and the TON decoder is migrated to the new tvm.ContractTLBRegistry / tvm.FullyQualifiedName types from the bumped chainlink-ton dependency. go.mod/go.sum are bumped accordingly.

Changes:

  • Add ContractTypeAndVersion field to types.OperationMetadata and a corresponding parameter to ton.NewTransaction.
  • Switch TON decoder/decoded operation to tvm.ContractTLBRegistry and tvm.FullyQualifiedName, and start using bindings.ShortRBAC/ShortTimelock/ShortMCMS and bindings.TypeRBAC/TypeTimelock/TypeMCMS constants instead of the hardcoded "RBACTimelock"/"MCMS" strings.
  • Bump chainlink-ton (and many transitive deps) in go.mod/go.sum.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
types/operation.go Adds ContractTypeAndVersion field to OperationMetadata.
sdk/ton/transaction.go Threads new contractTypeAndVersion parameter through NewTransaction.
sdk/ton/timelock_converter.go Uses bindings.ShortTimelock / TypeTimelock and passes the new TAV string.
sdk/ton/timelock_configurer.go Same update for the UpdateDelay skip-send path; reorganizes imports.
sdk/ton/configurer.go Uses bindings.ShortMCMS / TypeMCMS for the SetConfig skip-send path.
sdk/ton/decoder.go Switches to tvm.ContractTLBRegistry and tvm.FullyQualifiedName.
sdk/ton/decoded_operation.go DecodedOperation.ContractType becomes tvm.FullyQualifiedName.
sdk/ton/decoder_test.go Updates table to use tvm.FullyQualifiedName and binding constants.
sdk/ton/decoded_operation_test.go Renames contractTypecontractFQN and updates type.
sdk/ton/timelock_converter_test.go Updates fixtures to use binding constants and the new field.
sdk/ton/encoder_test.go Adds the new empty-string argument to NewTransaction calls.
go.mod / go.sum Bumps chainlink-ton and many transitive dependencies.

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

Comment thread sdk/ton/timelock_converter.go
Comment thread sdk/ton/transaction.go
@patricios-space patricios-space changed the title [NONEVM-4520] feat: ContractTypeAndVersion in OperationMetadata feat: [NONEVM-4520] ContractTypeAndVersion in OperationMetadata May 14, 2026
@patricios-space patricios-space marked this pull request as ready for review May 14, 2026 21:14
Copilot AI review requested due to automatic review settings May 14, 2026 21:14
@patricios-space patricios-space requested a review from a team as a code owner May 14, 2026 21:14
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

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

// Notice: EVM just sets 0 here, but on TON we need to set some value to cover gas fees
var tx types.Transaction
tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), "RBACTimelock", tags)
tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), bindings.ShortTimelock, string(bindings.TypeTimelock)+" 0.0.0", tags)
krebernisak
krebernisak previously approved these changes May 15, 2026
Comment thread e2e/tests/ton/executable.go Outdated
Comment thread sdk/ton/decoder_test.go
big.NewInt(0),
"RBACTimelock",
bindings.ShortTimelock,
string(bindings.TypeTimelock)+" 0.0.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why this space, shouldn't this be @ sign?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread types/operation.go Outdated
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

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

Comment thread e2e/tests/ton/executable.go Outdated
Comment on lines 108 to 110
"RBACTimelock",
string(bindings.TypeTimelock)+" 0.0.0",
[]string{"RBACTimelock", "GrantRole"},
// Notice: EVM just sets 0 here, but on TON we need to set some value to cover gas fees
var tx types.Transaction
tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), "RBACTimelock", tags)
tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), bindings.ShortTimelock, string(bindings.TypeTimelock)+" 0.0.0", tags)
Comment thread types/operation.go Outdated
ContractType string `json:"contractType"`
Tags []string `json:"tags"`
ContractType string `json:"contractType"` // ContractType is the short type used in data store e.g. "Router". It represents the crosschain interface/expected behaviour of the destination contract.
ContractTypeAndVersion string `json:"contractTypeAndVersion"` // ContractTypeAndVersion is the .String() representation of the TypeAndVersion of our contract. It is used for decoding the message data (cell) according to the correct TL-B schema. For example, in TON we use a FullyQualifiedName as the contract type. The resulting string looks like ""link.chain.ton.mcms.Timelock" 1.0.0".
@patricios-space patricios-space enabled auto-merge (squash) May 15, 2026 13:51
Copilot AI review requested due to automatic review settings May 15, 2026 14:55
@cl-sonarqube-production
Copy link
Copy Markdown

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

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

// Notice: EVM just sets 0 here, but on TON we need to set some value to cover gas fees
var tx types.Transaction
tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), "RBACTimelock", tags)
tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), bindings.ShortTimelock, string(bindings.TypeTimelock)+" 0.0.0", tags)
@patricios-space patricios-space merged commit 16b18da into main May 15, 2026
24 checks passed
@patricios-space patricios-space deleted the feat/OperationMetadata.ContractTypeAndVersion branch May 15, 2026 15:05
Comment thread types/operation.go
ContractType string `json:"contractType"`
Tags []string `json:"tags"`
ContractType string `json:"contractType"` // ContractType is the short type used in data store e.g. "Router". It represents the crosschain interface/expected behaviour of the destination contract.
ContractTypeAndVersion string `json:"contractTypeAndVersion"` // ContractTypeAndVersion is the .String() representation of the TypeAndVersion of our contract. It is used for decoding the message data (cell) according to the correct TL-B schema. For example, in TON we use a FullyQualifiedName as the contract type. The resulting string looks like "link.chain.ton.mcms.Timelock 1.0.0".
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not just Version?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also, I see the Copilot mentioning it's hardcoding -0.0.0. Why is it even added?

patricios-space pushed a commit that referenced this pull request May 15, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.44.0](v0.43.0...v0.44.0)
(2026-05-15)


### Features

* [NONEVM-4520] ContractTypeAndVersion in OperationMetadata
([#751](#751))
([16b18da](16b18da))
* support latest chain selectors in v1.0.100
([#753](#753))
([f5df18e](f5df18e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

[NONEVM-4520]:
https://smartcontract-it.atlassian.net/browse/NONEVM-4520?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
patricios-space added a commit that referenced this pull request May 18, 2026
- feat: ContractVersion in OperationMetadata (#751)
- feat: ContractFullyQualifiedName in TON's AdditionalFields
- fix: revert ContractTypeAndVersion in OperationMetadata (#751)
(16b18da)
patricios-space pushed a commit that referenced this pull request May 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.45.0](v0.44.0...v0.45.0)
(2026-05-18)


### Features

* [NONEVM-4520] ContractVersion in OperationMetadata
([#751](#751))
([f2eaf56](f2eaf56))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

[NONEVM-4520]:
https://smartcontract-it.atlassian.net/browse/NONEVM-4520?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
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