-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Implement Mini version of BlockAssembler to calculate mining scores #27021
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. ConflictsNo conflicts as of last run. |
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.
Wrote some more tests for this, please feel free to take: glozow@6761c59
1835589
to
daf023a
Compare
I wrote a fuzz test for the $ echo "AQEWCQEBAAEACf//////////////CBwAAgAAlRwB7QEA/wAAAAL7AAEAAAEB7QEA/wAAAAL7AAAA
AAAAXAD//w==" | base64 -d > mini_miner_crash.input
$ FUZZ=mini_miner ./src/test/fuzz/fuzz ./mini_miner_crash.input Now that could just mean that my assumptions about what should be passed into the Two questions:
|
In what way does the code added here differ from the real block assembly code? |
Thanks for fuzzing 💯
Actually no. It just uses what's cached in the mempool entries. The fees don't even need to match inputs - outputs, and mini miner definitely doesn't require ATMP checks.
Differential fuzzing is perfect for this really.
That would also be a really good way of testing the results (after the wallet stuff is added?). Add the bumping tx, mine another block with the target feerate as min feerate, and see that they all get mined. |
|
Added tests from glozow’s branch |
6761c59
to
5fbc31a
Compare
Is there a reason to leave the |
Oh good point, that just grew organically, but really it could be part of the mini-miner changes. I’ll squash it in there. |
5fbc31a
to
2136e8b
Compare
I’ve amended this branch to include the |
64d53fd
to
590b1fd
Compare
496f31d
to
bd338ad
Compare
I pushed some changes (with @xekyo's permission, thanks):
|
bd338ad
to
782d046
Compare
Awesome, thanks for the reworking this, @glozow, and the work on the fuzzer, @dergoegge. I've fixed a minor Ready for review |
782d046
to
ce882ef
Compare
Pushed again to provide signed commits |
review-beg-pinging @LarryRuane @josibake @stickies-v who have looked at |
For anyone wanting to review this PR and would like some help with basic mempool concepts, I made a video: https://youtu.be/sQ05azzTp9o -- it mentions 26152 but I think would be helpful for reviewers here as well. |
ACK ce882ef |
Follow-up from bitcoin#27021
Follow-up from bitcoin#27021: accessing of fields in MiniMinerMempoolEntry was done inconsistently. Even though we had a getter, we would directly write to the fields when we needed to update them. This commits sets the fields to private and introduces a method for updating the ancestor information in transactions using the same method name as used for Mempool Entries.
Follow-up from bitcoin#27021: In the prior commit, the vector started counting at 0, but the transaction names started with 1. This commit matches the names to the transactions’ vector indices for better readability. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021. Also included is an ASCII art visualization of the test’s transaction topology by theStack. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021
Follow-up from bitcoin#27021: accessing of fields in MiniMinerMempoolEntry was done inconsistently. Even though we had a getter, we would directly write to the fields when we needed to update them. This commits sets the fields to private and introduces a method for updating the ancestor information in transactions using the same method name as used for Mempool Entries.
Follow-up from bitcoin#27021: In the prior commit, the vector started counting at 0, but the transaction names started with 1. This commit matches the names to the transactions’ vector indices for better readability. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021. Also included is an ASCII art visualization of the test’s transaction topology by theStack. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021
Follow-up from bitcoin#27021: accessing of fields in MiniMinerMempoolEntry was done inconsistently. Even though we had a getter, we would directly write to the fields when we needed to update them. This commits sets the fields to private and introduces a method for updating the ancestor information in transactions using the same method name as used for Mempool Entries.
Follow-up from bitcoin#27021: In the prior commit, the vector started counting at 0, but the transaction names started with 1. This commit matches the names to the transactions’ vector indices for better readability. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021. Also included is an ASCII art visualization of the test’s transaction topology by theStack. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021
Follow-up from bitcoin#27021: accessing of fields in MiniMinerMempoolEntry was done inconsistently. Even though we had a getter, we would directly write to the fields when we needed to update them. This commits sets the fields to private and introduces a method for updating the ancestor information in transactions using the same method name as used for Mempool Entries.
Follow-up from bitcoin#27021: In the prior commit, the vector started counting at 0, but the transaction names started with 1. This commit matches the names to the transactions’ vector indices for better readability. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021. Also included is an ASCII art visualization of the test’s transaction topology by theStack. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021
Follow-up from bitcoin#27021: accessing of fields in MiniMinerMempoolEntry was done inconsistently. Even though we had a getter, we would directly write to the fields when we needed to update them. This commits sets the fields to private and introduces a method for updating the ancestor information in transactions using the same method name as used for Mempool Entries.
Follow-up from bitcoin#27021: In the prior commit, the vector started counting at 0, but the transaction names started with 1. This commit matches the names to the transactions’ vector indices for better readability. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021. Also included is an ASCII art visualization of the test’s transaction topology by theStack. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021
Follow-up from bitcoin#27021: accessing of fields in MiniMinerMempoolEntry was done inconsistently. Even though we had a getter, we would directly write to the fields when we needed to update them. This commits sets the fields to private and introduces a method for updating the ancestor information in transactions using the same method name as used for Mempool Entries.
…o target feerate f18f9ef Amend bumpfee for inputs with overlapping ancestry (Murch) 2e35e94 Bump unconfirmed parent txs to target feerate (Murch) 3e3e052 coinselection: Move GetSelectionWaste into SelectionResult (Andrew Chow) c57889d [node] interface to get bump fees (glozow) c24851b Make MiniMinerMempoolEntry fields private (Murch) ac6030e Remove unused imports (Murch) d2f90c3 Fix calculation of ancestor set feerates in test (Murch) a1f7d98 Match tx names to index in miniminer overlap test (Murch) Pull request description: Includes some commits to address follow-ups from #27021: bitcoin/bitcoin#27021 (comment) Reduces the effective value of unconfirmed UTXOs by the fees necessary to bump their ancestor transactions to the same feerate. While the individual UTXOs always account for their full ancestry before coin-selection, we can correct potential overestimates with a second pass where we establish the ancestry and bump fee for the whole input set collectively. Fixes #9645 Fixes #9864 Fixes #15553 ACKs for top commit: S3RK: ACK f18f9ef ismaelsadeeq: ACK f18f9ef achow101: ACK f18f9ef brunoerg: crACK f18f9ef t-bast: ACK bitcoin/bitcoin@f18f9ef, I reviewed the latest changes and run e2e tests against eclair, everything looks good 👍 Tree-SHA512: b65180c4243b1f9d13c311ada7a1c9f2f055d530d6c533b78c2068b50b8c29ac1321e89e85675b15515760d4f1b653ebd9da77b37c7be52d9bc565a3538f0aa6
Follow-up from bitcoin#27021: In the prior commit, the vector started counting at 0, but the transaction names started with 1. This commit matches the names to the transactions’ vector indices for better readability. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021. Also included is an ASCII art visualization of the test’s transaction topology by theStack. Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
Follow-up from bitcoin#27021
Follow-up from bitcoin#27021: accessing of fields in MiniMinerMempoolEntry was done inconsistently. Even though we had a getter, we would directly write to the fields when we needed to update them. This commits sets the fields to private and introduces a method for updating the ancestor information in transactions using the same method name as used for Mempool Entries.
Implement Mini version of BlockAssembler to calculate mining scores
Run the mining algorithm on a subset of the mempool, only disturbing the
mempool to copy out fee information for relevant entries. Intended to be
used by wallet to calculate amounts needed for fee-bumping unconfirmed
transactions.
From comments of sipa and glozow below: