Merge branch 'unstable' of https://github.com/sigp/lighthouse into electra-focil

This commit is contained in:
Eitan Seri-Levi
2025-04-05 17:49:57 -07:00
84 changed files with 1358 additions and 1313 deletions

View File

@@ -7,7 +7,10 @@ pub mod sync_state;
use crate::{
lighthouse::sync_state::SyncState,
types::{DepositTreeSnapshot, Epoch, FinalizedExecutionBlock, GenericResponse, ValidatorId},
types::{
AdminPeer, DepositTreeSnapshot, Epoch, FinalizedExecutionBlock, GenericResponse,
ValidatorId,
},
BeaconNodeHttpClient, DepositData, Error, Eth1Data, Hash256, Slot,
};
use proto_array::core::ProtoArray;
@@ -365,6 +368,30 @@ impl BeaconNodeHttpClient {
self.post_with_response(path, &()).await
}
/// `POST lighthouse/add_peer`
pub async fn post_lighthouse_add_peer(&self, req: AdminPeer) -> Result<(), Error> {
let mut path = self.server.full.clone();
path.path_segments_mut()
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
.push("lighthouse")
.push("add_peer");
self.post_with_response(path, &req).await
}
/// `POST lighthouse/remove_peer`
pub async fn post_lighthouse_remove_peer(&self, req: AdminPeer) -> Result<(), Error> {
let mut path = self.server.full.clone();
path.path_segments_mut()
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
.push("lighthouse")
.push("remove_peer");
self.post_with_response(path, &req).await
}
/*
Analysis endpoints.
*/

View File

@@ -104,8 +104,8 @@ impl std::fmt::Display for SyncState {
match self {
SyncState::SyncingFinalized { .. } => write!(f, "Syncing Finalized Chain"),
SyncState::SyncingHead { .. } => write!(f, "Syncing Head Chain"),
SyncState::Synced { .. } => write!(f, "Synced"),
SyncState::Stalled { .. } => write!(f, "Stalled"),
SyncState::Synced => write!(f, "Synced"),
SyncState::Stalled => write!(f, "Stalled"),
SyncState::SyncTransition => write!(f, "Evaluating known peers"),
SyncState::BackFillSyncing { .. } => write!(f, "Syncing Historical Blocks"),
}

View File

@@ -1426,6 +1426,11 @@ pub struct ManualFinalizationRequestData {
pub block_root: Hash256,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct AdminPeer {
pub enr: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct LivenessRequestData {
pub epoch: Epoch,