Skip to content

peer: clarify rbf coop close flag errors#10747

Closed
xsfX20 wants to merge 1 commit intolightningnetwork:masterfrom
xsfX20:fix/rbf-coop-close-flag-error
Closed

peer: clarify rbf coop close flag errors#10747
xsfX20 wants to merge 1 commit intolightningnetwork:masterfrom
xsfX20:fix/rbf-coop-close-flag-error

Conversation

@xsfX20
Copy link
Copy Markdown

@xsfX20 xsfX20 commented Apr 17, 2026

Summary

  • replace the generic disabled-flag RBF cooperative close bump error with an actionable message
  • tell operators they must enable --protocol.rbf-coop-close before starting lnd
  • add a focused regression test for the new error copy

Testing

  • gofmt -w peer/brontide.go peer/brontide_test.go
  • git diff --check
  • Unable to run go test ./peer -run TestRbfCoopCloseDisabledError locally because the available toolchain is go1.19.5 while this repository currently declares go 1.25.5 in go.mod

Part of #9775

@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 user experience for operators encountering RBF cooperative close errors. By providing a more descriptive error message that explicitly mentions the necessary configuration flag, it reduces ambiguity and helps users resolve the issue faster. A regression test was also included to ensure the error message remains consistent.

Highlights

  • Improved Error Messaging: Replaced the generic error message for disabled RBF cooperative closes with a clear, actionable instruction to enable the required protocol flag.
  • Regression Testing: Added a new unit test to verify that the error message correctly instructs users to enable the --protocol.rbf-coop-close flag.

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

@github-actions github-actions bot added the severity-critical Requires expert review - security/consensus critical label Apr 17, 2026
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 introduces a helper function, rbfCoopCloseDisabledError, to provide a consistent error message when RBF cooperative close is disabled, and includes a unit test for verification. The review feedback identifies that both the new helper function and its test function are missing required documentation comments according to the repository's style guide.

Comment thread peer/brontide.go
bothHaveBit(lnwire.RbfCoopCloseOptionalStaging)
}

func rbfCoopCloseDisabledError() error {
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 rbfCoopCloseDisabledError is missing a documentation comment. According to the repository style guide, every function must be documented with its purpose and assumptions, and the comment must start with the function name as a complete sentence.

Suggested change
func rbfCoopCloseDisabledError() error {
// rbfCoopCloseDisabledError returns an error indicating that the RBF
// cooperative close protocol is disabled.
func rbfCoopCloseDisabledError() error {
References
  1. Every function must be commented with its purpose and assumptions, beginning with the function name as a complete sentence. (link)

Comment thread peer/brontide_test.go
require.NotEqualValues(t, shutdownMsg.Address, dummyDeliveryScript)
}

func TestRbfCoopCloseDisabledError(t *testing.T) {
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 test function TestRbfCoopCloseDisabledError is missing a documentation comment. The repository style guide requires every function to be commented with its purpose and assumptions.

Suggested change
func TestRbfCoopCloseDisabledError(t *testing.T) {
// TestRbfCoopCloseDisabledError tests that the error returned when RBF
// cooperative close is disabled contains the expected actionable message.
func TestRbfCoopCloseDisabledError(t *testing.T) {
References
  1. Every function must be commented with its purpose and assumptions. (link)

@github-actions
Copy link
Copy Markdown

PR Severity: CRITICAL

Automated classification | 1 file (non-test) | 8 lines changed

Critical files (1):

  • peer/brontide.go - Core encrypted peer connection / Brontide Noise protocol implementation

Excluded test files (1):

  • peer/brontide_test.go

Analysis

This PR modifies peer/brontide.go, which implements the Brontide encrypted transport (Noise Protocol) for peer connections. The peer/* package is CRITICAL because it handles encrypted peer connections and the Noise protocol. Bugs here can compromise confidentiality or integrity of communications, or cause connectivity failures.

The change is small (6 additions, 2 deletions in production code) with no severity bump triggers met, but the package sensitivity warrants expert review regardless.


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

@hieblmi
Copy link
Copy Markdown
Collaborator

hieblmi commented Apr 17, 2026

Hi @xsfX20, thanks for your contributions.

Would you mind taking a look at our new guideline for developer contributions to lnd? See #10741.

Please note that for new contributors it is more meaningful to submit code reviews of existing PRs rather than opening new code PRs.

@saubyk
Copy link
Copy Markdown
Collaborator

saubyk commented Apr 17, 2026

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-critical Requires expert review - security/consensus critical

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants