Skip to content

Conversation

@huangzhen1997
Copy link
Contributor

@huangzhen1997 huangzhen1997 commented Dec 10, 2025

Copilot AI review requested due to automatic review settings December 10, 2025 03:08
@huangzhen1997 huangzhen1997 requested a review from a team as a code owner December 10, 2025 03:08
@changeset-bot
Copy link

changeset-bot bot commented Dec 10, 2025

🦋 Changeset detected

Latest commit: 0e98af6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
chainlink-deployments-framework Minor

Not sure what this means? Click here to learn what changesets are.

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

@huangzhen1997 huangzhen1997 marked this pull request as draft December 10, 2025 03:08
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 adds TON blockchain analyzer support to the chainlink-deployments-framework. The implementation follows existing patterns for other chain families (Aptos, Sui, Solana) by integrating TON-specific MCMS SDK functionality.

Key changes:

  • Added TON transaction analysis capabilities with decoder integration
  • Updated dependency versions including Go runtime, MCMS SDK, and various libraries
  • Refactored transaction encoding logic to use family-based routing

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
go.mod Updated Go version to 1.25.3 and bumped various dependencies including MCMS SDK, TON utilities, and added chainlink-ton package
experimental/analyzer/upf/upf.go Integrated TON family support in UPF decoding with mcmstonsdk decoder and simplified encoding logic
experimental/analyzer/ton_analyzer.go New file implementing TON transaction analysis functions mirroring Sui/Aptos patterns
experimental/analyzer/report_builder.go Added TON family handling in proposal and timelock report builders

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

@smartcontractkit smartcontractkit deleted a comment from github-actions bot Dec 10, 2025
@huangzhen1997 huangzhen1997 marked this pull request as ready for review December 12, 2025 02:01
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

Copilot reviewed 8 out of 9 changed files in this pull request and generated no new comments.


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

Copilot AI review requested due to automatic review settings December 12, 2025 04:00
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

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.


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

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

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.


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


// Sui: mcms::timelock_schedule_batch, mcms::timelock_bypasser_execute_batch
// Aptos: package::module::timelock_schedule_batch, package::module::timelock_bypasser_execute_batch
// TON: ContractType::ScheduleBatch(0x...), ContractType::BypasserExecuteBatch(0x...)

Choose a reason for hiding this comment

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

WIll TON type will be provided like this? (e.g., "com.chainlink.ton.lib.access.RBAC::GrantRole(0x0)")

Copy link
Contributor Author

@huangzhen1997 huangzhen1997 Dec 15, 2025

Choose a reason for hiding this comment

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

I didn't check the contract type, because with the timelock converter it would be converted to RBACTimelock::ScheduleBatch(0x0)

name: "TON_decode_failure",
selector: chainsel.TON_TESTNET.Selector,
expectedMsg: "failed to decode TON transaction",
wantErr: false, // TON doesn't unmarshal AdditionalFields, so decode errors go to Method field

Choose a reason for hiding this comment

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

Hmm, not sure why is here a difference for TON? There shouldn't be one...

Choose a reason for hiding this comment

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

Doesn't SUI impl also surfaces errors via .Method member:

Copy link
Contributor Author

@huangzhen1997 huangzhen1997 Dec 16, 2025

Choose a reason for hiding this comment

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

This test is for default unhappy pass, where the analyze function suppose to fail immediately. Unlike SUI we don't need extra field Unmarshal, so the first error will be hiding in Method field.

Choose a reason for hiding this comment

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

Ok, but what's the reason for diverge in this and other tests?

Where other analyzers fail, TON doesn't - why do we need to catch this error specifically for TON?

Copy link
Contributor Author

@huangzhen1997 huangzhen1997 Jan 27, 2026

Choose a reason for hiding this comment

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

The TON analyzer diverges from other analyzers because it reaches the decode stage, whereas EVM and Solana fail earlier due to missing registry, and Aptos and
Sui fail during additional field decoding. TON handles decode failures gracefully by placing the error in the method field rather than returning an error.

For better readability and more context there, I split the TON case into a separate test with comments explaining this distinction.

name: "TON_decode_failure",
selector: chainsel.TON_TESTNET.Selector,
expectedMsg: "failed to decode TON transaction",
wantErr: false, // TON doesn't unmarshal AdditionalFields, so decode errors go to Method field

Choose a reason for hiding this comment

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

Shouldn't diverge from other test cases

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

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


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

huangzhen1997 and others added 2 commits January 21, 2026 20:35
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 22, 2026 02:36
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

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.


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

Copilot AI review requested due to automatic review settings January 22, 2026 03:01
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

Copilot reviewed 10 out of 11 changed files in this pull request and generated no new comments.


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

Copilot AI review requested due to automatic review settings January 27, 2026 04:26
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

if err != nil {
return nil, err
}
for j := range dec {

Choose a reason for hiding this comment

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

nit: This is repeated N times in this file, feels like we should extract it out and simplify at one point:

for j := range dec {
	ops[j] = OperationReport{
		ChainSelector: chainSel,
		ChainName:     chainNameOrUnknown(chainName),
		Family:        family,
		Calls:         []*DecodedCall{dec[j]},
	}
}

name: "TON_decode_failure",
selector: chainsel.TON_TESTNET.Selector,
expectedMsg: "failed to decode TON transaction",
wantErr: false, // TON doesn't unmarshal AdditionalFields, so decode errors go to Method field

Choose a reason for hiding this comment

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

Ok, but what's the reason for diverge in this and other tests?

Where other analyzers fail, TON doesn't - why do we need to catch this error specifically for TON?

Comment on lines 183 to 188
exampleRoleBig, _ := cell.BeginCell().
MustStoreBigInt(new(big.Int).SetBytes(exampleRole[:]), 257).
EndCell().
ToBuilder().
ToSlice().
LoadBigInt(256)

Choose a reason for hiding this comment

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

Not sure this is needed as you can just use tlbe.NewUint256(new(big.Int).SetBytes(role[:]))?

Copilot AI review requested due to automatic review settings January 27, 2026 16:54
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

Copilot reviewed 10 out of 11 changed files in this pull request and generated no new comments.


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

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

Copilot reviewed 10 out of 11 changed files in this pull request and generated no new comments.


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

Copilot AI review requested due to automatic review settings January 29, 2026 17:09
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

Copilot reviewed 10 out of 11 changed files in this pull request and generated no new comments.


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

@cl-sonarqube-production
Copy link

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.

4 participants