Closed ziggie1984 closed 1 month ago
[!IMPORTANT]
Review skipped
Auto reviews are limited to specific labels.
Labels to auto review (1)
* llm-reviewPlease check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
The recent update enhances the fee-bumping mechanism for force close operations in Lightning Network channels, particularly when no HTLCs are involved. It introduces the BumpForceCloseFee
functionality, refines anchor handling, and ensures reliable fee adjustments for unconfirmed anchor channels. Users can now effectively increase force close fees, resolving previous limitations and improving overall usability.
Files/Directories | Change Summary |
---|---|
cmd/lncli/walletrpc_active.go |
Refactored bump force close fee logic, removed deprecated flags, and clarified budget usage for force closes without HTLCs. |
contractcourt/channel_arbitrator.go |
Modified anchor sweeping logic to register anchor outputs even when no HTLCs are present, enhancing fee adjustment capabilities. |
docs/release-notes/release-notes-0.18.1.md |
Documented the fix for bumping anchor channel fees when no HTLCs are present and added the new BumpForceCloseFee walletrpc endpoint. |
docs/release-notes/release-notes-0.18.3.md |
Detailed functional improvements and bug fixes related to the BumpForceCloseFee functionality. |
lnrpc/walletrpc/config_active.go |
Introduced a new field, ChanStateDB , in the Config struct for better state management in wallet RPC. |
lnrpc/walletrpc/walletkit.pb.json.go |
Added a JSON callback function for handling BumpForceCloseFee requests in the WalletKit service. |
lnrpc/walletrpc/walletkit.proto |
Introduced the BumpForceCloseFee RPC method for adjusting fees on anchor channel closures. |
lnrpc/walletrpc/walletkit_server.go |
Expanded the BumpForceCloseFee method to accommodate unconfirmed anchor channels and improve fee adjustment efficiency. |
itest/lnd_sweep_test.go |
Added tests for the new fee bumping functionality to validate behavior when handling force close transactions without HTLCs. |
lntest/rpc/wallet_kit.go |
Implemented a new method for invoking the BumpForceCloseFee RPC call within the HarnessRPC struct, enhancing testing capabilities. |
Objective (Issue #8837) | Addressed | Explanation |
---|---|---|
Register the anchor with the sweeper for accurate data | ✅ | |
Allow fee bumping without HTLCs | ✅ | |
Move logic from lncli to rpc |
✅ |
In the code's deep lightning grasp,
Anchors steady, no longer clasp.
Fees now bump, in clean euphoria,
Channels close, sans-HTLC gloria.
Rabbit smiles, in bits and bytes,
Onward flows, the network's lights. ✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai review
[!NOTE] Currently processing new changes in this PR. This may take a few minutes, please wait...
Commits
Files that changed from the base of the PR and between 68494fd91d69ccdd3e72a5eaca593b6e42babe23 and 219764f418dac9f25fd0f64a50559d5c4fa652cd.Files ignored due to path filters (5)
* `lnrpc/walletrpc/walletkit.pb.go` is excluded by `!**/*.pb.go`, `!**/*.pb.go` * `lnrpc/walletrpc/walletkit.pb.gw.go` is excluded by `!**/*.pb.gw.go`, `!**/*.pb.gw.go` * `lnrpc/walletrpc/walletkit.swagger.json` is excluded by `!**/*.json` * `lnrpc/walletrpc/walletkit.yaml` is excluded by `!**/*.yaml` * `lnrpc/walletrpc/walletkit_grpc.pb.go` is excluded by `!**/*.pb.go`, `!**/*.pb.go`Files selected for processing (9)
* cmd/lncli/walletrpc_active.go (1 hunks) * contractcourt/channel_arbitrator.go (1 hunks) * docs/release-notes/release-notes-0.18.1.md (1 hunks) * lnrpc/walletrpc/config_active.go (2 hunks) * lnrpc/walletrpc/walletkit.pb.json.go (1 hunks) * lnrpc/walletrpc/walletkit.proto (1 hunks) * lnrpc/walletrpc/walletkit_server.go (3 hunks) * lnwallet/wallet.go (1 hunks) * subrpcserver_config.go (1 hunks)_________________________________________________________________________________________________________________ < Iterate the schedule with the code. Use experience you gain as you implement to refine the project time scales. > ----------------------------------------------------------------------------------------------------------------- \ \ (\__/) (•ㅅ•) / づ
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
We definitely need to prioritize the flattening of the mulit_hop tests, fixing those takes super long because they include a lot of different special case for different channel types ...
waiting for https://github.com/lightningnetwork/lnd/pull/8717, so that itests are not updated twice.
I think this should be moved to 0.19 since we are adding an RPC?
I think this should be moved to 0.19 since we are adding an RPC?
Need to understand this better. I thought rpc was already added in 0.18 but not doing its function of bumping up the fee
This PR needs a final decision before I will proceed fixing the itests, basically the following:
Currently when creating the Force-Close transaction we will not account for the parent fee rate immediately but rely on the createRBFCompliantTx
which will at least create a transaction which meets the current mempool conditions. This has in my view several downsides, that's why I think the new approach by accounting the feerate is better:
When force-closing a channel the conf target will never select the right fee-rate which was essentially required but will only reach this feerate several blocks down the road which can be a long time until the desired feerate is reached in case the commitment transaction (parent) is very big.
Moreover when trying to bump the feerate of a closing transaction with this newly introduced RPC we will not be able to specify the exact feerate and therefore this might be a bad user experience.
Based on the decision above when we account for the parent feerate we need to change some itests which are now failing, but if we decide against it those itests remain unchanged. That's why I am waiting for your feedback before proceeding.
Maybe @morehouse and @yyforyongyu and comment on this matter ?
Thank you in advance for your time.
Moreover when trying to bump the feerate of a closing transaction with this newly introduced RPC we will not be able to specify the exact feerate and therefore this might be a bad user experience.
With the new sweeper I don't think it makes sense to specify a feerate anymore. Instead, users should seek to specify a budget, which is more accurate IMO, as in the end you wanna control the fees paid. Previously we achieved so by specifying a feerate, but it was not precise as it's mostly estimation.
I think this should be moved to 0.19 since we are adding an RPC?
Although its a new RPC, the logic was mostly copied from the lncli
side, and it fixes the bug of bumping force closes with no htlcs, so I think getting this in lnd 18.3 is a good choice :)
This PR needs a final decision before I will proceed fixing the itests, basically the following:
Currently when creating the Force-Close transaction we will not account for the parent fee rate immediately but rely on the createRBFCompliantTx which will at least create a transaction which meets the current mempool conditions. This has in my view several downsides, that's why I think the new approach by accounting the feerate is better:
When force-closing a channel the conf target will never select the right fee-rate which was essentially required but will only reach this feerate several blocks down the road which can be a long time until the desired feerate is reached in case the commitment transaction (parent) is very big.
Moreover when trying to bump the feerate of a closing transaction with this newly introduced RPC we will not be able to specify the exact feerate and therefore this might be a bad user experience.
Based on the decision above when we account for the parent feerate we need to change some itests which are now failing, but if we decide against it those itests remain unchanged. That's why I am waiting for your feedback before proceeding.
@ProofOfKeags this is the main question I have not sure if you saw it ?
Ok will split into 2 PR's.
Regarding the parent fee rate I am still undecided especially considering the above mentioned flow.
When force-closing a channel the conf target will never select the right fee-rate which was essentially required but will only reach this feerate several blocks down the road which can be a long time until the desired feerate is reached in case the commitment transaction (parent) is very big.
I will for now remove my addition of the parent weight consideration, so we can move on and merge this PR, however we might run into unpleasant behaviour when our commitment transaction is always broadcasted underestimating the fees.
Addressed all the comments, splitted the PR into two, first 3 commits of this PR belong to the other PR but we need this change so that the new itest will pass. Otherwise removed all the parent fee rate considerations which had the positive side effect of not breaking all the itests 😄.
@coderabbitai review
@yyforyongyu: review reminder @ziggie1984, remember to re-request review from reviewers when ready
0.18.3 is on a side branch, there is no merge freeze in effect.
Fixes https://github.com/lightningnetwork/lnd/issues/8837For reviewers please also focus on the following questions I included into the code starting with
Should we add an Integration Test for this new RPC call? => Yes I will
Thank you in advance 🙏
EDIT: Depends on https://github.com/lightningnetwork/lnd/pull/8946