lighthouse/beacon_node/beacon_chain
Michael Sproul efebf712dd Avoid cloning snapshots during sync (#3271)
## Issue Addressed

Closes https://github.com/sigp/lighthouse/issues/2944

## Proposed Changes

Remove snapshots from the cache during sync rather than cloning them. This reduces unnecessary cloning and memory fragmentation during sync.

## Additional Info

This PR relies on the fact that the `block_delay` cache is not populated for blocks from sync. Relying on block delay may have the side effect that a change in `block_delay` calculation could lead to: a) more clones, if block delays are added for syncing blocks or b) less clones, if blocks near the head are erroneously provided without a `block_delay`. Case (a) would be a regression to the current status quo, and (b) is low-risk given we know that the snapshot cache is current susceptible to misses (hence `tree-states`).
2022-06-20 23:20:29 +00:00
..
src Avoid cloning snapshots during sync (#3271) 2022-06-20 23:20:29 +00:00
tests Prevent attestation to future blocks from early attester cache (#3183) 2022-05-17 01:51:25 +00:00
Cargo.toml Allow TaskExecutor to be used in async tests (#3178) 2022-05-16 08:35:59 +00:00