lighthouse/beacon_node
Paul Hauner 48f73b21e6 Expand eth1 block cache, add more logs (#1938)
## Issue Addressed

NA

## Proposed Changes

- Caches later blocks than is required by `ETH1_FOLLOW_DISTANCE`.
- Adds logging to `warn` if the eth1 cache is insufficiently primed.
- Use `max_by_key` instead of `max_by` in `BeaconChain::Eth1Chain` since it's simpler.
- Rename `voting_period_start_timestamp` to `voting_target_timestamp` for accuracy.

## Additional Info

The reason for eating into the `ETH1_FOLLOW_DISTANCE` and caching blocks that are closer to the head is due to possibility for `SECONDS_PER_ETH1_BLOCK` to be incorrect (as is the case for the Pyrmont testnet on Goerli).

If `SECONDS_PER_ETH1_BLOCK` is too short, we'll skip back too far from the head and skip over blocks that would be valid [`is_candidate_block`](https://github.com/ethereum/eth2.0-specs/blob/v1.0.0/specs/phase0/validator.md#eth1-data) blocks. This was the case on the Pyrmont testnet and resulted in Lighthouse choosing blocks that were about 30 minutes older than is ideal.
2020-11-21 00:26:15 +00:00
..
beacon_chain Expand eth1 block cache, add more logs (#1938) 2020-11-21 00:26:15 +00:00
client Expand eth1 block cache, add more logs (#1938) 2020-11-21 00:26:15 +00:00
eth1 Expand eth1 block cache, add more logs (#1938) 2020-11-21 00:26:15 +00:00
eth2_libp2p Add additional libp2p tests (#1867) 2020-11-19 22:32:09 +00:00
genesis Return eth1-related data via the API (#1797) 2020-11-02 00:37:30 +00:00
http_api Update pool/attestations and committees endpoints (#1899) 2020-11-18 23:31:39 +00:00
http_metrics Support pre-flight CORS check (#1772) 2020-10-22 04:47:27 +00:00
network Move some rpc processing to the beacon_processor (#1936) 2020-11-19 23:33:44 +00:00
operation_pool Update pool/attestations and committees endpoints (#1899) 2020-11-18 23:31:39 +00:00
src Expand eth1 block cache, add more logs (#1938) 2020-11-21 00:26:15 +00:00
store Refine compaction (#1916) 2020-11-17 09:10:53 +00:00
tests Implement standard eth2.0 API (#1569) 2020-10-01 11:12:36 +10:00
timer Upgrade discovery and restructure task execution (#1693) 2020-10-05 18:45:54 +11:00
websocket_server Update external deps (#1711) 2020-10-05 08:22:19 +00:00
Cargo.toml Bump to v0.3.5 (#1927) 2020-11-18 00:44:28 +00:00