Skip to content

multi: remove deprecated RPCs and config flags scheduled for 0.21#10795

Open
erickcestari wants to merge 7 commits intolightningnetwork:masterfrom
erickcestari:remove-deprecated-rpcs-20
Open

multi: remove deprecated RPCs and config flags scheduled for 0.21#10795
erickcestari wants to merge 7 commits intolightningnetwork:masterfrom
erickcestari:remove-deprecated-rpcs-20

Conversation

@erickcestari
Copy link
Copy Markdown
Collaborator

This PR removes the deprecated RPCs, fields, and configuration options that
were announced for removal in 0.21 via the
0.20 release notes.

Changes

Removed deprecated RPCs

The following RPCs are removed. Callers must migrate to the V2 equivalents
listed in the 0.20 release notes:

Removed RPC Replacement
lnrpc.SendPayment (streaming) routerrpc.SendPaymentV2
lnrpc.SendPaymentSync routerrpc.SendPaymentV2
lnrpc.SendToRoute (streaming) routerrpc.SendToRouteV2
lnrpc.SendToRouteSync routerrpc.SendToRouteV2
routerrpc.SendPayment (streaming) routerrpc.SendPaymentV2
routerrpc.SendToRoute routerrpc.SendToRouteV2
routerrpc.TrackPayment (streaming) routerrpc.TrackPaymentV2

This includes removing the corresponding REST gateway routes:

  • POST /v1/channels/transaction-stream
  • POST /v1/channels/transactions
  • POST /v1/channels/transactions/route

Removed deprecated OutgoingChanId field

The single-channel outgoing_chan_id field on QueryRoutesRequest and
SendPaymentRequest is no longer honored. Callers must use the multi-channel
outgoing_chan_ids field introduced in 0.20.

The compatibility fallback that accepted either field (and errored when both
were set) is removed from the routerrpc backend.

Removed deprecated tor v2 support

The --tor.v2 configuration flag is removed. Tor v2 onion services have been
obsolete since October 2021 when the Tor network dropped support for them.

The hidden service setup paths in config.go, lnd.go, and server.go are
simplified to assume v3 whenever a hidden service is configured.

Internal cleanups

  • Removed the dead payment infrastructure in rpcserver.go that was
    exclusively used by the deleted lnrpc handlers: paymentStream,
    rpcPaymentRequest, rpcPaymentIntent, extractPaymentIntent,
    dispatchPaymentIntent, sendPayment, and sendPaymentSync (~640 lines).
  • Removed the legacyTrackPaymentServer wrapper, PaymentState enum, and
    PaymentStatus message that were only used by the deleted
    routerrpc.TrackPayment stream.
  • Removed the SendToRoute and SendToRouteSync helpers from the integration
    test harness.

Test changes

  • itest/lnd_routing_test.go: collapsed three SendToRoute test cases (sync,
    stream, v2) into a single test exercising SendToRouteV2. Updated the error
    propagation test to assert on HTLCAttempt.Failure.Code instead of the
    legacy PaymentError string.
  • itest/lnd_channel_policy_test.go: migrated from streaming SendToRoute to
    SendToRouteV2 with structured failure assertions.
  • lnrpc/routerrpc/router_backend_test.go: removed the singleChanID and
    bothChanIds test variants that exercised the deprecated single-field path
    and its conflict detection.

Commits

The PR is split into six logical commits:

  1. proto: remove deprecated SendPayment, SendToRoute, TrackPayment RPCs - all
    proto, yaml, and regenerated stub files
  2. lnrpc: remove deprecated Send* RPC server implementations - server-side
    handlers and dead payment infrastructure in rpcserver.go
  3. routerrpc: remove deprecated SendPayment, SendToRoute, TrackPayment impls -
    server-side shims and macaroon entries
  4. routerrpc: remove deprecated outgoing_chan_id field handling - backend
    compatibility fallback removal
  5. lncfg: remove deprecated tor v2 support - tor v2 config flag removal
  6. itest: migrate deprecated lnrpc Send* calls to routerrpc V2 - test harness
    and integration test updates

Breaking changes

This is a breaking change for any client that still uses the deprecated RPCs,
fields, or config flag listed above. All have had V2 / replacement equivalents
available for multiple releases.

@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 deprecation cycle for several RPCs, configuration flags, and fields that were announced for removal in the 0.20 release. By removing these legacy components, the codebase is simplified and technical debt is reduced, while ensuring that users migrate to the more robust V2 alternatives.

Highlights

  • Removal of Deprecated RPCs: Removed several deprecated RPCs, including lnrpc.SendPayment, lnrpc.SendToRoute, and routerrpc.TrackPayment, along with their REST gateway equivalents. Callers are directed to use the V2 equivalents.
  • Removal of Deprecated Fields: Removed the outgoing_chan_id field from QueryRoutesRequest and SendPaymentRequest, requiring callers to use the multi-channel outgoing_chan_ids field.
  • Tor v2 Support Removal: Removed the --tor.v2 configuration flag and associated infrastructure, as Tor v2 onion services are obsolete.
  • Internal Cleanup and Testing: Cleaned up dead payment infrastructure in rpcserver.go and migrated integration tests to use the V2 RPC equivalents.
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.

@github-actions github-actions Bot added the severity-critical Requires expert review - security/consensus critical label May 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

🔴 PR Severity: CRITICAL

Highest-severity file wins | 15 non-test/non-generated files | ~1,473 lines changed (excl. tests & generated)

🔴 Critical (2 files)
  • rpcserver.go - Core RPC server coordination (explicitly listed as critical)
  • server.go - Core server coordination (explicitly listed as critical)
🟠 High (3 files, plus 7 auto-generated excluded from count)
  • lnrpc/routerrpc/router_backend.go - RPC/API router backend logic
  • lnrpc/routerrpc/router_server.go - Router RPC server implementation
  • lnrpc/routerrpc/router_server_deprecated.go - Deprecated router RPC endpoints removed
  • (auto-generated, excluded: lnrpc/lightning.pb.go, lightning.pb.gw.go, lightning.pb.json.go, lightning_grpc.pb.go, routerrpc/router.pb.go, router.pb.json.go, router_grpc.pb.go)
🟡 Medium (9 files)
  • config.go - Root configuration file
  • lnd.go - Root entrypoint
  • lncfg/tor.go - lncfg package (Tor config)
  • lnrpc/lightning.proto - Lightning RPC proto definition
  • lnrpc/lightning.swagger.json - Swagger API spec
  • lnrpc/lightning.yaml - API YAML spec
  • lnrpc/routerrpc/router.proto - Router RPC proto definition
  • lnrpc/routerrpc/router.swagger.json - Router swagger spec
  • lnrpc/routerrpc/router.yaml - Router YAML spec
🟢 Low (7 files — excluded from severity calculation)
  • docs/release-notes/release-notes-0.21.0.md - Release notes
  • itest/lnd_channel_policy_test.go - Integration test
  • itest/lnd_routing_test.go - Integration test
  • lntest/harness_assertion.go - Test harness
  • lntest/rpc/lnd.go - Test RPC helper
  • config_test.go - Unit test
  • lnrpc/routerrpc/router_backend_test.go - Unit test

Analysis

This PR touches rpcserver.go (788 lines removed) and server.go, both of which are explicitly classified as CRITICAL core server coordination files. The changes appear to be a significant cleanup/removal of deprecated RPC endpoints — particularly in rpcserver.go (~788 lines removed) and lnrpc/routerrpc/router_server_deprecated.go (~114 lines removed), along with corresponding proto/swagger changes.

Even though most changes are deletions (3,055 deletions vs. 423 additions, net reduction of ~2,632 lines), removing RPC handlers from the core server warrants careful expert review to ensure no active functionality is inadvertently dropped and that all call sites have been migrated.

The >500 non-test/non-generated lines changed threshold for a severity bump is met (~1,473 lines), but the PR is already at the maximum CRITICAL level.


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 removes deprecated Tor v2 support and several legacy payment and tracking RPCs, including SendPayment, SendPaymentSync, SendToRoute, and TrackPayment, along with associated configuration flags and test cases. The changes simplify the codebase by removing obsolete logic and updating integration tests to use V2 RPC equivalents. Review feedback suggests moving the QueryProbability function to router_server.go and deleting the now-redundant router_server_deprecated.go file, while also improving the function's documentation to comply with the LND style guide for exported functions.

Comment on lines 10 to 12
// QueryProbability returns the current success probability estimate for a
// given node pair and amount.
func (s *Server) QueryProbability(_ context.Context,
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 function QueryProbability is the only remaining function in this file. It should be moved to router_server.go and this file should be deleted. Additionally, as an exported function, it requires a more detailed comment for the caller per the LND style guide.

References
  1. Exported functions require detailed comments for the caller. (link)

@erickcestari erickcestari force-pushed the remove-deprecated-rpcs-20 branch 2 times, most recently from b6c6036 to 74f5520 Compare May 7, 2026 19:54
@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 7, 2026
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 the --tor.v2 config flag and all associated handling. Tor v2
onion services have been obsolete since October 2021 when the Tor
network dropped support for them.

Update config.go, lnd.go, and server.go to assume v3 when a tor hidden
service is configured.
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.
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. Regenerate all
protobuf, gRPC, REST gateway, JSON, and swagger files.
…e notes

Add entries to the Breaking Changes section of the 0.21 release notes
covering the RPCs, fields, and config flags removed in this PR that were
announced for removal in 0.21 via the 0.20 release notes.
@erickcestari erickcestari force-pushed the remove-deprecated-rpcs-20 branch from 74f5520 to a99d010 Compare May 8, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

severity-critical Requires expert review - security/consensus critical

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant