lighthouse/beacon_node
Michael Sproul 99d2c33387 Avoid looking up pre-finalization blocks (#2909)
## Issue Addressed

This PR fixes the unnecessary `WARN Single block lookup failed` messages described here:

https://github.com/sigp/lighthouse/pull/2866#issuecomment-1008442640

## Proposed Changes

Add a new cache to the `BeaconChain` that tracks the block roots of blocks from before finalization. These could be blocks from the canonical chain (which might need to be read from disk), or old pre-finalization blocks that have been forked out.

The cache also stores a set of block roots for in-progress single block lookups, which duplicates some of the information from sync's `single_block_lookups` hashmap:

a836e180f9/beacon_node/network/src/sync/manager.rs (L192-L196)

On a live node you can confirm that the cache is working by grepping logs for the message: `Rejected attestation to finalized block`.
2022-01-27 22:58:32 +00:00
..
beacon_chain Avoid looking up pre-finalization blocks (#2909) 2022-01-27 22:58:32 +00:00
client Removed all disable_forks (#2925) 2022-01-20 09:14:26 +00:00
eth1 Bump crate versions (#2829) 2021-12-02 14:29:57 +11:00
execution_layer Rust 1.58 lints (#2906) 2022-01-13 22:39:58 +00:00
genesis Bump crate versions (#2829) 2021-12-02 14:29:57 +11:00
http_api Add API to compute discrete validator attestation performance (#2874) 2022-01-27 22:58:31 +00:00
http_metrics Additional networking metrics (#2549) 2021-12-22 06:17:14 +00:00
lighthouse_network Increase target subnet peers (#2948) 2022-01-24 12:08:00 +00:00
network Avoid looking up pre-finalization blocks (#2909) 2022-01-27 22:58:32 +00:00
operation_pool Implement API for block rewards (#2628) 2022-01-27 01:06:02 +00:00
src Update to spec v1.1.8 (#2893) 2022-01-19 00:24:19 +00:00
store Additional networking metrics (#2549) 2021-12-22 06:17:14 +00:00
tests Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
timer Update Lighthouse Dependencies (#2818) 2021-11-18 05:08:42 +00:00
Cargo.toml v2.1.1 (#2951) 2022-01-25 00:46:24 +00:00