-
Notifications
You must be signed in to change notification settings - Fork 2.2k
funding: skip rescan for already-confirmed zero-conf channels #10459
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
base: master
Are you sure you want to change the base?
funding: skip rescan for already-confirmed zero-conf channels #10459
Conversation
Summary of ChangesHello @hxrshxz, 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 an optimization for how LND handles already-confirmed zero-confirmation channels upon restart. By intelligently using the confirmed block height as a starting point for chain rescans, it eliminates redundant data retrieval from the initial broadcast height. This change primarily benefits mobile and Neutrino users by reducing bandwidth usage and improving the overall performance and responsiveness of the client after a restart. 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. 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.
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 an optimization to skip chain rescans for zero-conf channels that are already confirmed upon restart. This is achieved by using the confirmed block height as a hint for the chain notifier and by adding a check to skip the rescan logic if a zero-conf channel is already confirmed. The changes are logical and well-implemented. My main feedback is regarding the lack of tests to cover this new logic and prevent future regressions.
| // waitForZeroConfChannel is called when the state is addedToGraph with | ||
| // a zero-conf channel. This will wait for the real confirmation, add the | ||
| // confirmed SCID to the router graph, and then announce after six confs. | ||
| func (f *Manager) waitForZeroConfChannel(c *channeldb.OpenChannel) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the logic to skip the rescan for already confirmed zero-conf channels is sound, this bug fix would benefit from an accompanying regression test. A test case could be added to simulate a restart where a zero-conf channel is already confirmed, and then assert that no historical rescan is triggered. This would help prevent future regressions and ensure the long-term stability of this optimization.
|
Thanks. Why are we skipping the ci here? |
Oops , mb I used copilot's "generate commit message" and didn't notice the skip ci , I will remove it from both the Title and the commit msg |
dafe40e to
22e9ae0
Compare
Change Description
Fixes #9299. On restart, zero-conf channels that are already confirmed no longer trigger historical chain rescans from the broadcast height, reducing bandwidth usage on mobile/neutrino.
Steps to Test
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.