-
Notifications
You must be signed in to change notification settings - Fork 2.2k
multi: downgrade to legacy coop close for taproot channels #9669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi: downgrade to legacy coop close for taproot channels #9669
Conversation
In this commit, we implement logic to downgrade to the legacy coop close for taproot channels. Before this commit, we wouldn't allow nodes to start up with both the taproot flag and the rbf flag activated. In the future, once we implement the spec updates, we'll add support for this combo, and can revert parts of this commit.
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a downgrade mechanism for taproot channels to use the legacy cooperative close logic when the RBF coop close flag is enabled. Key changes include:
- Removing the error check in server.go that previously disallowed using taproot channels with RBF coop close.
- Adding conditional logic in peer/brontide.go to fall back to the legacy closer for taproot channels.
- Refactoring and extending the tests (in itest/) to cover various combinations of taproot and RBF coop close configurations.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
server.go | Removed error condition preventing taproot channels with RBF coop close. |
peer/brontide.go | Modified channel close logic to differentiate taproot channels from standard channels. |
lntest/node/config.go | Added configuration for the new RBF coop close flag. |
itest/lnd_coop_close_with_htlcs_test.go | Refactored test code to support multiple flag combinations and introduced restart tests. |
itest/list_on_test.go | Added a new test case entry for testing coop close with HTLCs and node restart. |
Comments suppressed due to low confidence (2)
peer/brontide.go:1234
- [nitpick] Consider extracting the taproot channel check into a helper function to reduce duplication across similar methods.
isTaprootChan := lnChan.ChanType().IsTaproot()
itest/lnd_coop_close_with_htlcs_test.go:80
- [nitpick] For consistency in naming, consider using the same capitalization for node names (e.g., 'Alice' and 'Bob').
alice := ht.NewNodeWithCoins("Alice", testCase.flags)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ⚡
In this commit, we test all the combinations of rbf close and taproot chans. This ensures that the downgrade logic works properly. Along the way we refactor the tests slightly, and also split them up, as running all the combos back to back mines more than 50 blocks in a test, which triggers an error in the itest sanity checks.
693269f
to
1fc2c64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Confirming that the test that is failing (same test in both jobs) is occurring elsewhere too and so is not related to this diff
// be used together. | ||
// | ||
// TODO(roasbeef): fix | ||
if cfg.ProtocolOptions.RbfCoopClose && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps we should update the RbfCoopClose
description just to indicate that if set, it wont be used for tap chans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the sample conf? Sure.
In this commit, we implement logic to downgrade to the legacy coop close
for taproot channels. Before this commit, we wouldn't allow nodes to
start up with both the taproot flag and the rbf flag activated.
In the future, once we implement the spec updates, we'll add support for
this combo, and can revert parts of this commit.
We then test all the combinations of rbf close and taproot
chans. This ensures that the downgrade logic works properly.
Along the way we refactor the tests slightly, and also split them up, as
running all the combos back to back mines more than 50 blocks in a test,
which triggers an error in the itest sanity checks.