lighthouse-pulse/beacon_node
Michael Sproul 3be41006a6 Add --light-client-server flag and state cache utils (#3714)
## Issue Addressed

Part of https://github.com/sigp/lighthouse/issues/3651.

## Proposed Changes

Add a flag for enabling the light client server, which should be checked before gossip/RPC traffic is processed (e.g. https://github.com/sigp/lighthouse/pull/3693, https://github.com/sigp/lighthouse/pull/3711). The flag is available at runtime from `beacon_chain.config.enable_light_client_server`.

Additionally, a new method `BeaconChain::with_mutable_state_for_block` is added which I envisage being used for computing light client updates. Unfortunately its performance will be quite poor on average because it will only run quickly with access to the tree hash cache. Each slot the tree hash cache is only available for a brief window of time between the head block being processed and the state advance at 9s in the slot. When the state advance happens the cache is moved and mutated to get ready for the next slot, which makes it no longer useful for merkle proofs related to the head block. Rather than spend more time trying to optimise this I think we should continue prototyping with this code, and I'll make sure `tree-states` is ready to ship before we enable the light client server in prod (cf. https://github.com/sigp/lighthouse/pull/3206).

## Additional Info

I also fixed a bug in the implementation of `BeaconState::compute_merkle_proof` whereby the tree hash cache was moved with `.take()` but never put back with `.restore()`.
2022-11-11 11:03:18 +00:00
..
beacon_chain Add --light-client-server flag and state cache utils (#3714) 2022-11-11 11:03:18 +00:00
builder_client Builder Specs v0.2.0 (#3134) 2022-07-30 00:22:37 +00:00
client add checkpoint-sync-url-timeout flag (#3710) 2022-11-11 00:38:28 +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 Blinded block and RANDAO APIs (#3571) 2022-11-11 00:38:27 +00:00
http_metrics Support IPv6 in BN and VC HTTP APIs (#3104) 2022-03-24 00:04:49 +00:00
lighthouse_network Fix rust 1.65 lints (#3682) 2022-11-04 07:43:43 +00:00
network Blocklookup data inconsistencies (#3677) 2022-11-07 06:48:34 +00:00
operation_pool Fix rust 1.65 lints (#3682) 2022-11-04 07:43:43 +00:00
src Add --light-client-server flag and state cache utils (#3714) 2022-11-11 11:03:18 +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