lighthouse-pulse/consensus
Giulio rebuffo 9d6209725f Added Merkle Proof Generation for Beacon State (#3674)
## Issue Addressed

This PR addresses partially #3651

## Proposed Changes

This PR adds the following methods:

* a new method to trait `TreeHash`, `hash_tree_leaves` which returns all the Merkle leaves of the ssz object.
* a new method to `BeaconState`: `compute_merkle_proof` which generates a specific merkle proof for given depth and index by using the `hash_tree_leaves` as leaves function.

## Additional Info

Now here is some rationale on why I decided to go down this route: adding a new function to commonly used trait is a pain but was necessary to make sure we have all merkle leaves for every object, that is why I just added  `hash_tree_leaves`  in the trait and not  `compute_merkle_proof` as well. although it would make sense it gives us code duplication/harder review time and we just need it from one specific object in one specific usecase so not worth the effort YET. In my humble opinion.

Co-authored-by: Michael Sproul <micsproul@gmail.com>
2022-11-08 01:58:18 +00:00
..
cached_tree_hash Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
fork_choice Strict count unrealized (#3522) 2022-09-05 04:50:47 +00:00
int_to_bytes Update to Rust 1.59 and 2021 edition (#3038) 2022-02-25 00:10:17 +00:00
merkle_proof Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
proto_array Strict count unrealized (#3522) 2022-09-05 04:50:47 +00:00
safe_arith Inline safe_arith methods (#3229) 2022-05-31 06:09:12 +00:00
serde_utils Fix rust 1.65 lints (#3682) 2022-11-04 07:43:43 +00:00
ssz Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
ssz_derive Update to Rust 1.59 and 2021 edition (#3038) 2022-02-25 00:10:17 +00:00
ssz_types New rust lints for rustc 1.64.0 (#3602) 2022-09-23 03:52:46 +00:00
state_processing Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
swap_or_not_shuffle Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
tree_hash Fix rust 1.65 lints (#3682) 2022-11-04 07:43:43 +00:00
tree_hash_derive Use SmallVec for TreeHash packed encoding (#3581) 2022-09-16 08:54:06 +00:00
types Added Merkle Proof Generation for Beacon State (#3674) 2022-11-08 01:58:18 +00:00