Skip to content

Commit e38e04b

Browse files
Removed code for GET validator/blinded_blocks and also adjusted/removed tests for that endpoint
1 parent d509246 commit e38e04b

File tree

4 files changed

+223
-628
lines changed

4 files changed

+223
-628
lines changed

beacon_node/http_api/src/lib.rs

Lines changed: 1 addition & 33 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::beacon_response;
3838
use beacon_chain::{
3939
attestation_verification::VerifiedAttestation, observed_operations::ObservationOutcome,
@@ -253,8 +253,6 @@ pub fn prometheus_metrics() -> warp::filters::log::Log<impl Fn(warp::filters::lo
253253
.or_else(|| starts_with("v2/validator/aggregate_attestation"))
254254
.or_else(|| starts_with("v1/validator/attestation_data"))
255255
.or_else(|| starts_with("v1/validator/beacon_committee_subscriptions"))
256-
.or_else(|| starts_with("v1/validator/blinded_blocks"))
257-
.or_else(|| starts_with("v2/validator/blinded_blocks"))
258256
.or_else(|| starts_with("v1/validator/blocks"))
259257
.or_else(|| starts_with("v2/validator/blocks"))
260258
.or_else(|| starts_with("v3/validator/blocks"))
@@ -3422,35 +3420,6 @@ pub fn serve<T: BeaconChainTypes>(
34223420
},
34233421
);
34243422

3425-
// GET validator/blinded_blocks/{slot}
3426-
let get_validator_blinded_blocks = eth_v1
3427-
.and(warp::path("validator"))
3428-
.and(warp::path("blinded_blocks"))
3429-
.and(warp::path::param::<Slot>().or_else(|_| async {
3430-
Err(warp_utils::reject::custom_bad_request(
3431-
"Invalid slot".to_string(),
3432-
))
3433-
}))
3434-
.and(warp::path::end())
3435-
.and(not_while_syncing_filter.clone())
3436-
.and(warp::query::<api_types::ValidatorBlocksQuery>())
3437-
.and(warp::header::optional::<api_types::Accept>("accept"))
3438-
.and(task_spawner_filter.clone())
3439-
.and(chain_filter.clone())
3440-
.then(
3441-
|slot: Slot,
3442-
not_synced_filter: Result<(), Rejection>,
3443-
query: api_types::ValidatorBlocksQuery,
3444-
accept_header: Option<api_types::Accept>,
3445-
task_spawner: TaskSpawner<T::EthSpec>,
3446-
chain: Arc<BeaconChain<T>>| {
3447-
task_spawner.spawn_async_with_rejection(Priority::P0, async move {
3448-
not_synced_filter?;
3449-
produce_blinded_block_v2(accept_header, chain, slot, query).await
3450-
})
3451-
},
3452-
);
3453-
34543423
// GET validator/attestation_data?slot,committee_index
34553424
let get_validator_attestation_data = eth_v1
34563425
.and(warp::path("validator"))
@@ -4954,7 +4923,6 @@ pub fn serve<T: BeaconChainTypes>(
49544923
.uor(get_node_peer_count)
49554924
.uor(get_validator_duties_proposer)
49564925
.uor(get_validator_blocks)
4957-
.uor(get_validator_blinded_blocks)
49584926
.uor(get_validator_attestation_data)
49594927
.uor(get_validator_aggregate_attestation)
49604928
.uor(get_validator_sync_committee_contribution)

beacon_node/http_api/src/produce_block.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -127,35 +127,6 @@ pub fn build_response_v3<T: BeaconChainTypes>(
127127
}
128128
}
129129

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

0 commit comments

Comments
 (0)