-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[5/5]sweep: introduce budget-based deadline aware fee bumper #8424
[5/5]sweep: introduce budget-based deadline aware fee bumper #8424
Commits on Apr 2, 2024
-
sweep: expand
InputSet
with more interface methodsThis commit adds more interface methods to `InputSet` to prepare the addition of budget-based aggregator.
Configuration menu - View commit details
-
Copy full SHA for 3f8da35 - Browse repository at this point
Copy the full SHA 3f8da35View commit details -
sweep: change
markInputsPublishFailed
to take outpointsThis way it's easier to pass values to this method in various callsites.
Configuration menu - View commit details
-
Copy full SHA for d00c104 - Browse repository at this point
Copy the full SHA d00c104View commit details -
sweep: refactor
markInputsPendingPublish
to takeInputSet
This commit changes `markInputsPendingPublish` to take `InputSet` only. This is needed for the following commits as we won't be able to know the tx being created beforehand, yet we still want to make sure these inputs won't be grouped to another input set as it complicates our RBF process.
Configuration menu - View commit details
-
Copy full SHA for bd9256e - Browse repository at this point
Copy the full SHA bd9256eView commit details -
sweep: introduce
BudgetInputSet
to manage budget-based inputsThis commit adds `BudgetInputSet` which implements `InputSet`. It handles the pending inputs based on the supplied budgets and will be used in the following commit.
Configuration menu - View commit details
-
Copy full SHA for 0496d70 - Browse repository at this point
Copy the full SHA 0496d70View commit details -
sweep: introduce
BudgetAggregator
to cluster inputs by deadlinesThis commit adds `BudgetAggregator` as a new implementation of `UtxoAggregator`. This aggregator will group inputs by their deadline heights and create input sets that can be used directly by the fee bumper for fee calculations.
Configuration menu - View commit details
-
Copy full SHA for 9565c3b - Browse repository at this point
Copy the full SHA 9565c3bView commit details -
sweep: introduce
Bumper
interface to handle RBFThis commit adds a new interface, `Bumper`, to handle RBF for a given input set. It's responsible for creating the sweeping tx using the input set, and monitors its confirmation status to decide whether a RBF should be attempted or not. We leave implementation details to future commits, and focus on mounting this `Bumper` interface to our sweeper in this commit.
Configuration menu - View commit details
-
Copy full SHA for 481216f - Browse repository at this point
Copy the full SHA 481216fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 818d1c2 - Browse repository at this point
Copy the full SHA 818d1c2View commit details -
sweep: remove RBF related tests
As there will be dedicated new tests for them.
Configuration menu - View commit details
-
Copy full SHA for 15872dc - Browse repository at this point
Copy the full SHA 15872dcView commit details -
sweep: remove
FeeRate()
fromInputSet
interfaceAs shown in the following commit, fee rate calculation will now be handled by the fee bumper, hence there's no need to expose this on `InputSet` interface.
Configuration menu - View commit details
-
Copy full SHA for 7af5bba - Browse repository at this point
Copy the full SHA 7af5bbaView commit details -
sweep: add
FeeFunction
interface and a linear implementationThis commit adds a new interface, `FeeFunction`, to deal with calculating fee rates. In addition, a simple linear function is implemented, hence `LinearFeeFunction`, which will be used to calculate fee rates when bumping fees. Check lightningnetwork#4215 for other type of fee functions that can be implemented.
Configuration menu - View commit details
-
Copy full SHA for f354b65 - Browse repository at this point
Copy the full SHA f354b65View commit details -
Configuration menu - View commit details
-
Copy full SHA for 447cf5c - Browse repository at this point
Copy the full SHA 447cf5cView commit details -
lnwallet+sweep: calculate max allowed feerate on
BumpResult
This commit adds the method `MaxFeeRateAllowed` to calculate the max fee rate. The caller may specify a large MaxFeeRate value, which cannot be cover by the budget. In that case, we default to use the max feerate calculated using `budget/weight`.
Configuration menu - View commit details
-
Copy full SHA for 6e84fe6 - Browse repository at this point
Copy the full SHA 6e84fe6View commit details -
lnwallet+sweep: introduce
TxPublisher
to handle fee bumpThis commit adds `TxPublisher` which implements `Bumper` interface. This is part one of the implementation that focuses on implementing the `Broadcast` method which guarantees a tx can be published with RBF-compliant. It does so by leveraging the `testmempoolaccept` API, keep increasing the fee rate until an RBF-compliant tx is made and broadcasts it. This tx will then be monitored by the `TxPublisher` and in the following commit, the monitoring process will be added.
Configuration menu - View commit details
-
Copy full SHA for 4ca1de3 - Browse repository at this point
Copy the full SHA 4ca1de3View commit details -
sweep: add monitor loop to
TxPublisher
This commit finishes the implementation of `TxPublisher` by adding the monitor process. Whenever a new block arrives, the publisher will check all its monitored records and attempt fee bumping them if necessary.
Configuration menu - View commit details
-
Copy full SHA for d5b5b76 - Browse repository at this point
Copy the full SHA d5b5b76View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3365333 - Browse repository at this point
Copy the full SHA 3365333View commit details -
sweep: increase delta fee rate precision in fee function
This commit adds a private type `mSatPerKWeight` that expresses a given fee rate in millisatoshi per kw. This is needed to increase the precision of the fee function. When sweeping anchor inputs, if using a deadline delta of over 1000, it's likely the delta will be 0 sat/kw due to precision.
Configuration menu - View commit details
-
Copy full SHA for 0103345 - Browse repository at this point
Copy the full SHA 0103345View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83729e2 - Browse repository at this point
Copy the full SHA 83729e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bd2589 - Browse repository at this point
Copy the full SHA 1bd2589View commit details -
sweep: make sure non-fee related errors are notified
So these inputs can be retried by the sweeper.
Configuration menu - View commit details
-
Copy full SHA for 4bf98e7 - Browse repository at this point
Copy the full SHA 4bf98e7View commit details