48f73b21e6
## 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. |
||
---|---|---|
.. | ||
attestation_verification.rs | ||
beacon_chain.rs | ||
beacon_fork_choice_store.rs | ||
beacon_snapshot.rs | ||
block_verification.rs | ||
builder.rs | ||
chain_config.rs | ||
errors.rs | ||
eth1_chain.rs | ||
events.rs | ||
head_tracker.rs | ||
lib.rs | ||
metrics.rs | ||
migrate.rs | ||
naive_aggregation_pool.rs | ||
observed_attestations.rs | ||
observed_attesters.rs | ||
observed_block_producers.rs | ||
observed_operations.rs | ||
persisted_beacon_chain.rs | ||
persisted_fork_choice.rs | ||
shuffling_cache.rs | ||
snapshot_cache.rs | ||
test_utils.rs | ||
timeout_rw_lock.rs | ||
validator_pubkey_cache.rs |