-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
cnct: anchor output sweeping and fee bumping #3758
cnct: anchor output sweeping and fee bumping #3758
Conversation
3a906e6
to
bb94988
Compare
79e8375
to
6df6c0e
Compare
338b1f2
to
7f4ecde
Compare
ef5d3c6
to
f4ac679
Compare
aaac70c
to
bec3316
Compare
e6c5a18
to
c72e852
Compare
cf266e3
to
8c9717c
Compare
One more issue found. Recording commit a9c08ab as base for comparison ( This issue was that when |
e36eccc
to
a6784a4
Compare
Co-authored-by: Joost Jager <[email protected]>
Exclusive group is a static property that doesn't need to be updated. Requiring the exclusive group to be passed into UpdateParams creates a burden for the caller to make sure they supply the existing group. This change will be beneficial for users that bump anchor sweeps that have exclusive groups set.
a6784a4
to
64c60f2
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.
Great work, LGTM ✅ Only non-blockinng comments.
Prior to this change, the trigger height for closed channels was set to the current best block height. As this height is in some cases used as a height hint, the spend may have been missed.
Allows unit testing of the channel arbitrator with fewer dependencies. This is a preparation for the addition of anchor sweeping.
Relay fee is needed later to sweep anchors at the minimum fee rate.
64c60f2
to
2cd26d0
Compare
Need to fix |
b01923b
to
afc5023
Compare
Start anchor sweep attempts immediately after the commitment transaction has been published. This makes the anchor known to the sweeper and allows the user to bump the fee on it to get their commitment transaction confirmed in case the fee committed too is insufficient for timely confirmation.
Preparation for the anchor resolver which does not have persistent state.
Preparation for anchor resolver. The recovered anchor amount should still be included in the pending channel report even after it has been resolved. This also fixes an existing bug that in some cases caused the recovered amount from an htlc resolver not to be included in the total.
Sweeping anchors and being able to bump the fee was already added in a previous commit. This commit extends anchor sweeping with an anchor resolver object that becomes active after the commitment tx confirms. At that point, the anchors do not serve the purpose of getting the commitment tranaction confirmed anymore. It is however still possible to reclaim some of their value if using a low fee rate.
To make it easier to determine which pending sweep to bump in order to get your anchor commitment tx confirmed.
This command allows users to easily bump the fee on their unconfirmed closing transactions.
afc5023
to
fa115b5
Compare
Anchors itest failure fixed as part of 'cnct: pre-confirmation anchor sweep' |
LND supports an experimental commitment format that produces anchor outputs (#3829, lightning/bolts#688). Anchor outputs allow users to increase the fee of their commitment txes after they've been published. It allows timely confirmation even if the miner fee of the commitment tx itself is insufficient.
This PR adds the functionality required to do so. When the commitment tx isn't confirming, the
BumpFee
rpc can be used to increase the fee of the total package. Anchor outpoints that are available can be discovered via thePendingChannels
andPendingSweeps
rpcs.To make the experience more friendly towards users, a composite
lncli
commandbumpclosefee
is added.For channels in the
waiting_close_channels
stage, this command can be used as follows:lncli wallet bumpclosefee 2b66cf489298b5b4a9305127413e4124e385588178e4b0fc4cec2d28c277b17d:0 --sat_per_byte 15
Notes:
lnd
needs to be built with thewalletrpc
subserver enabled.OpenChannel
when both sides runlnd
with--protocol.anchors
lnd
will most likely require anchor channels to be closed before upgrading.Important implementation changes made: