Skip to content

Commit b0b57b5

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

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,
@@ -256,8 +256,6 @@ pub fn prometheus_metrics() -> warp::filters::log::Log<impl Fn(warp::filters::lo
256256
.or_else(|| starts_with("v2/validator/aggregate_attestation"))
257257
.or_else(|| starts_with("v1/validator/attestation_data"))
258258
.or_else(|| starts_with("v1/validator/beacon_committee_subscriptions"))
259-
.or_else(|| starts_with("v1/validator/blinded_blocks"))
260-
.or_else(|| starts_with("v2/validator/blinded_blocks"))
261259
.or_else(|| starts_with("v1/validator/blocks"))
262260
.or_else(|| starts_with("v2/validator/blocks"))
263261
.or_else(|| starts_with("v3/validator/blocks"))
@@ -3430,35 +3428,6 @@ pub fn serve<T: BeaconChainTypes>(
34303428
},
34313429
);
34323430

3433-
// GET validator/blinded_blocks/{slot}
3434-
let get_validator_blinded_blocks = eth_v1
3435-
.and(warp::path("validator"))
3436-
.and(warp::path("blinded_blocks"))
3437-
.and(warp::path::param::<Slot>().or_else(|_| async {
3438-
Err(warp_utils::reject::custom_bad_request(
3439-
"Invalid slot".to_string(),
3440-
))
3441-
}))
3442-
.and(warp::path::end())
3443-
.and(not_while_syncing_filter.clone())
3444-
.and(warp::query::<api_types::ValidatorBlocksQuery>())
3445-
.and(warp::header::optional::<api_types::Accept>("accept"))
3446-
.and(task_spawner_filter.clone())
3447-
.and(chain_filter.clone())
3448-
.then(
3449-
|slot: Slot,
3450-
not_synced_filter: Result<(), Rejection>,
3451-
query: api_types::ValidatorBlocksQuery,
3452-
accept_header: Option<api_types::Accept>,
3453-
task_spawner: TaskSpawner<T::EthSpec>,
3454-
chain: Arc<BeaconChain<T>>| {
3455-
task_spawner.spawn_async_with_rejection(Priority::P0, async move {
3456-
not_synced_filter?;
3457-
produce_blinded_block_v2(accept_header, chain, slot, query).await
3458-
})
3459-
},
3460-
);
3461-
34623431
// GET validator/attestation_data?slot,committee_index
34633432
let get_validator_attestation_data = eth_v1
34643433
.and(warp::path("validator"))
@@ -4919,7 +4888,6 @@ pub fn serve<T: BeaconChainTypes>(
49194888
.uor(get_node_peer_count)
49204889
.uor(get_validator_duties_proposer)
49214890
.uor(get_validator_blocks)
4922-
.uor(get_validator_blinded_blocks)
49234891
.uor(get_validator_attestation_data)
49244892
.uor(get_validator_aggregate_attestation)
49254893
.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)