-
Notifications
You must be signed in to change notification settings - Fork 2.2k
localchans: populate FundingScript for missing edges #10410
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
localchans: populate FundingScript for missing edges #10410
Conversation
Summary of ChangesHello @ellemouton, 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 refactors the server's logic for adding graph edges. The primary goal is to ensure that channel edges are directly persisted to the graph database. By switching from Highlights
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 refactors the localChanMgr initialization to directly use graphDB.AddChannelEdge instead of graphBuilder.AddEdge. This is a good change as it bypasses the logic in graph.Builder that is specific to handling external gossip messages, such as erroring on existing channel edges. The graph.Builder's behavior is not suitable for the localChanMgr, which needs to ensure a local channel edge exists in the graph. The new implementation is more direct and correct for this purpose. The change is clean and has no apparent side effects. I approve.
c7cff02 to
76c8ac8
Compare
ziggie1984
left a comment
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.
LGTM
76c8ac8 to
a1d02f1
Compare
a1d02f1 to
e93901a
Compare
So that we can re-use this helper else where.
e93901a to
0f4b220
Compare
When creating a missing edge, we need to populate the funding script too so that the graph builder can update its ChainView appropriately. We use the MakeFundingScript helper from the funding package which ensures that we are using the same logic for creating a funding script as is used for any of the channels that we own.
0f4b220 to
da9868b
Compare
ziggie1984
left a comment
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.
LGTM
bitromortac
left a comment
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.
Really nice fix, LGTM 🎉
This issue seems to have re-surfaced this bug. The symptom of that bug was fixed in this pr but the root cause is still unknown.
With the graph refactor work done in the last release, some extra validation in the graph Builder has resurfaced the bug. The extra check requires that the FundingScript of a channel edge be set. So here, we just update the
createMissingEdgehelper to also set this value.