-
Notifications
You must be signed in to change notification settings - Fork 129
Ultra Honk arithmetic and grand product relations #351
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
Changes from all commits
170111e
bb93534
736636d
26c621f
8e343cf
e5ba410
265e79f
bd1005e
eb7c95a
dff21ab
4c9f2b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,19 +39,25 @@ std::vector<uint32_t> add_variables(auto& composer, std::vector<fr> variables) | |
| * @param honk_prover | ||
| * @param plonk_prover | ||
| */ | ||
| // NOTE: Currently only checking witness polynomials (wires, sorted lists) and table polys. The permutation polys | ||
| // are computed differently between plonk and honk and we do not enforce non-zero selectors in Honk so the final | ||
| // element in the selectors will disagree. | ||
| void verify_consistency(honk::UltraProver& honk_prover, plonk::UltraProver& plonk_prover) | ||
| { | ||
| // Check that all lagrange polys agree | ||
| auto& honk_store = honk_prover.key->polynomial_store; | ||
| auto& plonk_store = plonk_prover.key->polynomial_store; | ||
| for (auto& entry : honk_store) { | ||
| std::string key = entry.first; | ||
| if (plonk_store.contains(key)) { | ||
| bool is_sorted_table = (key.find("s_") != std::string::npos); | ||
| bool is_table = (key.find("table_value_") != std::string::npos); | ||
| if (plonk_store.contains(key) && (is_sorted_table || is_table)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you not checking wires any more?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The wires are checked just below this. It has to be done in a separate loop since the wires are owned directly by the prover in Honk but they are still stored in the proving_key for Plonk. I've added a comment to clarify. |
||
| ASSERT_EQ(honk_store.get(key), plonk_store.get(key)); | ||
| } | ||
| } | ||
|
|
||
| // Check that all wires agree | ||
| // Note: for Honk, wires are owned directly by the prover. For Plonk they are stored in the key. | ||
| for (size_t i = 0; i < 4; ++i) { | ||
| std::string label = "w_" + std::to_string(i + 1) + "_lagrange"; | ||
| ASSERT_EQ(honk_prover.wire_polynomials[i], plonk_prover.key->polynomial_store.get(label)); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do this, we'll have to add the zero knowledge relation before we can create a valid proof, since selectors could easily be zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a very good point. We need to make sure our tests are not passing trivially with zero selectors until we decide how to proceed. Maybe we should prioritize issue #217 in the near future.