Skip to content

Conversation

@kingpinXD
Copy link
Member

@kingpinXD kingpinXD commented Dec 18, 2025

Description

This PR updates the check for external chains that need TSS funds migration to use VM_EVM.
This would now include all EVM-based chains

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Note

Switches TSS funds migration eligibility to VM-based EVM filtering and updates keeper, tests, simulation, and changelog accordingly.

  • Crosschain Keeper:
    • Rename GetChainsSupportingTSSMigration to TSSFundsMigrationChains and change EVM filtering to chains.FilterByVM(chains.Vm_evm) (keeps Bitcoin via consensus filter).
    • Validate migrator count against TSSFundsMigrationChains; minor comment tweak (btc and evm).
  • Tests:
    • Replace usages with TSSFundsMigrationChains.
    • Add/expand tests to assert only external EVM and Bitcoin chains are included for mainnet/testnet and exclude Solana/Sui/TON/ZEVM.
  • Simulation:
    • Update to use TSSFundsMigrationChains in x/crosschain/simulation/operation_update_tss_address.go.
  • Changelog:
    • Add fix entry for VM-based EVM filtering in TSS funds migration.

Written by Cursor Bugbot for commit 19298d4. Configure here.

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced TSS address update process to more accurately determine which blockchains require funds migration, now specifically targeting EVM-compatible chains while explicitly excluding Solana, Sui, and Ton.
  • Tests

    • Expanded test coverage to validate migration requirements across mainnet and testnet chains, ensuring correct identification and handling of chains requiring TSS funds migration.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

The PR renames the TSS migration function from GetChainsSupportingTSSMigration to TSSFundsMigrationChains, updates its filtering logic to identify chains requiring funds migration by VM type (EVM) instead of consensus type, and expands test coverage to validate mainnet and testnet chain inclusion and exclusion criteria.

Changes

Cohort / File(s) Summary
Core keeper logic update
x/crosschain/keeper/msg_server_update_tss.go
Renames GetChainsSupportingTSSMigration to TSSFundsMigrationChains; replaces filter logic from FilterByConsensus(chains.Consensus_ethereum) to FilterByVM(chains.Vm_evm); updates pending-migrations guard message to reference BTC and EVMD chains; clarifies that Solana, Sui, and Ton do not require funds migration.
Test coverage expansion
x/crosschain/keeper/msg_server_update_tss_test.go
Replaces all usages of old function name with TSSFundsMigrationChains; adds dedicated test blocks for mainnet and testnet chains with explicit inclusion/exclusion assertions and chain ID validations.
Simulation logic update
x/crosschain/simulation/operation_update_tss_address.go
Replaces call to GetChainsSupportingTSSMigration with TSSFundsMigrationChains in SimulateMsgUpdateTssAddress.
Changelog entry
changelog.md
Documents fix for filtering by VM for EVM chains requiring TSS funds migration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Filter logic transition: Verify the semantic correctness of shifting from FilterByConsensus(Ethereum) to FilterByVM(EVM) and confirm the intended chain coverage remains correct, particularly regarding implications for chains such as Solana, Sui, and Ton.
  • Test case validation: Examine new mainnet and testnet test blocks to ensure inclusion/exclusion assertions align with chain properties (external status, VM type, gateway support).
  • Cross-file consistency: Confirm function rename is complete and consistent across all call sites (keeper, tests, simulation).

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive PR description is incomplete and contains formatting issues. While the core objective is stated, testing verification is absent and grammatical errors detract from clarity. Complete the testing checklist by selecting which tests were performed, or provide details on test coverage. Correct grammatical errors (e.g., 'extenal' → 'external', 'would no include' → 'will include') and enhance clarity on the scope and impact of VM_EVM filtering.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating TSS funds migration filtering to use VM_EVM for EVM chains, which is the core technical modification across the codebase.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.88%. Comparing base (3a6dae3) to head (17865ed).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4502      +/-   ##
===========================================
- Coverage    63.92%   63.88%   -0.05%     
===========================================
  Files          472      472              
  Lines        29354    29354              
===========================================
- Hits         18766    18752      -14     
- Misses        9554     9561       +7     
- Partials      1034     1041       +7     
Files with missing lines Coverage Δ
x/crosschain/keeper/msg_server_update_tss.go 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kingpinXD kingpinXD self-assigned this Dec 18, 2025
@kingpinXD kingpinXD changed the title fix: update chains requiring tss funds migration fix: update to filter by VM for evm chains requiring TSS funds migration Dec 18, 2025
@kingpinXD kingpinXD marked this pull request as ready for review December 18, 2025 16:06
@kingpinXD kingpinXD requested a review from a team as a code owner December 18, 2025 16:06
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
x/crosschain/keeper/msg_server_update_tss.go (2)

42-44: Minor formatting issue in comment.

There's a missing space in the comment: "Sui,Ton" should be "Sui, Ton" for consistency.

🔎 Suggested fix:
-	// Solana, Sui,Ton do not need funds migration just updating TSS address is enough
+	// Solana, Sui, Ton do not need funds migration; updating TSS address is sufficient

77-82: Comment is inconsistent with implementation.

The comment on line 81 states "Consensus is bitcoin or ethereum" but the implementation now uses FilterByVM(chains.Vm_evm) for EVM chains rather than FilterByConsensus(chains.Consensus_ethereum). This discrepancy could lead to confusion for future maintainers.

🔎 Suggested fix:
 // TSSFundsMigrationChains returns the chains that support tss migration.
 // Chains that support tss migration are chains that have the following properties:
 // 1. External chains
 // 2. Gateway observer
-// 3. Consensus is bitcoin or ethereum (Other consensus types are not supported)
+// 3. VM is EVM or Consensus is bitcoin (Solana, Sui, TON are excluded as they do not require funds migration)
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52a59aa and 19298d4.

📒 Files selected for processing (4)
  • changelog.md (1 hunks)
  • x/crosschain/keeper/msg_server_update_tss.go (3 hunks)
  • x/crosschain/keeper/msg_server_update_tss_test.go (13 hunks)
  • x/crosschain/simulation/operation_update_tss_address.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

⚙️ CodeRabbit configuration file

Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Files:

  • x/crosschain/keeper/msg_server_update_tss.go
  • x/crosschain/keeper/msg_server_update_tss_test.go
  • x/crosschain/simulation/operation_update_tss_address.go
🧠 Learnings (11)
📓 Common learnings
Learnt from: lumtis
Repo: zeta-chain/node PR: 4199
File: zetaclient/chains/evm/signer/signer_admin.go:25-26
Timestamp: 2025-09-15T13:42:17.594Z
Learning: In PR 4199, the CLI references to CmdMigrateTssFunds in x/crosschain/client/cli/ files are intentionally not updated as they are out of scope for this specific refactor focused on removing ERC20 custody messages.
Learnt from: kingpinXD
Repo: zeta-chain/node PR: 4064
File: cmd/zetae2e/local/solana.go:0-0
Timestamp: 2025-08-06T01:54:04.100Z
Learning: The `CheckSolanaTSSBalance()` method in e2e/runner has been refactored to not return an error. Instead, it uses internal assertions (require statements) to fail the test immediately if balance checks fail. This is part of a broader refactoring pattern in the E2E runner where balance check methods were changed from error-returning to assertion-based approaches.
📚 Learning: 2025-09-15T13:42:17.594Z
Learnt from: lumtis
Repo: zeta-chain/node PR: 4199
File: zetaclient/chains/evm/signer/signer_admin.go:25-26
Timestamp: 2025-09-15T13:42:17.594Z
Learning: In PR 4199, the CLI references to CmdMigrateTssFunds in x/crosschain/client/cli/ files are intentionally not updated as they are out of scope for this specific refactor focused on removing ERC20 custody messages.

Applied to files:

  • changelog.md
  • x/crosschain/keeper/msg_server_update_tss.go
  • x/crosschain/keeper/msg_server_update_tss_test.go
  • x/crosschain/simulation/operation_update_tss_address.go
📚 Learning: 2025-05-30T16:31:30.275Z
Learnt from: skosito
Repo: zeta-chain/node PR: 3939
File: go.mod:52-52
Timestamp: 2025-05-30T16:31:30.275Z
Learning: The ethermint dependency updates in the zeta-chain/node repository are typically moves between feature branches and main branch of the same fork, not breaking API changes. CI status should be verified before assuming compilation issues.

Applied to files:

  • changelog.md
📚 Learning: 2025-09-08T03:18:14.656Z
Learnt from: ws4charlie
Repo: zeta-chain/node PR: 4165
File: e2e/e2etests/test_spl_deposit_and_call.go:39-41
Timestamp: 2025-09-08T03:18:14.656Z
Learning: For non-EVM chain addresses (like Solana, TON, Sui) in ZetaChain e2e tests, string representations are used for the sender parameter in AssertTestDAppZEVMCalled, while EVM chains use raw byte representations. This is a deliberate architectural choice for consistency across different chain types.

Applied to files:

  • changelog.md
📚 Learning: 2025-08-06T01:54:04.100Z
Learnt from: kingpinXD
Repo: zeta-chain/node PR: 4064
File: cmd/zetae2e/local/solana.go:0-0
Timestamp: 2025-08-06T01:54:04.100Z
Learning: The `CheckSolanaTSSBalance()` method in e2e/runner has been refactored to not return an error. Instead, it uses internal assertions (require statements) to fail the test immediately if balance checks fail. This is part of a broader refactoring pattern in the E2E runner where balance check methods were changed from error-returning to assertion-based approaches.

Applied to files:

  • x/crosschain/keeper/msg_server_update_tss.go
  • x/crosschain/keeper/msg_server_update_tss_test.go
📚 Learning: 2024-11-01T10:30:27.952Z
Learnt from: lumtis
Repo: zeta-chain/node PR: 2984
File: x/crosschain/keeper/msg_server_whitelist_erc20.go:39-48
Timestamp: 2024-11-01T10:30:27.952Z
Learning: In the context of whitelisting assets in `MsgWhitelistERC20` within `x/crosschain/keeper/msg_server_whitelist_erc20.go`, there is no specific address validation required for Solana addresses.

Applied to files:

  • x/crosschain/keeper/msg_server_update_tss.go
📚 Learning: 2024-07-04T23:47:56.072Z
Learnt from: ws4charlie
Repo: zeta-chain/node PR: 2411
File: zetaclient/orchestrator/orchestrator.go:222-237
Timestamp: 2024-07-04T23:47:56.072Z
Learning: The `GetUpdatedChainObserver` method in the `Orchestrator` class is covered by unit tests in `zetaclient/orchestrator/orchestrator_test.go` and `zetaclient/orchestrator/chain_activate_test.go`.

Applied to files:

  • x/crosschain/keeper/msg_server_update_tss_test.go
📚 Learning: 2024-07-04T23:46:38.428Z
Learnt from: ws4charlie
Repo: zeta-chain/node PR: 2411
File: zetaclient/orchestrator/orchestrator.go:192-217
Timestamp: 2024-07-04T23:46:38.428Z
Learning: The `GetUpdatedSigner` method in `zetaclient/orchestrator/orchestrator.go` is covered by unit tests in `zetaclient/orchestrator/chain_activate_test.go` and `zetaclient/orchestrator/orchestrator_test.go`.

Applied to files:

  • x/crosschain/keeper/msg_server_update_tss_test.go
📚 Learning: 2024-09-13T22:29:09.747Z
Learnt from: ws4charlie
Repo: zeta-chain/node PR: 2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., `IsUTXO()` to `IsBitcoin()`), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Applied to files:

  • x/crosschain/keeper/msg_server_update_tss_test.go
📚 Learning: 2024-09-23T19:51:43.360Z
Learnt from: ws4charlie
Repo: zeta-chain/node PR: 2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the `mineTxNSetNonceMark` function within `bitcoin/observer/outbound_test.go`, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Applied to files:

  • x/crosschain/keeper/msg_server_update_tss_test.go
📚 Learning: 2024-12-12T15:51:51.144Z
Learnt from: kingpinXD
Repo: zeta-chain/node PR: 3207
File: x/observer/simulation/operation_reset_chain_nonces.go:26-27
Timestamp: 2024-12-12T15:51:51.144Z
Learning: In `x/observer/simulation/operation_reset_chain_nonces.go`, within the `SimulateResetChainNonces` function, the `authAccount` cannot be nil because it corresponds to the policy account which is set using simulation accounts.

Applied to files:

  • x/crosschain/simulation/operation_update_tss_address.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: test-sim-fullappsimulation / sim
  • GitHub Check: test-sim-after-import / sim
  • GitHub Check: test-sim-import-export / sim
  • GitHub Check: test-sim-nondeterminism / sim
  • GitHub Check: Cursor Bugbot
  • GitHub Check: build-zetanode
  • GitHub Check: lint
  • GitHub Check: gosec
  • GitHub Check: build-and-test
  • GitHub Check: build
  • GitHub Check: semgrep/ci
  • GitHub Check: analyze (go)
🔇 Additional comments (7)
changelog.md (1)

26-26: LGTM!

The changelog entry follows the established format and accurately describes the fix for TSS funds migration filtering.

x/crosschain/keeper/msg_server_update_tss.go (1)

84-95: LGTM!

The filtering logic correctly identifies chains requiring TSS funds migration by combining EVM chains (via VM type) and Bitcoin chains (via consensus type). This approach properly includes all EVM-based chains while excluding Solana, Sui, and TON which do not require funds migration.

x/crosschain/simulation/operation_update_tss_address.go (1)

31-38: LGTM!

The simulation correctly uses the renamed TSSFundsMigrationChains(ctx) function, maintaining consistency with the keeper implementation.

x/crosschain/keeper/msg_server_update_tss_test.go (4)

69-83: LGTM!

Test correctly updated to use TSSFundsMigrationChains(ctx). The assertion verifying migrator count matches the number of chains requiring migration is sound.


334-364: LGTM!

The test comprehensively validates that only EVM and Bitcoin chains are returned, with proper exclusion of Solana, Sui, TON (catchain), and Tendermint consensus chains.


366-437: LGTM!

Excellent test coverage for mainnet chains. The test explicitly validates:

  • Expected chains (Ethereum, BSC, Bitcoin, Polygon, Base, Arbitrum, Avalanche) are included
  • Excluded chains (ZetaChain, Solana, Sui, TON) are properly filtered out
  • Chain properties (external, observers gateway, VM type) are verified

439-515: LGTM!

The testnet test case mirrors the mainnet structure and provides thorough validation for testnet-specific chains including multiple Bitcoin testnets (Signet, Testnet4) and various EVM testnets. Excluded chains (ZetaChainTestnet, SolanaDevnet, SuiTestnet, TONTestnet) are properly verified.

@kingpinXD kingpinXD enabled auto-merge January 3, 2026 06:33
@kingpinXD kingpinXD added this pull request to the merge queue Jan 3, 2026
Merged via the queue into develop with commit 4f1c256 Jan 3, 2026
51 checks passed
@kingpinXD kingpinXD deleted the update-supporting-migration branch January 3, 2026 07:02
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