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 into
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 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.
6925adc to
dab25a4
Compare
|
Nice, cACK A few things to help with context:
|
jtobin
left a comment
There was a problem hiding this comment.
This looks pretty solid. I made one comment re: adding a test for the fee-bump-yields-different-outputs logic that I believe is not strongly exercised at present. What do you think?
dab25a4 to
8783fe4
Compare
🔴 PR Severity: CRITICAL
🔴 Critical (1 file)
🟢 Low (1 file, 1 excluded)
AnalysisThis PR modifies The PR is small in scope (82 additions / 9 deletions in the production file) and is accompanied by a test file update, but the sensitivity of the code path warrants expert review regardless of size. No bump rules were triggered:
To override, add a |
|
See regression test here: lightninglabs/taproot-assets#2091 |
8783fe4 to
94932a9
Compare
| // Aux output selection can depend on CloseFee. After we bump the fee, | ||
| // the aux closer can return a different output set (for example | ||
| // around dust thresholds). Run a second pass so the fee and output | ||
| // set are self-consistent, while keeping this bounded. |
There was a problem hiding this comment.
I find this quite fragile and cannot fully understand reason why we need to do 2 passes here, can you elaborate ?
|
@hieblmi: review reminder |
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.