-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Fee Estimation: Ignore all transactions that are CPFP'd #30079
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?
Fee Estimation: Ignore all transactions that are CPFP'd #30079
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/30079. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. 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. LLM Linter (✨ experimental)Possible typos and grammar issues:
drahtbot_id_4_m |
cc @josibake @instagibbs @naumenkogs @darosior @murchandamus since you reviewed the last time |
concept ACK strikes me as the right idea, keep it simple for now, focusing on correctness. Do we have charts anywhere tracking % of transactions that are in a cluster size of 1? |
I will analyze the percentage of cluster size 1 transactions mined in previous blocks. |
Concept ACK |
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.
tACK c12a677
Make successful, all functional tests successful.
Mentioned few nits and asked few questions for my clarity.
The downside of this approach is that transactions that are not CPFP’d will aslo be ignored.
Related to this^, one specific case I can think of that will be affected is of layered transactions that are meant to be confirmed together, example: fanout transactions to increase the utxo count in the wallet and make the utxo value distribution more even, but Idk how frequently these transactions happen.
c12a677
to
2563305
Compare
I tracked recent 1000 blocks from block ~61% of transactions in the last 1000 blocks were confirmed in a cluster size > 1. Transactions: 3974143 The data is available here here https://docs.google.com/spreadsheets/d/1QTE2EQeQlamA123pIn0SY4F-9jtnzS7e7CV1etT6ytM/edit?usp=sharing I used this script to collect the data https://gist.github.com/ismaelsadeeq/e2767040b720f65986976b3f8c6b7b20 |
Thanks for review @rkrux
|
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.
reACK 2563305
Thanks for the quick turnaround on this @ismaelsadeeq!
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 good, although unclear to me why we don't also remove the child transaction from fee estimation to avoid overestimating. Would recommend also removing the children, or at least documenting why it doesn't matter in a comment.
2563305
to
57556e5
Compare
This data shows that most transactions are in cluster size > 1. So I switched to ignoring transaction that are CPFP'd only. Thanks for your reviews @rkrux @josibake
|
57556e5
to
55d615c
Compare
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
55d615c
to
055d9e6
Compare
I didn't look too closely into the CI failure reason, but seems like a relatively simple fix, i.e. fixing an signed int overflow:
|
Marking as draft, as I attempt to fix the fuzzing overflow error. |
3f05950
to
ba565be
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
22726d4
to
a02dd61
Compare
Rebased and fix comment by @yancyribbens |
a02dd61
to
43d13e0
Compare
Feel free to ignore me if this PR is close to merge, but it does feel like there are two PRs here. The first 3 commits seem more about updates to miniminer, and then the 4th commit does what the title of this PR indicates. It may help to attract more review by breaking out the first 3 commits into their own PR, using this PR as a motivating use case. Either way, I plan to dig in more next week and review, but wanted to mention this. |
43d13e0
to
bf2a05b
Compare
Co-authored-by: willcl-ark <will@256k1.dev>
bf2a05b
to
1aa6583
Compare
- GetTxAncestorsAndDescendants takes the vector of transactions removed from the mempool after a block is connected. The function assumed that the order the transactions were included in the block was maintained; that is, all transaction parents was be added into the vector first before descendants. - GetTxAncestorsAndDescendants computes all the ancestors and descendants of the transactions. The transaction is also included as a descendant and ancestor of itself. Co-authored-by: willcl-ark <will@256k1.dev>
- This method takes removed mempool transaction and generates an output that can be linearized by mini miner. Co-authored-by: willcl-ark <will@256k1.dev>
Co-authored-by: Antoine Poinsot <darosior@protonmail.com>
1aa6583
to
1796a6b
Compare
Not close to merge I think, so far this PR received a couple of concept ACK and some initial review last year. On the contrary the mini miner changes are tiny, but thats the first step, I opened #33216 for that. The next two commits are preparing the removed mempool transactions for linearization by the mini miner. The subsequent three commits are the main feature and test. Hence I think they can be bundled together. In the latest pushes I moved the helper functions to fees for simplicity and make some improvement to the code. |
Putting in draft because of a dependent PR. |
Thanks for taking the suggestion of splitting this up! I think it would be nice to add a blurb to the description that this PR depends on #33216 and is in draft pending review on the parent PR. You mention this in the comments, but having it in the description ensures reviewers dont miss it / get confused on the status of the PR. |
Another attempt at #25380 with an alternate approach
This PR updates
CBlockPolicyEstimator
to ignore all transactions that are CPFP'd by some child when a new block is received.This fixes the assumption that all transactions are confirmed solely because of their fee rate.
As some transactions are confirmed due to a CPFP by some child.
This approach linearize all transactions removed from the mempool because of the new block, and only ignore transactions whose mining score is not the same with their the fee rate.
All transaction with in-mempool parent are already not tracked for fee estimation, so the child that CPFP'd the parent is also ignored.
Upon implementing the cluster mempool, we will just track chunks and make the fee estimator package aware.