Closed arya2 closed 4 days ago
zcash-rpc-diff
util output with verbose = true
:
It matches exactly when verbose is false, but the difficulty
and finalsaplingroot
fields aren't matching. It's possible the finalsaplingroot
field will match after Sapling activation (my zcashd is still syncing). zcashd also includes solution
and chainwork
fields, solution
should be trivial to add, chainwork
may be a little more complicated.
Update:
The finalsaplingroot
does match after Sapling activation, though it was reversed.
Now it's just the difficulty
field that's different, and the solution
and chainwork
fields that are missing.
Update 2:
The RPC is still missing the chainwork
field but otherwise matches the zcashd output exactly, including while the Sapling note commitment tree is empty.
The chainwork
field is confirmed to be the cumulative work in the chain, which Zebra doesn't store in the finalized state. It's also undocumented so we can probably leave it until/unless someone requests it. It could also still be calculated by the caller by summing up the work for the chain up to the requested block.
The chainwork field is confirmed to be the cumulative work in the chain, which Zebra doesn't store in the finalized state. It's also undocumented so we can probably leave it until/unless someone requests it. It could also still be calculated by the caller by summing up the work for the chain up to the requested block.
The chainwork
field was mentioned in the last Zcashd deprecation meeting and as it is an undocumented field it should be safe to ignore it in Zebra.
The failing test seems to be unrelated however it will be good to check that out in another issue/context.
@oxarbitrage can we get a final review here if it's all ok?
@mergify refresh
refresh
@mergify update
update
@mergify refresh
refresh
@mergify requeue
requeue
@mergify queue
queue
Motivation
This is needed for block explorer support and has been requested by a mining pool.
Closes #8442. Part of #8446 (always includes
height
in response when called withverbosity = 2
).Specifications & References
https://zcash.github.io/rpc/getblockheader.html
Solution
getblockheader
RPC method like the one in zcashdRelated changes:
height
field togetblock
response when called with a heightif verbosity == 2
Tests
PR Author's Checklist
PR Reviewer's Checklist