POST /eth/v2/beacon/pool/attestations bugfixes (#6867)

This commit is contained in:
Eitan Seri-Levi
2025-01-31 03:20:44 +03:00
committed by GitHub
parent d47b3e3e43
commit 276eda3dfe
15 changed files with 160 additions and 63 deletions

View File

@@ -8,6 +8,7 @@ authors = ["Sigma Prime <contact@sigmaprime.io>"]
beacon_node_fallback = { workspace = true }
bls = { workspace = true }
doppelganger_service = { workspace = true }
either = { workspace = true }
environment = { workspace = true }
eth2 = { workspace = true }
futures = { workspace = true }

View File

@@ -1,5 +1,6 @@
use crate::duties_service::{DutiesService, DutyAndProof};
use beacon_node_fallback::{ApiTopic, BeaconNodeFallback};
use either::Either;
use environment::RuntimeContext;
use futures::future::join_all;
use slog::{crit, debug, error, info, trace, warn};
@@ -461,7 +462,7 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
.iter()
.zip(validator_indices)
.filter_map(|(a, i)| {
match a.to_single_attestation_with_attester_index(*i as usize) {
match a.to_single_attestation_with_attester_index(*i) {
Ok(a) => Some(a),
Err(e) => {
// This shouldn't happen unless BN and VC are out of sync with
@@ -479,8 +480,12 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
}
})
.collect::<Vec<_>>();
beacon_node
.post_beacon_pool_attestations_v2(&single_attestations, fork_name)
.post_beacon_pool_attestations_v2::<E>(
Either::Right(single_attestations),
fork_name,
)
.await
} else {
beacon_node