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:
Mac L
2026-03-16 07:53:22 +03:00
committed by GitHub
parent 6ca610d918
commit 4eecca6da7
3 changed files with 124 additions and 12 deletions

View File

@@ -1802,7 +1802,7 @@ impl BeaconNodeHttpClient {
&self,
block_id: BlockId,
validators: &[ValidatorId],
) -> Result<GenericResponse<Vec<SyncCommitteeReward>>, Error> {
) -> Result<ExecutionOptimisticFinalizedResponse<Vec<SyncCommitteeReward>>, Error> {
let mut path = self.eth_path(V1)?;
path.path_segments_mut()
@@ -1819,7 +1819,7 @@ impl BeaconNodeHttpClient {
pub async fn get_beacon_rewards_blocks(
&self,
block_id: BlockId,
) -> Result<GenericResponse<StandardBlockReward>, Error> {
) -> Result<ExecutionOptimisticFinalizedResponse<StandardBlockReward>, Error> {
let mut path = self.eth_path(V1)?;
path.path_segments_mut()
@@ -1837,7 +1837,7 @@ impl BeaconNodeHttpClient {
&self,
epoch: Epoch,
validators: &[ValidatorId],
) -> Result<StandardAttestationRewards, Error> {
) -> Result<ExecutionOptimisticFinalizedResponse<StandardAttestationRewards>, Error> {
let mut path = self.eth_path(V1)?;
path.path_segments_mut()