Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed Apr 13, 2023
1 parent 152907c commit 6eb947c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,16 @@ std::vector<uint32_t> add_variables(auto& composer, std::vector<fr> variables)
*/
// 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 will disagree.
// element in the selectors will disagree.
void verify_consistency(honk::UltraProver& honk_prover, plonk::UltraProver& plonk_prover)
{
// Check that all lagrange polys agree (except for sigmas/ids which are constructed differently for Honk)
// 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;
bool is_sorted_table = (key.find("s_") != std::string::npos);
bool is_table = (key.find("table_value_") != std::string::npos);
// bool is_not_selector = (key.find("sigma") == std::string::npos) && (key.find("id") == std::string::npos);
if (plonk_store.contains(key) && (is_sorted_table || is_table)) {
ASSERT_EQ(honk_store.get(key), plonk_store.get(key));
}
Expand Down Expand Up @@ -155,7 +154,6 @@ TEST(UltraHonkComposer, create_gates_from_plookup_accumulators)
auto honk_prover = honk_composer.create_prover();
auto plonk_prover = plonk_composer.create_prover();

check_consistency(honk_prover, plonk_prover);
verify_consistency(honk_prover, plonk_prover);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ using namespace proof_system::honk;
namespace test_honk_relations {

/**
* @brief Test the correctness of the Standard Honk rleations
* @brief Test the correctness of the Standard Honk relations
*
* @details Check that the constraints encoded by the relations are satisfied by the polynomials produced by the
* Standard Honk Composer for a real circuit.
Expand Down Expand Up @@ -124,7 +124,7 @@ TEST(RelationCorrectness, StandardRelationCorrectness)
}

/**
* @brief Test the correctness of the Ultra Honk rleations
* @brief Test the correctness of the Ultra Honk relations
*
* @details Check that the constraints encoded by the relations are satisfied by the polynomials produced by the
* Ultra Honk Composer for a real circuit.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ void compute_honk_style_permutation_lagrange_polynomials_from_mapping(
current_permutation_poly[i] =
-barretenberg::fr(current_mapping.row_index + 1 + num_gates * current_mapping.column_index);
} else if (current_mapping.is_tag) {
// TODO(luke): enough to simply make these disjoint from non-tag values?
current_permutation_poly[i] = barretenberg::fr::zero();
// Set evaluations to (arbitrary) values disjoint from non-tag values
current_permutation_poly[i] = num_gates * program_width + current_mapping.row_index;
} else {
// For the regular permutation we simply point to the next location by setting the evaluation to its
// index
Expand Down

0 comments on commit 6eb947c

Please sign in to comment.