lighthouse/beacon_node
ethDreamer e8604757a2 Deposit Cache Finalization & Fast WS Sync (#2915)
## Summary

The deposit cache now has the ability to finalize deposits. This will cause it to drop unneeded deposit logs and hashes in the deposit Merkle tree that are no longer required to construct deposit proofs. The cache is finalized whenever the latest finalized checkpoint has a new `Eth1Data` with all deposits imported.

This has three benefits:

1. Improves the speed of constructing Merkle proofs for deposits as we can just replay deposits since the last finalized checkpoint instead of all historical deposits when re-constructing the Merkle tree.
2. Significantly faster weak subjectivity sync as the deposit cache can be transferred to the newly syncing node in compressed form. The Merkle tree that stores `N` finalized deposits requires a maximum of `log2(N)` hashes. The newly syncing node then only needs to download deposits since the last finalized checkpoint to have a full tree.
3. Future proofing in preparation for [EIP-4444](https://eips.ethereum.org/EIPS/eip-4444) as execution nodes will no longer be required to store logs permanently so we won't always have all historical logs available to us.

## More Details

Image to illustrate how the deposit contract merkle tree evolves and finalizes along with the resulting `DepositTreeSnapshot`
![image](https://user-images.githubusercontent.com/37123614/151465302-5fc56284-8a69-4998-b20e-45db3934ac70.png)

## Other Considerations

I've changed the structure of the `SszDepositCache` so once you load & save your database from this version of lighthouse, you will no longer be able to load it from older versions.

Co-authored-by: ethDreamer <37123614+ethDreamer@users.noreply.github.com>
2022-10-30 04:04:24 +00:00
..
beacon_chain Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
builder_client Builder Specs v0.2.0 (#3134) 2022-07-30 00:22:37 +00:00
client Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
eth1 Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
execution_layer Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
genesis Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
http_api Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
http_metrics Support IPv6 in BN and VC HTTP APIs (#3104) 2022-03-24 00:04:49 +00:00
lighthouse_network Update discv5 (#3171) 2022-10-28 05:40:06 +00:00
network [DEV FEATURE] Deterministic long lived subnets (#3453) 2022-10-04 10:37:48 +00:00
operation_pool Refactor op pool for speed and correctness (#3312) 2022-08-29 09:10:26 +00:00
src beacon_node: add --disable-deposit-contract-sync flag (#3597) 2022-10-19 22:55:49 +00:00
store Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
tests Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
timer Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
Cargo.toml Release v3.2.1 (#3660) 2022-10-26 09:38:25 +00:00