From 9dee7181537a488067eec8bbe673bf93545d0088 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 21 Apr 2023 03:40:10 +1000 Subject: [PATCH] Remove unused blob endpoint and types (#4209) --- common/eth2/src/lib.rs | 26 -------------------------- common/eth2/src/types.rs | 31 ------------------------------- 2 files changed, 57 deletions(-) diff --git a/common/eth2/src/lib.rs b/common/eth2/src/lib.rs index 5cd34faf2..9f7af3996 100644 --- a/common/eth2/src/lib.rs +++ b/common/eth2/src/lib.rs @@ -1443,32 +1443,6 @@ impl BeaconNodeHttpClient { self.get(path).await } - /// `GET v1/validator/blocks_and_blobs/{slot}` - pub async fn get_validator_blocks_and_blobs>( - &self, - slot: Slot, - randao_reveal: &SignatureBytes, - graffiti: Option<&Graffiti>, - ) -> Result>, Error> { - let mut path = self.eth_path(V1)?; - - path.path_segments_mut() - .map_err(|()| Error::InvalidUrl(self.server.clone()))? - .push("validator") - .push("blocks_and_blobs") - .push(&slot.to_string()); - - path.query_pairs_mut() - .append_pair("randao_reveal", &randao_reveal.to_string()); - - if let Some(graffiti) = graffiti { - path.query_pairs_mut() - .append_pair("graffiti", &graffiti.to_string()); - } - - self.get(path).await - } - /// `GET v2/validator/blinded_blocks/{slot}` pub async fn get_validator_blinded_blocks>( &self, diff --git a/common/eth2/src/types.rs b/common/eth2/src/types.rs index 3f4273730..36f80afd1 100644 --- a/common/eth2/src/types.rs +++ b/common/eth2/src/types.rs @@ -1218,37 +1218,6 @@ pub struct LivenessResponseData { pub is_live: bool, } -#[derive(PartialEq, Debug, Serialize, Deserialize)] -#[serde(bound = "T: EthSpec, Payload: AbstractExecPayload")] -pub struct BlocksAndBlobs> { - pub block: BeaconBlock, - pub blobs: Vec>, - pub kzg_aggregate_proof: KzgProof, -} - -impl> ForkVersionDeserialize - for BlocksAndBlobs -{ - fn deserialize_by_fork<'de, D: serde::Deserializer<'de>>( - value: serde_json::value::Value, - fork_name: ForkName, - ) -> Result { - #[derive(Deserialize)] - #[serde(bound = "T: EthSpec")] - struct Helper { - block: serde_json::Value, - blobs: Vec>, - kzg_aggregate_proof: KzgProof, - } - let helper: Helper = serde_json::from_value(value).map_err(serde::de::Error::custom)?; - - Ok(Self { - block: BeaconBlock::deserialize_by_fork::<'de, D>(helper.block, fork_name)?, - blobs: helper.blobs, - kzg_aggregate_proof: helper.kzg_aggregate_proof, - }) - } -} #[derive(Debug, Serialize, Deserialize)] pub struct ForkChoice { pub justified_checkpoint: Checkpoint,