feat(rpc); Add blockcommitments
field to getblock
output
#9217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This PR adds the
blockcommitments
field to the getblock command output which is returned by zcashd and is required for FlyClient functionality.Partially implements #9022 .
Solution
commitment
method to Header which returns the content of thecommitment_bytes
field in presentation byte orderblock_commitments
field to the response objects for bothgetblock
andgetblockheader
get_block_header
method of the RPC implementation to parse the value of thecommitment_bytes
field depending on the block's network and heightTests
blockcommitments
field was compared manually to the one returned by zcashd, before and after each network update.Follow-up Work
To resolve #9022 we have to consider if the
chainhistoryroot
andauthdataroot
fields should also be added. The content ofblockcommitments
is equal tofinalsaplingroot
before Heartwood, and is equal tochainhistoryroot
after Heartwood activation and before NU5.PR Author's Checklist
PR Reviewer's Checklist