lodestar icon indicating copy to clipboard operation
lodestar copied to clipboard

feat: add endpoint for Altair block reward

Open ensi321 opened this issue 1 year ago • 1 comments

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 finalized property 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
}

ensi321 avatar Dec 11 '23 10:12 ensi321

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 is 75.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     

codecov[bot] avatar Dec 11 '23 10:12 codecov[bot]

@wemeetagain Would love a second pass from you being merging this

ensi321 avatar Feb 20 '24 07:02 ensi321

:tada: This PR is included in v1.17.0 :tada:

wemeetagain avatar Mar 11 '24 15:03 wemeetagain