diff --git a/zebra-rpc/src/config.rs b/zebra-rpc/src/config.rs index f2adb66d10f..2a91d14334b 100644 --- a/zebra-rpc/src/config.rs +++ b/zebra-rpc/src/config.rs @@ -54,6 +54,8 @@ pub struct Config { /// We keep it just for backward compatibility but it actually do nothing. /// It was something configurable when the RPC server was based in the jsonrpc-core crate, /// not anymore since we migrated to jsonrpsee. + // TODO: Prefix this field name with an underscore so it's clear that it's now unused, and + // use serde(rename) to continue successfully deserializing old configs. pub parallel_cpu_threads: usize, /// Test-only option that makes Zebra say it is at the chain tip, diff --git a/zebra-rpc/src/methods.rs b/zebra-rpc/src/methods.rs index 66c9bd32f11..8634ec43ef5 100644 --- a/zebra-rpc/src/methods.rs +++ b/zebra-rpc/src/methods.rs @@ -1436,7 +1436,7 @@ where match nix::sys::signal::raise(nix::sys::signal::SIGINT) { Ok(_) => Ok("Zebra server stopping".to_string()), Err(error) => Err(ErrorObject::owned( - ErrorCode::ServerError(ErrorCode::InternalError.code()).code(), + ErrorCode::InternalError.code(), format!("Failed to shut down: {}", error).as_str(), None::<()>, )), diff --git a/zebra-rpc/src/methods/get_block_template_rpcs/get_block_template.rs b/zebra-rpc/src/methods/get_block_template_rpcs/get_block_template.rs index c6fe975a0c7..baa0200db1f 100644 --- a/zebra-rpc/src/methods/get_block_template_rpcs/get_block_template.rs +++ b/zebra-rpc/src/methods/get_block_template_rpcs/get_block_template.rs @@ -130,13 +130,7 @@ where let block_verifier_router_response = block_verifier_router .ready() .await - .map_err(|error| { - ErrorObject::owned( - ErrorCode::ServerError(0).code(), - error.to_string(), - None::<()>, - ) - })? + .map_err(|error| ErrorObject::owned(0, error.to_string(), None::<()>))? .call(zebra_consensus::Request::CheckProposal(Arc::new(block))) .await; @@ -223,13 +217,10 @@ where + 'static, { let request = zebra_state::ReadRequest::ChainInfo; - let response = state.oneshot(request.clone()).await.map_err(|error| { - ErrorObject::owned( - ErrorCode::ServerError(0).code(), - error.to_string(), - None::<()>, - ) - })?; + let response = state + .oneshot(request.clone()) + .await + .map_err(|error| ErrorObject::owned(0, error.to_string(), None::<()>))?; let chain_info = match response { zebra_state::ReadResponse::ChainInfo(chain_info) => chain_info, @@ -259,13 +250,7 @@ where let response = mempool .oneshot(mempool::Request::FullTransactions) .await - .map_err(|error| { - ErrorObject::owned( - ErrorCode::ServerError(0).code(), - error.to_string(), - None::<()>, - ) - })?; + .map_err(|error| ErrorObject::owned(0, error.to_string(), None::<()>))?; // TODO: Order transactions in block templates based on their dependencies