Merge branch 'single_attestation' of https://github.com/eserilev/lighthouse into electra-devnet-5

This commit is contained in:
Eitan Seri-Levi
2025-01-07 19:53:44 +07:00
13 changed files with 73 additions and 58 deletions

View File

@@ -36,7 +36,6 @@ use std::future::Future;
use std::path::PathBuf;
use std::time::Duration;
use store::fork_versioned_response::ExecutionOptimisticFinalizedForkVersionedResponse;
use types::attestation::SingleAttestation;
pub const V1: EndpointVersion = EndpointVersion(1);
pub const V2: EndpointVersion = EndpointVersion(2);

View File

@@ -5,7 +5,6 @@ use crate::{
Error as ServerError, CONSENSUS_BLOCK_VALUE_HEADER, CONSENSUS_VERSION_HEADER,
EXECUTION_PAYLOAD_BLINDED_HEADER, EXECUTION_PAYLOAD_VALUE_HEADER,
};
use attestation::SingleAttestation;
use lighthouse_network::{ConnectionDirection, Enr, Multiaddr, PeerConnectionStatus};
use mediatype::{names, MediaType, MediaTypeList};
use reqwest::header::HeaderMap;
@@ -1161,6 +1160,11 @@ impl<E: EthSpec> EventKind<E> {
"attestation" => Ok(EventKind::Attestation(serde_json::from_str(data).map_err(
|e| ServerError::InvalidServerSentEvent(format!("Attestation: {:?}", e)),
)?)),
"single_attestation" => Ok(EventKind::SingleAttestation(
serde_json::from_str(data).map_err(|e| {
ServerError::InvalidServerSentEvent(format!("SingleAttestation: {:?}", e))
})?,
)),
"block" => Ok(EventKind::Block(serde_json::from_str(data).map_err(
|e| ServerError::InvalidServerSentEvent(format!("Block: {:?}", e)),
)?)),