Skip to content

docs: explain rbf cooperative close flow#10749

Closed
xsfX20 wants to merge 1 commit into
lightningnetwork:masterfrom
xsfX20:docs/rbf-closechannel-docs
Closed

docs: explain rbf cooperative close flow#10749
xsfX20 wants to merge 1 commit into
lightningnetwork:masterfrom
xsfX20:docs/rbf-closechannel-docs

Conversation

@xsfX20

@xsfX20 xsfX20 commented Apr 17, 2026

Copy link
Copy Markdown

Summary

  • document the RBF cooperative close flow on the canonical closechannel command and RPC surfaces
  • explain the --protocol.rbf-coop-close requirement and the peer-support requirement
  • clarify that callers can reissue CloseChannel with a higher fee target or fee rate to request an RBF bump, and what max_fee_per_vbyte means in that flow

Testing

  • git diff --check

Closes #9771

@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 improves the documentation for the RBF (Replace-By-Fee) cooperative close functionality within the Lightning Network daemon. By updating the CLI and RPC documentation, it provides clearer guidance to users and developers on how to properly initiate and bump fees for cooperative channel closures, ensuring that the necessary configuration flags and peer requirements are well-understood.

Highlights

  • Documentation Update: Added detailed explanations regarding the RBF cooperative close flow to both the CLI command help text and the RPC service definition.
  • Protocol Requirements: Clarified that the RBF cooperative close feature requires the --protocol.rbf-coop-close flag and support from the remote peer.
  • Usage Clarification: Explained the mechanism for reissuing CloseChannel requests with higher fee targets or rates to trigger an RBF bump during an active negotiation.

🧠 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.

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 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.

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.

@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 adds documentation for RBF cooperative close fee bumping to the CLI and RPC interfaces. The review feedback focuses on improving the clarity and accuracy of this documentation, specifically by using more appropriate terminology for the CLI context and clarifying the relationship between confirmation targets and fee rates to avoid user confusion.

Comment thread cmd/commands/commands.go
RBF cooperative close fee bumping requires starting lnd with
--protocol.rbf-coop-close enabled and only works if the remote peer also
supports the protocol. When the initial cooperative close attempt is in
progress, the same closechannel RPC can be reissued with a higher fee

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

In the context of CLI documentation, it is more appropriate to refer to closechannel as a "command" rather than an "RPC". Users interacting with lncli are executing commands, and the underlying RPC is an implementation detail. This aligns with the goal of maintaining readable and user-friendly documentation.

Suggested change
progress, the same closechannel RPC can be reissued with a higher fee
progress, the same closechannel command can be reissued with a higher fee
References
  1. Readable code is the most important requirement for any commit created. (link)

Comment thread lnrpc/lightning.proto
RBF cooperative close fee bumping requires starting lnd with
`--protocol.rbf-coop-close` enabled and only works if the remote peer also
supports the protocol. While a cooperative close is already in progress,
callers can reissue CloseChannel with a higher fee target or fee rate to

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 term "higher fee target" is potentially confusing because a "higher" value for the target_conf field (more blocks) actually results in a lower fee. It would be clearer to use "more aggressive confirmation target" to avoid ambiguity regarding the direction of the value change.

Suggested change
callers can reissue CloseChannel with a higher fee target or fee rate to
callers can reissue CloseChannel with a more aggressive confirmation target or fee rate to

Comment thread lnrpc/lightning.proto
Comment on lines +2272 to +2273
// cooperative close retry, callers can increase this value (or the target
// fee rate) and reissue CloseChannel to request a higher-fee replacement.

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 term "target fee rate" is slightly ambiguous as it conflates "confirmation target" and "fee rate". Since this refers to the sat_per_vbyte field, it's better to just use "fee rate". Additionally, mentioning that the confirmation target can also be adjusted provides a more complete picture of the RBF options.

Suggested change
// cooperative close retry, callers can increase this value (or the target
// fee rate) and reissue CloseChannel to request a higher-fee replacement.
// cooperative close retry, callers can increase this value (or the fee
// rate / confirmation target) and reissue CloseChannel to request a higher-fee replacement.

@github-actions github-actions Bot added the severity-high Requires knowledgeable engineer review label Apr 17, 2026
@github-actions

Copy link
Copy Markdown

🟠 PR Severity: HIGH (severity-high)

Automated classification | 2 files | 18 lines changed

High severity file (1):

  • lnrpc/lightning.proto — RPC/API definition change; lnrpc/* proto files are HIGH

Medium severity file (1):

  • cmd/commands/commands.go — CLI client command; cmd/* is always MEDIUM regardless of filename keywords

Analysis:
The highest-severity file is lnrpc/lightning.proto, which falls under lnrpc/* (RPC/API definitions). Changes to .proto files define the external interface of lnd and require a knowledgeable engineer to ensure API compatibility, correct field definitions, and proper documentation.

The cmd/commands/commands.go file is CLI client code under cmd/* and is classified as MEDIUM per policy: cmd/* files are always MEDIUM even if the filename references a server-side package name.

No severity bump applies: only 2 non-test/non-generated files changed (threshold: >20) and only 18 lines changed (threshold: >500).

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

@saubyk

saubyk commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

User spamming the repo with LLM generated prs.

@saubyk saubyk closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

severity-high Requires knowledgeable engineer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: CloseChannel documentation makes no mention of the new RBF cooperative close protocol

2 participants