Zebra/zebra-chain/src/block
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
..
tests fix(chain): make FromHex consistent with ToHex for tx/block hashes (#3893) 2022-03-17 20:24:48 +00:00
arbitrary.rs feat(state): add transparent address indexes to the non-finalized state (#4022) 2022-04-12 17:21:46 +00:00
commitment.rs Encode CommitmentErrors as hex (#4021) 2022-04-01 22:31:03 +00:00
error.rs Move network_upgrade check into zebra-chain (#2354) 2021-06-22 12:06:52 +10:00
hash.rs fix(chain): make FromHex consistent with ToHex for tx/block hashes (#3893) 2022-03-17 20:24:48 +00:00
header.rs feat(rpc): Implement `z_gettreestate` RPC (#3990) 2022-05-12 07:00:12 +00:00
height.rs Support large block heights (#3401) 2022-02-11 00:32:57 +00:00
merkle.rs Fix new clippy lints in clippy nightly (#3176) 2021-12-09 14:19:14 +00:00
serialize.rs feature(rpc): implement getblock api call (#3707) 2022-03-10 01:12:41 +00:00
tests.rs Check MAX_BLOCK_SIGOPS in the block verifier (#3049) 2021-11-15 20:55:32 +00:00