chancloser: account for aux close outputs in initial coop close fee baseline#10615
chancloser: account for aux close outputs in initial coop close fee baseline#10615darioAnongba wants to merge 1 commit intolightningnetwork:masterfrom
Conversation
🔴 PR Severity: CRITICAL
🔴 Critical (1 file)
🟢 Low (1 file)
AnalysisThis PR modifies Severity bump check: No bump needed — only 2 non-test files changed (~98 lines), and a single critical package is touched. The test file ( To override, add a |
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 addresses a critical issue where cooperative channel closes, particularly for taproot and custom channels with auxiliary outputs, could fail due to insufficient fee estimation. The 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. Changelog
Activity
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. 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
|
There was a problem hiding this comment.
Code Review
This pull request addresses a problem where custom channel cooperative closes could fail due to insufficient fee estimation when auxiliary close outputs were present. The changes correctly extend the fee weight calculation to include these extra outputs, preventing underpriced close offers. The pull request also includes updates to release notes and new test cases to validate the fix. Overall, the changes improve the robustness of the channel closing mechanism for taproot and custom channels.
| // calcCoopCloseFee computes an "ideal" absolute co-op close fee given the | ||
| // delivery scripts of both parties and our ideal fee rate. |
There was a problem hiding this comment.
The function signature for calcCoopCloseFee has been updated to include extraOutputs. Please update the function comment to reflect this new parameter and its purpose, as per the style guide rule that every function must be commented with its purpose and assumptions (Repository Style Guide, line 17).
| // initFeeBaseline computes our ideal fee rate, and also the largest fee we'll | ||
| // accept given information about the delivery script of the remote party. | ||
| func (c *ChanCloser) initFeeBaseline() { | ||
| func (c *ChanCloser) initFeeBaseline() error { |
There was a problem hiding this comment.
The initFeeBaseline function now returns an error. The function comment should be updated to reflect this change, explaining when an error might be returned. This aligns with the style guide's requirement for function comments to be complete sentences and describe the function's purpose and assumptions (Repository Style Guide, lines 17, 19).
a00ee17 to
6925adc
Compare
6925adc to
dab25a4
Compare
Problem
Custom channel coop closes can fail with:
unable to process close msg: insufficient fee.Root cause
For taproot/custom channels,
ChanClosercomputed the initial coop close fee (idealFeeSat) from only local+remote outputs, but the final close tx can include auxiliary extra outputs.That mismatch can underprice the first accepted close offer (notably in taproot fast-close), causing mempool rejection and peer disconnect.
Fix
Extend coop close fee weight calculation to include optional extra outputs.