diff --git a/host/src/preflight.rs b/host/src/preflight.rs index 5b2437fa0..af1adcffa 100644 --- a/host/src/preflight.rs +++ b/host/src/preflight.rs @@ -331,7 +331,7 @@ struct GetBlobData { // pub signed_block_header: SignedBeaconBlockHeader, // ignore for now pub kzg_commitment: String, pub kzg_proof: String, - pub kzg_commitment_inclusion_proof: Vec, + // pub kzg_commitment_inclusion_proof: Vec, // ignore for now } #[derive(Clone, Debug, Deserialize, Serialize)] diff --git a/provers/sgx/config/sgx-guest.docker.manifest.template b/provers/sgx/config/sgx-guest.docker.manifest.template index 011bf7b9c..17e0bbb19 100644 --- a/provers/sgx/config/sgx-guest.docker.manifest.template +++ b/provers/sgx/config/sgx-guest.docker.manifest.template @@ -34,7 +34,7 @@ sgx.trusted_files = [ "file:/usr/lib/ssl/certs/", "file:sgx-guest", ] -sgx.max_threads = 16 +sgx.max_threads = 32 sgx.remote_attestation = "dcap" sys.enable_extra_runtime_domain_names_conf = true sys.insecure__allow_eventfd = true diff --git a/provers/sgx/config/sgx-guest.local.manifest.template b/provers/sgx/config/sgx-guest.local.manifest.template index b6b24d5dd..289b8fc04 100644 --- a/provers/sgx/config/sgx-guest.local.manifest.template +++ b/provers/sgx/config/sgx-guest.local.manifest.template @@ -45,7 +45,7 @@ sgx.trusted_files = [ "file:/usr/lib/ssl/certs/", "file:sgx-guest", ] -sgx.max_threads = 16 +sgx.max_threads = 32 sgx.remote_attestation = "dcap" sys.enable_extra_runtime_domain_names_conf = true sys.insecure__allow_eventfd = true diff --git a/provers/sgx/prover/src/lib.rs b/provers/sgx/prover/src/lib.rs index 8476c2d2b..feae48052 100644 --- a/provers/sgx/prover/src/lib.rs +++ b/provers/sgx/prover/src/lib.rs @@ -277,13 +277,22 @@ async fn prove( .spawn() .map_err(|e| format!("Could not spawn gramine cmd: {}", e))?; let stdin = child.stdin.as_mut().expect("Failed to open stdin"); - bincode::serialize_into(stdin, &input).expect("Unable to serialize input"); + let input_success = bincode::serialize_into(stdin, &input); + let output_success = child.wait_with_output(); - let output = child - .wait_with_output() - .map_err(|e| handle_gramine_error("Could not run SGX guest prover", e))?; - handle_output(&output, "SGX prove")?; - Ok(parse_sgx_result(output.stdout)?) + match (input_success, output_success) { + (Ok(_), Ok(output)) => { + handle_output(&output, "SGX prove")?; + Ok(parse_sgx_result(output.stdout)?) + } + (Err(i), output_success) => Err(ProverError::GuestError(format!( + "Can not serialize input for SGX {}, output is {:?}", + i, output_success + ))), + (Ok(_), Err(output_err)) => Err(ProverError::GuestError( + handle_gramine_error("Could not run SGX guest prover", output_err).to_string(), + )), + } }) .await .map_err(|e| ProverError::GuestError(e.to_string()))?