-
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
rpc(getblock): Add value pools output #8765
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.
This PR looks great, though it seems zcashd is returning the total chain value balances at the provided heights, so we may need another PR to track those in Zebra first.
@@ -1548,6 +1574,7 @@ impl Default for GetBlock { | |||
time: None, | |||
tx: Vec::new(), | |||
trees: GetBlockTrees::default(), | |||
value_pools: vec![], |
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.
Optional/Nitpick: This Default
impl could be derived.
Closed as it is not critical and much more work than expected. |
@@ -10,6 +10,7 @@ use std::{collections::HashSet, fmt::Debug, sync::Arc}; | |||
|
|||
use chrono::Utc; | |||
use futures::{stream::FuturesOrdered, FutureExt, StreamExt, TryFutureExt}; | |||
use get_block_template_rpcs::types::zec::Zec; |
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 type needs to be moved out from behind the getblocktemplate-rpcs
feature flag.
This looks good to merge once the |
Motivation
We want the lockbox value pool information in the
getblock
output for a given blockThe lockbox information was added in zcashd at zcash/zcash#6912, It is part of a list of pools that this PR adds to Zebra.
#8730
Specifications & References
zcash/zcash#6912
Solution
The solution implements the
valuePools
object and some of the fields. In zcashd this is like:Where
valueDelta
is the value pool for the requested block butchainValue
is the value pool up to the requested blocks. Zebra do not keep track of value pools at specific heights for the finalized chain so i think we can't have that value. I am open to suggestions here.Solution implements
id
,valueDelta
andvalueDeltaZat
for each pool including the lockboxTests
Snapshot tests added by now.
Follow-up Work
Need zcashd diff tests.
PR Author's Checklist
PR Reviewer's Checklist