-
Notifications
You must be signed in to change notification settings - Fork 107
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
z_gettreestate JSON-RPC method #3156
Comments
Hey team! Please add your planning poker estimate with ZenHub @conradoplg @dconnolly @gustavovalverde @jvff @oxarbitrage @teor2345 @upbqdn |
The RPC method |
Good question, and nice catch! We'll need to serialize to the Then we can encode as hex. Here are our different options for serialization:
zebra/zebra-chain/src/serialization/zcash_serialize.rs Lines 10 to 16 in 5d7f986
zebra/zebra-state/src/service/finalized_state/disk_format/shielded.rs Lines 87 to 95 in 5d7f986
Here's how we have done some other RPC serializations: zebra/zebra-chain/src/block/hash.rs Lines 27 to 61 in 5d7f986
|
We're using the |
That's the option I forgot: a In the code, that looks like: zebra/zebra-rpc/src/methods.rs Lines 352 to 356 in 5d7f986
And it also needs a |
In order to get |
I updated the description of this issue so that the RPC response doesn't contain the block time. I noticed the original docs don't mention it. |
@upbqdn unfortunately, we need to include |
(If you'd like to open a zcashd ticket to fix their docs, go for it!) |
I opened the issue here zcash/zcash#5913. |
Motivation
lightwalletd
uses thez_gettreestate
JSON-RPC method.Dependencies
We need to do these tickets first:
Required Fields
The method is documented here: https://zcash.github.io/rpc/z_gettreestate.html
lightwalletd
uses either the height or hash arguments, depending on what it has available internally: https://github.com/zcash/lightwalletd/blob/master/frontend/service.go#L182lightwalletd
only uses positive heights above zero, so Zebra doesn't need to supportheight = -1
:https://github.com/adityapk00/lightwalletd/blob/c1bab818a683e4de69cd952317000f9bb2932274/frontend/service.go#L340
But only these fields are used by
lightwalletd
: https://github.com/zcash/lightwalletd/blob/master/common/common.go#L104Field list:
Notes (see https://github.com/zcash/zcash/blob/bd2c35a93fdc93a06d650da2a90378fbb7083711/src/rpc/blockchain.cpp#L1305-L1328):
finalRoot
is the root of the note commitment tree after the given blockfinalState
is the encoding of the note commitment tree itself for the given block.skipHash
should never be supplied, we skip identical tree states internally when storing and loading from the databaseTasks
lightwalletd
API Reference
We plan to use jsonrpc_core with:
Example Code
Here are examples of:
Resolved Questions
Will we need to add an
orchard
field to this RPC? Yes.z_gettreestate
zcash/zcash#5554The text was updated successfully, but these errors were encountered: