Skip to content

Make use of lightning::util::anchor_channel_reserves to improve anchor reserve estimation? #668

Open

Description

@tnull

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.

Activity

  1. tnull commented on Feb 5, 2026

    @tnull
    CollaboratorAuthor

    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).

  2. ajaysehwal commented on Nov 15, 2026

    @ajaysehwal
    Contributor

    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:

    1. Move the reserve calculation into one place, with no behaviour change.
    2. Add the estimator as an option.
    3. Suggest new defaults, with numbers to back them up.

    A couple of questions:

    1. Should the estimator become the default eventually, or stay opt-in?
    2. Does this overlap with Provision a reserved set of utxos, one for each outbound anchor channel #1198 or Count the funding fee in anchor reserve checks for channel opens #1204?

    Happy to change direction if you had something else in mind

  3. tnull commented on Nov 16, 2026

    @tnull
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions