Add aux channel closer support to RBF cooperative close flow#10817
Add aux channel closer support to RBF cooperative close flow#10817haanhvu wants to merge 4 commits into
Conversation
… through RBF coop close - chancloser now carries shutdown custom records, derives auxiliary close outputs, and preserves them across RBF close state transitions. - peer wires the extra close metadata into the RBF closer environment and surfaces final close outputs in close updates. Signed-off-by: haanhvu <haanhvu888@gmail.com>
- add --dev.mock-aux-chan-closer config option for integration tests - expose dev config helpers to detect and retrieve a mock AuxChanCloser - wire ImplementationCfg.AuxChanCloser from dev config when enabled Signed-off-by: haanhvu <haanhvu888@gmail.com>
- add integration test for RBF cooperative close with mock aux chan closer enabled - assert extra close outputs are included in pending and final close transactions - verify auxiliary outputs persist across fee bump update Signed-off-by: haanhvu <haanhvu888@gmail.com>
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 introduces support for auxiliary channel closers into the RBF cooperative close flow. It ensures that custom shutdown records are correctly propagated and that auxiliary close outputs are derived, preserved during fee updates, and exposed in final close updates. These changes enable more flexible channel closing logic for custom channel types while maintaining robustness through new integration and unit tests. Highlights
New Features🧠 You can now enable Memory (public preview) 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 the 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 counterproductive. 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
|
Signed-off-by: haanhvu <haanhvu888@gmail.com>
🔴 PR Severity: CRITICAL
🔴 Critical (4 files)
🟡 Medium (3 files)
🟢 Low / Excluded (4 files — excluded from counts)
AnalysisThis PR modifies the RBF (Replace-By-Fee) cooperative channel close state machine inside Additionally, Expert review is warranted given the state machine complexity and the interaction between channel-close coordination and the peer layer. To override, add a |
There was a problem hiding this comment.
Code Review
This pull request introduces support for auxiliary channel closers within the RBF cooperative close state machine, enabling the handling of custom TLV records and auxiliary close outputs. The implementation includes updates to the state machine environment, message mapping, and peer initialization, along with new integration tests. Feedback recommends refactoring the configuration logic in config.go to reduce code duplication and centralizing hardcoded test outputs into a shared constant to enhance maintainability.
| if c.Dev.NeedMockAuxChanCloser() { | ||
| implCfg.AuxChanCloser = c.Dev.GetMockAuxChanCloserValueForTest() | ||
| } |
There was a problem hiding this comment.
This if block is a duplicate of the one on lines 1959-1962. To improve maintainability, you could refactor ImplementationConfig to avoid this code repetition. One way is to declare implCfg before the main if/else block, initialize it within each branch, and then have a single block to set AuxChanCloser before returning.
| TxOut: wire.TxOut{ | ||
| Value: 50_000, | ||
| PkScript: []byte{ | ||
| 0x00, 0x14, 0x11, 0x11, | ||
| 0x11, 0x11, 0x11, 0x11, | ||
| 0x11, 0x11, 0x11, 0x11, | ||
| 0x11, 0x11, 0x11, 0x11, | ||
| 0x11, 0x11, 0x11, 0x11, | ||
| 0x11, 0x11, | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Change Description
fixes #9663
Add auxiliary channel closer support to the RBF cooperative close flow. This change propagates shutdown custom records through the RBF close state machine, derives and preserves auxiliary close outputs across fee renegotiations, and exposes final local/remote/aux close outputs in close updates. It also adds a dev-only mock auxiliary channel closer and integration/unit test coverage for the new behavior.
Tests