Skip to content

5522: warn users when connecting watchtower client to local watchtower#10811

Open
murraystewart96 wants to merge 2 commits into
lightningnetwork:masterfrom
murraystewart96:5522-warn-watchtower-clients-connecting-local-node
Open

5522: warn users when connecting watchtower client to local watchtower#10811
murraystewart96 wants to merge 2 commits into
lightningnetwork:masterfrom
murraystewart96:5522-warn-watchtower-clients-connecting-local-node

Conversation

@murraystewart96
Copy link
Copy Markdown

Change Description

#5522

Adding local watchtower pub key to watchtower client config so that it can warn users if connecting to the local watchtower node.

Steps to Test

Steps for reviewers to follow to test the change.

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a safety mechanism for users configuring watchtower clients. By tracking the public key of a local watchtower instance, the system can now detect and warn users if they are attempting to connect their client to the same node, preventing potential availability issues where the tower becomes unreachable if the node goes offline.

Highlights

  • Watchtower Client Configuration: Added the local watchtower public key to the watchtower client configuration to enable identification of local nodes.
  • User Warning System: Implemented a warning log in the AddTower method that triggers when a user attempts to connect the watchtower client to their own local watchtower node.
  • Dependency Injection: Updated the server initialization flow to pass the local watchtower public key through the configuration stack.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a mechanism to detect and warn when a watchtower client is connecting to a local watchtower. It updates the server initialization to pass the local tower's public key to the watchtower manager, which now issues a warning if the node's own identity key is used as a tower address. Review feedback suggested improving the documentation for the new configuration field to better align with the style guide's requirements for complete sentences and readability.

Comment thread watchtower/wtclient/manager.go Outdated
@github-actions github-actions Bot added the severity-critical Requires expert review - security/consensus critical label May 18, 2026
@github-actions
Copy link
Copy Markdown

🔴 PR Severity: CRITICAL

Automated classification | 3 files | 26 lines changed

🔴 Critical (1 file)
  • server.go - Core server coordination file (explicitly listed as CRITICAL)
🟠 High (1 file)
  • watchtower/wtclient/manager.go - Watchtower client code (watchtower/* → HIGH)
🟡 Medium (1 file)
  • lnd.go - Main daemon entry point (not explicitly categorized → MEDIUM)

Analysis

This PR is classified CRITICAL because it modifies server.go, which is the core LND server coordination file explicitly listed in the CRITICAL tier. Changes to this file can affect how the entire daemon initializes and wires together its subsystems, warranting expert review.

The PR also touches watchtower/wtclient/manager.go (HIGH — breach remediation subsystem) and lnd.go (MEDIUM — main entry point). The highest severity file determines the PR severity.

Bump rule check: 3 files changed (threshold: >20), 26 lines changed (threshold: >500), only one critical package touched — no severity bump applied.


To override, add a severity-override-{critical,high,medium,low} label.
<!-- pr-severity-bot -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

severity-critical Requires expert review - security/consensus critical

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant