Skip to content

Commit f82b201

Browse files
committed
Revert double-assignment mock prover check
Revert the check introduced in #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.
1 parent 17e9765 commit f82b201

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

halo2_proofs/src/dev.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,7 @@ impl<F: Field> Assignment<F> for MockProver<F> {
461461
.get_mut(column.index())
462462
.and_then(|v| v.get_mut(row))
463463
.expect("bounds failure");
464-
if let CellValue::Assigned(value) = value {
465-
// Inconsistent assignment between different phases.
466-
assert_eq!(value, &to, "value={:?}, to={:?}", value, &to);
467-
} else {
468-
*value = CellValue::Assigned(to);
469-
}
464+
*value = CellValue::Assigned(to);
470465
}
471466
Err(err) => {
472467
// Propagate `assign` error if the column is in current phase.

0 commit comments

Comments
 (0)