[Merged by Bors] - Add API to compute discrete validator attestation performance#2874
Closed
macladson wants to merge 7 commits intosigp:unstablefrom
Closed
[Merged by Bors] - Add API to compute discrete validator attestation performance#2874macladson wants to merge 7 commits intosigp:unstablefrom
macladson wants to merge 7 commits intosigp:unstablefrom
Conversation
michaelsproul
requested changes
Jan 17, 2022
Member
michaelsproul
left a comment
There was a problem hiding this comment.
Looks good on a first pass. Just a few perf improvements suggested 👌
michaelsproul
approved these changes
Jan 18, 2022
Member
michaelsproul
left a comment
There was a problem hiding this comment.
Happy to merge modulo one smol optimisation
Member
|
Will merge once v2.1.0 is released. |
michaelsproul
requested changes
Jan 18, 2022
|
Merge conflict. |
054536d to
8fc449b
Compare
Member
|
I think we're blocked on CLA assistant working again (or getting disabled) |
Member
Member
|
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Jan 27, 2022
## 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.
|
Pull request successfully merged into unstable. Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Alternatively, to compute performances for the global validator set:
Response
The response is JSON formatted as follows:
Additional Info
end_epochit's actually 101 epochs) to prevent Lighthouse using exceptionally large amounts of memory.