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: remove all dynamic peer discovery #3289

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

gartnera
Copy link
Member

@gartnera gartnera commented Dec 12, 2024

We've had to revert the new private peer discovery for two releases. It didn't work on live networks because it's very hard to discover which port is actually publicly accessible on our zetaclients because of the sentry architecture.

We've been using a static address book for awhile now which isn't that hard to manage on the operations side.

Related to #3277

go-tss change: zeta-chain/go-tss#40

Summary by CodeRabbit

  • New Features

    • Updated dependency versions for improved stability and performance.
  • Bug Fixes

    • Removed obsolete tracking of known peers from telemetry and health check functionalities, streamlining operations.
  • Refactor

    • Simplified telemetry interface by eliminating the SetKnownPeers method, enhancing peer management.

@gartnera gartnera added the PERFORMANCE_TESTS Run make start-e2e-performance-test label Dec 12, 2024
@zeta-chain zeta-chain deleted a comment from coderabbitai bot Dec 12, 2024
@gartnera gartnera marked this pull request as ready for review December 12, 2024 20:15
@gartnera gartnera requested a review from a team as a code owner December 12, 2024 20:15
Copy link
Contributor

coderabbitai bot commented Dec 12, 2024

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

Walkthrough

This pull request introduces several updates to the dependency management and telemetry functionalities within the project. The go.mod file has been modified to update the Go toolchain version and the version of the github.com/zeta-chain/go-tss dependency. Additionally, the telemetry system has undergone changes, including the removal of the knownPeers field and associated methods from the TelemetryServer struct, as well as the elimination of the knownPeersCounter function from the health check process. These changes streamline the telemetry functionality, focusing on connected peers.

Changes

File Change Summary
go.mod Updated Go toolchain version from go1.22.7 to go1.22.8. Updated github.com/zeta-chain/go-tss dependency version from v0.0.0-20241115165301-8535262eb16f to v0.0.0-20241211022951-f486d1f8425c.
zetaclient/metrics/telemetry.go Removed knownPeers field, SetKnownPeers, GetKnownPeers methods, and knownPeersHandler HTTP handler from TelemetryServer.
zetaclient/tss/healthcheck.go Removed knownPeersCounter function from HealthcheckWorker, which tracked known peers.
zetaclient/tss/service.go Removed SetKnownPeers(peers []peer.AddrInfo) method from Telemetry interface.

Possibly related PRs

Suggested labels

no-changelog, breaking:cli, SOLANA_TESTS

Suggested reviewers

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

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. (Beta)
  • @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.

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

🧹 Outside diff range and nitpick comments (1)
go.mod (1)

Based on the GitHub security advisory results, I can generate the final response as the verification is complete.

Security audit of fixed dependency versions reveals critical concerns

The project's dependencies have known security vulnerabilities:

  • github.com/ethereum/go-ethereum v1.13.15: Currently using the patched version that fixes a HIGH severity DoS vulnerability via malicious p2p messages.

  • github.com/libp2p/go-libp2p v0.27.8: Using a version that patches the HIGH severity RSA key attack vulnerability, but is vulnerable to a HIGH severity OOM attack (requires upgrade to v0.27.4 or later).

🔗 Analysis chain

Line range hint 6-373: Verify security implications of fixed dependency versions.

Several dependencies have fixed versions. While this ensures reproducible builds, it's important to verify that these versions don't have known security vulnerabilities.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for known vulnerabilities in key dependencies

# Check for security advisories for ethereum/go-ethereum
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: GO, package: "github.com/ethereum/go-ethereum") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

# Check for security advisories for libp2p
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: GO, package: "github.com/libp2p/go-libp2p") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Length of output: 2860

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 462fcea and edcd2d7.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • go.mod (1 hunks)
  • zetaclient/metrics/telemetry.go (0 hunks)
  • zetaclient/tss/healthcheck.go (0 hunks)
  • zetaclient/tss/service.go (0 hunks)
💤 Files with no reviewable changes (3)
  • zetaclient/tss/service.go
  • zetaclient/tss/healthcheck.go
  • zetaclient/metrics/telemetry.go
🔇 Additional comments (2)
go.mod (2)

Line range hint 1-4: LGTM: Go toolchain version is appropriately specified.

The Go toolchain version is explicitly set to 1.22.8, which is a good practice for ensuring consistent builds across different environments.


374-374: Verify the impact of go-tss dependency update.

The replacement of gitlab.com/thorchain/tss/go-tss with github.com/zeta-chain/go-tss aligns with the PR objective of removing dynamic peer discovery. However, we should verify that this change doesn't introduce any breaking changes.

✅ Verification successful

Let me gather more information about the specific changes in the go-tss dependency.


Let me try a different approach to analyze the go-tss usage.


Go-TSS dependency update verified as safe

Based on the code analysis, the update from gitlab.com/thorchain/tss/go-tss to github.com/zeta-chain/go-tss is safe for the following reasons:

  1. The codebase maintains compatibility with the TSS interface, using the same core types and methods (TssServer, KeygenConfig, etc.).
  2. The implementation in zetaclient/tss/setup.go shows that the TSS server initialization and configuration remain consistent with the original interface.
  3. The change aligns with removing dynamic peer discovery as evidenced by the explicit peer whitelisting in NewTSSServer.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for significant changes between the old and new go-tss versions

# Find files importing the old go-tss package
rg -l "gitlab.com/thorchain/tss/go-tss"

# Find files importing the new go-tss package
rg -l "github.com/zeta-chain/go-tss"

# Look for any TSS-related configuration or initialization code
ast-grep --pattern 'type $_ struct {
  $$$
  tss $_ 
  $$$
}'

Length of output: 11351


Script:

#!/bin/bash
# Check the actual usage of go-tss in the codebase
rg -A 5 "NewTssServer|NewTssKeySign" 

# Check for any configuration or initialization changes required
rg -A 5 "tss.Config|tss.KeygenConfig"

# Look for any specific imports or usage patterns that might be affected
ast-grep --pattern 'import $_ "gitlab.com/thorchain/tss/go-tss"'
ast-grep --pattern 'import $_ "github.com/zeta-chain/go-tss"'

Length of output: 209


Script:

#!/bin/bash
# Check the implementation details in tss-related files
cat zetaclient/tss/config.go
cat zetaclient/tss/setup.go

# Look for specific TSS server initialization patterns
rg -A 10 "func New.*Server" zetaclient/tss/

# Check for any configuration structures
rg -A 10 "type Config struct" zetaclient/tss/

Length of output: 13844

@gartnera gartnera force-pushed the remove-dynamic-peer-discovery branch from edcd2d7 to 588abe0 Compare December 16, 2024 16:17
@gartnera gartnera enabled auto-merge December 16, 2024 16:17
@gartnera gartnera added this pull request to the merge queue Dec 16, 2024
Merged via the queue into develop with commit 5fd8314 Dec 16, 2024
44 checks passed
@gartnera gartnera deleted the remove-dynamic-peer-discovery branch December 16, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PERFORMANCE_TESTS Run make start-e2e-performance-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants