mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 13:58:28 +00:00
Implement /lighthouse/custody/info API (#8276)
Closes: - https://github.com/sigp/lighthouse/issues/8249 New `/lighthouse/custody` API including: - [x] Earliest custodied data column slot - [x] Node CGC - [x] Custodied columns Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
mod attestation_performance;
|
||||
mod block_packing_efficiency;
|
||||
mod block_rewards;
|
||||
mod custody;
|
||||
pub mod sync_state;
|
||||
|
||||
use crate::{
|
||||
@@ -22,6 +23,7 @@ pub use block_packing_efficiency::{
|
||||
BlockPackingEfficiency, BlockPackingEfficiencyQuery, ProposerInfo, UniqueAttestation,
|
||||
};
|
||||
pub use block_rewards::{AttestationRewards, BlockReward, BlockRewardMeta, BlockRewardsQuery};
|
||||
pub use custody::CustodyInfo;
|
||||
|
||||
// Define "legacy" implementations of `Option<T>` which use four bytes for encoding the union
|
||||
// selector.
|
||||
@@ -193,6 +195,19 @@ impl BeaconNodeHttpClient {
|
||||
self.get(path).await
|
||||
}
|
||||
|
||||
/// `GET lighthouse/custody/info`
|
||||
pub async fn get_lighthouse_custody_info(&self) -> Result<CustodyInfo, Error> {
|
||||
let mut path = self.server.full.clone();
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
.push("lighthouse")
|
||||
.push("custody")
|
||||
.push("info");
|
||||
|
||||
self.get(path).await
|
||||
}
|
||||
|
||||
/*
|
||||
* Note:
|
||||
*
|
||||
|
||||
11
common/eth2/src/lighthouse/custody.rs
Normal file
11
common/eth2/src/lighthouse/custody.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use types::Slot;
|
||||
|
||||
#[derive(Debug, PartialEq, Deserialize, Serialize)]
|
||||
pub struct CustodyInfo {
|
||||
pub earliest_custodied_data_column_slot: Slot,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
pub custody_group_count: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64_vec")]
|
||||
pub custody_columns: Vec<u64>,
|
||||
}
|
||||
Reference in New Issue
Block a user