feat(rpc): add value pools to getblock - #9432
Conversation
I think it would be work that will be rarely used, since after the database is upgraded you'll never have to worry about it again. You can somewhat check the progress by calling |
|
@conradoplg can we close this one in favour of @arya2 's PR? |
I thin I'll repurpose it to contain the RPC call itself based on @arya2 's PR (which contains the DB changes but not the RPC change itself IIRC) |
|
@Mergifyio update |
✅ Branch has been successfully updated |
|
@arya2 review reminder 🙏 |
arya2
left a comment
There was a problem hiding this comment.
This looks good, I left some comments but none of them are blockers.
|
@Mergifyio queue |
✅ The pull request has been merged automaticallyDetailsThe pull request has been merged automatically at 9caa717 |


Motivation
We want to fill the
valuePoolsandchainSupplyfields for thegetblockRPC.Solution
The database part was included in #9539, I'll leave its description below for the record.
That requires keeping track of the value pools after each block; we only keep it for the entire chain.
This PR introduces a new column family named
block_data. The idea behind the generic name is that we could add other data there like chainwork and block size. In fact, the main reason this is a draft PR is because we might want to add those in the same PR, but I'd like to get feedback on this first.The database upgrade is slow (main reason) and takes ~2h to complete (it was 4h, I managed to improve a bit with rayon). I think this is harmless since it only impacts the RPC itself (it does not return the field if the data is not yet available).
To avoid a circular dependency, this also moves some subsidy-related functions from
zebra-consensustozebra-chain. I'm not sure if I should go ahead and move everything else related to that. Let me know if you prefer a separate PR with the move, but I also wanted feedback on this first.Closes #5449
Tests
I adjusted the existing tests and used
zcash-rpc-diffto compare with zcashd, and everything seems to match (with this exception)Specifications & References
https://github.com/zcash/zcash/blob/99ad6fdc3a549ab510422820eea5e5ce9f60a5fd/src/rpc/blockchain.cpp#L766-L782
Follow-up Work
PR Checklist
C-exclude-from-changeloglabel.