Skip to content

Optimize cluster sweep fee rates #4812

@halseth

Description

@halseth

The sweeper clusters input with similar fee rates together to save on fees. However, in such a cluster all inputs won't necessarily have the exact same fee preference, and hence we must choose a "compromise fee rate" to use when sweeping them together.

Currently we take just the average among the inputs in the cluster:

// calculating the average fee rate of the inputs within each set.

As pointed out by @cfromknecht (see #4779 (comment)) this is probably not optimal, for several reasons:

  • a high pref input might get a lower fee rate than we want, in case it gets clustered together with lower pri inputs.
  • it is not weight aware, meaning that the fee rate for heavy inputs will impact the final fee rate no more than less heavy inputs
  • the input might be lingering for a while, so the fee estimates might not be up-to-date. Could make sense to update them/or take most recent fee estimate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3might get fixed, nice to havebrainstormingLong term ideas/discussion/requests for feedbackfeesRelated to the fees paid for transactions (both LN and funding/commitment transactions)optimizationutxo sweeping

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions