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
rpc: update estimatesmartfee to return max of CBlockPolicyEstimator::estimateSmartFee, mempoolMinFee and minRelayTxFee #22722
Conversation
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.
Concept ACK
Concept ACK (Including mempoolMinFee)
|
Concept ACK |
Tried this on Pop!_OS with regtest. Initially had issues understanding how GetMinFee() works, Andrew Chow answered it in detail on stackexchange: https://bitcoin.stackexchange.com/questions/108126/getminfee-in-blockchain-cpp I saved
Changed
Expected results:
How to calculate
Why this will be useful?
💡 One project which can be helpful in improving `estimatesmartfee`https://github.com/TrueLevelSA/btc-congestion-manager It returns mempool position which can be added in output for |
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.
Concept ACK, but i think this should not be restricted to the estimatesmartfee
RPC. Maybe we could have a wrapper to CBlockPolicyEstimator
's estimateSmartFee
in CTxMemPool
that would return the max of minerPolicyEstimator->estimateSmartFee()
and GetMinFee
? This way the node interface would call this wrapper instead of the estimator's one and it would apply this behaviour to all the current call sites.
@prayank23 Thank you for the detailed review. Just wanted to confirm, are you suggesting to change |
@darosior Thank you for the suggestion. But as of now, I only found one other call for the |
Sounds good to me, it's already a fix as is and we can always de-duplicate the |
Yes. We could do something similar in follow up to improve For example: In first case mempool has some transactions with fee rate ranging from 1 to 100 sat/vB (less than 2MvB), estimatesmartfee should suggest fee rate close to 1 sat/vB for conf_target 2. It shows 20x what we actually need minimum at that moment. |
concept ACK, can you please squash? |
a549bd1
to
c7e871d
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.
ACK aside from test nit
5db8e4d
to
de90829
Compare
I updated the test such that in the end, it sets the |
Can you please change to a more descriptive PR title and commit message? "update estimatesmartfee" doesn't say much 😄 |
de90829
to
b2152f3
Compare
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. |
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.
utACK b2152f3
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.
utACK b2152f3
dbcd679
to
71a3d98
Compare
…lMinFee and minRelayTxFee. This will provide better estimates which would be closer to fee paid in actual transactions. The test has also been changed such that when the node is restarted with a high mempoolMinFee, the estimatesmartfee still returns a feeRate greater than or equal to the mempoolMinFee, minRelayTxFee.(just like the feeRate of actual transactions)
71a3d98
to
ea31caf
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.
re-utACK ea31caf
…lockPolicyEstimator::estimateSmartFee, mempoolMinFee and minRelayTxFee ea31caf update estimatesmartfee rpc to return max of estimateSmartFee, mempoolMinFee and minRelayTxFee. (pranabp-bit) Pull request description: This PR is in response to the issue [bitcoin#19699](bitcoin#19699). Based on the discussion in the comments of PR [bitcoin#22673](bitcoin#22673) changes have been made in the `estimatesmartfee` itself such that it takes into account `mempoolMinFee` and `relayMinFee` . Hence it provides a fee estimate that is most likely to be paid by the user in an actual transaction, preventing issues such as [bitcoin#16072](bitcoin#16072). The test file test/functional/feature_fee_estimation.py has also been updated to check this functionality. ACKs for top commit: meshcollider: re-utACK ea31caf Tree-SHA512: 8f36153a07cbd552c5c13d11d9c6e987a7a555ea4cc83f2573c0c92dd97c706d90c30a7248671437c2f3a836d3272f8fad53d15a5fa6efaa0409ae8009b0a18d
…lMinFee and minRelayTxFee. This will provide better estimates which would be closer to fee paid in actual transactions. The test has also been changed such that when the node is restarted with a high mempoolMinFee, the estimatesmartfee still returns a feeRate greater than or equal to the mempoolMinFee, minRelayTxFee.(just like the feeRate of actual transactions) Github-Pull: bitcoin#22722 Rebased-From: b2152f3
…f smart fee data is unavailable cd8d156 Bugfix: RPC/mining: Fail properly in estimatesmartfee if smart fee data is unavailable (Luke Dashjr) Pull request description: Fixes a regression introduced by #22722 (Not entirely sure on the solution) ACKs for top commit: prayank23: crACK cd8d156 darosior: utACK cd8d156 kristapsk: utACK cd8d156 Tree-SHA512: eb4aa3cc345c69c44ffd5733b51b90eefe1d7854b7a2855e8cbb98268db24d43b7d0ae9fbb0eccf9b6dc01da644d19433cc77fec52ff67bf890be1fc53a67fc4
…rtfee if smart fee data is unavailable cd8d156 Bugfix: RPC/mining: Fail properly in estimatesmartfee if smart fee data is unavailable (Luke Dashjr) Pull request description: Fixes a regression introduced by bitcoin#22722 (Not entirely sure on the solution) ACKs for top commit: prayank23: crACK bitcoin@cd8d156 darosior: utACK cd8d156 kristapsk: utACK cd8d156 Tree-SHA512: eb4aa3cc345c69c44ffd5733b51b90eefe1d7854b7a2855e8cbb98268db24d43b7d0ae9fbb0eccf9b6dc01da644d19433cc77fec52ff67bf890be1fc53a67fc4
…lMinFee and minRelayTxFee. This will provide better estimates which would be closer to fee paid in actual transactions. The test has also been changed such that when the node is restarted with a high mempoolMinFee, the estimatesmartfee still returns a feeRate greater than or equal to the mempoolMinFee, minRelayTxFee.(just like the feeRate of actual transactions) Github-Pull: bitcoin#22722 Rebased-From: b2152f3
This PR is in response to the issue #19699.
Based on the discussion in the comments of PR #22673 changes have been made in the
estimatesmartfee
itself such that it takes into accountmempoolMinFee
andrelayMinFee
. Hence it provides a fee estimate that is most likely to be paid by the user in an actual transaction, preventing issues such as #16072.The test file test/functional/feature_fee_estimation.py has also been updated to check this functionality.