From f82b201f1dfe3daf5f2d90ee6cf6a699b2f7f4bd Mon Sep 17 00:00:00 2001 From: Eduard S Date: Wed, 3 May 2023 15:31:58 +0200 Subject: [PATCH] Revert double-assignment mock prover check Revert the check introduced in https://github.com/privacy-scaling-explorations/halo2/pull/129 to detect double assignments with different values, because it breaks some tests in the zkevm project. There's a legitimate use case of double assignment with different values, which is overwriting cells in order to perform negative tests (tests with bad witness that should not pass the constraints). Also in the EVM Circuit from the zkevm project we "abuse" the assignment of cells as a cache: sometimes we assign some cells with a guess value, and later on we reassign with the correct value. I believe this check is interesting to have, so we could think of ways to add it back as an optional feature. --- halo2_proofs/src/dev.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/halo2_proofs/src/dev.rs b/halo2_proofs/src/dev.rs index 8ac379cfac..98b99012ce 100644 --- a/halo2_proofs/src/dev.rs +++ b/halo2_proofs/src/dev.rs @@ -461,12 +461,7 @@ impl Assignment for MockProver { .get_mut(column.index()) .and_then(|v| v.get_mut(row)) .expect("bounds failure"); - if let CellValue::Assigned(value) = value { - // Inconsistent assignment between different phases. - assert_eq!(value, &to, "value={:?}, to={:?}", value, &to); - } else { - *value = CellValue::Assigned(to); - } + *value = CellValue::Assigned(to); } Err(err) => { // Propagate `assign` error if the column is in current phase.