Skip to content

Commit 0d463bd

Browse files
Removed code for GET validator/blinded_blocks and also adjusted/removed tests for that endpoint
1 parent 1853d83 commit 0d463bd

File tree

4 files changed

+223
-630
lines changed

4 files changed

+223
-630
lines changed

beacon_node/http_api/src/lib.rs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mod validator_inclusion;
3333
mod validators;
3434
mod version;
3535
use crate::light_client::{get_light_client_bootstrap, get_light_client_updates};
36-
use crate::produce_block::{produce_blinded_block_v2, produce_block_v2, produce_block_v3};
36+
use crate::produce_block::{produce_block_v2, produce_block_v3};
3737
use crate::version::fork_versioned_response;
3838
use beacon_chain::{
3939
attestation_verification::VerifiedAttestation, observed_operations::ObservationOutcome,
@@ -257,8 +257,6 @@ pub fn prometheus_metrics() -> warp::filters::log::Log<impl Fn(warp::filters::lo
257257
.or_else(|| starts_with("v2/validator/aggregate_attestation"))
258258
.or_else(|| starts_with("v1/validator/attestation_data"))
259259
.or_else(|| starts_with("v1/validator/beacon_committee_subscriptions"))
260-
.or_else(|| starts_with("v1/validator/blinded_blocks"))
261-
.or_else(|| starts_with("v2/validator/blinded_blocks"))
262260
.or_else(|| starts_with("v1/validator/blocks"))
263261
.or_else(|| starts_with("v2/validator/blocks"))
264262
.or_else(|| starts_with("v3/validator/blocks"))
@@ -3377,36 +3375,6 @@ pub fn serve<T: BeaconChainTypes>(
33773375
},
33783376
);
33793377

3380-
// GET validator/blinded_blocks/{slot}
3381-
let get_validator_blinded_blocks = eth_v1
3382-
.and(warp::path("validator"))
3383-
.and(warp::path("blinded_blocks"))
3384-
.and(warp::path::param::<Slot>().or_else(|_| async {
3385-
Err(warp_utils::reject::custom_bad_request(
3386-
"Invalid slot".to_string(),
3387-
))
3388-
}))
3389-
.and(warp::path::end())
3390-
.and(not_while_syncing_filter.clone())
3391-
.and(warp::query::<api_types::ValidatorBlocksQuery>())
3392-
.and(warp::header::optional::<api_types::Accept>("accept"))
3393-
.and(task_spawner_filter.clone())
3394-
.and(chain_filter.clone())
3395-
.then(
3396-
|slot: Slot,
3397-
not_synced_filter: Result<(), Rejection>,
3398-
query: api_types::ValidatorBlocksQuery,
3399-
accept_header: Option<api_types::Accept>,
3400-
task_spawner: TaskSpawner<T::EthSpec>,
3401-
chain: Arc<BeaconChain<T>>| {
3402-
task_spawner.spawn_async_with_rejection(Priority::P0, async move {
3403-
not_synced_filter?;
3404-
produce_blinded_block_v2(EndpointVersion(2), accept_header, chain, slot, query)
3405-
.await
3406-
})
3407-
},
3408-
);
3409-
34103378
// GET validator/attestation_data?slot,committee_index
34113379
let get_validator_attestation_data = eth_v1
34123380
.and(warp::path("validator"))
@@ -4867,7 +4835,6 @@ pub fn serve<T: BeaconChainTypes>(
48674835
.uor(get_node_peer_count)
48684836
.uor(get_validator_duties_proposer)
48694837
.uor(get_validator_blocks)
4870-
.uor(get_validator_blinded_blocks)
48714838
.uor(get_validator_attestation_data)
48724839
.uor(get_validator_aggregate_attestation)
48734840
.uor(get_validator_sync_committee_contribution)

beacon_node/http_api/src/produce_block.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -128,36 +128,6 @@ pub fn build_response_v3<T: BeaconChainTypes>(
128128
}
129129
}
130130

131-
pub async fn produce_blinded_block_v2<T: BeaconChainTypes>(
132-
endpoint_version: EndpointVersion,
133-
accept_header: Option<api_types::Accept>,
134-
chain: Arc<BeaconChain<T>>,
135-
slot: Slot,
136-
query: api_types::ValidatorBlocksQuery,
137-
) -> Result<Response<Body>, warp::Rejection> {
138-
let randao_reveal = query.randao_reveal.decompress().map_err(|e| {
139-
warp_utils::reject::custom_bad_request(format!(
140-
"randao reveal is not a valid BLS signature: {:?}",
141-
e
142-
))
143-
})?;
144-
145-
let randao_verification = get_randao_verification(&query, randao_reveal.is_infinity())?;
146-
let block_response_type = chain
147-
.produce_block_with_verification(
148-
randao_reveal,
149-
slot,
150-
query.graffiti,
151-
randao_verification,
152-
None,
153-
BlockProductionVersion::BlindedV2,
154-
)
155-
.await
156-
.map_err(warp_utils::reject::unhandled_error)?;
157-
158-
build_response_v2(chain, block_response_type, endpoint_version, accept_header)
159-
}
160-
161131
pub async fn produce_block_v2<T: BeaconChainTypes>(
162132
endpoint_version: EndpointVersion,
163133
accept_header: Option<api_types::Accept>,

0 commit comments

Comments
 (0)