Zebra/zebra-chain/src/sapling
Marek 7c726b246d
feat(rpc): Implement `z_gettreestate` RPC (#3990)
* Impl the elementary structure of the `z_gettreestate` RPC

* Fix merging bugs

* Fix a merge bug

* Fix a merge bug

* Move a derive attribute

Co-authored-by: teor <teor@riseup.net>

* Clarify the support of negative heights

* Add Orchard note commitment trees to the response

* Add the time to the response

* Finalize the `z_gettreestate` RPC

* Add a note that verified blocks have coinbase height

* Refactor `from_str` for `HashOrHeight`

* Fix a mistake in the docs

Co-authored-by: teor <teor@riseup.net>

* Clarify request types

Co-authored-by: teor <teor@riseup.net>

* Simplify `hash_or_height` conversion to height

Co-authored-by: teor <teor@riseup.net>

* Add a TODO about optimization

Co-authored-by: teor <teor@riseup.net>

* Add a doc comment

* Make sure Sapling & Orchard trees don't get mixed up

* Serialize Sapling commitment trees

* Refactor some comments

* Serialize Orchard commitment trees

* Serialize block heights

* Simplify the serialization of commitment trees

* Remove the block time from the RPC response

* Simplify the serialization of block heights

* Put Sapling & Orchard requests together

* Remove a redundant TODO

* Add block times to the RPC response

* Derive `Clone, Debug, Eq, PartialEq` for `GetTreestate`

Co-authored-by: teor <teor@riseup.net>

* Derive `Clone`, `Debug`, `Eq` and `PartialEq` for `SerializedTree`

* Document the fields of `GetTreestate`

* Skip the serialization of empty trees

This ensures compatibility with `zcashd` in the `z_gettreestate` RPC.

* Document the `impl` of `merkle_tree::Hashable` for nodes

* Make the structure of the JSON response consistent with `zcashd`

* Derive `Eq` for nodes

Co-authored-by: teor <teor@riseup.net>

* Convert Sapling commitment trees to a format compatible with zcashd

* Refactor the conversion of Sapling commitment trees

* Refactor some comments

* Refactor comments

* Add a description of the conversion

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

* Fix comment indenting

* Document the conversion between the dense and sparse formats

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2022-05-12 07:00:12 +00:00
..
commitment Update multiple crates to ensure bitvec 0.22.3 is being used (#2351) 2021-06-23 13:16:22 +10:00
keys Check jubjub key correctness independent of redjubjub / jubjub (#3154) 2021-12-22 15:10:34 +00:00
note build(deps): bump serde-big-array from 0.3.2 to 0.4.1 (#4004) 2022-03-31 01:33:52 +00:00
tests refactor(anchorSapling): Change type to force consensus rule validation (#3544) 2022-02-17 03:20:22 +00:00
address.rs Check jubjub key correctness independent of redjubjub / jubjub (#3154) 2021-12-22 15:10:34 +00:00
arbitrary.rs refactor(anchorSapling): Change type to force consensus rule validation (#3544) 2022-02-17 03:20:22 +00:00
commitment.rs docs: document consensus rules from 4.4 Spend Descriptions (#3460) 2022-02-08 09:56:59 +00:00
keys.rs docs: document consensus rules from 4.5 Output Descriptions (#3462) 2022-02-14 21:31:20 +00:00
note.rs Replace smart quotes with ascii quotes 2021-03-15 03:18:10 -04:00
output.rs docs: document consensus rules from 4.5 Output Descriptions (#3462) 2022-02-14 21:31:20 +00:00
shielded_data.rs refactor(anchorSapling): Change type to force consensus rule validation (#3544) 2022-02-17 03:20:22 +00:00
spend.rs docs: document consensus rules from 7.3 Spend Description Encoding and Consensus (#3575) 2022-02-19 02:27:09 +00:00
tests.rs Calculate incremental note commitment trees (#2407) 2021-07-15 13:58:36 +00:00
tree.rs feat(rpc): Implement `z_gettreestate` RPC (#3990) 2022-05-12 07:00:12 +00:00