Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

New rpc GetConfigInfo added#10608

Closed
saubyk wants to merge 5 commits intolightningnetwork:masterfrom
saubyk:add-getconfiginfo-rpc
Closed

New rpc GetConfigInfo added#10608
saubyk wants to merge 5 commits intolightningnetwork:masterfrom
saubyk:add-getconfiginfo-rpc

Conversation

Copy link
Collaborator

saubyk commented Feb 25, 2026 *
edited
Loading

Change Description

Fixes #10508

Adds a new rpc GetConfigInfo

Steps to Test

  1. Build
    make build
  2. Run make rpc-check
    Verifies the generated proto code matches the proto definitions
  3. Unit tests
    Run the root package tests to ensure nothing is broken:
    make unit pkg=. timeout=5m
  4. Manual testing
    Start lnd (with any backend), then run:
    lncli getconfiginfo

Expected output (varies by config):
{
"db_backend": "bolt",
"native_sql": false
}

Test with different configurations:

  • Default (bolt): Should return "db_backend": "bolt"
  • With --db.backend=sqlite: Should return "db_backend": "sqlite"
  • With --db.use-native-sql: Should return "native_sql": true
  1. REST endpoint
    curl -s --cacert ~/.lnd/tls.cert
    -H "Grpc-Metadata-macaroon: $(xxd -ps -u -c 1000 ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon)"
    https://localhost:8080/v1/getconfiginfo
  2. Macaroon permissions
    Verify it works with a readonly.macaroon (since it uses info:read) and fails with an invoice-only macaroon.

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.

saubyk self-assigned this Feb 25, 2026
Copy link

gemini-code-assist bot commented Feb 25, 2026

Summary of Changes

Hello @saubyk, 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 enhances the LND daemon's introspection capabilities by providing a new RPC and CLI command. This addition allows users and applications to programmatically and directly query the operational configuration of the LND node, specifically regarding its database setup. This improves transparency and aids in debugging or operational monitoring by exposing key internal settings.

Highlights

  • New RPC GetConfigInfo: A new RPC endpoint, GetConfigInfo, has been introduced to retrieve configuration details of the running LND node. This includes information about the database backend in use and whether native SQL is enabled.
  • New lncli Command: A corresponding lncli command, getconfiginfo, has been added, allowing users to easily query the daemon's configuration from the command line.
  • API and Documentation Updates: The necessary gRPC, gRPC-Gateway, Swagger, and release notes documentation have been updated to reflect the new RPC and command.

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.

Changelog
  • cmd/commands/commands.go
    • Added getConfigInfoCommand and its action function getConfigInfo to handle the new CLI command.
  • cmd/commands/main.go
    • Registered the new getConfigInfoCommand to make it available in the lncli application.
  • docs/release-notes/release-notes-0.21.0.md
    • Documented the new GetConfigInfo RPC and the getconfiginfo lncli command in the release notes.
  • lnrpc/lightning.pb.gw.go
    • Updated generated gRPC-Gateway code to include request and local request handlers for the GetConfigInfo RPC.
    • Added a new mux.Handle entry for the GetConfigInfo RPC to register its HTTP GET endpoint.
    • Defined pattern_Lightning_GetConfigInfo_0 for the new RPC's HTTP path.
    • Added forward_Lightning_GetConfigInfo_0 for message forwarding.
  • lnrpc/lightning.pb.json.go
    • Added a new entry to the registry map for lnrpc.Lightning.GetConfigInfo to handle JSON marshalling and unmarshalling for the RPC.
  • lnrpc/lightning.proto
    • Defined the new GetConfigInfo RPC service method.
    • Added GetConfigInfoRequest and GetConfigInfoResponse messages, including db_backend and native_sql fields.
  • lnrpc/lightning.swagger.json
    • Added a new Swagger path definition for /v1/getconfiginfo with its summary, operation ID, and response schema.
    • Defined the lnrpcGetConfigInfoResponse schema with db_backend and native_sql properties.
  • lnrpc/lightning.yaml
    • Added a new HTTP GET mapping for lnrpc.Lightning.GetConfigInfo to /v1/getconfiginfo.
  • lnrpc/lightning_grpc.pb.go
    • Updated the LightningClient interface to include the GetConfigInfo method.
    • Implemented the GetConfigInfo method for the lightningClient struct.
    • Updated the LightningServer interface to include the GetConfigInfo method.
    • Added an unimplemented GetConfigInfo method to UnimplementedLightningServer.
    • Implemented the _Lightning_GetConfigInfo_Handler for server-side RPC handling.
    • Added GetConfigInfo to Lightning_ServiceDesc.Methods.
  • rpcserver.go
    • Added permissions for the /lnrpc.Lightning/GetConfigInfo endpoint, requiring 'info' entity with 'read' action.
    • Implemented the GetConfigInfo method in the rpcServer to return the configured database backend and native SQL status.
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 or @gemini-code-assist . 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 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 a new GetConfigInfo RPC and its corresponding lncli command getconfiginfo. The changes are well-structured and cover all necessary parts, including protobuf definitions, RPC server implementation, lncli command, and release notes. I've found a couple of minor issues: a missing function comment in cmd/commands/commands.go and a broken markdown link in the release notes. After addressing these, the PR should be in good shape.

saubyk force-pushed the add-getconfiginfo-rpc branch from 787f1c9 to ca0b107 Compare February 25, 2026 01:02
lightninglabs-deploy added the severity-critical Requires expert review - security/consensus critical label Feb 25, 2026
Copy link
Collaborator

lightninglabs-deploy commented Feb 25, 2026

PR Severity: CRITICAL

Automated classification | 7 files (excl. auto-generated) | 102 lines changed

Critical (1 file)
  • rpcserver.go - Core server coordination file
High (2 files)
  • lnrpc/lightning.swagger.json - RPC/API definitions (lnrpc/*)
  • lnrpc/lightning.yaml - RPC/API definitions (lnrpc/*)
Medium (3 files)
  • lnrpc/lightning.proto - Proto/API schema change
  • cmd/commands/commands.go - CLI client command (cmd/*)
  • cmd/commands/main.go - CLI client entry (cmd/*)
Low (1 file)
  • docs/release-notes/release-notes-0.21.0.md - Documentation/release notes
Excluded from counting (4 auto-generated files)
  • lnrpc/lightning.pb.go - auto-generated (*.pb.go)
  • lnrpc/lightning.pb.gw.go - auto-generated (*.pb.gw.go)
  • lnrpc/lightning.pb.json.go - auto-generated (*.pb.json.go)
  • lnrpc/lightning_grpc.pb.go - auto-generated (*.pb.go)

Analysis

This PR is classified as CRITICAL because it modifies rpcserver.go, which is the core RPC server coordination file. Changes here can affect how the node handles all RPC calls and is one of the most sensitive files in the codebase.

The bulk of the line changes (3,590 additions / 3,454 deletions) are in auto-generated protobuf files (lightning.pb.go, etc.) which are excluded from the severity bump calculation. The actual hand-authored changes are modest: ~102 lines across 7 non-excluded files, so no severity bump was triggered.

The PR appears to add new RPC functionality (additions only, no deletions in non-generated files), touching the proto definition, swagger spec, gRPC generated code, CLI commands, and the RPC server itself. Expert review of the rpcserver.go changes is warranted to ensure proper input validation, authorization checks, and error handling.


To override, add a severity-override-{critical,high,medium,low} label.

saubyk force-pushed the add-getconfiginfo-rpc branch from ca0b107 to b046fd6 Compare February 25, 2026 01:11
saubyk added this to the v0.21.0 milestone Feb 25, 2026
saubyk added this to v0.21 Feb 25, 2026
saubyk moved this to In progress in v0.21 Feb 25, 2026
saubyk marked this pull request as ready for review February 25, 2026 01:22
saubyk requested a review from ziggie1984 February 25, 2026 01:22
saubyk force-pushed the add-getconfiginfo-rpc branch from b046fd6 to 6bee8a7 Compare February 26, 2026 01:04
saubyk force-pushed the add-getconfiginfo-rpc branch from 6bee8a7 to 4180c48 Compare February 26, 2026 03:12
ellemouton requested changes Feb 26, 2026
Copy link
Collaborator

ellemouton left a comment

Choose a reason for hiding this comment

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

i think this info is already present in lncli getdebuginfo?

saubyk reacted with heart emoji
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
Copy link
Collaborator

ellemouton Feb 26, 2026

Choose a reason for hiding this comment

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

pls squash into previous commit

Comment on lines +161 to +166
/* lncli: `getconfiginfo`
GetConfigInfo returns configuration information about the running
LND node. This includes details about the database backend and
other operational settings.
*/
rpc GetConfigInfo (GetConfigInfoRequest) returns (GetConfigInfoResponse);
Copy link
Collaborator

ellemouton Feb 26, 2026

Choose a reason for hiding this comment

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

do we need this if we already have GetDebugInfo?

Copy link
Collaborator Author

saubyk commented Feb 26, 2026 *
edited
Loading

i think this info is already present in lncli getdebuginfo?

That's a good callout. I wasn't even aware of this rpc!
Although, the output of the rpc is very noisy, since it outputs the log as well. I can may be add a --config argument to getdebuginfo to just output the config info, which should satisfy the ask in the issue. wdyt?

Copy link
Collaborator

ellemouton commented Feb 26, 2026

yeah could do!

saubyk reacted with heart emoji

Copy link
Collaborator Author

saubyk commented Feb 26, 2026

Closing this one. Will open a new one which will add a config param to the getdebuginfo rpc.

saubyk closed this Feb 26, 2026
github-project-automation bot moved this from In progress to Done in v0.21 Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

ellemouton ellemouton requested changes

ziggie1984 Awaiting requested review from ziggie1984

+1 more reviewer

gemini-code-assist[bot] gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

saubyk

Labels

severity-critical Requires expert review - security/consensus critical

Projects

Status: Done

Milestone

v0.21.0

Development

Successfully merging this pull request may close these issues.

[feature]: getinfo should also show DB type in use

3 participants