chainreg: use feerate estimator in regtest and simnet#9257
Conversation
|
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
6ef0409 to
3222cb7
Compare
|
@ziggie1984: review reminder |
yyforyongyu
left a comment
There was a problem hiding this comment.
Pending a release note, otherwise LGTM🙏
If feeurl is not provided and LND is running in bitcoind or btcd mode, use fee estimator provided by bitcoind or btcd instead of using static fee estimator (which always returns 50 sats/vbyte). This enables simulating high feerate environment in regtest and simnet not only via feeurl, but also by filling mempool with high feerate transactions, which is closer to what happens in mainnet. Also skip creating bitcoind or btcd fee estimator, if feeurl is provided. Before LND logged both "Initializing bitcoind backed fee estimator" and "Using external fee estimator" if running in bitcoind mode with feeurl provided, but actually feeurl was used, so this is not a change of behavior.
3222cb7 to
23b025c
Compare
Thanks! Added to release notes. |
ziggie1984
left a comment
There was a problem hiding this comment.
I wonder if it makes sense to have the possiblity to have the static estimator still in place if needed via a config value even if bitcoind and btcd backends are selected ?
It is possible via feeurl flag pointing to a static URL returning the static fee. |
ziggie1984
left a comment
There was a problem hiding this comment.
Cool, yeah for itests we already use theWebFeeService so I guess there is no real usecase for the static fee-estimator and as you mentioned if people still need it in manual testing they should run their own web fee service.
|
Just as a reminder, most of the time bitcoind in regtest mode will not really have enough data to come up with an estimation due to the lack of mempool transaction, hence for most of the regtest setups if not many mempool transaction are created manually, the fallbackfee will be used and the estimator will in fact behave like a static estimator again. Line 408 in e30e43e |
We update expected channel open fees because due to lightningnetwork/lnd#9257 fee estimation in regtest was halved from 50 sat/vbyte to 25 sat/vbyte.
Change Description
If feeurl is not provided and LND is running in bitcoind or btcd mode, use fee estimator provided by bitcoind or btcd instead of using static fee estimator (which always returns 50 sats/vbyte).
This enables simulating high feerate environment in regtest and simnet not only via feeurl, but also by filling mempool with high feerate transactions, which is closer to what happens in mainnet.
Also skip creating bitcoind or btcd fee estimator, if feeurl is provided. Before LND logged both "Initializing bitcoind backed fee estimator" and "Using external fee estimator" if running in bitcoind mode with feeurl provided, but actually feeurl was used, so this is not a change of behavior.
Steps to Test
lncli wallet estimatefeerate 2and make sure thatsat_per_vbytein response is 1. If you see value50, this means that the deployed LND is not from this branch (previous behavior was to always return 50).lncli wallet estimatefeerate 2again and make sure sat_per_vbyte is higher than 1.I tested bitcoind/regtest and btcd/simnet modes.
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.