-
Notifications
You must be signed in to change notification settings - Fork 406
Expose HTLC transaction locktime in BumpTransactionEvent::HTLCResolution #2082
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
Expose HTLC transaction locktime in BumpTransactionEvent::HTLCResolution #2082
Conversation
cd3048d
to
22c31c0
Compare
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #2082 +/- ##
==========================================
- Coverage 91.40% 91.39% -0.01%
==========================================
Files 102 101 -1
Lines 49563 49564 +1
Branches 49563 49564 +1
==========================================
- Hits 45303 45299 -4
- Misses 4260 4265 +5
... and 11 files with indirect coverage changes 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 in Codecov by Sentry. |
22c31c0
to
095bf6c
Compare
095bf6c
to
99fff74
Compare
Wait, aren't the anchor outputs 1-CSV? Doesn't that mean the locktime is implicitly the |
The 1 CSV doesn't affect the transaction locktime though, only the height at which a spend is valid, but that's not an issue here since with anchors we only offer the HTLCs to claim once a confirmed commitment is presented. We can use a later locktime on HTLC transactions from a counterparty's commitment, which we can spend with only our signature. For our commitments, we need to maintain the same locktime the counterparty signed on. |
Right, this is changing the semantics of this function pretty substantially, and now really confusing - whereas it used to always be "the soonest time this can be confirmed" (which was correct because IIRC we had some code that looked at it in that light), its now that for all the transaction types except |
It seems like we can just reword the comment in |
Yea, I think so. let's just add more clarity. Happy to fix the fee sniping and use that too. |
Previously, this would return the earliest height the output could be confirmed, which seems to no longer be useful. The only use of the method was to determine whether we should delay a package to a future block. Instead, we choose to return the absolute locktime the transaction spending the output should have, which better corresponds to the method name and still supports the delay functionality mentioned. Doing so also allows us to expose the locktime required for HTLC transactions we need to broadcast based on our own commitments for anchor channels.
This only applies to all malleable packages on channels pre-dating anchors and malleables packages for counterparty commitments post-anchors. Malleables packages for holder commitments post-anchors should have their transaction locktime applied manually by the consumer of `BumpTransactionEvent::HTLCResolution` events.
While users could easily figure it out based on the set of HTLC descriptors included within, we already track it within the `OnchainTxHandler`, so we might as well expose it to users as a nice-to-have. It's also yet another thing they must get right to ensure their HTLC transaction broadcasts are valid.
99fff74
to
23e233b
Compare
Done, also had to rebase to address a conflict. |
Thanks, nice to have anti-fee-sniping. |
While users could easily figure it out based on the set of HTLC descriptors included within, we already track it within the
OnchainTxHandler
, so we might as well expose it to users as a nice-to-have. It's also yet another thing they must get right to ensure their HTLC transaction broadcasts are valid.