fix: catch exceptions in ChonkBatchVerifier::batch_check for corrupted proofs#22278
Draft
AztecBot wants to merge 1 commit intomerge-train/barretenbergfrom
Draft
fix: catch exceptions in ChonkBatchVerifier::batch_check for corrupted proofs#22278AztecBot wants to merge 1 commit intomerge-train/barretenbergfrom
AztecBot wants to merge 1 commit intomerge-train/barretenbergfrom
Conversation
…d 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.
ludamad
requested changes
Apr 2, 2026
Collaborator
ludamad
left a comment
There was a problem hiding this comment.
This should not spoil the whole batch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #22263 replaced
BB_ASSERT(val.on_curve())withthrow_or_abortinfield_conversion.hpp. UnlikeBB_ASSERT,throw_or_abortis not gated byBB_DISABLE_ASSERTS(), so corrupted IPA proof data now throwsstd::runtime_errorduring deserialization inbatch_check(). This crashedChonkBatchVerifierTests.RandomMixedBatcheswhich relies on graceful failure handling for tampered proofs.Wrapped
batch_reduce_verifyin try-catch so exceptions trigger bisection (isolating the bad proof) instead of crashing. This matches the existing exception handling inparallel_reduce().Detailed analysis: https://gist.github.com/AztecBot/77137fb49556386b149db99b4f2f3e55
Test plan
ChonkBatchVerifierTests.RandomMixedBatchespasses./bootstrap.sh ci— all 6148 tests passClaudeBox log: https://claudebox.work/s/2f534a3f42ce7803?run=1