lighthouse/lighthouse/tests
Michael Sproul 47d57a290b Improve eth1 block cache sync (for Ropsten) (#3234)
## Issue Addressed

Fix for the eth1 cache sync issue observed on Ropsten.

## Proposed Changes

Ropsten blocks are so infrequent that they broke our algorithm for downloading eth1 blocks. We currently try to download forwards from the last block in our cache to the block with block number [`remote_highest_block - FOLLOW_DISTANCE + FOLLOW_DISTANCE / ETH1_BLOCK_TIME_TOLERANCE_FACTOR`](6f732986f1/beacon_node/eth1/src/service.rs (L489-L492)). With the tolerance set to 4 this is insufficient because we lag by 1536 blocks, which is more like ~14 hours on Ropsten. This results in us having an incomplete eth1 cache, because we should cache all blocks between -16h and -8h. Even if we were to set the tolerance to 2 for the largest allowance, we would only look back 1024 blocks which is still more than 8 hours.

For example consider this block https://ropsten.etherscan.io/block/12321390. The block from 1536 blocks earlier is 14 hours and 20 minutes before it: https://ropsten.etherscan.io/block/12319854. The block from 1024 blocks earlier is https://ropsten.etherscan.io/block/12320366, 8 hours and 48 minutes before.

- This PR introduces a new CLI flag called `--eth1-cache-follow-distance` which can be used to set the distance manually.
- A new dynamic catchup mechanism is added which detects when the cache is lagging the true eth1 chain and tries to download more blocks within the follow distance in order to catch up.
2022-06-03 06:05:03 +00:00
..
account_manager.rs Updates to tests and local testnet for Ganache 7 (#3056) 2022-03-20 22:48:14 +00:00
beacon_node.rs Improve eth1 block cache sync (for Ropsten) (#3234) 2022-06-03 06:05:03 +00:00
boot_node.rs Engine API v1.0.0.alpha.6 + interop tests (#3024) 2022-02-17 21:47:06 +00:00
exec.rs Enforce Optimistic Sync Conditions & CLI Tests (v2) (#3050) 2022-03-01 22:56:47 +00:00
main.rs Add regression tests for boot_node (#2749) 2021-11-08 01:37:58 +00:00
validator_client.rs Support IPv6 in BN and VC HTTP APIs (#3104) 2022-03-24 00:04:49 +00:00