-
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
[bug]: sweep: LinearFeeFunction off by one #8741
Comments
@saubyk add to 18.0? |
makes sense. added. |
cc: @yyforyongyu |
What do you mean by saying next-block deadline? That we only have 1 block left till it times out? What is this min feerate? |
Here's an example graph of the Now imagine we call But for this next-block deadline case, we really don't want a sloped line at all -- we want to start right at the maximum. |
func (l *LinearFeeFunction) feeRateAtPosition(p uint32) chainfee.SatPerKWeight { |
In this commit, we add a model for the linear fee function we use in lnd for fee bumping. This models can be used to reproduce the issue reported in lightningnetwork#8741, and can also be shown that that bug fix resolves a counter example found by the model checker.
In this commit, we add a model for the linear fee function we use in lnd for fee bumping. This models can be used to reproduce the issue reported in lightningnetwork#8741, and can also be shown that that bug fix resolves a counter example found by the model checker.
In this commit, we add a model for the linear fee function we use in lnd for fee bumping. This models can be used to reproduce the issue reported in lightningnetwork#8741, and can also be shown that that bug fix resolves a counter example found by the model checker.
LinearFeeFunction
doesn't return the max fee rate until after the deadline has been missed.Example
Current block height is
H
. An incoming HTLC has acltv_expiry
ofH + 10
, so the contractcourt setsdeadline := H + 10
for the HTLC input.We need to confirm our HTLC-Preimage no later than block
H + 10
, or else we'll get into a bidding war with the channel peer since they can spend the timeout path after blockH + 10
confirms.LinearFeeFunction
should max out its fee rate after blockH + 9
confirms since this is the last shot at meeting the deadline. Instead,LinearFeeFunction
waits to max out the fee rate until blockH + 10
.Severity
For typical deadlines 10+ blocks away, this is a minor problem. But in the extreme case of a next-block deadline,
LinearFeeFunction
will return the min feerate instead of the max, which is quite bad.The text was updated successfully, but these errors were encountered: