Skip to content

Commit

Permalink
Revert double-assignment mock prover check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ed255 committed May 3, 2023
1 parent 17e9765 commit f82b201
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions halo2_proofs/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,7 @@ impl<F: Field> Assignment<F> for MockProver<F> {
.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.
Expand Down

0 comments on commit f82b201

Please sign in to comment.