-
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
feat(zebra-checkpoints): make zebra-checkpoints
work for zebrad backend
#5894
Conversation
I did some manual test for comparison and performance. In regards to time, zebra started a bit faster but they both ended up taking pretty much the same amount of time to get a full list of up to date checkpoints in the Mainnet. Here what i did: zebra (i have a synchronized chain at port 6666):
zcashd (synchronized and running in default rpc port):
A comparassion of this 2 generated files show that they are exactly the same.
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5894 +/- ##
==========================================
- Coverage 78.01% 77.90% -0.12%
==========================================
Files 312 312
Lines 38997 39022 +25
==========================================
- Hits 30425 30401 -24
- Misses 8572 8621 +49 |
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.
@Mergifyio refresh |
✅ Pull request refreshed |
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, and I'd really like to merge it. But it seems to cause a performance issue with lightwalletd
.
I spent some time trying to work out how to fix it, let me know what you think of my suggestions!
zebra-checkpoint
work for zebrad backendzebra-checkpoints
work for zebrad backend
If we can't get this merged with minimal changes, e.g timeboxed to 1 day + 1 more round of reviews then we should park it for now |
I think this is easy enough for a fix in one day and another round of reviews. Working on it now. |
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 for the workaround to the performance issue!
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, just doing some testing to make sure all the backends produce the same results.
All 3 backend/node combinations produce the same results for new checkpoints, I'll run a full set of checkpoints overnight to be sure. I think it's worth doing this test because checkpoints are consensus-critical. |
The full checkpoint files were exactly the same as each other, and they didn't change any of the existing checkpoints. |
…kend (#5894) - theirs merge: git cherry-pick --strategy=ort --strategy-option=theirs * make `zebra-checkpoint` util work with zebra as the backend * update snapshots * update documentation * applies suggestions from code review * irefactor zebra-checkpoints to work with zebra using deserialization of the raw block * fix imports and derives * rename mode to backend * remove old stuff * fix docs Co-authored-by: arya2 <[email protected]>
Motivation
Zebra has an utility tool to create checkpoints. Until now this tool only work if zcashd is used as the backend.
This PR make the changes to make it work with
zebrad
as the backend whilezcashd
is still supported.Close #5852
Solution
When i started on this i was only expecting to make changes to the
zebra-checkpoints
binary, however i realized later we were going to need changes in thegetblock
rpc method.The binary is expecting
height
,hash
andsize
fields of agetblock
call with verbosity = 1. Currently (and because ligthwalletd only make use of thetx
field of the object response), we are not returning any additional data.this PR updated the
getblock
rpc method to return the additional data needed to make the tool work.Also, in the
zebra-checkpoints
we changed the use ofgetblockcount
to theblocks
field ofgetblockchaininfo
call as suggested in the proposed changes section of the ticket.Review
This is optional and low priority. It can wait until people get back. Anyone can review.
Reviewer Checklist
Follow Up Work