Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(zetaclient): infinite discovery address leak #3171

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

gartnera
Copy link
Member

@gartnera gartnera commented Nov 15, 2024

zeta-chain/go-tss#37

Will backport to release/v22 and release v22.1.1

No changelog since it will be released on v22

Summary by CodeRabbit

  • Chores
    • Updated Go toolchain version to ensure compatibility.
    • Routine updates to several dependencies for improved performance and stability.
    • Removed indirect comments from specific dependencies for clarity.

@gartnera gartnera added no-changelog Skip changelog CI check PERFORMANCE_TESTS Run make start-e2e-performance-test labels Nov 15, 2024
Copy link
Contributor

coderabbitai bot commented Nov 15, 2024

📝 Walkthrough

Walkthrough

The go.mod file has been updated to reflect several dependency changes, including version upgrades and the addition of new dependencies. The Go toolchain version was updated from go1.22.7 to go1.22.8. Key dependencies such as github.com/gagliardetto/binary and gitlab.com/thorchain/tss/go-tss have been modified, with the latter being updated to a new version. Several new dependencies have been introduced, and indirect comments have been removed from some existing dependencies.

Changes

File Change Summary
go.mod - Updated Go toolchain version from go1.22.7 to go1.22.8
- Updated dependency: gitlab.com/thorchain/tss/go-tss from v0.0.0-20241031223543-... to v0.0.0-20241115165301-...
- Added dependencies: github.com/bnb-chain/tss-lib v1.5.0, github.com/montanaflynn/stats v0.7.1, github.com/showa-93/go-mask v0.6.2, github.com/tonkeeper/tongo v1.9.3
- Updated golang.org/x/mod v0.17.0 (removed indirect comment)
- Updated github.com/gagliardetto/binary v0.8.0 (removed indirect comment)

Possibly related PRs

Suggested labels

UPGRADE_LIGHT_TESTS

Suggested reviewers

  • lumtis
  • swift1337
  • kingpinXD
  • fbac
  • skosito
  • brewmaster012

Warning

Rate limit exceeded

@gartnera has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 58 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 470ba7d and 4e45902.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 470ba7d and 4e45902.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod (3 hunks)
🔇 Additional comments (2)
go.mod (2)

142-142: LGTM: Dependency comment updates

The removal of indirect comments from github.com/gagliardetto/binary and golang.org/x/mod indicates these are now direct dependencies, which aligns with their usage in the codebase.

Also applies to: 298-298


374-374: Verify the impact of TSS library replacement

The replacement of gitlab.com/thorchain/tss/go-tss with github.com/zeta-chain/go-tss is a critical change that addresses the infinite discovery address leak mentioned in the PR objectives.

Let's verify the TSS library usage and potential impact:

✅ Verification successful

Let me gather more information about the changes in the forked TSS library to understand the impact better.


TSS Library Update Addresses Critical Discovery Address Leak

The replacement of the TSS library with the forked version is verified to be a targeted security fix. The commit message from the forked repository explicitly confirms that it addresses the infinite discovery address leak issue. The change impacts multiple components across the codebase, but the modification is contained to the library replacement without requiring additional code changes.

Key findings:

  • The TSS library is used across 10 different files in the codebase
  • The forked version (8535262eb16f) specifically fixes the infinite discovery address leak
  • All imports will automatically use the patched version due to the go.mod replacement directive
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for TSS library imports and usage
echo "Checking TSS library imports..."
rg -l "gitlab.com/thorchain/tss/go-tss"

echo "Checking TSS discovery-related function calls..."
ast-grep --pattern 'discovery.$_($$$)'

echo "Checking for any remaining thorchain TSS references..."
rg "thorchain.*tss"

Length of output: 2110


Script:

#!/bin/bash
# Check the commit history of the forked TSS library
echo "Checking the forked TSS library commit..."
gh api repos/zeta-chain/go-tss/commits/8535262eb16f --jq '.commit.message'

# Look for discovery-related code patterns
echo "Checking discovery patterns in the codebase..."
rg -A 3 "discovery" --type go

# Check for any TSS configuration or setup code
echo "Looking for TSS configuration..."
ast-grep --pattern 'NewTssServer($$$)'
ast-grep --pattern 'NewTssKeySign($$$)'

Length of output: 562


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 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.

@gartnera gartnera added this pull request to the merge queue Nov 15, 2024
gartnera added a commit that referenced this pull request Nov 15, 2024
* fix(zetaclient): infinite discovery address leak (#3171)

* changelog
Merged via the queue into develop with commit 6e03cc6 Nov 15, 2024
45 checks passed
@gartnera gartnera deleted the fix-infinite-addresses-leak branch November 15, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Skip changelog CI check PERFORMANCE_TESTS Run make start-e2e-performance-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants