lighthouse/common
Mac L 4c510f8f6b Add BlockTimesCache to allow additional block delay metrics (#2546)
## Issue Addressed

Closes #2528

## Proposed Changes

- Add `BlockTimesCache` to provide block timing information to `BeaconChain`. This allows additional metrics to be calculated for blocks that are set as head too late.
- Thread the `seen_timestamp` of blocks received from RPC responses (except blocks from syncing) through to the sync manager, similar to what is done for blocks from gossip.

## Additional Info

This provides the following additional metrics:
- `BEACON_BLOCK_OBSERVED_SLOT_START_DELAY_TIME`
  - The delay between the start of the slot and when the block was first observed.
- `BEACON_BLOCK_IMPORTED_OBSERVED_DELAY_TIME`
   - The delay between when the block was first observed and when the block was imported.
- `BEACON_BLOCK_HEAD_IMPORTED_DELAY_TIME`
  - The delay between when the block was imported and when the block was set as head.

The metric `BEACON_BLOCK_IMPORTED_SLOT_START_DELAY_TIME` was removed.

A log is produced when a block is set as head too late, e.g.:
```
Aug 27 03:46:39.006 DEBG Delayed head block                      set_as_head_delay: Some(21.731066ms), imported_delay: Some(119.929934ms), observed_delay: Some(3.864596988s), block_delay: 4.006257988s, slot: 1931331, proposer_index: 24294, block_root: 0x937602c89d3143afa89088a44bdf4b4d0d760dad082abacb229495c048648a9e, service: beacon
```
2021-09-30 04:31:41 +00:00
..
account_utils Update zeroize_derive (#2625) 2021-09-25 05:58:37 +00:00
clap_utils Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00
compare_fields Check for unused deps in CI (#1262) 2020-06-14 10:59:50 +10:00
compare_fields_derive Update external deps (#1711) 2020-10-05 08:22:19 +00:00
deposit_contract Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00
directory fix default network handling (#2029) 2020-12-08 05:41:10 +00:00
eth2 Add BlockTimesCache to allow additional block delay metrics (#2546) 2021-09-30 04:31:41 +00:00
eth2_config Improve ergonomics of adding a new network config (#2489) 2021-08-30 23:27:28 +00:00
eth2_interop_keypairs Fix nightly bump num bigint (#2591) 2021-09-12 23:55:20 +00:00
eth2_network_config Activate Altair on mainnet at epoch 74240 (#2632) 2021-09-27 04:22:06 +00:00
eth2_wallet_manager Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
fallback Improve eth1 fallback logging (#2490) 2021-08-30 00:51:26 +00:00
filesystem Update file permissions (#2499) 2021-09-03 02:41:10 +00:00
hashset_delay Upgrade dependencies (#2513) 2021-08-17 01:00:24 +00:00
lighthouse_metrics Web3Signer support for VC (#2522) 2021-09-16 03:26:33 +00:00
lighthouse_version v1.5.2 (#2595) 2021-09-13 23:01:19 +00:00
lockfile Enable Compatibility with Windows (#2333) 2021-05-19 23:05:16 +00:00
logging Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
lru_cache Keep track of failed head chains and prevent re-lookups (#1534) 2020-08-18 03:54:09 +00:00
malloc_utils Modify Malloc Tuning (#2398) 2021-06-09 02:30:06 +00:00
monitoring_api Upgrade dependencies (#2513) 2021-08-17 01:00:24 +00:00
sensitive_url Add SensitiveUrl to redact user secrets from endpoints (#2326) 2021-05-04 01:59:51 +00:00
slot_clock Validator monitor support for sync committees (#2476) 2021-08-31 23:31:36 +00:00
target_check Improve compilation error on 32-bit (#2424) 2021-06-30 04:56:22 +00:00
task_executor Web3Signer support for VC (#2522) 2021-09-16 03:26:33 +00:00
test_random_derive Update external deps (#1711) 2020-10-05 08:22:19 +00:00
validator_dir Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00
warp_utils Upgrade dependencies (#2513) 2021-08-17 01:00:24 +00:00
README.md Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00

eth2

Common crates containing eth2-specific logic.