Skip to content

[WIP] MPP record support for QueryRoutes/SendToRoute (#9952)#10770

Open
code-orange-dev wants to merge 2 commits intolightningnetwork:masterfrom
code-orange-dev:fix/9952-mpp-queryroutes
Open

[WIP] MPP record support for QueryRoutes/SendToRoute (#9952)#10770
code-orange-dev wants to merge 2 commits intolightningnetwork:masterfrom
code-orange-dev:fix/9952-mpp-queryroutes

Conversation

@code-orange-dev
Copy link
Copy Markdown

Work in Progress

Adds MPP record support to QueryRoutes and SendToRoute RPC calls.

TODO

  • Update router.proto
  • Update lightning.proto (if needed)
  • Regenerate Go code
  • Update router implementation
  • Update lncli
  • Add tests

See CHANGE-9952.md for implementation guide.

Relates-to: #9952


🍊 Contributed via Code Orange Dev School

Add MPP record support to QueryRoutes and SendToRoute.

Relates-to: lightningnetwork#9952
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 the initial planning and documentation for adding Multi-Path Payment (MPP) record support to the QueryRoutes and SendToRoute RPC calls. It serves as a roadmap for upcoming changes to the protocol buffers, router implementation, and command-line interface.

Highlights

  • Implementation Guide: Added a new documentation file CHANGE-9952.md outlining the required steps for implementing MPP record support in QueryRoutes and SendToRoute.

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

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.

@github-actions github-actions Bot added the severity-low Best-effort review label Apr 26, 2026
@github-actions
Copy link
Copy Markdown

🟢 PR Severity: LOW

Automated classification | 1 file | 35 lines changed

🟢 Low (1 file)
  • CHANGE-9952.md - Markdown changelog/documentation file

Analysis

This PR adds a single markdown changelog file (CHANGE-9952.md). Markdown files fall under the LOW severity category (docs/, release-notes/, *.md files) and require only best-effort review. No production code is modified; there are no security, correctness, or protocol concerns.


To override, add a severity-override-{critical,high,medium,low} label.
<!-- pr-severity-bot -->

Add payment_addr support to QueryRoutes and mpp_record support to
SendToRoute for multi-path payments.

Changes:
- Add payment_addr field to QueryRoutesRequest proto
- Add payment_addr flag to lncli queryroutes command
- Add mpp_record field to SendToRouteRequest in router.proto

This allows users to:
- Query routes with MPP payment address included
- Send payments via SendToRoute with MPP records

Fixes lightningnetwork#9952

🍊 Code Orange Dev School contribution
@github-actions github-actions Bot added severity-high Requires knowledgeable engineer review and removed severity-low Best-effort review labels Apr 26, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Severity changed: severity-lowseverity-high (files changed since last classification)

🟠 PR Severity: HIGH

Highest-severity file rule | 4 files | 65 lines changed

🟠 High (2 files)
  • lnrpc/lightning.proto - lnrpc/* package: RPC/API definition changes
  • lnrpc/routerrpc/router.proto - lnrpc/* package: RPC/API definition changes
🟡 Medium (1 file)
  • cmd/commands/cmd_payments.go - cmd/* package: CLI client command (classified as MEDIUM per rule 2, not inheriting lnrpc severity)
🟢 Low (1 file)
  • CHANGE-9952.md - documentation/changelog file

Analysis

This PR modifies lnrpc/lightning.proto and lnrpc/routerrpc/router.proto, which define the core Lightning RPC API surface. Changes to .proto files under lnrpc/* fall into the HIGH severity tier because they represent RPC/API definitions that affect external consumers, gRPC bindings, and client compatibility. The accompanying cmd/commands/cmd_payments.go change is CLI client code (MEDIUM per the cmd/* rule), and CHANGE-9952.md is documentation (LOW).

The previous severity-low classification did not account for the proto file changes in lnrpc/*. A knowledgeable engineer should review the API additions for backward compatibility, correct field numbering, and consistency with the broader LND RPC design.


To override, add a severity-override-{critical,high,medium,low} label.
<!-- pr-severity-bot -->

Copy link
Copy Markdown

@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 introduces an implementation guide for LND #9952, outlining changes to Protobuf definitions, the router, and the CLI to support multi-path payments. Review feedback identified several technical inaccuracies in the guide, including field number collisions in QueryRoutesRequest and SendToRouteRequest, the incorrect file location for QueryRoutesRequest, and a redundant definition of the MPPRecord message which conflicts with the existing implementation.

Comment thread CHANGE-9952.md
### 1. lnrpc/routerrpc/router.proto
Add to `QueryRoutesRequest`:
```protobuf
bytes payment_addr = 15;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Field number 15 is already occupied by last_hop_pubkey in QueryRoutesRequest (see lnrpc/lightning.proto line 3327). Additionally, QueryRoutesRequest is defined in lnrpc/lightning.proto, not lnrpc/routerrpc/router.proto. Please use the next available field number, which is 21, in the correct file.

Suggested change
bytes payment_addr = 15;
bytes payment_addr = 21;

Comment thread CHANGE-9952.md

Add to `SendToRouteRequest`:
```protobuf
MPPRecord mpp_record = 3;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Field number 3 is already occupied by skip_temp_err in SendToRouteRequest (see lnrpc/routerrpc/router.proto line 482). Please use the next available field number, which is 5.

Suggested change
MPPRecord mpp_record = 3;
MPPRecord mpp_record = 5;

Comment thread CHANGE-9952.md
Comment on lines +19 to +22
message MPPRecord {
bytes payment_addr = 1;
uint64 total_amt_msat = 2;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The MPPRecord message is already defined in lnrpc/lightning.proto (lines 3488-3505) with field numbers 11 and 10. Redefining it with field numbers 1 and 2 would be a breaking change and is inconsistent with the existing definition. This section should be updated to match the existing definition or removed.

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

Labels

severity-high Requires knowledgeable engineer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant