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 error hint #270

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ceno_zkvm/src/scheme/mock_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,15 @@ impl<'a, E: ExtensionField + Hash> MockProver<E> {
println!("======================================================");
println!("Error: {} constraints not satisfied", errors.len());

println!(
r"Hints:
- If you encounter a constraint error that sporadically occurs in different environments
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like we need to tighten up our constraints? Otherwise, a malicious prover might be able to exploit the UB?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like we need to tighten up our constraints? Otherwise, a malicious prover might be able to exploit the UB?

It not related to constraints :) This problem just related to the witnesses where we assuming them to be zero and skip their assignment, but actually unassigned witnesses is "undefined behaviour" due to we enclosed MaybeUint when allocated vector.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that makes sense.

Btw, why do we do these shenanigans? Have we done a benchmark to check whether MaybeUninit actually helps us?

(e.g., passes locally but fails in CI),
this often points to unassigned witnesses during the assignment phase.
Accessing these cells before they are properly written leads to undefined behavior.
"
);

for error in errors {
error.print(wits_in, &cb.cs.witin_namespace_map);
}
Expand Down
Loading