Add post attestation v2 endpoint logic to attestation service

This commit is contained in:
Eitan Seri-Levi
2024-12-13 21:51:35 +07:00
parent 366bed3a41
commit 68292ad9dd
3 changed files with 134 additions and 73 deletions

View File

@@ -457,8 +457,11 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
&[validator_metrics::ATTESTATIONS_HTTP_POST],
);
if fork_name.electra_enabled() {
let single_attestations = attestations.iter().zip(validator_indices).filter_map(|(a, i)| {
a.to_single_attestation_with_attester_index(*i as usize).ok()
}).collect::<Vec<_>>();
beacon_node
.post_beacon_pool_attestations_v2(attestations, fork_name)
.post_beacon_pool_attestations_v2::<E>(&single_attestations, fork_name)
.await
} else {
beacon_node