Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MockProver] bug: query_instance always triggers VerifyFailure::CellNotAssigned. #621

Closed
therealyingtong opened this issue Jul 5, 2022 · 2 comments · Fixed by #622
Closed
Assignees

Comments

@therealyingtong
Copy link
Collaborator

therealyingtong commented Jul 5, 2022

In the current MockProver, query_instance always results in a VerifyFailure::CellNotAssigned when used in a gate with a selector. This is because we only look for assigned cells in the region where the gate was activated, and instance cells are not in any region.

gate.queried_cells().iter().filter_map(move |cell| {
// Determine where this cell should have been assigned.
let cell_row = ((gate_row + n + cell.rotation.0) % n) as usize;
// Check that it was assigned!
if r.cells.contains(&(cell.column, cell_row)) {
None
} else {
Some(VerifyFailure::CellNotAssigned {
gate: (gate_index, gate.name()).into(),
region: (r_i, r.name.clone()).into(),
gate_offset: *selector_row,
column: cell.column,
offset: cell_row as isize - r.rows.unwrap().0 as isize,
})
}
})

@therealyingtong
Copy link
Collaborator Author

Thank you @nalinbhardwaj for surfacing this bug 🐛

@therealyingtong therealyingtong self-assigned this Jul 5, 2022
@therealyingtong therealyingtong changed the title [MockProver] bug: query_instance does not work in MockProver. [MockProver] bug: query_instance always triggers VerifyFailure::CellNotAssigned. Jul 5, 2022
@themighty1
Copy link

@str4d , is there a reason why #622 is still pending your review?
I'm finding this bug to slow down development, since I have to wait a long time to start up the real Prover every time I need to debug the circuit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants