Default to fallbacks for huge bogus values in fee estimation conversion#430
Merged
tnull merged 2 commits intolightningdevkit:mainfrom Jan 17, 2025
Merged
Conversation
b3fea0e to
fe61011
Compare
3534f78 to
cf7ac78
Compare
75b4733 to
715d56b
Compare
Previously, we would cast `FeeRate::to_sat_per_kwu` to `u32`, which however might result in `u32::max_value` being used if our fee estimation source delivers huge bogus data. Here, we make sure to use the fallback rate if we would do so otherwise.
715d56b to
15c3e0e
Compare
Collaborator
Author
|
Rebased on main after #426 landed. |
arik-so
approved these changes
Jan 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #426.Previously, we would cast
FeeRate::to_sat_per_kwutou32, which however might result inu32::max_valuebeing used if our fee estimation source delivers huge bogus data. Here, we make sure to use the fallback rate if we would do so otherwise.We also make sure our post-estimation adjustments could never underflow.
Both of these changes aren't super critical but make the code a bit more robust.