lodestar
lodestar copied to clipboard
feat: add endpoint for Altair block reward
Description Introduce a beacon API endpoint to return block reward info according to the spec. This is one of the three reward endpoints mentioned in #5694
Note that the endpoint currently only supports Altair block or later. Attempts to query for phase0 block will return error.
TODO Will open follow-up PRs for:
- Support block reward api for phase0 blocks
- Add
finalizedproperty to the reward response mentioning in #5693 which is currently blocked
Steps to test or reproduce
curl http://localhost:9596/eth/v1/beacon/rewards/blocks/head | jq
{
"data": {
"proposer_index": "0",
"total": "0",
"attestations": "0",
"sync_aggregate": "0",
"proposer_slashings": "0",
"attester_slashings": "0"
},
"execution_optimistic": false
}
Codecov Report
Merging #6178 (eceea02) into unstable (ed43a98) will increase coverage by
1.53%. Report is 59 commits behind head on unstable. The diff coverage is75.52%.
Additional details and impacted files
@@ Coverage Diff @@
## unstable #6178 +/- ##
============================================
+ Coverage 60.15% 61.69% +1.53%
============================================
Files 407 554 +147
Lines 46511 58090 +11579
Branches 1550 1832 +282
============================================
+ Hits 27980 35840 +7860
- Misses 18499 22213 +3714
- Partials 32 37 +5
@wemeetagain Would love a second pass from you being merging this
:tada: This PR is included in v1.17.0 :tada: