peer: clarify rbf coop close flag errors#10747
peer: clarify rbf coop close flag errors#10747xsfX20 wants to merge 1 commit intolightningnetwork:masterfrom
Conversation
Summary of ChangesHello, 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
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| bothHaveBit(lnwire.RbfCoopCloseOptionalStaging) | ||
| } | ||
|
|
||
| func rbfCoopCloseDisabledError() error { |
There was a problem hiding this comment.
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.
| func rbfCoopCloseDisabledError() error { | |
| // rbfCoopCloseDisabledError returns an error indicating that the RBF | |
| // cooperative close protocol is disabled. | |
| func rbfCoopCloseDisabledError() error { |
References
- Every function must be commented with its purpose and assumptions, beginning with the function name as a complete sentence. (link)
| require.NotEqualValues(t, shutdownMsg.Address, dummyDeliveryScript) | ||
| } | ||
|
|
||
| func TestRbfCoopCloseDisabledError(t *testing.T) { |
There was a problem hiding this comment.
The test function TestRbfCoopCloseDisabledError is missing a documentation comment. The repository style guide requires every function to be commented with its purpose and assumptions.
| 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
- Every function must be commented with its purpose and assumptions. (link)
|
PR Severity: CRITICAL Automated classification | 1 file (non-test) | 8 lines changed Critical files (1):
Excluded test files (1):
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. |
|
User spamming the repo with LLM generated prs. |
Summary
--protocol.rbf-coop-closebefore startinglndTesting
gofmt -w peer/brontide.go peer/brontide_test.gogit diff --checkgo test ./peer -run TestRbfCoopCloseDisabledErrorlocally because the available toolchain isgo1.19.5while this repository currently declaresgo 1.25.5ingo.modPart of #9775