Skip to content
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

sweep: continue sweeping at previous feerate when reaggregating #9422

Open
morehouse opened this issue Jan 16, 2025 · 0 comments
Open

sweep: continue sweeping at previous feerate when reaggregating #9422

morehouse opened this issue Jan 16, 2025 · 0 comments
Assignees
Labels
fees Related to the fees paid for transactions (both LN and funding/commitment transactions) intermediate Issues suitable for developers moderately familiar with the codebase and LN utxo sweeping
Milestone

Comments

@morehouse
Copy link
Collaborator

The sweeper currently aggregates HTLC claims with the same deadlines into the same sweep transaction. If the channel peer then claims one of those HTLCs on chain, the sweeper's aggregated transaction becomes invalid. The sweeper then removes the claimed HTLC and reaggregates the remaining HTLC claims into a new transaction.

When this occurs, the fee function gets reset and the feerate for the new transaction starts at the minimum again.

Image

Instead, we should continue following the intended feerate curve after reaggregation.

Implementation

For the current linear fee function, we could make use of the existing StartingFeeRate field in SweeperInput.params to store the previous feerate value when an input is marked PublishFailed. Then on reaggregation the linear fee function will start there instead of back at the minimum.

If we ever add more complex fee functions, we'd need to do something more complicated.

@morehouse morehouse added bug Unintended code behaviour needs triage fees Related to the fees paid for transactions (both LN and funding/commitment transactions) utxo sweeping labels Jan 16, 2025
@yyforyongyu yyforyongyu added the intermediate Issues suitable for developers moderately familiar with the codebase and LN label Jan 17, 2025
@yyforyongyu yyforyongyu added this to the 0.20.0 milestone Jan 17, 2025
@yyforyongyu yyforyongyu removed the bug Unintended code behaviour label Jan 17, 2025
@yyforyongyu yyforyongyu modified the milestones: v0.20.0, v0.19.0 Jan 18, 2025
@yyforyongyu yyforyongyu self-assigned this Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fees Related to the fees paid for transactions (both LN and funding/commitment transactions) intermediate Issues suitable for developers moderately familiar with the codebase and LN utxo sweeping
Projects
None yet
Development

No branches or pull requests

3 participants