Skip to content

test: update tss address on gateway for TSS migration test#3597

Merged
kingpinXD merged 3 commits intodevelopfrom
tss-migration-test-protocol-v2
Feb 26, 2025
Merged

test: update tss address on gateway for TSS migration test#3597
kingpinXD merged 3 commits intodevelopfrom
tss-migration-test-protocol-v2

Conversation

@kingpinXD
Copy link
Member

@kingpinXD kingpinXD commented Feb 26, 2025

Description

THe PR

  • Updates the TSS address on the gatway contract , so that the e2e tests can run post TSS migration with the new TSS addres .
  • Updates a check on the Bitcoin outbound , to allow outbounds of cointype CMD to go through , which allows the migration TX to be mined

How Has This Been Tested?

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

Summary by CodeRabbit

  • New Features
    • Enhanced multi-chain TSS address updates, now including support for gateway contracts.
    • Extended Bitcoin outbound transaction validation to accept an additional coin type.
  • Tests
    • Updated log messaging for Bitcoin and Ethereum TSS balances to improve clarity.
  • Chores
    • Removed a redundant log message during the TSS setup process for a cleaner output.

@kingpinXD kingpinXD requested a review from a team as a code owner February 26, 2025 18:01
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2025

📝 Walkthrough

Walkthrough

This pull request expands the TSS migration functionality by modifying the core TSSMigration function to include a new update for connected chains via a call to UpdateTSSAddressForGateway. A new method in the E2E runner is introduced to update the gateway contract’s TSS address with transaction verification. Additionally, logging messages in the migration tests have been refined for clarity, an unnecessary log in the setup process has been removed, and the validation for Bitcoin outbound data now accepts an additional coin type.

Changes

File(s) Change Summary
cmd/zetae2e/local/tss_migration.go
e2e/runner/admin_evm.go
Modified TSSMigration to invoke UpdateTSSAddressForGateway; added new UpdateTSSAddressForGateway method with transaction submission, receipt waiting, and TSS address verification; enhanced inline documentation in existing methods.
e2e/e2etests/test_migrate_tss.go
e2e/runner/setup_zevm.go
Updated logging for TSS balance statements in tests to explicitly reference BTC and ETH TSS; removed an extraneous log message in the TSS address setup method.
zetaclient/chains/bitcoin/signer/outbound_data.go Expanded coin type validation in NewOutboundData to accept both CoinType_Gas and CoinType_Cmd for Bitcoin outbound transactions.

Sequence Diagram(s)

sequenceDiagram
    participant Migration as TSSMigration
    participant Runner as deployerRunner
    participant Gateway as GatewayEVM
    participant Chain as Blockchain

    Migration->>Runner: UpdateTSSAddressForGateway()
    Runner->>Gateway: Submit TSS address update transaction
    Gateway->>Chain: Process transaction and return receipt
    Runner->>Gateway: Retrieve and verify updated TSS address
Loading

Possibly related PRs

Suggested labels

chain:bitcoin, SOLANA_TESTS, TON_TESTS

Suggested reviewers

  • ws4charlie
  • gartnera
  • brewmaster012
  • lumtis
  • skosito

Tip

CodeRabbit's docstrings feature is now available as part of our Pro Plan! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8ae60f and e905119.

📒 Files selected for processing (5)
  • cmd/zetae2e/local/tss_migration.go (1 hunks)
  • e2e/e2etests/test_migrate_tss.go (2 hunks)
  • e2e/runner/admin_evm.go (3 hunks)
  • e2e/runner/setup_zevm.go (0 hunks)
  • zetaclient/chains/bitcoin/signer/outbound_data.go (1 hunks)
💤 Files with no reviewable changes (1)
  • e2e/runner/setup_zevm.go
✅ Files skipped from review due to trivial changes (1)
  • e2e/e2etests/test_migrate_tss.go
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.go`: Review the Go code, point out issues relative to ...

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

  • zetaclient/chains/bitcoin/signer/outbound_data.go
  • cmd/zetae2e/local/tss_migration.go
  • e2e/runner/admin_evm.go
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: start-tss-migration-test / e2e
🔇 Additional comments (6)
zetaclient/chains/bitcoin/signer/outbound_data.go (1)

60-61: Coin type validation expanded to include CMD type.

The validation logic has been appropriately expanded to accept both CoinType_Gas and CoinType_Cmd for Bitcoin outbound transactions. This change aligns with the PR objective to allow outbound transactions of coin type CMD necessary for the migration transaction to be mined.

cmd/zetae2e/local/tss_migration.go (2)

94-97: Clear documentation with actionable TODO.

The added comments effectively document the purpose of the following updates and provide a clear reference to GitHub issue #3599 for potential future work. This approach ensures that developers understand both the immediate changes and potential future enhancements.


99-99: Gateway TSS address update added to the migration process.

The addition of deployerRunner.UpdateTSSAddressForGateway() completes the TSS address updates for all relevant contracts, which aligns with the PR objective of updating the TSS address on the gateway for TSS migration tests.

e2e/runner/admin_evm.go (3)

10-10: Documentation added for UpdateTSSAddressForConnector method.

Adding a clear comment for the existing method improves code readability and maintainability.


25-25: Documentation added for UpdateTSSAddressForERC20custody method.

Adding a clear comment for the existing method improves code readability and maintainability.


41-54: Well-implemented gateway TSS address update method.

The UpdateTSSAddressForGateway method follows the established pattern used in similar methods. It properly:

  1. Sets the TSS addresses
  2. Updates the TSS address on the gateway contract
  3. Logs the transaction details
  4. Waits for and verifies the transaction receipt
  5. Confirms the TSS address was correctly updated

This implementation ensures the gateway contract's TSS address is properly updated during the migration process.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kingpinXD kingpinXD added the no-changelog Skip changelog CI check label Feb 26, 2025
@kingpinXD kingpinXD added TSS_MIGRATION_TESTS Run TSS migration tests and removed breaking:cli labels Feb 26, 2025
Copy link
Contributor

@ws4charlie ws4charlie left a comment

Choose a reason for hiding this comment

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

LGTM

@kingpinXD kingpinXD marked this pull request as draft February 26, 2025 18:08
@codecov
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.69%. Comparing base (e8ae60f) to head (e905119).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3597   +/-   ##
========================================
  Coverage    64.69%   64.69%           
========================================
  Files          466      466           
  Lines        32477    32477           
========================================
  Hits         21010    21010           
  Misses       10512    10512           
  Partials       955      955           
Files with missing lines Coverage Δ
zetaclient/chains/bitcoin/signer/outbound_data.go 93.44% <100.00%> (ø)

@kingpinXD kingpinXD marked this pull request as ready for review February 26, 2025 18:18
@kingpinXD kingpinXD added this pull request to the merge queue Feb 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 26, 2025
@kingpinXD kingpinXD added this pull request to the merge queue Feb 26, 2025
Merged via the queue into develop with commit 4e5c732 Feb 26, 2025
51 checks passed
@kingpinXD kingpinXD deleted the tss-migration-test-protocol-v2 branch February 26, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking:cli no-changelog Skip changelog CI check TSS_MIGRATION_TESTS Run TSS migration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants