Zebra/zebra-chain/src
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
..
amount Check remaining transaction value & make value balance signs match the spec (#2566) 2021-08-09 14:22:26 -03:00
block feat(rpc): Implement `z_gettreestate` RPC (#3990) 2022-05-12 07:00:12 +00:00
chain_tip feat(rpc): Implement `getblockchaininfo` RPC method (#3891) 2022-03-25 12:25:31 +00:00
history_tree refactor(anchorSapling): Change type to force consensus rule validation (#3544) 2022-02-17 03:20:22 +00:00
orchard feat(rpc): Implement `z_gettreestate` RPC (#3990) 2022-05-12 07:00:12 +00:00
parameters feat(util): add a `zebra-tip-height` utility (#4289) 2022-05-06 03:31:52 +00:00
primitives change(nu5): use new V5 transaction script verification API (#3799) 2022-04-19 10:14:16 +10:00
sapling feat(rpc): Implement `z_gettreestate` RPC (#3990) 2022-05-12 07:00:12 +00:00
serialization change(nu5): use new V5 transaction script verification API (#3799) 2022-04-19 10:14:16 +10:00
sprout build(deps): bump serde-big-array from 0.3.2 to 0.4.1 (#4004) 2022-03-31 01:33:52 +00:00
transaction refactor: document coinbase rules, refactor to ease understanding (#4056) 2022-04-20 09:31:12 +00:00
transparent change(rpc): Simplify RPC types and add documentation (#4218) 2022-05-03 04:10:21 +00:00
value_balance Split ValueBalance methods into NegativeAllowed and NonNegative (#2649) 2021-08-20 13:30:38 +00:00
work build(deps): bump serde-big-array from 0.3.2 to 0.4.1 (#4004) 2022-03-31 01:33:52 +00:00
amount.rs 8. feat(state): add a query function for transparent address balances (#4097) 2022-04-14 13:34:31 +00:00
block.rs feat(rpc): Implement `z_gettreestate` RPC (#3990) 2022-05-12 07:00:12 +00:00
chain_tip.rs feat(rpc): Implement `getblockchaininfo` RPC method (#3891) 2022-03-25 12:25:31 +00:00
fmt.rs Add a TypeNameToDebug formatter to zebra_chain (#2466) 2021-07-09 12:40:19 +10:00
history_tree.rs Tweak some assertions to better match their error messages (#2822) 2021-10-04 10:31:56 -03:00
lib.rs build(deps): bump serde-big-array from 0.3.2 to 0.4.1 (#4004) 2022-03-31 01:33:52 +00:00
orchard.rs ZIP 212: validate Sapling and Orchard output of coinbase transactions (#3029) 2021-11-11 22:18:37 +00:00
parameters.rs Cleanup a few arbitrary impls (#2222) 2021-05-28 09:49:28 -03:00
primitives.rs ZIP 212: validate Sapling and Orchard output of coinbase transactions (#3029) 2021-11-11 22:18:37 +00:00
sapling.rs Update multiple crates to ensure bitvec 0.22.3 is being used (#2351) 2021-06-23 13:16:22 +10:00
serialization.rs Refactor addr v1 serialization using a separate AddrV1 type (#3021) 2021-11-10 06:47:50 +10:00
shutdown.rs Fix shutdown panics (#1637) 2021-02-03 19:03:28 +10:00
sprout.rs Validate JoinSplit proofs (#3128) 2021-12-10 16:33:15 +00:00
transaction.rs refactor: document coinbase rules, refactor to ease understanding (#4056) 2022-04-20 09:31:12 +00:00
transparent.rs 6. feat(db): Add a transparent address UTXO index (#3999) 2022-04-13 04:06:52 +00:00
value_balance.rs Enforce Rust edition 2021 (#3332) 2022-01-14 12:10:18 +00:00
work.rs Replace primitives_types with uint (#2350) 2021-06-18 15:35:05 -03:00