Skip to content

chainreg: clarify zmq port mismatch warning message#10639

Open
Bortlesboat wants to merge 2 commits intolightningnetwork:masterfrom
Bortlesboat:fix/zmq-warning-message
Open

chainreg: clarify zmq port mismatch warning message#10639
Bortlesboat wants to merge 2 commits intolightningnetwork:masterfrom
Bortlesboat:fix/zmq-warning-message

Conversation

@Bortlesboat
Copy link

Description

The existing zmq warning messages say "unable to subscribe to zmq block/tx events on X (bitcoind is running on X)" which implies lnd failed to create zmq connections entirely. In reality, lnd only detected that the configured port doesn't match what bitcoind reports via getzmqnotifications — which is expected in port-forwarding setups.

This rewrites the warnings to clearly state it's a port mismatch and advise the user to verify their configuration:

zmq block event port mismatch: lnd is configured for X but bitcoind reports X -- ensure the ports match or are forwarded correctly

Fixes #10568

The existing warning "unable to subscribe to zmq block/tx events" is
misleading because it implies lnd failed to create zmq connections,
when it actually means the configured port doesn't match what bitcoind
reports via getzmqnotifications. This is expected in port-forwarding
setups.

Reword the warning to clearly state it's a port mismatch and suggest
verifying the configuration.

Fixes lightningnetwork#10568
@gemini-code-assist
Copy link

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 enhances the clarity of ZMQ port mismatch warning messages within the lnd chain registry. The previous messages could be misleading, suggesting a complete failure to subscribe to ZMQ events. The updated warnings now precisely state that a port mismatch has occurred and guide users to check their configuration or port forwarding, significantly improving diagnostic information for users encountering these issues.

Highlights

  • ZMQ Warning Message Clarity: Rewrote ZMQ block and transaction event port mismatch warnings to be more explicit, indicating a configuration mismatch rather than a connection failure, and advising users to verify their setup.

🧠 New Feature in Public Preview: You can now enable Memory 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.

Changelog
  • chainreg/chainregistry.go
    • Updated the warning message for ZMQ block event port mismatches to provide clearer guidance.
    • Updated the warning message for ZMQ transaction event port mismatches to be more informative.
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 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 counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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

@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 improves the clarity of ZMQ port mismatch warning messages, which is a great enhancement for user experience. My review includes a couple of minor suggestions to make the formatting of the new log messages more compact, in line with the repository's style guide.

Comment on lines +481 to +485
"zmq block event port mismatch: "+
"lnd is configured for %s but "+
"bitcoind reports %s -- ensure "+
"the ports match or are forwarded "+
"correctly",

Choose a reason for hiding this comment

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

medium

While the new log message is much clearer, the formatting could be more compact to improve readability, per the style guide's preference for minimizing lines in log messages. The format string can be combined into fewer lines.

Suggested change
"zmq block event port mismatch: "+
"lnd is configured for %s but "+
"bitcoind reports %s -- ensure "+
"the ports match or are forwarded "+
"correctly",
"zmq block event port mismatch: lnd is configured for %s but "+
"bitcoind reports %s -- ensure the ports match or are "+
"forwarded correctly",
References
  1. The style guide recommends minimizing lines for log and error messages. The suggested change makes the format string more compact. (link)

Comment on lines +499 to +503
"zmq tx event port mismatch: "+
"lnd is configured for %s but "+
"bitcoind reports %s -- ensure "+
"the ports match or are forwarded "+
"correctly",

Choose a reason for hiding this comment

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

medium

Similar to the previous comment, this log message formatting can be made more compact to improve readability and better align with the style guide's goal of minimizing lines.

Suggested change
"zmq tx event port mismatch: "+
"lnd is configured for %s but "+
"bitcoind reports %s -- ensure "+
"the ports match or are forwarded "+
"correctly",
"zmq tx event port mismatch: lnd is configured for %s but "+
"bitcoind reports %s -- ensure the ports match or are "+
"forwarded correctly",
References
  1. The style guide recommends minimizing lines for log and error messages. The suggested change makes the format string more compact. (link)

Combine multi-line format strings into fewer lines for readability.
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.

[bug]: Misleading warning message when lnd encounters mismatched zmq ports

1 participant