lighthouse/common
Mac L e05142b798 Add API to compute discrete validator attestation performance (#2874)
## Issue Addressed

N/A

## Proposed Changes

Add a HTTP API which can be used to compute the attestation performances of a validator (or all validators) over a discrete range of epochs.
Performances can be computed for a single validator, or for the global validator set. 

## Usage
### Request
The API can be used as follows:
```
curl "http://localhost:5052/lighthouse/analysis/attestation_performance/{validator_index}?start_epoch=57730&end_epoch=57732"
```
Alternatively, to compute performances for the global validator set:
```
curl "http://localhost:5052/lighthouse/analysis/attestation_performance/global?start_epoch=57730&end_epoch=57732"
```

### Response
The response is JSON formatted as follows:
```
[
  {
    "index": 72,
    "epochs": {
      "57730": {
        "active": true,
        "head": false,
        "target": false,
        "source": false
      },
      "57731": {
        "active": true,
        "head": true,
        "target": true,
        "source": true,
        "delay": 1
      },
      "57732": {
        "active": true,
        "head": true,
        "target": true,
        "source": true,
        "delay": 1
      },
    }
  }
]
```
> Note that the `"epochs"` are not guaranteed to be in ascending order. 

## Additional Info

- This API is intended to be used in our upcoming validator analysis tooling (#2873) and will likely not be very useful for regular users. Some advanced users or block explorers may find this API useful however.
- The request range is limited to 100 epochs (since the range is inclusive and it also computes the `end_epoch` it's actually 101 epochs) to prevent Lighthouse using exceptionally large amounts of memory.
2022-01-27 22:58:31 +00:00
..
account_utils Update zeroize_derive (#2625) 2021-09-25 05:58:37 +00:00
clap_utils Bump crate versions (#2829) 2021-12-02 14:29:57 +11: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 Bump crate versions (#2829) 2021-12-02 14:29:57 +11:00
directory Add background file logging (#2762) 2021-11-30 03:25:32 +00:00
eth2 Add API to compute discrete validator attestation performance (#2874) 2022-01-27 22:58:31 +00:00
eth2_config Remove unused deps (#2592) 2021-09-30 04:31:42 +00:00
eth2_interop_keypairs Fix nightly bump num bigint (#2591) 2021-09-12 23:55:20 +00:00
eth2_network_config Update to spec v1.1.8 (#2893) 2022-01-19 00:24:19 +00:00
eth2_wallet_manager Remove unused deps (#2592) 2021-09-30 04:31:42 +00:00
fallback Improve eth1 fallback logging (#2490) 2021-08-30 00:51:26 +00:00
filesystem Fix linting error on Windows (#2759) 2021-11-01 07:44:42 +00:00
hashset_delay Update Lighthouse Dependencies (#2818) 2021-11-18 05:08:42 +00:00
lighthouse_metrics Additional networking metrics (#2549) 2021-12-22 06:17:14 +00:00
lighthouse_version v2.1.1 (#2951) 2022-01-25 00:46:24 +00:00
lockfile 1.57.0 lints (#2850) 2021-12-03 04:44:30 +00:00
logging 1.57.0 lints (#2850) 2021-12-03 04:44:30 +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 Set mmap threshold to 128KB in malloc utils (#2937) 2022-01-26 23:14:24 +00:00
monitoring_api Fix metric name for monitoring (#2950) 2022-01-24 22:33:02 +00:00
sensitive_url Add SensitiveUrl to redact user secrets from endpoints (#2326) 2021-05-04 01:59:51 +00:00
slot_clock Avoid penalizing peers for delays during processing (#2894) 2022-01-12 02:36:24 +00:00
target_check Improve compilation error on 32-bit (#2424) 2021-06-30 04:56:22 +00:00
task_executor [Merge] Implement execution_layer (#2635) 2021-12-02 14:26:51 +11:00
test_random_derive Update external deps (#1711) 2020-10-05 08:22:19 +00:00
validator_dir 1.57.0 lints (#2850) 2021-12-03 04:44:30 +00:00
warp_utils Support duplicate keys in HTTP API query strings (#2908) 2022-01-20 09:14:19 +00:00
README.md Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00

eth2

Common crates containing eth2-specific logic.