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

Invalid proofs when proving in parallel. #23

Open
recmo opened this issue Mar 18, 2022 · 1 comment
Open

Invalid proofs when proving in parallel. #23

recmo opened this issue Mar 18, 2022 · 1 comment

Comments

@recmo
Copy link
Contributor

recmo commented Mar 18, 2022

The ProvingKey<Bn254>, ConstraintMatrices<Fr> are shared through constant reference. WitnessCalculator is cloned and passed as mutable reference.

@recmo
Copy link
Contributor Author

recmo commented Mar 18, 2022

Adding a Mutex around the WitnessCalculator solves it. So .clone() on it is not actually safe.

The clone call happens concurrently (because the types allow it). Forcing the clone to be sequential does not solve the issue. Forcing calculate_witness_element to be sequential does solve it. This despite the calls being on separated clones instances. So it appears that clone() creates unsafe shared state.

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

No branches or pull requests

2 participants
@recmo and others