-
Notifications
You must be signed in to change notification settings - Fork 417
[Custom Transactions] Abstract the weight of HTLC transactions away from channel #3921
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
base: main
Are you sure you want to change the base?
Conversation
👋 Thanks for assigning @carlaKC as a reviewer! |
We discussed earlier passing the entire list of HTLCs to So we prefer to add a single method that surfaces this limit to channel, and then let channel sort HTLCs depending on whether their value sits above or below that amount. As a result, builders of custom transactions will only have a say on where the dust limit sits, and won't be able to choose arbitrary subsets for dust and non-dust HTLCs. |
Hence, we let `TxBuilder` set the total endogenous fees spent on a set of HTLC transactions via `htlc_txs_endogenous_fees_sat`. Furthermore, we also let `TxBuilder` set the dust limit for offered and accepted HTLCs on commitment transactions; channel will use those limits when sorting dust HTLCs from non-dust HTLCs. These limits are a function of the weight of HTLC transactions in legacy channels. As a result of this commit, implementers of `TxBuilder` may now set arbitrary dust limits for HTLCs on commitment transactions.
Is the main motivation for this to get all of the commitment-related logic out of
The key questions we're looking to answer seems to be "can I afford a commitment with this theoretical dust/nondust htlc"? This does seem to be something we could move into Sadly here's no getting around needing to know the dust limit if we want to clamp our capacity to that value, so we'd still need to surface
Tempting to suggest just adding an so tl;dr: I'd be interested in seeing what trying to pull more of the dust logic out into Meta note: This has got a lot of overlap with 3bb0586, so I think we should either:
|
I would say we focus on the latter for this PR, and let the former be the overarching goal :)
Let me know what you think of this new direction here. Still have some clunkiness to resolve, but that's what it's looking like right now.
|
Definitely let me rebase on top of your PR, you've rebased once already :) |
Hence, we let
TxBuilder
set the total endogenous fees spent on a set of HTLC transactions viahtlc_txs_endogenous_fees_sat
.Furthermore, we also let
TxBuilder
set the dust limit for offered and accepted HTLCs on commitment transactions; channel will use those limits when sorting dust HTLCs from non-dust HTLCs.These limits are a function of the weight of HTLC transactions in legacy channels.
As a result of this commit, implementers of
TxBuilder
may now set arbitrary dust limits for HTLCs on commitment transactions.