docs: add RPC deprecation policy by ziggie1984 · Pull Request #10878 · lightningnetwork/lnd · GitHub
Skip to content

docs: add RPC deprecation policy#10878

Open
ziggie1984 wants to merge 1 commit into
lightningnetwork:masterfrom
ziggie1984:docs-rpc-deprecation-policy
Open

docs: add RPC deprecation policy#10878
ziggie1984 wants to merge 1 commit into
lightningnetwork:masterfrom
ziggie1984:docs-rpc-deprecation-policy

Conversation

@ziggie1984

@ziggie1984 ziggie1984 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Change Description

Add a RPC deprecation policy that documents the staged lifecycle for deprecating, rejecting, and finally removing public RPC fields and methods.

The policy focuses on behavior-affecting request fields, where removing a protobuf field directly can cause old gRPC clients to have values decoded as unknown fields and silently ignored.

Steps to Test

Doc-only change.

  • git diff --check

@gemini-code-assist

Copy link
Copy Markdown

@github-actions github-actions Bot added the severity-low Best-effort review label Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

🟢 PR Severity: LOW

Automated classification | 2 files | 102 lines changed

🟢 Low (2 files)
  • docs/development_guidelines.md - documentation file (docs/*)
  • docs/rpc_deprecation_policy.md - documentation file (docs/*)

Analysis

Both changed files are in the docs/ directory, which falls under the LOW severity category (documentation, markdown files). This PR adds a new RPC deprecation policy document and makes minor updates to development guidelines — no source code is modified. No severity bump conditions were met (2 files changed, 102 lines added, no critical packages touched).


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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 comprehensive RPC Deprecation Policy document (docs/rpc_deprecation_policy.md) and updates the development guidelines to reference it. The policy outlines a structured four-stage lifecycle for deprecating, rejecting, and removing behavior-affecting RPC fields and methods. The review feedback recommends valuable enhancements to the policy, including logging warnings when deprecated fields are used, clarifying the rejection behavior for proto3 primitive fields lacking explicit presence tracking, and specifying standard gRPC status codes for rejected methods.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +37 to +39
If the old and new fields have equivalent semantics, the server may continue
accepting the deprecated field and translating it to the new behavior during
this stage.

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

During the deprecation and announcement stages (Major N and N+1), it is highly recommended to log a warning (e.g., at warn or info level) on the server when a client sends a deprecated field. This gives node operators visibility into which of their integrated applications or scripts are still using deprecated APIs before they are hard-rejected in Major N+2.

Suggested change
If the old and new fields have equivalent semantics, the server may continue
accepting the deprecated field and translating it to the new behavior during
this stage.
If the old and new fields have equivalent semantics, the server may continue
accepting the deprecated field and translating it to the new behavior during
this stage. It is also recommended to log a warning when the deprecated field
is used, giving operators visibility before rejection begins.

Comment on lines +49 to +52
Keep the deprecated field in the protobuf schema, but stop honoring it. If
the client sets the field to a non-default value, return a clear
`InvalidArgument` error that identifies the deprecated field and names the
replacement field.

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

For primitive proto3 fields without explicit presence tracking (i.e., those not marked optional), the server cannot distinguish between a client explicitly setting the field to its default value (e.g., 0, false, "") and not setting it at all. Clarifying how presence tracking affects rejection behavior will help developers implement this policy correctly.

Suggested change
Keep the deprecated field in the protobuf schema, but stop honoring it. If
the client sets the field to a non-default value, return a clear
`InvalidArgument` error that identifies the deprecated field and names the
replacement field.
Keep the deprecated field in the protobuf schema, but stop honoring it. If
the client sets the field to a non-default value (or if presence is detected
for `optional` fields), return a clear `InvalidArgument` error that identifies
the deprecated field and names the replacement field.

Comment on lines +86 to +88
3. Prefer returning a clear error for one major release if the method can remain
registered without creating confusing behavior. The error should identify
the deprecated RPC method and name the replacement RPC method.

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

To ensure consistency across the API, it would be helpful to specify the recommended gRPC status code to return when a deprecated method is rejected (e.g., codes.Unimplemented or codes.FailedPrecondition).

Suggested change
3. Prefer returning a clear error for one major release if the method can remain
registered without creating confusing behavior. The error should identify
the deprecated RPC method and name the replacement RPC method.
3. Prefer returning a clear error (using `codes.Unimplemented` or `codes.FailedPrecondition`)
for one major release if the method can remain registered without creating
confusing behavior. The error should identify the deprecated RPC method and
name the replacement RPC method.

@lightninglabs-deploy

Copy link
Copy Markdown
Collaborator

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants