mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-04 05:14:33 +00:00
fix(http_api): ignore committee_index in attestation data endpoint (#9437)
Co-Authored-By: Vansh Sahay <vansh.sahay1234@gmail.com> Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>
This commit is contained in:
@@ -277,8 +277,10 @@ pub fn get_validator_attestation_data<T: BeaconChainTypes>(
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Always use committee_index 0 regardless of the query parameter, since
|
||||||
|
// attestation data does not depend on the committee index post-Electra.
|
||||||
chain
|
chain
|
||||||
.produce_unaggregated_attestation(query.slot, query.committee_index)
|
.produce_unaggregated_attestation(query.slot, 0)
|
||||||
.map(|attestation| attestation.data().clone())
|
.map(|attestation| attestation.data().clone())
|
||||||
.map(GenericResponse::from)
|
.map(GenericResponse::from)
|
||||||
.map_err(warp_utils::reject::unhandled_error)
|
.map_err(warp_utils::reject::unhandled_error)
|
||||||
|
|||||||
@@ -4856,6 +4856,19 @@ impl ApiTester {
|
|||||||
assert_eq!(result, expected);
|
assert_eq!(result, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The committee_index in the response must always be 0 post-Electra,
|
||||||
|
// regardless of the query parameter.
|
||||||
|
let committee_count = state.get_committee_count_at_slot(slot).unwrap();
|
||||||
|
if committee_count > 0 {
|
||||||
|
let result = self
|
||||||
|
.client
|
||||||
|
.get_validator_attestation_data(slot, 1)
|
||||||
|
.await
|
||||||
|
.unwrap()
|
||||||
|
.data;
|
||||||
|
assert_eq!(result.index, 0);
|
||||||
|
}
|
||||||
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user