-
Notifications
You must be signed in to change notification settings - Fork 117
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): Add value pool balances to getblockchaininfo
RPC method response
#8769
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.
Looks really good to me, great work, thanks!
It seems the tests are hang somewhere so the CI is giving up. https://github.com/ZcashFoundation/zebra/actions/runs/10414872254/job/28844504197?pr=8769 I am having the same issue locally when running the suite:
|
Ah, yes, I forgot to handle the mock service requests in the prop tests. |
Motivation
We want to add value pool balances at the chain tip to Zebra's
getblockchaininfo
RPC method response.Closes #8767.
Specifications & References
https://zcash.github.io/rpc/getblockchaininfo.html
Solution
Zec
type inzebra-rpc
out from behind thegetblocktemplate-rpcs
feature flag.ValuePoolBalance
type to a newtypes::get_blockchain_info
module with a fn for creating one from aValueBalance
.getblockchaininfo
RPC method return type to aBoxFuture
to make async calls to the state service.ChainTipBlock
instead of adding a new state service request, but in practice, the tip and value balance should be in-memory when there is no non-finalized best chain and blocks are being committed rapidly, so it should be unlikely to return that error. Still, let me know if we want to add it to theChainTipBlock
instead, we could do that here or in a follow-up PR.getblockchaininfo
method to get the chain tip height, hash, value balance, and block time from state requests.Related Changes:
estimated_height
assignmentTests
Updates existing snapshots (and some prop tests to handle the
BoxFuture
wrapped return type).PR Author's Checklist
PR Reviewer's Checklist