From c18f2dd5b30a38e993710b01c0444131dd0448ea Mon Sep 17 00:00:00 2001 From: CPerezz Date: Wed, 11 Jan 2023 12:19:51 +0100 Subject: [PATCH] fix: FailureLocation::find empty-region handling After working on fixing privacy-scaling-explorations/zkevm-circuits#1024, a bug was found in the verification fn of the MockProver which implies that while finding a FailureLocation, if a Region doesn't contain any rows. This is fixed by introducing a 2-line solution suggested by @lispc. Resolves: #117 --- halo2_proofs/src/dev/failure.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/halo2_proofs/src/dev/failure.rs b/halo2_proofs/src/dev/failure.rs index 2fcb2a1fc8..55505ae04c 100644 --- a/halo2_proofs/src/dev/failure.rs +++ b/halo2_proofs/src/dev/failure.rs @@ -90,6 +90,9 @@ impl FailureLocation { .iter() .enumerate() .find(|(_, r)| { + if r.rows.is_none() { + return false; + } let (start, end) = r.rows.unwrap(); // We match the region if any input columns overlap, rather than all of // them, because matching complex selector columns is hard. As long as