-
Notifications
You must be signed in to change notification settings - Fork 38.7k
fees: enable CBlockPolicyEstimator return sub 1 sat/vb fee rate estimates
#33199
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
base: master
Are you sure you want to change the base?
fees: enable CBlockPolicyEstimator return sub 1 sat/vb fee rate estimates
#33199
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33199. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste 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. |
e0da552 to
413c81b
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.
concept ACK
This change makes much sense to me, if the min relay fee is lowered the feerate tracking should also take that into account.
|
Concept ACK 413c81b It makes sense to update I do think the additional test is a bit redundant but I am okay in adding if others think it makes sense |
|
This picks up #13990? If yes, it may be good to explain the differences. |
30415b6 to
0eb02ea
Compare
This is different from #13990 in approach: It omits the consistency check and avoids extending the fee rate buckets when the min bucket fee rate changes. |
fbf49e0 to
98be7ef
Compare
|
Rebased and fixed nits. |
polespinasa
left a comment
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.
Just some nits and questions :=)
- This commit deletes a dummy field that is "dummy" and unused.
- This commit also refactors the test the better track confirmed utxos.
98be7ef to
b767897
Compare
I force pushed to address the comment, thanks for review @polespinasa |
|
Concept ACK (code review up to b767897) I’m new to fee estimation, but I was able to understand this PR because it is fairly straightforward. The idea is to make By default, if a transaction’s feerate is below Nodes are free to choose a different value via the
Before this PR mempool policy accepts transactions down to As a result, transactions that were perfectly valid, accepted, and relayed by the node were not recorded by the fee estimator. Therefore the estimator could not learn from low-fee traffic. By making:
Confirmed this behaviour by digging into CBlockPolicyEstimator bucket construction logic. |
| def transact_and_mine(self, numblocks, mining_node): | ||
| min_fee = Decimal("0.00001") | ||
| min_fee = MINIMUM_RELAY_FEE_RATE | ||
| # We will now mine numblocks blocks generating on average 100 transactions between each block |
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.
nit: feel free to ignore
| # We will now mine numblocks blocks generating on average 100 transactions between each block | |
| # We will now mine "numblocks" blocks, generating on average 100 transactions between each block |
I think makes it easier to read
polespinasa
left a comment
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.
code looks good to me, currently trying to test it on mainnet will ack if positive results :)
a small nit for more clarity on the PR
polespinasa
left a comment
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.
cr and tACK b767897
This is a simple PR that updates the block policy estimator’s
MIN_BUCKET_FEERATEconstant to be identical to the policyDEFAULT_MIN_RELAY_TX_FEE.It also enables the fee estimator to record transactions with a fee rate up to the
DEFAULT_MIN_RELAY_TX_FEEin its stats, which effectively allows the estimator to return sub-1 sat/vB fee rate estimates.The change is correct because the estimator creates buckets of fee rates from
MIN_BUCKET_FEERATE,MIN_BUCKET_FEERATE+FEE_SPACING,MIN_BUCKET_FEERATE+2 * FEE_SPACING,… up to
MAX_BUCKET_FEERATE.This means it will record sub-1 sat/vB fee rates in the buckets and may return them as a fee rate estimate when that bucket is the lowest one with sufficient transactions for a given target.
Tying
MIN_BUCKET_FEERATEtoDEFAULT_MIN_RELAY_TX_FEEalso makes it dynamic, so we don’t need to update the fee estimator when theminrelaytxfeedefault is adjusted in the future.For the mempool fee rate estimator in #31664, no update is needed since it uses the block assembler and because the node can see sub-1 sat/vB transactions, it can generate block templates with those and therefore return a fee rate estimate accordingly.
While touching this part of the fee estimator code, this PR got rid of the dummy value persisted in the file