mirror of
https://github.com/Sunscreen-tech/Sunscreen.git
synced 2026-04-19 03:00:06 -04:00
get fhe node data impleented, still doesnt ocmpile. need to figure out how to handle sealdata stuff
This commit is contained in:
@@ -17,8 +17,8 @@ async fn main() {
|
||||
}
|
||||
|
||||
let app = Compiler::new()
|
||||
.fhe_program(mad)
|
||||
.fhe_program(add_squares)
|
||||
.fhe_program(mad)
|
||||
.compile()
|
||||
.unwrap();
|
||||
|
||||
|
||||
@@ -82,6 +82,38 @@ async fn get_code(session: web::Path<String>) -> impl Responder {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the info of a node in the debugging graph for an FHE program.
|
||||
*/
|
||||
#[get("graphs/{session}/{nodeid}")]
|
||||
pub async fn get_fhe_node_data(
|
||||
path_info: web::Path<(String, usize)>
|
||||
) -> Result<HttpResponse, actix_web::Error> {
|
||||
|
||||
let (session, nodeid) = path_info.into_inner();
|
||||
let sessions = get_sessions().lock().unwrap();
|
||||
|
||||
if sessions.contains_key(&session) {
|
||||
let curr_session = sessions.get(&session).unwrap().unwrap_bfv_session();
|
||||
|
||||
let data = curr_session
|
||||
.program_data
|
||||
.get(nodeid)
|
||||
.unwrap();
|
||||
|
||||
let data_json = serde_json::to_string(data).map_err(|e| {
|
||||
actix_web::error::ErrorInternalServerError(format!(
|
||||
"Failed to serialize node data to JSON: {}",
|
||||
e
|
||||
))
|
||||
})?;
|
||||
Ok(HttpResponse::Ok().body(data_json))
|
||||
} else {
|
||||
Ok(HttpResponse::NotFound().body("Node {:?} not found", nodeid))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Gets node data in the compilation graph.
|
||||
|
||||
@@ -60,6 +60,8 @@ pub struct BfvSession {
|
||||
/**
|
||||
* The values of operands in the compilation graph.
|
||||
*/
|
||||
|
||||
// TODO: maybe this shouldn't be a Vec of SealData ...
|
||||
pub program_data: Vec<Option<SealData>>,
|
||||
/**
|
||||
* Used for decryption of ciphertexts for visualization.
|
||||
|
||||
@@ -438,6 +438,7 @@ where
|
||||
fhe_program.metadata.name,
|
||||
SESSION_NUM.fetch_add(1, std::sync::atomic::Ordering::Relaxed)
|
||||
);
|
||||
println!("session name: {:?}", session_name);
|
||||
|
||||
self.run_impl(
|
||||
fhe_program,
|
||||
|
||||
Reference in New Issue
Block a user