From a25fd42e716a18e6728736913c99a1cb3baa044d Mon Sep 17 00:00:00 2001 From: AztecBot Date: Thu, 2 Apr 2026 14:22:05 +0000 Subject: [PATCH] fix: catch exceptions in ChonkBatchVerifier::batch_check for corrupted proofs PR #22263 replaced BB_ASSERT(val.on_curve()) with throw_or_abort in field_conversion.hpp. Unlike BB_ASSERT, throw_or_abort is not gated by BB_DISABLE_ASSERTS(), so corrupted IPA proof data now throws std::runtime_error during deserialization in batch_check(). This crashed ChonkBatchVerifierTests.RandomMixedBatches which relies on graceful failure handling for tampered proofs. Wrap batch_reduce_verify in try-catch so exceptions trigger bisection (isolating the bad proof) instead of crashing. --- .../src/barretenberg/chonk/chonk_batch_verifier.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/chonk/chonk_batch_verifier.cpp b/barretenberg/cpp/src/barretenberg/chonk/chonk_batch_verifier.cpp index 44c213b4bd7a..2f164a4dc32c 100644 --- a/barretenberg/cpp/src/barretenberg/chonk/chonk_batch_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/chonk/chonk_batch_verifier.cpp @@ -227,7 +227,15 @@ bool ChonkBatchVerifier::batch_check(const std::vector& results, c } auto ipa_vk = VerifierCommitmentKey{ ECCVMFlavor::ECCVM_FIXED_SIZE }; - return IPA::batch_reduce_verify(ipa_vk, claims, transcripts); + try { + return IPA::batch_reduce_verify(ipa_vk, claims, transcripts); + } catch (const std::exception& e) { + info("ChonkBatchVerifier: batch_check threw: ", e.what()); + return false; + } catch (...) { + info("ChonkBatchVerifier: batch_check threw unknown exception"); + return false; + } } void ChonkBatchVerifier::bisect(std::vector& results,