mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 21:08:32 +00:00
Update /rewards endpoints to match spec (#8967)
I believe one of our rewards endpoints is slightly out of spec. We do not return the `finalized` status for `post_beacon_rewards_attestations`. Additionally, the `eth2` client doesn't expect the correct wrapper types for some other endpoints. - Update `post_beacon_rewards_attestations` server implementation to match spec. - Update all three client functions in `eth2` to the correct wrapper type. - Add missing tests for `http_api` to detect any regressions. Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
@@ -1801,8 +1801,16 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
let execution_optimistic =
|
||||
chain.is_optimistic_or_invalid_head().unwrap_or_default();
|
||||
|
||||
Ok(api_types::GenericResponse::from(attestation_rewards))
|
||||
.map(|resp| resp.add_execution_optimistic(execution_optimistic))
|
||||
let finalized = epoch + 2
|
||||
<= chain
|
||||
.canonical_head
|
||||
.cached_head()
|
||||
.finalized_checkpoint()
|
||||
.epoch;
|
||||
|
||||
Ok(api_types::GenericResponse::from(attestation_rewards)).map(|resp| {
|
||||
resp.add_execution_optimistic_finalized(execution_optimistic, finalized)
|
||||
})
|
||||
})
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user