sigp / lighthouse

Ethereum consensus client in Rust
https://lighthouse.sigmaprime.io/
Apache License 2.0
2.93k stars 745 forks source link

getAttestationsRewards (POST /eth/v1/beacon/rewards/attestations/{epoch}) does not include finalized flag #4509

Open jcracknell opened 1 year ago

jcracknell commented 1 year ago

The response from this endpoint does not currently include the finalized flag:

https://ethereum.github.io/beacon-APIs/#/Beacon/getAttestationsRewards

https://github.com/sigp/lighthouse/blob/dfcb3363c757671eb19d5f8e519b4b94ac74677a/beacon_node/http_api/src/lib.rs#L2075-L2077

Is this intentional because of performance implications, or was it accidentally omitted?

michaelsproul commented 1 year ago

Thanks for opening the issue!

The finalized tag was added around the same time as the rewards APIs and we intended to come back and add it for them. The perf implications shouldn't be severe

Let's leave this issue open so we can track it

muang0 commented 1 year ago

I'd like to take a crack at this one assuming it's ok with @michaelsproul @jimmygchen

Gua00va commented 1 year ago

I would like to work on this if this is still open

jimmygchen commented 1 year ago

Yep, this is still open! Thanks @Gua00va

Gua00va commented 12 months ago

@jimmygchen, finalization refers to block finalization here, right? Or does it refer to state finalization?

Yep, this is still open! Thanks @Gua00va

jimmygchen commented 12 months ago

Hi @Gua00va

finalized field schema from the Beacon API spec:

True if the response references the finalized history of the chain, as determined by fork choice.

In this scenario you're computing the rewards from the state, so finalized in the response would represent whether this state you're using to compute rewards is finalized. Hope this helps.