Merge unstable

This commit is contained in:
Eitan Seri-Levi
2025-02-02 00:18:00 +03:00
340 changed files with 10457 additions and 4957 deletions

View File

@@ -17,6 +17,7 @@ pub mod types;
use self::mixin::{RequestAccept, ResponseOptional};
use self::types::{Error as ResponseError, *};
use derivative::Derivative;
use either::Either;
use futures::Stream;
use futures_util::StreamExt;
use lighthouse_network::PeerId;
@@ -1330,7 +1331,7 @@ impl BeaconNodeHttpClient {
/// `POST v2/beacon/pool/attestations`
pub async fn post_beacon_pool_attestations_v2<E: EthSpec>(
&self,
attestations: &[Attestation<E>],
attestations: Either<Vec<Attestation<E>>, Vec<SingleAttestation>>,
fork_name: ForkName,
) -> Result<(), Error> {
let mut path = self.eth_path(V2)?;
@@ -1341,13 +1342,26 @@ impl BeaconNodeHttpClient {
.push("pool")
.push("attestations");
self.post_with_timeout_and_consensus_header(
path,
&attestations,
self.timeouts.attestation,
fork_name,
)
.await?;
match attestations {
Either::Right(attestations) => {
self.post_with_timeout_and_consensus_header(
path,
&attestations,
self.timeouts.attestation,
fork_name,
)
.await?;
}
Either::Left(attestations) => {
self.post_with_timeout_and_consensus_header(
path,
&attestations,
self.timeouts.attestation,
fork_name,
)
.await?;
}
};
Ok(())
}