From d60cd6cc3de91ece6d535715cefb591742ee88a7 Mon Sep 17 00:00:00 2001 From: makemake Date: Fri, 13 Jun 2025 14:58:26 +0200 Subject: [PATCH 01/12] feat: trace --- crates/server/src/api/process_request.rs | 65 +++++++++++++++++++++--- examples/test_http_client.rs | 10 +++- 2 files changed, 66 insertions(+), 9 deletions(-) diff --git a/crates/server/src/api/process_request.rs b/crates/server/src/api/process_request.rs index 06d7410..7861596 100644 --- a/crates/server/src/api/process_request.rs +++ b/crates/server/src/api/process_request.rs @@ -60,6 +60,7 @@ use hyper::{ use tracing::{ debug, info, + warn, }; /// Matches the incoming method sent by a client to a corresponding function. @@ -96,13 +97,19 @@ where "da_submit_assertion" => { let code = match json_rpc["params"][0].as_str() { Some(code) => code, - _ => return Ok(rpc_error(&json_rpc, -32602, "Invalid params")), + _ => { + warn!(target: "json_rpc", method = "da_submit_assertion", "Invalid params: missing or invalid bytecode parameter"); + return Ok(rpc_error(&json_rpc, -32602, "Invalid params")); + } }; // Validate hex inputs let bytecode = match alloy::hex::decode(code.trim_start_matches("0x")) { Ok(code) => code, - _ => return Ok(rpc_error(&json_rpc, 500, "Failed to decode hex")), + _ => { + warn!(target: "json_rpc", method = "da_submit_assertion", code = code, "Failed to decode hex bytecode"); + return Ok(rpc_error(&json_rpc, 500, "Failed to decode hex")); + } }; debug!(target: "json_rpc", bytecode_len = bytecode.len(), "Submitting raw assertion bytecode"); @@ -111,7 +118,8 @@ where let id = keccak256(&bytecode); let signature = match signer.sign_hash(&id).await { Ok(sig) => sig, - Err(_) => { + Err(err) => { + warn!(target: "json_rpc", method = "da_submit_assertion", error = %err, "Failed to sign assertion"); return Ok(rpc_error( &json_rpc, -32604, @@ -121,6 +129,7 @@ where }; debug!(target: "json_rpc", ?id, ?signature, bytecode_hex = hex::encode(&bytecode), "Compiled solidity source"); + info!(target: "json_rpc", method = "da_submit_assertion", ?id, "Successfully processed raw assertion submission"); let stored_assertion = StoredAssertion::new( "NaN".to_string(), @@ -146,6 +155,7 @@ where match serde_json::from_value(json_rpc["params"][0].clone()) { Ok(da_submission) => da_submission, Err(err) => { + warn!(target: "json_rpc", method = "da_submit_solidity_assertion", error = %err, "Failed to parse DaSubmission payload"); return Ok(rpc_error( &json_rpc, -32602, @@ -166,6 +176,7 @@ where { Ok(bytecode) => bytecode, Err(err) => { + warn!(target: "json_rpc", method = "da_submit_solidity_assertion", error = %err, compiler_version = da_submission.compiler_version, contract_name = da_submission.assertion_contract_name, "Solidity compilation failed"); return Ok(rpc_error( &json_rpc, -32603, @@ -180,6 +191,7 @@ where ) { Ok(encoded_args) => encoded_args, Err(err) => { + warn!(target: "json_rpc", method = "da_submit_solidity_assertion", error = %err, constructor_abi = da_submission.constructor_abi_signature, "Constructor args ABI encoding failed"); return Ok(rpc_error( &json_rpc, -32603, @@ -195,7 +207,8 @@ where let id = keccak256(&deployment_data); let prover_signature = match signer.sign_hash(&id).await { Ok(sig) => sig, - Err(_) => { + Err(err) => { + warn!(target: "json_rpc", method = "da_submit_solidity_assertion", error = %err, "Failed to sign assertion"); return Ok(rpc_error( &json_rpc, -32604, @@ -206,6 +219,8 @@ where debug!(target: "json_rpc", ?id, ?prover_signature, bytecode_hex = ?deployment_data, "Compiled solidity source"); + info!(target: "json_rpc", method = "da_submit_solidity_assertion", ?id, contract_name = da_submission.assertion_contract_name, compiler_version = da_submission.compiler_version, "Successfully compiled and processed Solidity assertion"); + let stored_assertion = StoredAssertion::new( da_submission.assertion_contract_name, da_submission.compiler_version, @@ -229,6 +244,7 @@ where let id = match json_rpc["params"][0].as_str() { Some(id) => id, None => { + warn!(target: "json_rpc", method = "da_get_assertion", "Invalid params: missing id parameter"); return Ok(rpc_error( &json_rpc, -32602, @@ -241,6 +257,7 @@ where let id: B256 = match id.trim_start_matches("0x").parse() { Ok(id) => id, _ => { + warn!(target: "json_rpc", method = "da_get_assertion", id = id, "Failed to decode hex ID"); return Ok(rpc_error( &json_rpc, -32605, @@ -252,6 +269,13 @@ where debug!(target: "json_rpc", ?id, "Getting assertion"); let res = process_get_assertion(id, db, &json_rpc).await; + + // Log success for get_assertion if not an error response + if let Ok(ref response) = res { + if !response.contains("\"error\"") { + info!(target: "json_rpc", method = "da_get_assertion", ?id, "Successfully retrieved assertion"); + } + } histogram!( "da_request_duration_seconds", "method" => "get_assertion", @@ -261,6 +285,7 @@ where res } _ => { + warn!(target: "json_rpc", method = method, "Unknown JSON-RPC method"); gauge!("api_requests_active", &labels).decrement(1); counter!("api_requests_error_count", &labels).increment(1); histogram!( @@ -272,6 +297,20 @@ where } }; + // Log final request completion status + match &result { + Ok(response) => { + if response.contains("\"error\"") { + debug!(target: "json_rpc", %method, duration_ms = req_start.elapsed().as_millis(), "Request completed with error"); + } else { + info!(target: "json_rpc", %method, duration_ms = req_start.elapsed().as_millis(), "Request completed successfully"); + } + }, + Err(err) => { + warn!(target: "json_rpc", %method, error = %err, duration_ms = req_start.elapsed().as_millis(), "Request failed with internal error"); + }, + } + result } @@ -327,7 +366,8 @@ async fn process_add_assertion( let ser_assertion = match bincode::serialize(&stored_assertion) { Ok(ser) => ser, - Err(_) => { + Err(err) => { + warn!(target: "json_rpc", error = %err, "Failed to serialize assertion for database storage"); return Ok(rpc_error(json_rpc, -32603, "Internal error d")); } }; @@ -345,8 +385,14 @@ async fn process_add_assertion( }; match rx.await { - Ok(_) => Ok(rpc_response(json_rpc, result)), - Err(_) => Ok(rpc_error(json_rpc, -32603, "Internal error c")), + Ok(_) => { + info!(target: "json_rpc", ?id, "Successfully stored assertion in database"); + Ok(rpc_response(json_rpc, result)) + }, + Err(err) => { + warn!(target: "json_rpc", error = %err, "Database operation failed for assertion storage"); + Ok(rpc_error(json_rpc, -32603, "Internal error c")) + }, } } @@ -374,7 +420,10 @@ async fn process_get_assertion(id: B256, db: &DbRequestSender, json_rpc: &Value) Ok(rpc_response(json_rpc, result)) } - None => Ok(rpc_error(json_rpc, 404, "Assertion not found")), + None => { + warn!(target: "json_rpc", ?id, "Assertion not found in database"); + Ok(rpc_error(json_rpc, 404, "Assertion not found")) + }, } } diff --git a/examples/test_http_client.rs b/examples/test_http_client.rs index 5455b52..795afab 100644 --- a/examples/test_http_client.rs +++ b/examples/test_http_client.rs @@ -1,3 +1,6 @@ +use std::str::FromStr; + +use alloy::primitives::FixedBytes; use assertion_da_client::DaClient; #[tokio::main] @@ -9,9 +12,14 @@ async fn main() -> Result<(), Box> { // Test with HTTPS endpoint println!("Testing HTTPS endpoint..."); - let _https_client = DaClient::new("https://demo-21-assertion-da.phylax.systems")?; + let https_client = DaClient::new("https://demo-21-assertion-da.phylax.systems")?; println!("✓ HTTPS client created successfully"); + let bytes: FixedBytes<32> = FixedBytes::from_str("43ccaf21bc5cf9efce72530ecfecbd6d513e895546749720048e0e39bbedce37").expect("REASON"); + let rax = https_client.fetch_assertion(bytes).await.unwrap(); + println!("Fetched assertion: {rax:?}"); + + // Test with authentication println!("Testing authenticated client..."); let _auth_client = DaClient::new_with_auth( From 33527dc30d773fcc8bfed4fb785a99d47e648baa Mon Sep 17 00:00:00 2001 From: makemake Date: Fri, 13 Jun 2025 17:20:11 +0200 Subject: [PATCH 02/12] feat: distributed tracing changes --- crates/server/src/api/accept.rs | 20 +++++-- crates/server/src/api/mod.rs | 2 +- crates/server/src/api/process_request.rs | 75 ++++++++++++++++-------- 3 files changed, 65 insertions(+), 32 deletions(-) diff --git a/crates/server/src/api/accept.rs b/crates/server/src/api/accept.rs index cb75796..7c29854 100644 --- a/crates/server/src/api/accept.rs +++ b/crates/server/src/api/accept.rs @@ -35,13 +35,14 @@ pub async fn accept_request( db: DbRequestSender, signer: &PrivateKeySigner, docker: Arc, + client_addr: std::net::SocketAddr, ) -> Result>, Infallible> where B: hyper::body::Body, { tracing::debug!(target = "api::accept_request", "Incoming request"); // Respond accordingly - let resp = match match_method(tx, &db, signer, docker).await { + let resp = match match_method(tx, &db, signer, docker, client_addr).await { Ok(rax) => rax, Err(e) => { let e = e.to_string(); @@ -58,18 +59,25 @@ macro_rules! accept { $io:expr, $db:expr, $signer:expr, - $docker:expr + $docker:expr, + $client_addr:expr ) => { let db_c = $db.clone(); + let signer_clone = $signer.clone(); + let docker_clone = $docker.clone(); + let client_addr = $client_addr; // Bind the incoming connection to our service if let Err(err) = hyper::server::conn::http1::Builder::new() // `service_fn` converts our function in a `Service` .serve_connection( $io, - hyper::service::service_fn(|req| { - let response = - $crate::api::accept::accept_request(req, db_c.clone(), $signer, $docker); - response + hyper::service::service_fn(move |req| { + let db_c = db_c.clone(); + let signer_clone = signer_clone.clone(); + let docker_clone = docker_clone.clone(); + async move { + $crate::api::accept::accept_request(req, db_c, &signer_clone, docker_clone, client_addr).await + } }), ) .with_upgrades() diff --git a/crates/server/src/api/mod.rs b/crates/server/src/api/mod.rs index 273132e..cf93489 100644 --- a/crates/server/src/api/mod.rs +++ b/crates/server/src/api/mod.rs @@ -176,7 +176,7 @@ fn serve_connection( // Spawn a tokio task to serve multiple connections concurrently tokio::task::spawn(async move { - crate::accept!(io, db_clone, &signer, docker_clone.clone()); + crate::accept!(io, db_clone, &signer, docker_clone.clone(), socketaddr); }); } diff --git a/crates/server/src/api/process_request.rs b/crates/server/src/api/process_request.rs index 7861596..07123a2 100644 --- a/crates/server/src/api/process_request.rs +++ b/crates/server/src/api/process_request.rs @@ -1,4 +1,5 @@ use std::{ + net::SocketAddr, sync::Arc, time::Instant, }; @@ -51,6 +52,7 @@ use serde_json::{ Value, }; use tokio::sync::oneshot; +use uuid::Uuid; use http_body_util::BodyExt; use hyper::{ @@ -64,21 +66,31 @@ use tracing::{ }; /// Matches the incoming method sent by a client to a corresponding function. -#[tracing::instrument(level = "debug", skip_all, target = "api::match_method")] +#[tracing::instrument(level = "debug", skip_all, target = "api::match_method", fields(request_id, client_addr))] pub async fn match_method( req: Request, db: &DbRequestSender, signer: &PrivateKeySigner, docker: Arc, + client_addr: SocketAddr, ) -> Result where B: hyper::body::Body, { + // Generate unique request ID for correlation + let request_id = Uuid::new_v4(); + let client_ip = client_addr.ip().to_string(); + + // Add request context to the current tracing span + tracing::Span::current().record("request_id", tracing::field::display(&request_id)); + tracing::Span::current().record("client_addr", tracing::field::display(&client_addr)); + // Read body and parse as JSON-RPC request let headers = req.headers().clone(); let body = req.into_body().collect().await?.to_bytes(); let json_rpc: Value = serde_json::from_slice(&body)?; let method = json_rpc["method"].as_str().unwrap_or_default(); + let json_rpc_id = json_rpc["id"].clone(); let labels = [("http_method", method.to_string())]; gauge!("api_requests_active", &labels).increment(1); @@ -87,6 +99,9 @@ where info!( target: "json_rpc", %method, + %request_id, + %client_ip, + json_rpc_id = %json_rpc_id, ?headers, "Received request" ); @@ -98,7 +113,7 @@ where let code = match json_rpc["params"][0].as_str() { Some(code) => code, _ => { - warn!(target: "json_rpc", method = "da_submit_assertion", "Invalid params: missing or invalid bytecode parameter"); + warn!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, "Invalid params: missing or invalid bytecode parameter"); return Ok(rpc_error(&json_rpc, -32602, "Invalid params")); } }; @@ -107,7 +122,7 @@ where let bytecode = match alloy::hex::decode(code.trim_start_matches("0x")) { Ok(code) => code, _ => { - warn!(target: "json_rpc", method = "da_submit_assertion", code = code, "Failed to decode hex bytecode"); + warn!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, code = code, "Failed to decode hex bytecode"); return Ok(rpc_error(&json_rpc, 500, "Failed to decode hex")); } }; @@ -119,7 +134,7 @@ where let signature = match signer.sign_hash(&id).await { Ok(sig) => sig, Err(err) => { - warn!(target: "json_rpc", method = "da_submit_assertion", error = %err, "Failed to sign assertion"); + warn!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to sign assertion"); return Ok(rpc_error( &json_rpc, -32604, @@ -129,7 +144,7 @@ where }; debug!(target: "json_rpc", ?id, ?signature, bytecode_hex = hex::encode(&bytecode), "Compiled solidity source"); - info!(target: "json_rpc", method = "da_submit_assertion", ?id, "Successfully processed raw assertion submission"); + info!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Successfully processed raw assertion submission"); let stored_assertion = StoredAssertion::new( "NaN".to_string(), @@ -141,7 +156,7 @@ where Bytes::new(), ); - let res = process_add_assertion(id, stored_assertion, db, &json_rpc).await; + let res = process_add_assertion(id, stored_assertion, db, &json_rpc, request_id, &client_ip, &json_rpc_id).await; histogram!( "da_request_duration_seconds", "method" => "submit_solidity_assertion", @@ -155,7 +170,7 @@ where match serde_json::from_value(json_rpc["params"][0].clone()) { Ok(da_submission) => da_submission, Err(err) => { - warn!(target: "json_rpc", method = "da_submit_solidity_assertion", error = %err, "Failed to parse DaSubmission payload"); + warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to parse DaSubmission payload"); return Ok(rpc_error( &json_rpc, -32602, @@ -176,7 +191,7 @@ where { Ok(bytecode) => bytecode, Err(err) => { - warn!(target: "json_rpc", method = "da_submit_solidity_assertion", error = %err, compiler_version = da_submission.compiler_version, contract_name = da_submission.assertion_contract_name, "Solidity compilation failed"); + warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, compiler_version = da_submission.compiler_version, contract_name = da_submission.assertion_contract_name, "Solidity compilation failed"); return Ok(rpc_error( &json_rpc, -32603, @@ -191,7 +206,7 @@ where ) { Ok(encoded_args) => encoded_args, Err(err) => { - warn!(target: "json_rpc", method = "da_submit_solidity_assertion", error = %err, constructor_abi = da_submission.constructor_abi_signature, "Constructor args ABI encoding failed"); + warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, constructor_abi = da_submission.constructor_abi_signature, "Constructor args ABI encoding failed"); return Ok(rpc_error( &json_rpc, -32603, @@ -208,7 +223,7 @@ where let prover_signature = match signer.sign_hash(&id).await { Ok(sig) => sig, Err(err) => { - warn!(target: "json_rpc", method = "da_submit_solidity_assertion", error = %err, "Failed to sign assertion"); + warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to sign assertion"); return Ok(rpc_error( &json_rpc, -32604, @@ -219,7 +234,7 @@ where debug!(target: "json_rpc", ?id, ?prover_signature, bytecode_hex = ?deployment_data, "Compiled solidity source"); - info!(target: "json_rpc", method = "da_submit_solidity_assertion", ?id, contract_name = da_submission.assertion_contract_name, compiler_version = da_submission.compiler_version, "Successfully compiled and processed Solidity assertion"); + info!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, contract_name = da_submission.assertion_contract_name, compiler_version = da_submission.compiler_version, "Successfully compiled and processed Solidity assertion"); let stored_assertion = StoredAssertion::new( da_submission.assertion_contract_name, @@ -231,7 +246,7 @@ where encoded_constructor_args, ); - let res = process_add_assertion(id, stored_assertion, db, &json_rpc).await; + let res = process_add_assertion(id, stored_assertion, db, &json_rpc, request_id, &client_ip, &json_rpc_id).await; histogram!( "da_request_duration_seconds", "method" => "submit_solidity_assertion", @@ -244,7 +259,7 @@ where let id = match json_rpc["params"][0].as_str() { Some(id) => id, None => { - warn!(target: "json_rpc", method = "da_get_assertion", "Invalid params: missing id parameter"); + warn!(target: "json_rpc", method = "da_get_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, "Invalid params: missing id parameter"); return Ok(rpc_error( &json_rpc, -32602, @@ -257,7 +272,7 @@ where let id: B256 = match id.trim_start_matches("0x").parse() { Ok(id) => id, _ => { - warn!(target: "json_rpc", method = "da_get_assertion", id = id, "Failed to decode hex ID"); + warn!(target: "json_rpc", method = "da_get_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, id = id, "Failed to decode hex ID"); return Ok(rpc_error( &json_rpc, -32605, @@ -268,12 +283,12 @@ where debug!(target: "json_rpc", ?id, "Getting assertion"); - let res = process_get_assertion(id, db, &json_rpc).await; + let res = process_get_assertion(id, db, &json_rpc, request_id, &client_ip, &json_rpc_id).await; // Log success for get_assertion if not an error response if let Ok(ref response) = res { if !response.contains("\"error\"") { - info!(target: "json_rpc", method = "da_get_assertion", ?id, "Successfully retrieved assertion"); + info!(target: "json_rpc", method = "da_get_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Successfully retrieved assertion"); } } histogram!( @@ -285,7 +300,7 @@ where res } _ => { - warn!(target: "json_rpc", method = method, "Unknown JSON-RPC method"); + warn!(target: "json_rpc", method = method, %request_id, %client_ip, json_rpc_id = %json_rpc_id, "Unknown JSON-RPC method"); gauge!("api_requests_active", &labels).decrement(1); counter!("api_requests_error_count", &labels).increment(1); histogram!( @@ -301,13 +316,13 @@ where match &result { Ok(response) => { if response.contains("\"error\"") { - debug!(target: "json_rpc", %method, duration_ms = req_start.elapsed().as_millis(), "Request completed with error"); + debug!(target: "json_rpc", %method, %request_id, %client_ip, json_rpc_id = %json_rpc_id, duration_ms = req_start.elapsed().as_millis(), "Request completed with error"); } else { - info!(target: "json_rpc", %method, duration_ms = req_start.elapsed().as_millis(), "Request completed successfully"); + info!(target: "json_rpc", %method, %request_id, %client_ip, json_rpc_id = %json_rpc_id, duration_ms = req_start.elapsed().as_millis(), "Request completed successfully"); } }, Err(err) => { - warn!(target: "json_rpc", %method, error = %err, duration_ms = req_start.elapsed().as_millis(), "Request failed with internal error"); + warn!(target: "json_rpc", %method, %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, duration_ms = req_start.elapsed().as_millis(), "Request failed with internal error"); }, } @@ -360,6 +375,9 @@ async fn process_add_assertion( stored_assertion: StoredAssertion, db: &DbRequestSender, json_rpc: &Value, + request_id: Uuid, + client_ip: &str, + json_rpc_id: &Value, ) -> Result { // Store in database let (tx, rx) = oneshot::channel(); @@ -367,7 +385,7 @@ async fn process_add_assertion( let ser_assertion = match bincode::serialize(&stored_assertion) { Ok(ser) => ser, Err(err) => { - warn!(target: "json_rpc", error = %err, "Failed to serialize assertion for database storage"); + warn!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to serialize assertion for database storage"); return Ok(rpc_error(json_rpc, -32603, "Internal error d")); } }; @@ -386,17 +404,24 @@ async fn process_add_assertion( match rx.await { Ok(_) => { - info!(target: "json_rpc", ?id, "Successfully stored assertion in database"); + info!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Successfully stored assertion in database"); Ok(rpc_response(json_rpc, result)) }, Err(err) => { - warn!(target: "json_rpc", error = %err, "Database operation failed for assertion storage"); + warn!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Database operation failed for assertion storage"); Ok(rpc_error(json_rpc, -32603, "Internal error c")) }, } } -async fn process_get_assertion(id: B256, db: &DbRequestSender, json_rpc: &Value) -> Result { +async fn process_get_assertion( + id: B256, + db: &DbRequestSender, + json_rpc: &Value, + request_id: Uuid, + client_ip: &str, + json_rpc_id: &Value, +) -> Result { let (tx, rx) = oneshot::channel(); let req = DbRequest { request: DbOperation::Get(id.to_vec()), @@ -421,7 +446,7 @@ async fn process_get_assertion(id: B256, db: &DbRequestSender, json_rpc: &Value) Ok(rpc_response(json_rpc, result)) } None => { - warn!(target: "json_rpc", ?id, "Assertion not found in database"); + warn!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Assertion not found in database"); Ok(rpc_error(json_rpc, 404, "Assertion not found")) }, } From 7de61579e794ea902b50b357b0b091d916df05f4 Mon Sep 17 00:00:00 2001 From: makemake Date: Fri, 13 Jun 2025 17:24:09 +0200 Subject: [PATCH 03/12] feat: return request id on bad request --- crates/server/src/api/process_request.rs | 48 +++++++++++++++++------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/crates/server/src/api/process_request.rs b/crates/server/src/api/process_request.rs index 07123a2..7df686b 100644 --- a/crates/server/src/api/process_request.rs +++ b/crates/server/src/api/process_request.rs @@ -114,7 +114,7 @@ where Some(code) => code, _ => { warn!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, "Invalid params: missing or invalid bytecode parameter"); - return Ok(rpc_error(&json_rpc, -32602, "Invalid params")); + return Ok(rpc_error_with_request_id(&json_rpc, -32602, "Invalid params", &request_id)); } }; @@ -123,7 +123,7 @@ where Ok(code) => code, _ => { warn!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, code = code, "Failed to decode hex bytecode"); - return Ok(rpc_error(&json_rpc, 500, "Failed to decode hex")); + return Ok(rpc_error_with_request_id(&json_rpc, 500, "Failed to decode hex", &request_id)); } }; @@ -135,10 +135,11 @@ where Ok(sig) => sig, Err(err) => { warn!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to sign assertion"); - return Ok(rpc_error( + return Ok(rpc_error_with_request_id( &json_rpc, -32604, "Internal Error: Failed to sign Assertion", + &request_id, )) } }; @@ -171,10 +172,11 @@ where Ok(da_submission) => da_submission, Err(err) => { warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to parse DaSubmission payload"); - return Ok(rpc_error( + return Ok(rpc_error_with_request_id( &json_rpc, -32602, format!("Invalid params: Failed to parse payload {err:?}").as_str(), + &request_id, )) } }; @@ -192,10 +194,11 @@ where Ok(bytecode) => bytecode, Err(err) => { warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, compiler_version = da_submission.compiler_version, contract_name = da_submission.assertion_contract_name, "Solidity compilation failed"); - return Ok(rpc_error( + return Ok(rpc_error_with_request_id( &json_rpc, -32603, &format!("Solidity Compilation Error: {err}"), + &request_id, )) } }; @@ -207,10 +210,11 @@ where Ok(encoded_args) => encoded_args, Err(err) => { warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, constructor_abi = da_submission.constructor_abi_signature, "Constructor args ABI encoding failed"); - return Ok(rpc_error( + return Ok(rpc_error_with_request_id( &json_rpc, -32603, &format!("Constructor args ABI Encoding Error: {err}"), + &request_id, )) } }; @@ -224,10 +228,11 @@ where Ok(sig) => sig, Err(err) => { warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to sign assertion"); - return Ok(rpc_error( + return Ok(rpc_error_with_request_id( &json_rpc, -32604, "Internal Error: Failed to sign Assertion", + &request_id, )) } }; @@ -260,10 +265,11 @@ where Some(id) => id, None => { warn!(target: "json_rpc", method = "da_get_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, "Invalid params: missing id parameter"); - return Ok(rpc_error( + return Ok(rpc_error_with_request_id( &json_rpc, -32602, "Invalid params: Didn't find id", + &request_id, )) } }; @@ -273,10 +279,11 @@ where Ok(id) => id, _ => { warn!(target: "json_rpc", method = "da_get_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, id = id, "Failed to decode hex ID"); - return Ok(rpc_error( + return Ok(rpc_error_with_request_id( &json_rpc, -32605, "Internal Error: Failed to decode hex of id", + &request_id, )) } }; @@ -308,7 +315,7 @@ where "method" => "unknown" ) .record(req_start.elapsed().as_secs_f64()); - Ok(rpc_error(&json_rpc, -32601, "Method not found")) + Ok(rpc_error_with_request_id(&json_rpc, -32601, "Method not found", &request_id)) } }; @@ -386,7 +393,7 @@ async fn process_add_assertion( Ok(ser) => ser, Err(err) => { warn!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to serialize assertion for database storage"); - return Ok(rpc_error(json_rpc, -32603, "Internal error d")); + return Ok(rpc_error_with_request_id(json_rpc, -32603, "Internal error d", &request_id)); } }; @@ -409,7 +416,7 @@ async fn process_add_assertion( }, Err(err) => { warn!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Database operation failed for assertion storage"); - Ok(rpc_error(json_rpc, -32603, "Internal error c")) + Ok(rpc_error_with_request_id(json_rpc, -32603, "Internal error c", &request_id)) }, } } @@ -447,7 +454,7 @@ async fn process_get_assertion( } None => { warn!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Assertion not found in database"); - Ok(rpc_error(json_rpc, 404, "Assertion not found")) + Ok(rpc_error_with_request_id(json_rpc, 404, "Assertion not found", &request_id)) }, } } @@ -473,6 +480,21 @@ fn rpc_error(request: &Value, code: i128, message: &str) -> String { .to_string() } +fn rpc_error_with_request_id(request: &Value, code: i128, message: &str, request_id: &Uuid) -> String { + json!({ + "jsonrpc": "2.0", + "error": { + "code": code, + "message": message, + "data": { + "request_id": request_id.to_string() + } + }, + "id": request["id"] + }) + .to_string() +} + #[cfg(test)] mod tests { use super::*; From 2f798d68e7131d8f9f8820d65a14345cd6241774 Mon Sep 17 00:00:00 2001 From: makemake Date: Fri, 13 Jun 2025 17:39:59 +0200 Subject: [PATCH 04/12] fix: fmt --- crates/server/src/api/accept.rs | 9 +- crates/server/src/api/process_request.rs | 141 ++++++++++++++++------- examples/test_http_client.rs | 5 +- 3 files changed, 112 insertions(+), 43 deletions(-) diff --git a/crates/server/src/api/accept.rs b/crates/server/src/api/accept.rs index 7c29854..4f268ef 100644 --- a/crates/server/src/api/accept.rs +++ b/crates/server/src/api/accept.rs @@ -76,7 +76,14 @@ macro_rules! accept { let signer_clone = signer_clone.clone(); let docker_clone = docker_clone.clone(); async move { - $crate::api::accept::accept_request(req, db_c, &signer_clone, docker_clone, client_addr).await + $crate::api::accept::accept_request( + req, + db_c, + &signer_clone, + docker_clone, + client_addr, + ) + .await } }), ) diff --git a/crates/server/src/api/process_request.rs b/crates/server/src/api/process_request.rs index 7df686b..ad0edc3 100644 --- a/crates/server/src/api/process_request.rs +++ b/crates/server/src/api/process_request.rs @@ -66,7 +66,12 @@ use tracing::{ }; /// Matches the incoming method sent by a client to a corresponding function. -#[tracing::instrument(level = "debug", skip_all, target = "api::match_method", fields(request_id, client_addr))] +#[tracing::instrument( + level = "debug", + skip_all, + target = "api::match_method", + fields(request_id, client_addr) +)] pub async fn match_method( req: Request, db: &DbRequestSender, @@ -80,11 +85,11 @@ where // Generate unique request ID for correlation let request_id = Uuid::new_v4(); let client_ip = client_addr.ip().to_string(); - + // Add request context to the current tracing span tracing::Span::current().record("request_id", tracing::field::display(&request_id)); tracing::Span::current().record("client_addr", tracing::field::display(&client_addr)); - + // Read body and parse as JSON-RPC request let headers = req.headers().clone(); let body = req.into_body().collect().await?.to_bytes(); @@ -114,7 +119,12 @@ where Some(code) => code, _ => { warn!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, "Invalid params: missing or invalid bytecode parameter"); - return Ok(rpc_error_with_request_id(&json_rpc, -32602, "Invalid params", &request_id)); + return Ok(rpc_error_with_request_id( + &json_rpc, + -32602, + "Invalid params", + &request_id, + )); } }; @@ -123,7 +133,12 @@ where Ok(code) => code, _ => { warn!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, code = code, "Failed to decode hex bytecode"); - return Ok(rpc_error_with_request_id(&json_rpc, 500, "Failed to decode hex", &request_id)); + return Ok(rpc_error_with_request_id( + &json_rpc, + 500, + "Failed to decode hex", + &request_id, + )); } }; @@ -140,7 +155,7 @@ where -32604, "Internal Error: Failed to sign Assertion", &request_id, - )) + )); } }; @@ -157,7 +172,16 @@ where Bytes::new(), ); - let res = process_add_assertion(id, stored_assertion, db, &json_rpc, request_id, &client_ip, &json_rpc_id).await; + let res = process_add_assertion( + id, + stored_assertion, + db, + &json_rpc, + request_id, + &client_ip, + &json_rpc_id, + ) + .await; histogram!( "da_request_duration_seconds", "method" => "submit_solidity_assertion", @@ -167,19 +191,20 @@ where res } "da_submit_solidity_assertion" => { - let da_submission: DaSubmission = - match serde_json::from_value(json_rpc["params"][0].clone()) { - Ok(da_submission) => da_submission, - Err(err) => { - warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to parse DaSubmission payload"); - return Ok(rpc_error_with_request_id( - &json_rpc, - -32602, - format!("Invalid params: Failed to parse payload {err:?}").as_str(), - &request_id, - )) - } - }; + let da_submission: DaSubmission = match serde_json::from_value( + json_rpc["params"][0].clone(), + ) { + Ok(da_submission) => da_submission, + Err(err) => { + warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to parse DaSubmission payload"); + return Ok(rpc_error_with_request_id( + &json_rpc, + -32602, + format!("Invalid params: Failed to parse payload {err:?}").as_str(), + &request_id, + )); + } + }; debug!(target: "json_rpc", compiler_version = da_submission.compiler_version, da_submission.solidity_source , "Compiling solidity source"); @@ -199,7 +224,7 @@ where -32603, &format!("Solidity Compilation Error: {err}"), &request_id, - )) + )); } }; @@ -215,7 +240,7 @@ where -32603, &format!("Constructor args ABI Encoding Error: {err}"), &request_id, - )) + )); } }; @@ -233,7 +258,7 @@ where -32604, "Internal Error: Failed to sign Assertion", &request_id, - )) + )); } }; @@ -251,7 +276,16 @@ where encoded_constructor_args, ); - let res = process_add_assertion(id, stored_assertion, db, &json_rpc, request_id, &client_ip, &json_rpc_id).await; + let res = process_add_assertion( + id, + stored_assertion, + db, + &json_rpc, + request_id, + &client_ip, + &json_rpc_id, + ) + .await; histogram!( "da_request_duration_seconds", "method" => "submit_solidity_assertion", @@ -270,7 +304,7 @@ where -32602, "Invalid params: Didn't find id", &request_id, - )) + )); } }; @@ -284,14 +318,16 @@ where -32605, "Internal Error: Failed to decode hex of id", &request_id, - )) + )); } }; debug!(target: "json_rpc", ?id, "Getting assertion"); - let res = process_get_assertion(id, db, &json_rpc, request_id, &client_ip, &json_rpc_id).await; - + let res = + process_get_assertion(id, db, &json_rpc, request_id, &client_ip, &json_rpc_id) + .await; + // Log success for get_assertion if not an error response if let Ok(ref response) = res { if !response.contains("\"error\"") { @@ -315,7 +351,12 @@ where "method" => "unknown" ) .record(req_start.elapsed().as_secs_f64()); - Ok(rpc_error_with_request_id(&json_rpc, -32601, "Method not found", &request_id)) + Ok(rpc_error_with_request_id( + &json_rpc, + -32601, + "Method not found", + &request_id, + )) } }; @@ -327,10 +368,10 @@ where } else { info!(target: "json_rpc", %method, %request_id, %client_ip, json_rpc_id = %json_rpc_id, duration_ms = req_start.elapsed().as_millis(), "Request completed successfully"); } - }, + } Err(err) => { warn!(target: "json_rpc", %method, %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, duration_ms = req_start.elapsed().as_millis(), "Request failed with internal error"); - }, + } } result @@ -393,7 +434,12 @@ async fn process_add_assertion( Ok(ser) => ser, Err(err) => { warn!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Failed to serialize assertion for database storage"); - return Ok(rpc_error_with_request_id(json_rpc, -32603, "Internal error d", &request_id)); + return Ok(rpc_error_with_request_id( + json_rpc, + -32603, + "Internal error d", + &request_id, + )); } }; @@ -413,17 +459,22 @@ async fn process_add_assertion( Ok(_) => { info!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Successfully stored assertion in database"); Ok(rpc_response(json_rpc, result)) - }, + } Err(err) => { warn!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Database operation failed for assertion storage"); - Ok(rpc_error_with_request_id(json_rpc, -32603, "Internal error c", &request_id)) - }, + Ok(rpc_error_with_request_id( + json_rpc, + -32603, + "Internal error c", + &request_id, + )) + } } } async fn process_get_assertion( - id: B256, - db: &DbRequestSender, + id: B256, + db: &DbRequestSender, json_rpc: &Value, request_id: Uuid, client_ip: &str, @@ -454,8 +505,13 @@ async fn process_get_assertion( } None => { warn!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Assertion not found in database"); - Ok(rpc_error_with_request_id(json_rpc, 404, "Assertion not found", &request_id)) - }, + Ok(rpc_error_with_request_id( + json_rpc, + 404, + "Assertion not found", + &request_id, + )) + } } } @@ -480,7 +536,12 @@ fn rpc_error(request: &Value, code: i128, message: &str) -> String { .to_string() } -fn rpc_error_with_request_id(request: &Value, code: i128, message: &str, request_id: &Uuid) -> String { +fn rpc_error_with_request_id( + request: &Value, + code: i128, + message: &str, + request_id: &Uuid, +) -> String { json!({ "jsonrpc": "2.0", "error": { diff --git a/examples/test_http_client.rs b/examples/test_http_client.rs index 795afab..acdb850 100644 --- a/examples/test_http_client.rs +++ b/examples/test_http_client.rs @@ -15,11 +15,12 @@ async fn main() -> Result<(), Box> { let https_client = DaClient::new("https://demo-21-assertion-da.phylax.systems")?; println!("✓ HTTPS client created successfully"); - let bytes: FixedBytes<32> = FixedBytes::from_str("43ccaf21bc5cf9efce72530ecfecbd6d513e895546749720048e0e39bbedce37").expect("REASON"); + let bytes: FixedBytes<32> = + FixedBytes::from_str("43ccaf21bc5cf9efce72530ecfecbd6d513e895546749720048e0e39bbedce37") + .expect("REASON"); let rax = https_client.fetch_assertion(bytes).await.unwrap(); println!("Fetched assertion: {rax:?}"); - // Test with authentication println!("Testing authenticated client..."); let _auth_client = DaClient::new_with_auth( From 241bfadc75cbad2fe2799967e405192606f3d10b Mon Sep 17 00:00:00 2001 From: makemake Date: Fri, 13 Jun 2025 17:40:43 +0200 Subject: [PATCH 05/12] fix: clippy --- crates/server/src/api/process_request.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/server/src/api/process_request.rs b/crates/server/src/api/process_request.rs index ad0edc3..0c56893 100644 --- a/crates/server/src/api/process_request.rs +++ b/crates/server/src/api/process_request.rs @@ -524,6 +524,7 @@ fn rpc_response(request: &Value, result: T) -> String { .to_string() } +#[allow(dead_code)] fn rpc_error(request: &Value, code: i128, message: &str) -> String { json!({ "jsonrpc": "2.0", From 5dc68462a0e7824828108f4f69581f51afc5a7ca Mon Sep 17 00:00:00 2001 From: makemake Date: Mon, 16 Jun 2025 14:51:54 +0200 Subject: [PATCH 06/12] fix: comments --- examples/test_http_client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/test_http_client.rs b/examples/test_http_client.rs index acdb850..1709768 100644 --- a/examples/test_http_client.rs +++ b/examples/test_http_client.rs @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box> { println!("✓ HTTPS client created successfully"); let bytes: FixedBytes<32> = - FixedBytes::from_str("43ccaf21bc5cf9efce72530ecfecbd6d513e895546749720048e0e39bbedce37") + FixedBytes::from_str("43ccaf21bc5cf9efce72530ecfecbd6d513e895546749720048e0e39bbedce37") // example id .expect("REASON"); let rax = https_client.fetch_assertion(bytes).await.unwrap(); println!("Fetched assertion: {rax:?}"); From f4c7cfc5b6a19f329f050afbe8e7c85c6f849321 Mon Sep 17 00:00:00 2001 From: makemake Date: Mon, 16 Jun 2025 16:07:18 +0200 Subject: [PATCH 07/12] fix: erroneous logs --- crates/server/src/api/process_request.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/server/src/api/process_request.rs b/crates/server/src/api/process_request.rs index 0c56893..1d8d609 100644 --- a/crates/server/src/api/process_request.rs +++ b/crates/server/src/api/process_request.rs @@ -160,7 +160,7 @@ where }; debug!(target: "json_rpc", ?id, ?signature, bytecode_hex = hex::encode(&bytecode), "Compiled solidity source"); - info!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Successfully processed raw assertion submission"); + debug!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Processed raw assertion submission, proceeding to database storage"); let stored_assertion = StoredAssertion::new( "NaN".to_string(), @@ -264,7 +264,7 @@ where debug!(target: "json_rpc", ?id, ?prover_signature, bytecode_hex = ?deployment_data, "Compiled solidity source"); - info!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, contract_name = da_submission.assertion_contract_name, compiler_version = da_submission.compiler_version, "Successfully compiled and processed Solidity assertion"); + debug!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, contract_name = da_submission.assertion_contract_name, compiler_version = da_submission.compiler_version, "Successfully compiled Solidity assertion, proceeding to database storage"); let stored_assertion = StoredAssertion::new( da_submission.assertion_contract_name, From 663ea520689ea014d94afded834b2c462e1218df Mon Sep 17 00:00:00 2001 From: makemake Date: Tue, 17 Jun 2025 11:27:52 +0200 Subject: [PATCH 08/12] fix: logging --- crates/server/src/api/process_request.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/crates/server/src/api/process_request.rs b/crates/server/src/api/process_request.rs index 1d8d609..efc495a 100644 --- a/crates/server/src/api/process_request.rs +++ b/crates/server/src/api/process_request.rs @@ -261,11 +261,8 @@ where )); } }; - debug!(target: "json_rpc", ?id, ?prover_signature, bytecode_hex = ?deployment_data, "Compiled solidity source"); - debug!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, contract_name = da_submission.assertion_contract_name, compiler_version = da_submission.compiler_version, "Successfully compiled Solidity assertion, proceeding to database storage"); - let stored_assertion = StoredAssertion::new( da_submission.assertion_contract_name, da_submission.compiler_version, @@ -286,6 +283,15 @@ where &json_rpc_id, ) .await; + + if let Ok(ref response) = res { + if !response.contains("\"error\"") { + info!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, contract_name = da_submission.assertion_contract_name, compiler_version = da_submission.compiler_version, "Successfully compiled Solidity assertion"); + } else { + warn!(target: "json_rpc", method = "da_submit_solidity_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, contract_name = da_submission.assertion_contract_name, compiler_version = da_submission.compiler_version, "Failed to process Solidity assertion"); + } + } + histogram!( "da_request_duration_seconds", "method" => "submit_solidity_assertion", @@ -457,11 +463,11 @@ async fn process_add_assertion( match rx.await { Ok(_) => { - info!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Successfully stored assertion in database"); + debug!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Successfully stored assertion in database"); Ok(rpc_response(json_rpc, result)) } Err(err) => { - warn!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Database operation failed for assertion storage"); + debug!(target: "json_rpc", %request_id, %client_ip, json_rpc_id = %json_rpc_id, error = %err, "Database operation failed for assertion storage"); Ok(rpc_error_with_request_id( json_rpc, -32603, From a87b4a1df7d7329fbc2ce20ff0fd27fbcf4de6b6 Mon Sep 17 00:00:00 2001 From: makemake Date: Tue, 17 Jun 2025 11:29:43 +0200 Subject: [PATCH 09/12] fix: raw assertion logging --- crates/server/src/api/process_request.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/server/src/api/process_request.rs b/crates/server/src/api/process_request.rs index efc495a..cdb9e86 100644 --- a/crates/server/src/api/process_request.rs +++ b/crates/server/src/api/process_request.rs @@ -182,6 +182,16 @@ where &json_rpc_id, ) .await; + + // Log success or failure based on response + if let Ok(ref response) = res { + if !response.contains("\"error\"") { + info!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Successfully processed raw assertion submission"); + } else { + warn!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Failed to process raw assertion submission"); + } + } + histogram!( "da_request_duration_seconds", "method" => "submit_solidity_assertion", From 548caada934fc5ab890d0a85c8995f588ad00767 Mon Sep 17 00:00:00 2001 From: makemake Date: Tue, 17 Jun 2025 11:32:10 +0200 Subject: [PATCH 10/12] fix: borrowing contract metadata --- crates/server/src/api/process_request.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/server/src/api/process_request.rs b/crates/server/src/api/process_request.rs index cdb9e86..fc4a0cd 100644 --- a/crates/server/src/api/process_request.rs +++ b/crates/server/src/api/process_request.rs @@ -274,8 +274,8 @@ where debug!(target: "json_rpc", ?id, ?prover_signature, bytecode_hex = ?deployment_data, "Compiled solidity source"); let stored_assertion = StoredAssertion::new( - da_submission.assertion_contract_name, - da_submission.compiler_version, + da_submission.assertion_contract_name.clone(), + da_submission.compiler_version.clone(), da_submission.solidity_source, deployment_data, prover_signature, From c0eec69fb62d1686d2f9bdf8fce2a6519041131c Mon Sep 17 00:00:00 2001 From: makemake Date: Tue, 17 Jun 2025 12:07:37 +0200 Subject: [PATCH 11/12] fix: log level updates --- crates/server/src/api/process_request.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/server/src/api/process_request.rs b/crates/server/src/api/process_request.rs index fc4a0cd..69749fc 100644 --- a/crates/server/src/api/process_request.rs +++ b/crates/server/src/api/process_request.rs @@ -62,6 +62,7 @@ use hyper::{ use tracing::{ debug, info, + trace, warn, }; @@ -159,7 +160,7 @@ where } }; - debug!(target: "json_rpc", ?id, ?signature, bytecode_hex = hex::encode(&bytecode), "Compiled solidity source"); + trace!(target: "json_rpc", ?id, ?signature, bytecode_hex = hex::encode(&bytecode), "Raw submitted bytecode"); debug!(target: "json_rpc", method = "da_submit_assertion", %request_id, %client_ip, json_rpc_id = %json_rpc_id, ?id, "Processed raw assertion submission, proceeding to database storage"); let stored_assertion = StoredAssertion::new( @@ -271,7 +272,7 @@ where )); } }; - debug!(target: "json_rpc", ?id, ?prover_signature, bytecode_hex = ?deployment_data, "Compiled solidity source"); + trace!(target: "json_rpc", ?id, ?prover_signature, bytecode_hex = ?deployment_data, "Compiled solidity source"); let stored_assertion = StoredAssertion::new( da_submission.assertion_contract_name.clone(), From 600ce9a5950ebc524e157c1e4bbb321e29cea64f Mon Sep 17 00:00:00 2001 From: makemake Date: Tue, 17 Jun 2025 12:14:38 +0200 Subject: [PATCH 12/12] feat: add @fredo to codeowners --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index ce0eebb..650d9d6 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @makemake-kbo @0xgregthedev +* @makemake-kbo @0xgregthedev @fredo