diff --git a/host/src/server/api/v1/proof.rs b/host/src/server/api/v1/proof.rs index 8e5ba75a..5bc1725c 100644 --- a/host/src/server/api/v1/proof.rs +++ b/host/src/server/api/v1/proof.rs @@ -1,6 +1,5 @@ use axum::{debug_handler, extract::State, routing::post, Json, Router}; use raiko_core::interfaces::ProofRequest; -use raiko_lib::prover::Proof; use raiko_tasks::get_task_manager; use serde_json::Value; use utoipa::OpenApi; @@ -9,9 +8,12 @@ use crate::{ interfaces::HostResult, metrics::{dec_current_req, inc_current_req, inc_guest_req_count, inc_host_req_count}, proof::handle_proof, + server::api::v1::Status, ProverState, }; +use super::ProofResponse; + #[utoipa::path(post, path = "/proof", tag = "Proving", request_body = ProofRequestOpt, @@ -31,7 +33,7 @@ use crate::{ async fn proof_handler( State(prover_state): State, Json(req): Json, -) -> HostResult> { +) -> HostResult> { inc_current_req(); // Override the existing proof request config from the config file and command line // options with the request from the client. @@ -57,7 +59,16 @@ async fn proof_handler( dec_current_req(); e }) - .map(Json) + .map(|proof| { + dec_current_req(); + Json(Status::Ok { + data: ProofResponse { + output: None, + proof: proof.proof, + quote: proof.quote, + }, + }) + }) } #[derive(OpenApi)] diff --git a/lib/src/prover.rs b/lib/src/prover.rs index a854409e..1266d5c4 100644 --- a/lib/src/prover.rs +++ b/lib/src/prover.rs @@ -29,7 +29,7 @@ pub type ProofKey = (ChainId, B256, u8); #[derive(Debug, Serialize, ToSchema, Deserialize, Default)] /// The response body of a proof request. pub struct Proof { - /// The ZK proof. + /// The proof either TEE or ZK. pub proof: Option, /// The TEE quote. pub quote: Option,