-
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
lnwallet: add new config group and configurable cache for web fee estimator #8484
lnwallet: add new config group and configurable cache for web fee estimator #8484
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
c3c2915
to
041535e
Compare
59a8fd0
to
a9e76c8
Compare
083df79
to
7409156
Compare
7409156
to
d090f90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! And a very helpful PR description! Just some nits.
70867cc
to
e6f0481
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two more nits, otherwise LGTM 🎉
e6f0481
to
46aefad
Compare
@saubyk: review reminder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
Given that we are already in the rc phase for 0.18. Tagging this for 0.18.1 instead.
Would require updating the release notes accordingly
Add fee.min-update-timeout and fee.max-update-timeout config options to allow configuration of the web fee estimator cache.
46aefad
to
c8caa6d
Compare
Given the included breaking change (removal of deprecated neutrino.feeurl setting), shouldn't this go in 0.18.0? I've rebased the PR in any case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
; Optional URL for external fee estimation. If no URL is specified, the method | ||
; for fee estimation will depend on the chosen backend and network. Must be set | ||
; for neutrino on mainnet. | ||
; Default: | ||
; feeurl= | ||
; fee.url= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the prefix creates a new sub config part, this whole section should get a section title ([fee]
) and be moved to just above the [prometheus]
section, otherwise this becomes syntactically invalid for the config file parser (even though people shouldn't use this as a template directly, a lot of people probably still will).
Merged to 0.18.1 branch. |
a7fc762
into
lightningnetwork:elle-0-18-1
sorry didn't see the above comments, feel free to reopen and address the issue. If this goes to 0.18.1, then a new release notes doc is needed. |
I wouldn't feel comfortable introducing a breaking change into a patch release like that. That seems problematic. Either this should be ported in 0.18.0, or the breaking change should be removed from 0.18.1. I'd prefer the former, since otherwise we're maintaining multiple levels of backwards compatibility which is pretty messy and confusing (hence why the super old |
yeah. I was waiting to chat with @Roasbeef about it and see if we can merge it in 0.18. Agree that this shouldn't be in 0.18.1 |
Approved to merge in 0.18.0 |
Change Description
Add new
fee
config group with optionsfee.min-update-timeout
andfee.max-update-timeout
to allow configuration of the web fee estimator cache refresh rate. Also addsfee.url
which deprecates the old top levelfeeurl
setting. The previously deprecatedneutrino.feeurl
setting has now been removed with this change.Closes #8482
This pull request includes changes to the fee estimation configuration in the
chainreg/chainregistry.go
andconfig.go
files, and the fee estimation process in thechainfee/estimator.go
file. The changes deprecate theFeeURL
field and introduce a newFee
field withURL
,MinUpdateTimeout
, andMaxUpdateTimeout
subfields. TheFeeURL
field is mapped to theFee.URL
field for backward compatibility. TheMinUpdateTimeout
andMaxUpdateTimeout
fields determine the minimum and maximum intervals for updating fees from the fee estimation URL. The pull request also includes changes to the test files to accommodate these changes.Changes to fee estimation configuration:
chainreg/chainregistry.go
: Deprecated theFeeURL
field in theConfig
struct and introduced a newFee
field withURL
,MinUpdateTimeout
, andMaxUpdateTimeout
subfields. Mapped theFeeURL
field to theFee.URL
field for backward compatibility. [1] [2] [3] [4]config.go
: Made similar changes to theConfig
struct and theDefaultConfig
function. [1] [2] [3]Changes to fee estimation process:
chainfee/estimator.go
: Removed theminFeeUpdateTimeout
andmaxFeeUpdateTimeout
constants and addedMinUpdateTimeout
andMaxUpdateTimeout
fields to theWebAPIEstimator
struct. Modified theNewWebAPIEstimator
function to take these fields as parameters and check thatMinUpdateTimeout
is less thanMaxUpdateTimeout
. Adjusted therandomFeeUpdateTimeout
method to use these fields. (Faf38103L12R12, [1] [2] [3]Changes to tests:
config_builder.go
,htlcswitch/link.go
,htlcswitch/link_test.go
,htlcswitch/test_utils.go
,lntest/fee_service.go
,lntest/node/config.go
,lnwallet/chainfee/estimator_test.go
: Updated the tests to accommodate the changes to theConfig
struct and theNewWebAPIEstimator
function. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]New file:
lncfg/fee.go
: Introduced a new file to define theFee
struct and theDefaultMinUpdateTimeout
andDefaultMaxUpdateTimeout
constants.Deprecation:
lncfg/neutrino.go
: Deprecated theFeeURL
field in theNeutrino
struct.Steps to Test
fee.min-update-timeout
and/orfee.max-update-timeout
set as cli args or inlnd.conf
.fee.url
can be used to set the web estimator fee urlfeeurl
can still be usedfee.url
andfeeurl
results in a startup errorExample
Start lnd with a custom fee estimator timeout window:
Create/Unlock the wallet the wallet to trigger activation of the web fee estimator:
Review the logs:
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.