From 08e338801079fb9c1350b35f363b3fee1fa60423 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Thu, 2 Apr 2026 13:45:58 +0000 Subject: [PATCH] fix: add try-catch in ChonkBatchVerifier::batch_check for on-curve validation PR #22263 replaced BB_ASSERT(val.on_curve()) with throw_or_abort() in field_conversion.hpp. This bypasses BB_DISABLE_ASSERTS() and causes batch_check to crash when deserializing corrupted IPA proof points. Wrap batch_check internals in try-catch so corrupted proofs trigger bisection instead of terminating the process. --- .../chonk/chonk_batch_verifier.cpp | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/chonk/chonk_batch_verifier.cpp b/barretenberg/cpp/src/barretenberg/chonk/chonk_batch_verifier.cpp index 44c213b4bd7a..f31b0fcd57e0 100644 --- a/barretenberg/cpp/src/barretenberg/chonk/chonk_batch_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/chonk/chonk_batch_verifier.cpp @@ -216,18 +216,23 @@ bool ChonkBatchVerifier::batch_check(const std::vector& results, c set_parallel_for_concurrency(num_cores_); - // Collect IPA claims and transcripts for batch verification - std::vector> claims; - std::vector> transcripts; - claims.reserve(indices.size()); - transcripts.reserve(indices.size()); - for (size_t idx : indices) { - claims.push_back(results[idx].ipa_claim); - transcripts.push_back(std::make_shared(results[idx].ipa_proof)); - } + try { + // Collect IPA claims and transcripts for batch verification + std::vector> claims; + std::vector> transcripts; + claims.reserve(indices.size()); + transcripts.reserve(indices.size()); + for (size_t idx : indices) { + claims.push_back(results[idx].ipa_claim); + transcripts.push_back(std::make_shared(results[idx].ipa_proof)); + } - auto ipa_vk = VerifierCommitmentKey{ ECCVMFlavor::ECCVM_FIXED_SIZE }; - return IPA::batch_reduce_verify(ipa_vk, claims, transcripts); + auto ipa_vk = VerifierCommitmentKey{ ECCVMFlavor::ECCVM_FIXED_SIZE }; + return IPA::batch_reduce_verify(ipa_vk, claims, transcripts); + } catch (const std::exception& e) { + info("ChonkBatchVerifier: batch_check exception: ", e.what()); + return false; + } } void ChonkBatchVerifier::bisect(std::vector& results,