lighthouse/beacon_node/beacon_chain/src
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
..
attestation_verification.rs Add check for head/target consistency (#1702) 2020-10-03 10:08:06 +10:00
beacon_chain.rs Address queue congestion in migrator (#1923) 2020-11-17 23:11:26 +00:00
beacon_fork_choice_store.rs Apply store refactor to new fork choice 2020-06-17 15:20:44 +10:00
beacon_snapshot.rs Add no-copy block processing cache (#863) 2020-04-06 10:53:33 +10:00
block_verification.rs Implement database temp states to reduce memory usage (#1798) 2020-10-23 01:27:51 +00:00
builder.rs fix genesis state root provided to HTTP server (#1783) 2020-10-21 23:15:30 +00:00
chain_config.rs Implement database temp states to reduce memory usage (#1798) 2020-10-23 01:27:51 +00:00
errors.rs Weak subjectivity start from genesis (#1675) 2020-10-03 10:00:28 +10:00
eth1_chain.rs Expand eth1 block cache, add more logs (#1938) 2020-11-21 00:26:15 +00:00
events.rs Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00
head_tracker.rs Fix head tracker concurrency bugs (#1771) 2020-10-19 05:58:39 +00:00
lib.rs Fix head tracker concurrency bugs (#1771) 2020-10-19 05:58:39 +00:00
metrics.rs Fix head tracker concurrency bugs (#1771) 2020-10-19 05:58:39 +00:00
migrate.rs Address queue congestion in migrator (#1923) 2020-11-17 23:11:26 +00:00
naive_aggregation_pool.rs Implement standard eth2.0 API (#1569) 2020-10-01 11:12:36 +10:00
observed_attestations.rs Move long-running tests to dbg (#1137) 2020-05-13 10:55:02 +10:00
observed_attesters.rs Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00
observed_block_producers.rs Add attestation gossip pre-verification (#983) 2020-05-06 21:42:56 +10:00
observed_operations.rs Process exits and slashings off the network (#1253) 2020-06-18 21:06:34 +10:00
persisted_beacon_chain.rs Fix head tracker concurrency bugs (#1771) 2020-10-19 05:58:39 +00:00
persisted_fork_choice.rs v0.12 fork choice update (#1229) 2020-06-17 11:10:22 +10:00
shuffling_cache.rs Implement standard eth2.0 API (#1569) 2020-10-01 11:12:36 +10:00
snapshot_cache.rs Support multiple BLS implementations (#1335) 2020-07-25 02:03:18 +00:00
test_utils.rs Implement database temp states to reduce memory usage (#1798) 2020-10-23 01:27:51 +00:00
timeout_rw_lock.rs Add timeouts to canonical head rwlock (#759) 2020-01-06 17:30:37 +11:00
validator_pubkey_cache.rs Allow truncation of pubkey cache on creation (#1686) 2020-09-30 04:42:52 +00:00