Skip to content

Remove deprecated Send* / TrackPayment RPCs and outgoing_chan_id field#10814

Merged
ziggie1984 merged 6 commits into
lightningnetwork:masterfrom
erickcestari:deprecated-rpc-removal
May 19, 2026
Merged

Remove deprecated Send* / TrackPayment RPCs and outgoing_chan_id field#10814
ziggie1984 merged 6 commits into
lightningnetwork:masterfrom
erickcestari:deprecated-rpc-removal

Conversation

@erickcestari
Copy link
Copy Markdown
Collaborator

Context

This PR is carved out of #10795 ("multi: remove deprecated RPCs and
config flags scheduled for 0.21"), which was split into smaller,
independently-reviewable PRs by topic. This is the payment RPC piece:
removal of the legacy Send* and TrackPayment surface that was
announced for removal in 0.21 via the 0.20 release notes.

The replacements have shipped since 0.20: callers should be on the V2
variants (SendPaymentV2, SendToRouteV2, TrackPaymentV2) and the
multi-channel outgoing_chan_ids field. This PR drops the deprecated
surface they replace.

What changes

RPCs removed

lnrpc

  • SendPayment (bidirectional streaming)
  • SendPaymentSync
  • SendToRoute (bidirectional streaming)
  • SendToRouteSync

routerrpc

  • SendPayment (streaming)
  • SendToRoute
  • TrackPayment (streaming)

The now-orphan routerrpc.SendToRouteResponse message and the
PaymentState enum / PaymentStatus message (only referenced by the
deprecated TrackPayment response) are dropped as well.

Fields removed

  • lnrpc.QueryRoutesRequest.outgoing_chan_id (tag 14, now reserved)
  • routerrpc.SendPaymentRequest.outgoing_chan_id (tag 8, now reserved)

The compatibility fallback in QueryRoutes and ExtractPaymentIntent
that accepted the single-channel field alongside outgoing_chan_ids
is removed; callers must now use outgoing_chan_ids.

Server-side cleanup

  • Handler implementations and macaroon permission entries for the
    deleted lnrpc RPCs are removed from rpcserver.go, along with the
    dead payment infrastructure that was exclusively used by them:
    paymentStream, rpcPaymentRequest, rpcPaymentIntent,
    extractPaymentIntent, dispatchPaymentIntent, sendPayment,
    sendPaymentSync.
  • The routerrpc shim methods in router_server_deprecated.go that
    delegated to V2, the matching macaroon entries, and the
    legacyTrackPaymentServer wrapper are removed.
  • All affected pb.go, pb.gw.go, pb.json.go, _grpc.pb.go, REST
    yaml, and swagger artifacts are regenerated.

Itest migration

  • lnd_routing_test.go: the three SendToRoute test cases (sync,
    stream, v2) are collapsed into a single test using SendToRouteV2;
    testSendToRouteErrorPropagation now asserts on Failure.Code
    instead of the legacy PaymentError string.
  • lnd_channel_policy_test.go: streaming SendToRoute replaced with
    SendToRouteV2, asserting on HTLCAttempt.Failure.
  • SendToRoute / SendToRouteSync helpers are removed from the test
    harness.

Release notes

Breaking Changes entries added to release-notes-0.21.0.md covering
the RPC and field removals.

Breaking changes / caller-facing notes

This is a breaking change for any client still on the legacy surface.
Migration:

  • SendPayment / SendPaymentSync (lnrpc) and SendPayment
    (routerrpc) callers must switch to routerrpc.SendPaymentV2.
  • SendToRoute / SendToRouteSync (lnrpc) and SendToRoute
    (routerrpc) callers must switch to routerrpc.SendToRouteV2. Error
    reporting moves from the string PaymentError field to the
    structured Failure / HTLCAttempt.Failure field.
  • TrackPayment (routerrpc) callers must switch to TrackPaymentV2;
    the PaymentState / PaymentStatus types are gone.
  • Requests setting outgoing_chan_id must populate
    outgoing_chan_ids (a repeated field) instead. The old tag is
    reserved, so stale clients sending it will be rejected by proto
    parsing.

Remove the compatibility fallback in QueryRoutes and ExtractPaymentIntent
that accepted the deprecated single outgoing_chan_id field alongside the
replacement outgoing_chan_ids. Callers must now use outgoing_chan_ids.

Update TestQueryRoutes and TestExtractPaymentIntent accordingly.
Remove SendToRoute and SendToRouteSync helpers from the test harness and
update integration tests to use routerrpc.SendToRouteV2:

- lnd_routing_test.go: collapse three SendToRoute test cases (sync,
  stream, v2) into a single test using SendToRouteV2; update
  testSendToRouteErrorPropagation to assert on Failure.Code instead of
  PaymentError string
- lnd_channel_policy_test.go: replace streaming SendToRoute with
  SendToRouteV2 and assert on HTLCAttempt.Failure instead of
  PaymentError string
Remove handler implementations and macaroon permission entries for the
now-deleted lnrpc RPCs: SendPayment, SendPaymentSync, SendToRoute, and
SendToRouteSync.

Also remove the dead payment infrastructure that was exclusively used by
these handlers: paymentStream, rpcPaymentRequest, rpcPaymentIntent,
extractPaymentIntent, dispatchPaymentIntent, sendPayment, and
sendPaymentSync.
…mpls

Remove the SendPayment, SendToRoute, and TrackPayment shim methods from
router_server_deprecated.go that delegated to their V2 counterparts.
Remove their macaroon permission entries from router_server.go and the
now-unused legacyTrackPaymentServer wrapper.
@erickcestari erickcestari added the backport-v0.21.x-branch This label triggers a backport to branch `v0.21.x-branch ` label May 18, 2026
@erickcestari erickcestari force-pushed the deprecated-rpc-removal branch from 381b584 to a618a93 Compare May 18, 2026 19:58
@github-actions github-actions Bot added the severity-critical Requires expert review - security/consensus critical label May 18, 2026
@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 completes the removal of legacy payment RPCs and fields that were marked for deprecation in version 0.20. By removing these interfaces, the codebase is streamlined, and callers are now required to use the V2 variants (SendPaymentV2, SendToRouteV2, TrackPaymentV2) and the multi-channel outgoing_chan_ids field. This is a breaking change intended to simplify the API surface for the 0.21 release.

Highlights

  • RPC Removal: Removed deprecated legacy RPCs including SendPayment, SendPaymentSync, SendToRoute, and TrackPayment from both lnrpc and routerrpc.
  • Field Removal: Removed the deprecated outgoing_chan_id field from QueryRoutesRequest and SendPaymentRequest, reserving the proto tags.
  • Test Migration: Updated integration tests to migrate from legacy RPC calls to the V2 variants, ensuring consistent error handling and functionality.
  • Server-side Cleanup: Removed legacy handler implementations, macaroon permissions, and dead payment infrastructure that supported the deprecated RPCs.
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 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 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 .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 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

  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
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 removes several deprecated payment and tracking RPCs and fields across the lnrpc and routerrpc packages, updating documentation and tests to use their V2 equivalents. Feedback indicates that the body of the QueryProbability function was accidentally deleted, which would cause a compilation error; it is recommended to restore this function and move it to router_server.go to keep the codebase clean.

Comment thread lnrpc/routerrpc/router_server_deprecated.go
Copy link
Copy Markdown
Member

@yyforyongyu yyforyongyu left a comment

Choose a reason for hiding this comment

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

Good move on splitting, LGTM🚢

Comment thread lnrpc/routerrpc/router_backend.go Outdated
Remove the following deprecated RPC definitions that were announced for
removal in 0.21 via the 0.20 release notes:

lnrpc:
  - SendPayment (bidirectional streaming)
  - SendPaymentSync
  - SendToRoute (bidirectional streaming)
  - SendToRouteSync

routerrpc:
  - SendPayment (streaming)
  - SendToRoute
  - TrackPayment (streaming)

Also remove the now-unused PaymentState enum and PaymentStatus message
that were only used by the deprecated TrackPayment response stream, plus
the corresponding REST annotations from the yaml files.

Drop the now-orphan routerrpc.SendToRouteResponse message that was only
referenced by the deleted routerrpc.SendToRoute RPC.

Also remove the deprecated outgoing_chan_id field from
lnrpc.QueryRoutesRequest (tag 14) and routerrpc.SendPaymentRequest
(tag 8); their tag numbers are now reserved. Callers must use the
multi-channel outgoing_chan_ids field introduced in 0.20.

Drop the compat fallback in router_backend.go that previously consumed
the field, and regenerate all protobuf, gRPC, REST gateway, JSON, and
swagger files.
Add entries to the Breaking Changes section covering the payment and
tracking RPCs and the `outgoing_chan_id` field removed in this branch,
all of which were announced for removal in 0.21 via the 0.20 release
notes.
@erickcestari erickcestari force-pushed the deprecated-rpc-removal branch from a618a93 to 05bdb66 Compare May 19, 2026 12:47
@github-actions github-actions Bot added severity-critical Requires expert review - security/consensus critical and removed severity-critical Requires expert review - security/consensus critical labels May 19, 2026
@erickcestari erickcestari requested a review from ziggie1984 May 19, 2026 12:49
@github-actions
Copy link
Copy Markdown

PR Severity: CRITICAL

auto-classified | 14 files | 1604 lines changed (excluding tests and auto-generated)

Critical (1 file):

  • rpcserver.go - Core server coordination

High (10 files):

  • lnrpc/lightning.proto
  • lnrpc/lightning.swagger.json
  • lnrpc/lightning.yaml
  • lnrpc/metadata.go
  • lnrpc/routerrpc/router.proto
  • lnrpc/routerrpc/router.swagger.json
  • lnrpc/routerrpc/router.yaml
  • lnrpc/routerrpc/router_backend.go
  • lnrpc/routerrpc/router_server.go
  • lnrpc/routerrpc/router_server_deprecated.go

Low/Excluded (tests, docs, auto-generated - not counted):

  • docs/release-notes/release-notes-0.21.0.md, docs/rest/websockets.md, lnrpc/README.md
  • itest/, lntest/, *_test.go files (8 test files)
  • 7 auto-generated pb.go files

Analysis: CRITICAL is driven by rpcserver.go (core server coordination). PR removes deprecated RPC endpoints (~4800 line net deletion). The 1604 qualified lines would trigger a bump, but CRITICAL is already the maximum.

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

@saubyk saubyk added this to the v0.21.0 milestone May 19, 2026
@saubyk saubyk added this to v0.21 May 19, 2026
@saubyk saubyk moved this to In review in v0.21 May 19, 2026
Copy link
Copy Markdown
Collaborator

@ziggie1984 ziggie1984 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread lnrpc/routerrpc/router_backend.go Outdated
// The deprecated single outgoing_chan_id field is no longer
// honored. Reject requests that still set it so that callers do
// not silently get an unrestricted route.
if in.OutgoingChanId != 0 {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if we do it in the first commit there is no need for this removal in the first place ?

@ziggie1984 ziggie1984 enabled auto-merge May 19, 2026 15:56
@ziggie1984 ziggie1984 merged commit 361cdba into lightningnetwork:master May 19, 2026
86 of 87 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in v0.21 May 19, 2026
@github-actions
Copy link
Copy Markdown

],
"default": "APRIORI"
},
"PaymentPaymentStatus": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The OpenAPI/Swagger definition for the payment-status enum was renamed from lnrpcPaymentPaymentStatus to PaymentPaymentStatus (and the standalone routerrpcPaymentStatus was removed)
▎ as a side effect of the deprecated TrackPayment V1 removal. Downstream consumers regenerating clients from the swagger JSON will need to update identifier references.

Just noting it here, in case someone runs into it

ziggie1984 added a commit that referenced this pull request May 19, 2026
…21.x-branch

[v0.21.x-branch] Backport #10814: Remove deprecated Send* / TrackPayment RPCs and outgoing_chan_id field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v0.21.x-branch This label triggers a backport to branch `v0.21.x-branch ` severity-critical Requires expert review - security/consensus critical

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants