-
Notifications
You must be signed in to change notification settings - Fork 107
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
change(rpc): Select getblocktemplate RPC transactions according to ZIP-317 #5724
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5724 +/- ##
==========================================
+ Coverage 78.67% 79.09% +0.41%
==========================================
Files 306 306
Lines 38552 39768 +1216
==========================================
+ Hits 30331 31454 +1123
- Misses 8221 8314 +93 |
This will be used for block production and relaying
3a83759
to
b1c03e5
Compare
The code in this PR will have further changes after a ZIP update. I suggest we review and merge it based on the current ZIP-317, and then do the update in a separate PR based on ticket #5752. That will make reviewing the update easier, because the diff will be smaller. |
(Oops, pressed the wrong button.) |
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 to me.
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.
This looks good!
@Mergifyio refresh |
✅ Pull request refreshed |
Note that the algorithm has changed, as discussed in ZIP sync. PR here: zcash/zips#650 |
Please don't worry about restarting the tests in this PR, or merging in main, I'm going to update the code tomorrow anyway. |
Motivation
We want to select transactions for block production according to ZIP-317.
Close #5473.
Depends-On: #5761
Specifications
https://zips.z.cash/zip-0317#recommended-algorithm-for-block-template-construction
Designs
Follow the recommended algorithm in the specification.
Use
f32
for efficient calculations and weight storage.Use a minimum fee weight of
1.0 / 20.0
to simplify the implementation. (This is not in the spec, but changes are allowed because it is not consensus-critical. If the ZIP editors disagree with this, I'll open another PR to fix it.)Use the same random weight APIs that we use in mempool transaction eviction.
Some parts of this PR are outside the
getblocktemplate-rpcs
feature, because we will probably use them in ticket #5336.Solution
Related Refactors:
This PR has some testing from the existing test vectors and snapshot tests.
The rest of its tests will be implemented as part of ticket #5652.
Review
We should probably get two reviews on this.
Reviewer Checklist