You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make use of lightning::util::anchor_channel_reserves to improve anchor reserve estimation? #668
Rather than always requiring the user a flat fee, we could consider to make use of the changes in lightningdevkit/rust-lightning#3487 to allow for a more detailed estimation.
We explored using lightning::util::anchor_channel_reserves in #674 and found that AnchorChannelReserveContext::default() results in reserve values that are unfeasibly high for most (edge) users.
We played around with the numbers there, and it seems we'll have to set really low AnchorChannelReserveContext parameters to arrive at reasonable (comaparable to our current default) reserve values. So, just as before, it will be very hard to set sane default parameters that make sense for ~all or ~most users. It likely comes down to 'user profiles': if you run a forwarding node that is exposed to a lot of HTLC-related risks, you might want to bump the numbers or use AnchorChannelReserveContext::default() numbers. Most edge nodes however likely want to considerably reduce these numbers.
Hence, most users will continue to have a very hard time to wrap their head around what risk they are taking and what numbers they should pick here, which is exactly what we hoped to improve upon by using the anchor_channel_reserves util over just having them choose some per-channel reserve value.
So, at some point it might make sense to introduce the notion of 'user profiles' as a general concept, but I'm not sure right now is the right time to do that. So I think we should just kick the can down the road a bit further, and revisit this issue some time down the road, maybe in conjunction with Server-specific behavior (cc @benthecarman).
Hey @tnull , is anyone working on this right now, or has there been any progress since it was opened? If not, I’d be happy to pick it up.
Right now, we reserve a flat 25k sats per anchor channel. That’s about enough to get the commitment tx confirmed at high fees, but it doesn’t cover any HTLC claims. Using upstream’s defaults directly (#674) goes too far the other way, at around 336k per channel.
My idea is to use upstream’s get_reserve_per_channel but with more realistic inputs: fewer expected HTLCs (capped by max_accepted_htlcs), plus a fee rate the user can configure. The current flat value would stay as an option, so nothing breaks for existing users.
I’d split it into small PRs:
Move the reserve calculation into one place, with no behaviour change.
Add the estimator as an option.
Suggest new defaults, with numbers to back them up.
A couple of questions:
Should the estimator become the default eventually, or stay opt-in?
Hey @tnull , is anyone working on this right now, or has there been any progress since it was opened? If not, I’d be happy to pick it up.
Yes, I think @tankyleo wanted to eventually look into UTXO selection more broadly, of which anchor reserve estimation is basically a sub-topic.
In general I'd be hesitant to roll too much custom logic here. If we think we can improve the util::anchor_channel_reserves tooling, it should probably happen upstream.
Activity
tnull commentedon Feb 5, 2026
We explored using
lightning::util::anchor_channel_reservesin #674 and found thatAnchorChannelReserveContext::default()results in reserve values that are unfeasibly high for most (edge) users.We played around with the numbers there, and it seems we'll have to set really low
AnchorChannelReserveContextparameters to arrive at reasonable (comaparable to our current default) reserve values. So, just as before, it will be very hard to set sane default parameters that make sense for ~all or ~most users. It likely comes down to 'user profiles': if you run a forwarding node that is exposed to a lot of HTLC-related risks, you might want to bump the numbers or useAnchorChannelReserveContext::default()numbers. Most edge nodes however likely want to considerably reduce these numbers.Hence, most users will continue to have a very hard time to wrap their head around what risk they are taking and what numbers they should pick here, which is exactly what we hoped to improve upon by using the
anchor_channel_reservesutil over just having them choose some per-channel reserve value.So, at some point it might make sense to introduce the notion of 'user profiles' as a general concept, but I'm not sure right now is the right time to do that. So I think we should just kick the can down the road a bit further, and revisit this issue some time down the road, maybe in conjunction with Server-specific behavior (cc @benthecarman).
ajaysehwal commentedon Nov 15, 2026
Hey @tnull , is anyone working on this right now, or has there been any progress since it was opened? If not, I’d be happy to pick it up.
Right now, we reserve a flat 25k sats per anchor channel. That’s about enough to get the commitment tx confirmed at high fees, but it doesn’t cover any HTLC claims. Using upstream’s defaults directly (#674) goes too far the other way, at around 336k per channel.
My idea is to use upstream’s get_reserve_per_channel but with more realistic inputs: fewer expected HTLCs (capped by max_accepted_htlcs), plus a fee rate the user can configure. The current flat value would stay as an option, so nothing breaks for existing users.
I’d split it into small PRs:
A couple of questions:
Happy to change direction if you had something else in mind
tnull commentedon Nov 16, 2026
Yes, I think @tankyleo wanted to eventually look into UTXO selection more broadly, of which anchor reserve estimation is basically a sub-topic.
In general I'd be hesitant to roll too much custom logic here. If we think we can improve the
util::anchor_channel_reservestooling, it should probably happen upstream.