chainreg: clarify zmq port mismatch warning message#10639
chainreg: clarify zmq port mismatch warning message#10639Bortlesboat wants to merge 2 commits intolightningnetwork:masterfrom
Conversation
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
Summary of ChangesHello, 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 Highlights
🧠 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
chainreg/chainregistry.go
Outdated
| "zmq block event port mismatch: "+ | ||
| "lnd is configured for %s but "+ | ||
| "bitcoind reports %s -- ensure "+ | ||
| "the ports match or are forwarded "+ | ||
| "correctly", |
There was a problem hiding this comment.
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.
| "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
- The style guide recommends minimizing lines for log and error messages. The suggested change makes the format string more compact. (link)
chainreg/chainregistry.go
Outdated
| "zmq tx event port mismatch: "+ | ||
| "lnd is configured for %s but "+ | ||
| "bitcoind reports %s -- ensure "+ | ||
| "the ports match or are forwarded "+ | ||
| "correctly", |
There was a problem hiding this comment.
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.
| "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
- 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.
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:
Fixes #10568