multi: support MPP and AMP records in QueryRoutes, BuildRoute and Sen…#10801
multi: support MPP and AMP records in QueryRoutes, BuildRoute and Sen…#10801murraystewart96 wants to merge 8 commits into
Conversation
…dToRoute Closes lightningnetwork#9952 - Add payment_addr field to QueryRoutesRequest to allow callers to include the invoice payment secret. The MPP record is injected into the final hop of the returned route. - Add amp_record field to QueryRoutesRequest and BuildRouteRequest. - Enforce that SendToRouteV2 and BuildRoute require a payment_addr, as payment_secret is now mandatory per the BOLT 11 spec. - Add AMP record support to BuildRoute, threading it through finalHopParams into newRoute with a feature check against the destination node.
…dToRoute - updating release notes
Summary of ChangesHello, 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 support for Multi-Path Payment (MPP) and Atomic Multi-Path (AMP) records within the routing layer. By updating the RPC definitions and internal route-building logic, the changes allow callers to provide necessary payment secrets and AMP records, which are then correctly injected into the final hop of a route. These updates ensure the system remains compliant with current BOLT 11 standards while providing robust validation for new payment types. Highlights
New Features🧠 You can now enable Memory (public preview) 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 the 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 counterproductive. 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
|
There was a problem hiding this comment.
Code Review
This pull request adds support for Multi-Path Payments (MPP) and Atomic Multi-Path (AMP) records across the routing and RPC layers by introducing payment_addr and amp_record fields to QueryRoutesRequest and BuildRouteRequest. These records are now injected into the final hop of generated routes, and SendToRouteV2 has been updated to enforce mandatory MPP records. Review feedback highlights a critical logic error in BuildRoute that prevents AMP record processing, identifies missing length validations for payment_addr which could lead to panics, and notes a style guide violation in unit tests where manual error checks should be replaced with the require library.
…dToRoute - small refactor
…dToRoute - fixing BuildRoute amp injection
…dToRoute - validating payment addr length before casting
…dToRoute - ensuring payment_addr is 32 bytes - using require for test assertion
|
PR Severity: HIGH. Files: lnrpc/lightning.proto, lnrpc/lightning.swagger.json, lnrpc/routerrpc/router.proto, lnrpc/routerrpc/router.swagger.json, lnrpc/routerrpc/router_backend.go, lnrpc/routerrpc/router_server.go (all HIGH via lnrpc/), routing/pathfind.go, routing/router.go (HIGH via routing/). 9 non-excluded files, ~143 non-excluded lines - no bump. <!-- pr-severity-bot --> |
…dToRoute - adding small comments
…dToRoute - removing comments
…dToRoute
Closes #9952
Change Description
Description of change / link to associated issue.
Steps to Test
Steps for reviewers to follow to test the change.
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.