Skip to content

[NONEVM-4520] ref: FullyQualifiedName in deployment module#742

Merged
patricios-space merged 27 commits into
mainfrom
ref/FullyQualifiedName/deployment-mod
May 20, 2026
Merged

[NONEVM-4520] ref: FullyQualifiedName in deployment module#742
patricios-space merged 27 commits into
mainfrom
ref/FullyQualifiedName/deployment-mod

Conversation

@patricios-space
Copy link
Copy Markdown
Collaborator

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

Copilot AI review requested due to automatic review settings May 14, 2026 14:39
@patricios-space patricios-space requested a review from a team as a code owner May 14, 2026 14:39
@github-actions
Copy link
Copy Markdown

👋 patricios-space, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@patricios-space patricios-space marked this pull request as draft May 14, 2026 14:39
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

This PR standardizes TON contract type identifiers by introducing a tvm.FullyQualifiedName type and updating deployment/codec plumbing to use fully-qualified contract names plus CLD-compatible short names, alongside dependency bumps needed by the new interfaces.

Changes:

  • Introduce tvm.FullyQualifiedName and migrate registries/codec/debug decoders to use it instead of raw string.
  • Add short-name constants + ShortToFQT mapping in pkg/bindings, and update deployment state/sequences to emit both short ContractType and ContractTypeAndVersion.
  • Update Go module dependencies / sums across submodules and refresh Nix lock hashes.

Reviewed changes

Copilot reviewed 44 out of 49 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
staging-monitor/go.mod Bumps Go/toolchain version and updates module requirements.
staging-monitor/go.sum Updates dependency lockfile to match new requirements.
scripts/oplint/lock.nix Updates pinned hash for oplint.
pkg/ton/tvm/registry.go Adds FullyQualifiedName and migrates ContractTLBRegistry keys/signatures.
pkg/ton/codec/resolvers/contract_data_to_cell.go Converts contract string input into tvm.FullyQualifiedName for registry lookups.
pkg/ton/codec/envelope.go Changes envelope metadata contract type to tvm.FullyQualifiedName (JSON-compatible).
pkg/ton/codec/debug/pretty_print.go Switches debugger decoder registries to tvm.FullyQualifiedName keys.
pkg/ton/codec/debug/lib/lib.go Updates ContractDecoder interface and helpers to use tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/mcms/timelock/decoder.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/mcms/mcms/decoder.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/lib/access/rbac/decoder.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/jetton/wallet/jetton_wallet.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/jetton/minter/jetton_minter.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/jetton/common.go Propagates tvm.FullyQualifiedName through shared jetton decoder helper.
pkg/ton/codec/debug/decoders/ccip/router/router.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/ccip/onramp/onramp.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/ccip/offramp/decoder.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/ccip/feequoter/feequoter.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/ccip/ccipsendexecutor/ccipsendexecutor.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/ton/codec/debug/decoders/ccip/ccipcommon/common.go Updates decoder contract type return type to tvm.FullyQualifiedName.
pkg/bindings/index.go Types all fully-qualified constants as tvm.FullyQualifiedName; adds short-name constants + ShortToFQT.
pkg/bindings/getters.go Keys getter registry by tvm.FullyQualifiedName.
integration-tests/go.mod Bumps CLDF/chainlink-ton/mcms deps to versions compatible with new typing.
integration-tests/go.sum Updates dependency lockfile to match integration test requirements.
integration-tests/deployment/mcms/cs_deployer_test.go Adjusts type equality assertions for new typed contract identifiers.
go.mod Bumps root dependencies (CLDF/mcms/libocr/etc.) for new deployment typing expectations.
go.sum Updates root dependency lockfile accordingly.
go.md Updates module graph documentation reflecting new dependency edges.
devenv/go.mod Bumps devenv module deps/toolchain version.
devenv/go.sum Updates devenv dependency lockfile.
deployment/utils/operation/deploy_ton_contract.go Changes deploy input name to tvm.FullyQualifiedName and adjusts validation.
deployment/utils/compiled_contracts.go Uses tvm.FullyQualifiedName keys for contract package metadata + compiled contract maps.
deployment/utils/compiled_contracts_test.go Updates tests to use typed fully-qualified names.
deployment/state/state.go Rebuilds long↔short contract type mapping using bindings’ authoritative short-name map.
deployment/state/mcms.go Sources MCMS short contract types from pkg/bindings constants.
deployment/pkg/ops/ton/types.go Types compiled-contract metadata IDs as tvm.FullyQualifiedName.
deployment/pkg/ops/ton/send_test.go Updates helper signatures to accept tvm.FullyQualifiedName.
deployment/pkg/ops/mcms/sequence.go Passes both ContractType and ContractTypeAndVersion into MCMS transaction construction.
deployment/pkg/ops/mcms/deploy.go Requests compiled contracts by tvm.FullyQualifiedName.
deployment/pkg/ops/lib/versioning/upgradeable/upgrade.go Uses bindings.TypeUpgradeable instead of manually building the contract type string.
deployment/go.mod Bumps deployment module deps/toolchain version.
deployment/go.sum Updates deployment dependency lockfile.
deployment/ccip/sequence/update_lanes.go Uses fully-qualified binding constants for message wrapping and adds metadata fields for MCMS.
deployment/ccip/sequence/deploy_ccip.go Requests compiled CCIP contracts via tvm.FullyQualifiedName.
deployment/ccip/1_6_0/sequences/transfer_ownership.go Uses bindings.TypeOwnable and adds ContractTypeAndVersion metadata (but currently has a duplicate import issue).
deployment/ccip/1_6_0/sequences/fastcurse.go Adds ContractTypeAndVersion metadata (but currently has a duplicate import issue + inconsistent type used for TypeAndVersion).
deployment/ccip/1_6_0/sequences/connect_chains.go Updates message wrapping to fully-qualified types and populates operation metadata (one spot missing ContractTypeAndVersion).
cmd/chainlink-ton/lock.nix Updates pinned hash for the chainlink-ton package.
cmd/chainlink-ton-extras/lock.nix Updates pinned hash for the chainlink-ton-extras package.
Comments suppressed due to low confidence (4)

deployment/ccip/sequence/update_lanes.go:177

  • The error message says "failed to get router owner" but this call is fetching the OffRamp owner. Please update the message to reference OffRamp for accurate diagnostics.
		addr := stateCCIP.OffRamp

		owner, err := tvm.CallGetterLatest(b.GetContext(), chain.Client, &addr, ownable2step.GetOwner)
		if err != nil {
			return sequences.OnChainOutput{}, fmt.Errorf("failed to get router owner: %w", err)
		}

deployment/ccip/sequence/update_lanes.go:205

  • The error message says "failed to get router owner" but this call is fetching the FeeQuoter owner (gas price update path). Please update the message to reference FeeQuoter.
		addr := stateCCIP.FeeQuoter

		owner, err := tvm.CallGetterLatest(b.GetContext(), chain.Client, &addr, ownable2step.GetOwner)
		if err != nil {
			return sequences.OnChainOutput{}, fmt.Errorf("failed to get router owner: %w", err)
		}

deployment/ccip/sequence/update_lanes.go:157

  • In this OnRamp update block, the error message returned from the owner lookup just above this metadata construction says "failed to get router owner" even though it is fetching the OnRamp owner. Updating the message will make failures much easier to understand.
			plan := !sender.Equals(owner) // plan if sender is not owner
			_inputMCMS.Add(opston.AsCells(r.Output.Plans), plan, []types.OperationMetadata{
				{
					ContractType:           bindings.ShortOnRamp,
					ContractTypeAndVersion: deployment.TypeAndVersion{Type: deployment.ContractType(bindings.TypeOnRamp)}.String(),
					Tags:                   []string{},

deployment/ccip/1_6_0/sequences/fastcurse.go:412

  • ContractTypeAndVersion is being built from the short contract name (bindings.ShortRouter). For consistency with the other sequences (which pass fully-qualified types into deployment.TypeAndVersion), use the fully-qualified router type here (likely bindings.TypeRouter) so the resulting string encodes the expected contract type.
			meta := []types.OperationMetadata{
				{
					ContractType:           bindings.ShortRouter,
					ContractTypeAndVersion: deployment.TypeAndVersion{Type: deployment.ContractType(bindings.ShortRouter)}.String(),
					Tags:                   []string{},

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

Comment thread deployment/ccip/1_6_0/sequences/transfer_ownership.go Outdated
Comment thread deployment/ccip/1_6_0/sequences/fastcurse.go
Comment thread deployment/ccip/1_6_0/sequences/fastcurse.go Outdated
Comment thread deployment/ccip/1_6_0/sequences/connect_chains.go Outdated
Comment thread deployment/ccip/sequence/update_lanes.go Outdated
@patricios-space patricios-space force-pushed the ref/FullyQualifiedName/deployment-mod branch from 3f1a1cd to b1f66df Compare May 15, 2026 11:14
@patricios-space patricios-space marked this pull request as ready for review May 15, 2026 17:24
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 33 out of 37 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

deployment/ccip/1_6_0/sequences/transfer_ownership.go:29

  • This file imports deployment/pkg/ops/mcms twice (as tonmcms and as opsmcms). Duplicate imports of the same path are a compile-time error. Remove one of the imports and use a single alias for both the types and functions you need from that package.
	tonmcms "github.com/smartcontractkit/chainlink-ton/deployment/pkg/ops/mcms"
	"github.com/smartcontractkit/chainlink-ton/pkg/bindings"
	"github.com/smartcontractkit/chainlink-ton/pkg/ccip/bindings/ownable2step"
	"github.com/smartcontractkit/chainlink-ton/pkg/ton/codec"
	"github.com/smartcontractkit/chainlink-ton/pkg/ton/tvm"

	"github.com/smartcontractkit/chainlink-ton/deployment/pkg/dep"
	opsmcms "github.com/smartcontractkit/chainlink-ton/deployment/pkg/ops/mcms"
	opston "github.com/smartcontractkit/chainlink-ton/deployment/pkg/ops/ton"

Comment thread pkg/ton/codec/resolvers/contract_data_to_cell.go
Comment thread deployment/ccip/cs_set_ocr3_config.go Outdated
});
in
pkgs.buildGo126Module rec {
pkgs.buildGo126Module.override {go = go_1_26_2;} rec {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: you should be able to do this override once while declaring pkgs here: https://github.com/smartcontractkit/chainlink-ton/blob/main/flake.nix#L16C7-L16C11

}

contractStr, ok := contract.(string)
contractFQN, ok := contract.(tvm.FullyQualifiedName)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need this one or another check? Think this will be a string here.

Package string
Contracts []string // Fully qualified contract names from pkg/bindings/index.go (e.g. bindings.TypeRouter)
PkgsDir string // optional base directory for the local package cache (passed through to DownloadArtifacts)
Contracts []tvm.FullyQualifiedName // Fully qualified contract names from pkg/bindings/index.go (e.g. bindings.TypeRouter)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The FQN is not a TON concept but general and as such doesn't fit the tvm.FullyQualifiedName structure.

This should read types.FQN or contract.FQN and eventually be moved from chainlink-ton to share with others

@patricios-space patricios-space merged commit 15ca4de into main May 20, 2026
35 checks passed
@patricios-space patricios-space deleted the ref/FullyQualifiedName/deployment-mod branch May 20, 2026 10:38
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