-
Notifications
You must be signed in to change notification settings - Fork 368
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
Miscellaneous anchor outputs preparatory changes #1685
Conversation
Didn't see the CI failure locally as it only came up when running without |
Codecov ReportBase: 90.86% // Head: 90.80% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1685 +/- ##
==========================================
- Coverage 90.86% 90.80% -0.06%
==========================================
Files 86 85 -1
Lines 46482 46019 -463
Branches 46482 46019 -463
==========================================
- Hits 42234 41789 -445
+ Misses 4248 4230 -18
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
CI is green now that the test vectors are updated for the zero fee HTLC transaction anchors variant. I've also upstreamed the changes to the spec at lightning/bolts#1018. |
Basically LGTM. |
Pushed a new update to the HTLC trimming logic as it's only based on the dust limit for the zero fee HTLC transaction variant. |
Can you squash the fixups and I think we can land this. |
LGTM, can you squash again and I think this is good to go (again lol). |
@@ -616,12 +616,17 @@ pub fn build_htlc_transaction(commitment_txid: &Txid, feerate_per_kw: u32, conte | |||
} else { | |||
htlc_success_tx_weight(opt_anchors) | |||
}; | |||
let total_fee = feerate_per_kw as u64 * weight / 1000; | |||
let output_value = if opt_anchors { |
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.
Actually we could a) recall opt_anchors
to opt_anchors_zero_fee
or document the field in ChannelTransactionParameters
that we're supporting only option_anchors_zero_fee_htlc_tx
variant
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.
It's now documented under ChannelTransactionParameters
. I'm not opposed to renaming it but it will be a large diff. Perhaps we can leave it as a follow-up PR?
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.
Yes, can be done in a follow-up PR.
5c0e1c2
to
eddcf0f
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.
Generally LGTM, feel free to squash.
eddcf0f
to
168e76b
Compare
Squashed with no further changes. |
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.
Still LGTM :)
Let's hold this until 0.0.112. I'm not 100% sure how the 0fee HTLC change will impact VLS (and the CLN folks aren't responding), but given the CLN folks haven't responded I'm fine with just shipping it. |
I believe #1685 (comment) still needs addressing. |
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.
SGTM 168e76b
Thanks for documenting f43a7e8
, make it easier to detect wrong script detection.
168e76b
to
ccae963
Compare
Force pushed to address final comments:
|
Oops, ugh, needs rebase :( |
There's no need to broadcast our local commitment transaction if we've already seen a confirmed one as it'll be immediately rejected as a duplicate/conflict. This will also help prevent dispatching spurious events for bumping commitment and HTLC transactions through anchor outputs (once implemented in future work) and the dispatch for said events follows the same flow as our usual commitment broadcast.
HTLC transactions from anchor channels are constrained by a CSV of 1 block, so broadcasting them along with the unconfirmed commitment tranasction will result in them being immediately rejected as premature.
This is based on the assumption that we only support the zero HTLC transaction fee variant of anchor channels.
With the zero fee HTLC transaction anchors variant, HTLCs can no longer be trimmed due to their amount being too low to have a mempool valid HTLC transaction. Now they can only be trimmed based on the dust limit of each party within the channel.
Each test featuring HTLCs had a minimum and maximum feerate case. This is no longer necessary for the zero HTLC transaction anchors variant as the commitment feerate does not impact whether HTLCs can be trimmed or not, only the dust limit does.
ccae963
to
f3a5a72
Compare
non-zero-fee anchor support was broken by LDK in lightningdevkit/rust-lightning#1685 and fix was later submitted by us
This PR includes a few miscellaneous changes that will be required for the integration of anchors outputs. They are standalone and should be fine to merge without the remaining changes to come to help split up the upcoming work into multiple PRs.