routerrpc: add outgoing_chan_ids to EstimateRouteFee#10501
routerrpc: add outgoing_chan_ids to EstimateRouteFee#10501asheswook wants to merge 3 commits intolightningnetwork:masterfrom
Conversation
Summary of ChangesHello @asheswook, 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 a new 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.
Code Review
This pull request adds the outgoing_chan_ids field to the EstimateRouteFee RPC, which is a useful addition. The implementation looks correct. However, I have a couple of suggestions. First, for consistency within cmd/commands/cmd_payments.go, the new outgoing_chan_id flag should be a StringSliceFlag and parsed with the existing parseChanIDs helper, similar to other commands. Second, while you've mentioned that core logic is tested, this new functionality should have its own integration test to ensure the outgoing_chan_ids parameter is correctly handled from the CLI/RPC down to the routing logic. Please consider adding a test case to itest/lnd_estimate_route_fee_test.go. The lack of tests for new functionality is a high-severity issue.
There was a problem hiding this comment.
Code Review
This pull request adds the outgoing_chan_ids field to the EstimateRouteFee RPC, allowing users to specify which outgoing channels to use for fee estimation. The changes look good and include updates to the command-line interface, RPC server, and integration tests. I've made a few suggestions to improve code style and correctness.
| outChanIDs := ctx.StringSlice("outgoing_chan_id") | ||
| var err error | ||
| req.OutgoingChanIds, err = parseChanIDs(outChanIDs) | ||
| if err != nil { | ||
| return fmt.Errorf("unable to decode outgoing_chan_id: %w", err) | ||
| } |
There was a problem hiding this comment.
The variable outChanIDs is only used once and can be inlined to make the code more concise. Additionally, the separate declaration of err is not necessary and can be combined with the assignment.
req.OutgoingChanIds, err := parseChanIDs(ctx.StringSlice("outgoing_chan_id"))
if err != nil {
return fmt.Errorf("unable to decode outgoing_chan_id: %w", err)
}|
@asheswook, remember to re-request review from reviewers when ready |
Change Description
I needed the OutgoingChanIds field in EstateRouteFee. Fortunately, I was able to change it with a few modifications without core logic changes.
Steps to Test
I didn't write a separate test because this change doesn't change the test coverage of the core route logic.I checked that the test for the EstimateRouteFee command already exists.
So I added integration tests for
outgoing_chan_idsinEstimateRouteFee.make itest icase=estimate_route_feePull Request Checklist
Testing
Code Style and Documentation
[skip ci]in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.