From 7c3aa48a9679d9535b1bce6c0515cfde990117e6 Mon Sep 17 00:00:00 2001 From: Chetany Bhardwaj Date: Thu, 14 May 2026 01:33:43 +0530 Subject: [PATCH 1/3] feat: reject proof requests early for verifier-only instances --- .../http/v1/post_execution_proof_requests.rs | 20 +++++++++++++++++-- crates/server/src/server.rs | 12 +++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/crates/server/src/http/v1/post_execution_proof_requests.rs b/crates/server/src/http/v1/post_execution_proof_requests.rs index d306d41..3d00d8d 100644 --- a/crates/server/src/http/v1/post_execution_proof_requests.rs +++ b/crates/server/src/http/v1/post_execution_proof_requests.rs @@ -4,7 +4,7 @@ use std::{collections::HashSet, sync::Arc}; use axum::{Json, extract::State}; use bytes::Bytes; -use tracing::{info_span, instrument}; +use tracing::{debug, info_span, instrument}; use zkboost_types::{ Decode, MainnetEthSpec, NewPayloadRequest, ProofRequestQuery, ProofRequestResponse, TreeHash, }; @@ -14,7 +14,7 @@ use crate::{ AppState, v1::{ErrorResponse, Query}, }, - proof::ProofServiceMessage, + proof::{ProofServiceMessage, zkvm::zkVMInstance}, }; #[instrument(skip_all)] @@ -44,6 +44,22 @@ pub(crate) async fn post_execution_proof_requests( } } + // Reject proof generation requests for verifier-only instances early, + // before wasting resources on witness fetching. + for proof_type in &proof_types { + if let Some(zkvm) = state.zkvms.get(proof_type) { + if matches!(zkvm, zkVMInstance::Verifier { .. }) { + debug!( + %proof_type, + "rejecting proof request: verifier-only instance" + ); + return Err(ErrorResponse::bad_request(format!( + "proof generation not supported for verifier-only zkvm '{proof_type}'" + ))); + } + } + } + let new_payload_request = NewPayloadRequest::::from_ssz_bytes(&body) .map(Arc::new) .map_err(|e| ErrorResponse::bad_request(format!("invalid SSZ body: {e:?}")))?; diff --git a/crates/server/src/server.rs b/crates/server/src/server.rs index f10431f..0355328 100644 --- a/crates/server/src/server.rs +++ b/crates/server/src/server.rs @@ -79,10 +79,22 @@ impl zkBoostServer { let mut zkvms = HashMap::new(); for zkvm_config in &config.zkvm { let instance = zkVMInstance::new(zkvm_config).await?; + let mode = match zkvm_config { + crate::config::zkVMConfig::Ere { .. } => "prover", + crate::config::zkVMConfig::Mock { .. } => "mock", + crate::config::zkVMConfig::Verifier { .. } => "verifier-only", + }; info!( proof_type = %zkvm_config.proof_type(), + mode, "zkvm instance created" ); + if matches!(zkvm_config, crate::config::zkVMConfig::Verifier { .. }) { + info!( + proof_type = %zkvm_config.proof_type(), + "verifier-only mode: proof generation requests will be rejected" + ); + } zkvms.insert(zkvm_config.proof_type(), instance); } set_programs_loaded(zkvms.len()); From b1bda9c33745d0f7c1dd11e39abb2ea0d89c6368 Mon Sep 17 00:00:00 2001 From: Chetany Bhardwaj Date: Thu, 14 May 2026 22:45:28 +0530 Subject: [PATCH 2/3] fix: lint --- crates/server/src/http/v1/post_execution_proof_requests.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/server/src/http/v1/post_execution_proof_requests.rs b/crates/server/src/http/v1/post_execution_proof_requests.rs index 3d00d8d..5c7bd4c 100644 --- a/crates/server/src/http/v1/post_execution_proof_requests.rs +++ b/crates/server/src/http/v1/post_execution_proof_requests.rs @@ -47,8 +47,8 @@ pub(crate) async fn post_execution_proof_requests( // Reject proof generation requests for verifier-only instances early, // before wasting resources on witness fetching. for proof_type in &proof_types { - if let Some(zkvm) = state.zkvms.get(proof_type) { - if matches!(zkvm, zkVMInstance::Verifier { .. }) { + if let Some(zkvm) = state.zkvms.get(proof_type) + && matches!(zkvm, zkVMInstance::Verifier { .. }) { debug!( %proof_type, "rejecting proof request: verifier-only instance" @@ -57,7 +57,6 @@ pub(crate) async fn post_execution_proof_requests( "proof generation not supported for verifier-only zkvm '{proof_type}'" ))); } - } } let new_payload_request = NewPayloadRequest::::from_ssz_bytes(&body) From 0508ddb0c24af2017a7affc3e4d7728d06e96634 Mon Sep 17 00:00:00 2001 From: Chetany Bhardwaj Date: Thu, 14 May 2026 23:15:55 +0530 Subject: [PATCH 3/3] fix: rustfmt formatting --- .../http/v1/post_execution_proof_requests.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/crates/server/src/http/v1/post_execution_proof_requests.rs b/crates/server/src/http/v1/post_execution_proof_requests.rs index 5c7bd4c..92be0d3 100644 --- a/crates/server/src/http/v1/post_execution_proof_requests.rs +++ b/crates/server/src/http/v1/post_execution_proof_requests.rs @@ -48,15 +48,16 @@ pub(crate) async fn post_execution_proof_requests( // before wasting resources on witness fetching. for proof_type in &proof_types { if let Some(zkvm) = state.zkvms.get(proof_type) - && matches!(zkvm, zkVMInstance::Verifier { .. }) { - debug!( - %proof_type, - "rejecting proof request: verifier-only instance" - ); - return Err(ErrorResponse::bad_request(format!( - "proof generation not supported for verifier-only zkvm '{proof_type}'" - ))); - } + && matches!(zkvm, zkVMInstance::Verifier { .. }) + { + debug!( + %proof_type, + "rejecting proof request: verifier-only instance" + ); + return Err(ErrorResponse::bad_request(format!( + "proof generation not supported for verifier-only zkvm '{proof_type}'" + ))); + } } let new_payload_request = NewPayloadRequest::::from_ssz_bytes(&body)