diff --git a/beacon_node/rest_api/src/lib.rs b/beacon_node/rest_api/src/lib.rs index b269bd476a..2c7b90e3f0 100644 --- a/beacon_node/rest_api/src/lib.rs +++ b/beacon_node/rest_api/src/lib.rs @@ -170,7 +170,7 @@ pub fn start_server( validator::get_new_beacon_block::(req) } (&Method::POST, "/beacon/validator/block") => { - validator::publish_beacon_block::(req) + helpers::implementation_pending_response(req) } (&Method::GET, "/beacon/validator/attestation") => { validator::get_new_attestation::(req) diff --git a/beacon_node/rest_api/src/validator.rs b/beacon_node/rest_api/src/validator.rs index 427f6a5145..bbc9761755 100644 --- a/beacon_node/rest_api/src/validator.rs +++ b/beacon_node/rest_api/src/validator.rs @@ -184,55 +184,6 @@ pub fn get_new_beacon_block(req: Request) - Ok(success_response(body)) } -/// HTTP Handler to accept a validator-signed BeaconBlock, and publish it to the network. -pub fn publish_beacon_block(req: Request) -> ApiResult { - let beacon_chain = get_beacon_chain_from_request::(&req)?; - - let query = UrlQuery::from_request(&req)?; - let slot = match query.first_of(&["slot"]) { - Ok((_, v)) => Slot::new(v.parse::().map_err(|e| { - ApiError::InvalidQueryParams(format!("Invalid slot parameter, must be a u64. {:?}", e)) - })?), - Err(e) => { - return Err(e); - } - }; - let randao_reveal = match query.first_of(&["randao_reveal"]) { - Ok((_, v)) => Signature::from_bytes( - hex::decode(&v) - .map_err(|e| { - ApiError::InvalidQueryParams(format!( - "Invalid hex string for randao_reveal: {:?}", - e - )) - })? - .as_slice(), - ) - .map_err(|e| { - ApiError::InvalidQueryParams(format!("randao_reveal is not a valid signature: {:?}", e)) - })?, - Err(e) => { - return Err(e); - } - }; - - let new_block = match beacon_chain.produce_block(randao_reveal, slot) { - Ok((block, _state)) => block, - Err(e) => { - return Err(ApiError::ServerError(format!( - "Beacon node is not able to produce a block: {:?}", - e - ))); - } - }; - - let body = Body::from( - serde_json::to_string(&new_block) - .expect("We should always be able to serialize a new block that we produced."), - ); - Ok(success_response(body)) -} - /// HTTP Handler to produce a new Attestation from the current state, ready to be signed by a validator. pub fn get_new_attestation(req: Request) -> ApiResult { let beacon_chain = get_beacon_chain_from_request::(&req)?;