Skip to content

Conversation

@asheswook
Copy link

@asheswook asheswook commented Jan 14, 2026

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_ids in EstimateRouteFee.

  • Estimation with a specific outgoing channel restriction
  • Error handling when an invalid channel ID is specified
  • Passed make itest icase=estimate_route_fee

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 outgoing_chan_ids parameter to the EstimateRouteFee RPC, allowing users to explicitly define a set of channels to be considered for the initial hop of a payment route. This enhancement provides finer-grained control over route fee estimations, making it possible to tailor calculations based on specific channel preferences, thereby improving the accuracy and utility of the fee estimation process for both direct and probe-based routing scenarios.

Highlights

  • RPC Enhancement: Added an outgoing_chan_ids field to the EstimateRouteFee RPC request, allowing users to specify preferred outgoing channels for the first hop in fee estimation.
  • Command-Line Interface Update: Updated the lncli estimateroutefee command to include a new outgoing_chan_id flag, enabling users to provide a list of desired initial channels.
  • Routing Logic Integration: Integrated the new outgoing_chan_ids parameter into both graph-based (probeDestination) and probe-based (probePaymentRequest) route fee calculations, ensuring the specified channels are considered during route restriction.
  • API Documentation: Updated the router.proto definition and router.swagger.json to reflect the addition of the outgoing_chan_ids field, ensuring API consistency and discoverability.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 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.

Comment on lines +2025 to +2030
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)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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)
}

@lightninglabs-deploy
Copy link
Collaborator

@asheswook, remember to re-request review from reviewers when ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants