rpc: Don't allow to 'estimatesmartfee' in blocksonly mode#16890
rpc: Don't allow to 'estimatesmartfee' in blocksonly mode#16890darosior wants to merge 1 commit intobitcoin:masterfrom
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
promag
left a comment
There was a problem hiding this comment.
Mind adding a small release note?
src/rpc/mining.cpp
Outdated
There was a problem hiding this comment.
nit, add braces or single line.
|
I'm not sure I understand the thinking here -- should we also disallow transacting if in blocksonly mode? It's not clear to me that hiding the fee estimation results but allowing the wallet to transact is a useful user experience. I see the original issue has to do with a lightning wallet that is using our fee estimates under the hood; perhaps we should instead expose the blocksonly setting via an rpc call (if we're not doing it already) and the lightning wallet can decide how to handle the configuration? |
Since the
Yes (C-lightning) and it assumes that the estimation is accurate (or rather not very inaccurate).
I think this should be handled on our side as we expose an inaccurate information. |
33cb347 to
f53a815
Compare
If this is a substantial problem, then I would think we should take action to protect our own wallet users as well (rather than hide the results of what our fee estimation would do!). |
|
Yes that's preferable and also what I wanted to do instead of this PR. I thought about median fees in the last |
Could just fail? There's already the error "Insufficient data or no feerate found" so looks like we could add "Expired data" or something like that - this would affect wallets too. |
Yes, that's why I ended up submitting this :-) |
|
🐙 This pull request conflicts with the target branch and needs rebase. |
|
Should this be closed? I think it's no longer needed now that #18766 is open. |
|
Absolutely, i thought i added a magical "closes xxx" link in #18766 . Anyways, thanks for the reminder! |
…the fee estimates global) 4e28753 feestimator: encapsulate estimation file logic (Antoine Poinsot) e8ea6ad init: don't create a CBlockPolicyEstimator if we don't relay transactions (Antoine Poinsot) 86ff2cf Remove the remaining fee estimation globals (Antoine Poinsot) 03bfeee interface: remove unused estimateSmartFee method from node (Antoine Poinsot) Pull request description: If the `blocksonly` mode is turned on after running with transaction relay enabled for a while, the fee estimation will serve outdated data to both the internal wallet and to external applications that might be feerate-sensitive and make use of `estimatesmartfee` (for example a Lightning Network node). This has already caused issues (for example #16840 (C-lightning), or lightningnetwork/lnd#2562 (LND)) and it seems prudent to fail rather than to give inaccurate values. This fixes #16840, and closes #16890 which tried to fix the symptoms (RPC) but not the cause as mentioned by sdaftuar : > If this is a substantial problem, then I would think we should take action to protect our own wallet users as well (rather than hide the results of what our fee estimation would do!). ACKs for top commit: MarcoFalke: re-ACK 4e28753 👋 jnewbery: utACK 4e28753 Tree-SHA512: c869cf03b86d8194002970bbc84662dae76874967949b9be0d9a4511a1eabcb1627c38aca3154da9dcece1a4c49ec02bd4f9fcca2ec310986e07904559e63ba8
Fixes #16840.
EDIT: some context from the issue:
estimatesmartfeewill return bad (outdated) fee estimation if ran inblocksonlymode. Seems better for it to fail instead of succeeding with potentially harmful (in the case of a lightning penalty tx for example) values.