-
Notifications
You must be signed in to change notification settings - Fork 105
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): Adds getmininginfo
, getnetworksolps
and getnetworkhashps
methods
#5808
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.
Thanks, this looks great!
I can see some places where the argument handling and result format doesn't seem to match the RPC reference. But I understand the reference might be different from what zcashd
actually does.
Can you document each new argument and field with its description from the reference, and document any changes from zcashd
or special processing that we do?
I'd also like to see the manual test results from zcash-rpc-diff
, that will show up any differences.
zebra-rpc/src/methods/get_block_template_rpcs/types/get_mining_info.rs
Outdated
Show resolved
Hide resolved
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5808 +/- ##
==========================================
+ Coverage 78.82% 78.90% +0.07%
==========================================
Files 307 308 +1
Lines 38737 38685 -52
==========================================
- Hits 30536 30523 -13
+ Misses 8201 8162 -39 |
I did a But since it's a manual test, we'll need to do it again before we merge. |
updates ReadRequest::SolutionRate doc link
moves snapshot tests up where it can use the populated state service
…r is not added to `total_work`
zebra-rpc/src/methods/tests/snapshot/snapshots/get_mining_info@mainnet_10.snap
Outdated
Show resolved
Hide resolved
zebra-rpc/src/methods/get_block_template_rpcs/types/get_mining_info.rs
Outdated
Show resolved
Hide resolved
It looks like we've hit a GitHub API rate limit, causing CI jobs across multiple PRs to fail: it should reset within an hour or so. I'll ask Gustavo to look into this next week. But until then, please push your commits in batches, rather than one at a time. (Each push runs about 50 jobs.) |
Adds "arbitrary_precision" feature to serde_json in zebra-rpc
🤦 Whoops. Okay, noted. Response diffs: WARNING: comparing RPC responses from different heights:
zcashd is at: 107837
zebrad is at: 1905342
Request: getnetworkhashps
Querying zebrad main chain at height >=1905342...
time: real 0m0.005s, user 0m0.002s, sys 0m0.000s
Querying zcashd main chain at height >=107837...
time: real 0m0.003s, user 0m0.003s, sys 0m0.000s
Response diff between zcashd and zebrad:
-12139905448
+56199849 WARNING: comparing RPC responses from different heights:
zcashd is at: 146135
zebrad is at: 1905349
Request:
getnetworksolps
Querying zebrad main chain at height >=1905349...
time: real 0m0.005s, user 0m0.002s, sys 0m0.000s
Querying zcashd main chain at height >=146135...
time: real 0m0.063s, user 0m0.003s, sys 0m0.000s
Response diff between zcashd and zebrad:
-12224410071
+201076157 WARNING: comparing RPC responses from different heights:
zcashd is at: 108810
zebrad is at: 1905347
Request: getmininginfo
Querying zebrad main chain at height >=1905347...
time: real 0m0.006s, user 0m0.003s, sys 0m0.000s
Querying zcashd main chain at height >=108810...
time: real 0m0.002s, user 0m0.002s, sys 0m0.000s
Response diff between zcashd and zebrad:
{
- "networksolps": 12413336220,
- "networkhashps": 12413336220,
+ "blocks": 108810,
+ "difficulty": 1348528.045183577,
+ "errors": "Your computer's date and time may be behind the rest of the network! If your clock is wrong Zcash will not work properly.",
+ "errorstimestamp": 1670465885,
+ "genproclimit": 1,
+ "localsolps": 0,
+ "networksolps": 81163088,
+ "networkhashps": 81163088,
+ "pooledtx": 0,
+ "testnet": false,
"chain": "main",
- "testnet": false
+ "generate": false
} I'll update these diffs when the zcashd node finishes syncing. |
The different heights are going to make some fields different, even if the calculations in Zebra and Here it is with them both synced:
In this last one, all the differences are due to extra fields (including the line deletion for the trailing comma). Great work, thanks for making this all match up! |
@Mergifyio refresh |
✅ Pull request refreshed |
@Mergifyio refresh |
✅ Pull request refreshed |
Motivation
We want to support the
getnetworksolps
,getnetworkhashps
, andgetmininginfo
RPCs.getmininginfo
RPC call #5468Solution
getmininginfo
,getnetworksolps
andgetnetworkhashps
RPCsReview
Part of regular scheduled work.
Reviewer Checklist
Follow Up Work
getmininginfo
response