sigp / lighthouse

Ethereum consensus client in Rust
https://lighthouse.sigmaprime.io/
Apache License 2.0
2.9k stars 736 forks source link

Persist Deposit Merkle tree #776

Open pawanjay176 opened 4 years ago

pawanjay176 commented 4 years ago

Description

The deposit tree is rebuilt from the persisted tree leaves every time for use in the Eth1 caches (once #760 is merged). Rebuilding the deposit tree from scratch for deposit sizes > 1 million takes a few seconds. Encoding the merkle tree as bytes is not straightforward as its a recursive data structure.

Steps to resolve

Figure out a way to encode/decode the deposit tree and save/load the deposit tree on shutdown/startup.

Blocked on #760

michaelsproul commented 4 years ago

Relevant: the MerkleTree struct could be deleted and replaced by a TreeHashCache, which is easily serializable.

michaelsproul commented 7 months ago

This seems like it's probably obsoleted by the deposit snapshots? cc @ethDreamer