lighthouse/beacon_node/http_api/src
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
..
attestation_performance.rs Add API to compute discrete validator attestation performance (#2874) 2022-01-27 22:58:31 +00:00
attester_duties.rs Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
block_id.rs Use the forwards iterator more often (#2376) 2021-05-31 04:18:20 +00:00
block_rewards.rs Implement API for block rewards (#2628) 2022-01-27 01:06:02 +00:00
database.rs Implement checkpoint sync (#2244) 2021-09-22 00:37:28 +00:00
lib.rs Add API to compute discrete validator attestation performance (#2874) 2022-01-27 22:58:31 +00:00
metrics.rs Metrics and DEBG log for late gossip blocks (#2533) 2021-08-23 00:59:14 +00:00
proposer_duties.rs Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
state_id.rs Fork schedule api (#2525) 2021-08-24 01:36:27 +00:00
sync_committees.rs Rename eth2_libp2p to lighthouse_network (#2702) 2021-10-19 00:30:39 +00:00
validator_inclusion.rs Validator monitor support for sync committees (#2476) 2021-08-31 23:31:36 +00:00
version.rs Add API version headers and map_fork_name! (#2745) 2021-10-28 01:18:04 +00:00