-
Notifications
You must be signed in to change notification settings - Fork 2.2k
routing: fix missing graph data for local channels #10516
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?
routing: fix missing graph data for local channels #10516
Conversation
Summary of ChangesHello @fresh3nough, 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 addresses an issue where 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. 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 fixes an issue where missing graph data for local channels was not handled correctly when updating policies. The change in routing/localchans/manager.go correctly defers handling of channels with missing edge policies to a later stage when createMissingEdge is true, allowing for their recreation.
The accompanying tests in routing/localchans/manager_test.go are extended to cover these new scenarios. However, I've found an issue in the test mock for forAllOutgoingChannels that prevents the new test cases from actually testing the intended edge == nil scenario. My review includes a comment with details on this. Once the test is fixed, this PR should be good to go.
| // Use the channel's specific edge policy if set, | ||
| // otherwise use the default current policy. | ||
| edgePolicy := c.edgePolicy | ||
| if edgePolicy == nil && len(c.edgeInfo.ChannelPoint.Hash) != 0 { | ||
| edgePolicy = ¤tPolicy | ||
| } |
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.
The logic in this mock for forAllOutgoingChannels seems to prevent the new test cases from correctly testing the edge == nil scenario. The new tests ("nil edge policy recreated" and "nil edge policy not recreated") are intended to test the case where ForAllOutgoingChannels provides a nil edge policy. However, the current logic assigns ¤tPolicy to edgePolicy when c.edgePolicy is nil and the channel point is valid. This means the if edge == nil block in manager.go is not actually exercised by these tests.
To ensure the new logic in manager.go is tested, this mock should be updated to allow passing a nil policy to the callback cb for the relevant test cases.
|
It's important that you read the contribution guide and review other PRs to see how it's done. |
Add release notes entry for the bug fix that addresses missing graph data for local channels, which was preventing channels from being used for sending or forwarding payments. Co-Authored-By: Warp <agent@warp.dev>
|
I've updated the PR to follow the contribution guidelines: ✅ Added a detailed Change Description with reference to issue #10447 The PR is now ready for review. |
Co-Authored-By: Warp <agent@warp.dev>
Add release notes entry for the bug fix that addresses missing graph data for local channels, which was preventing channels from being used for sending or forwarding payments. Co-Authored-By: Warp <agent@warp.dev>
573d1ca to
40396c5
Compare
Co-Authored-By: Warp <agent@warp.dev>
40396c5 to
a99bb49
Compare
Change Description
Fixes #10447.
Under rare conditions, a local channel can exist in the graph DB with edge
information but without an associated edge policy. When
lncli updatechanpolicy --create_missing_edgeis used,routing/localchansshould recreate the missing edge policy.
Previously, the
UpdatePolicyflow would still mark those channels as a policyupdate failure (NOT_FOUND), preventing the missing-edge creation path from
running.
This PR keeps those channels in
unprocessedChanswhencreateMissingEdgeisset, allowing the later missing-edge creation logic to handle them, and adds
unit tests covering both
createMissingEdge=trueandcreateMissingEdge=false.Steps to Reproduce
This issue is easiest to reproduce via the unit test case added in this PR:
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.