-
Notifications
You must be signed in to change notification settings - Fork 236
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
chore: add goblin ops in add_gates_to_ensure_all_polys_are_non_zero #5468
Changes from all commits
5413208
ddce4ab
7856e83
eff14e8
64f8996
0a5f456
e9cddbd
b6b9f63
af71b66
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ void GoblinAcirComposer::create_circuit(acir_format::AcirFormat& constraint_syst | |
acir_format::build_constraints(builder_, constraint_system, true); | ||
|
||
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. Its debatable whether we should remove the ops here. In the case of UGH, removing them is fine since eventually we'd like a world where we dont NEED goblin ops to make a valid proof. This one, however, is a Goblin specific test so it would defeat the purpose of the test to not have any ops. So when/if we get rid of the |
||
// TODO(https://github.com/AztecProtocol/barretenberg/issues/817): Add some arbitrary op gates to ensure the | ||
// associated polynomials are non-zero and to give ECCVM and Translator some ECC ops to process. | ||
// to give ECCVM and Translator some ECC ops to process. | ||
MockCircuits::construct_goblin_ecc_op_circuit(builder_); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,8 @@ TEST_F(GoblinRecursionTests, Vanilla) | |
size_t NUM_CIRCUITS = 2; | ||
for (size_t circuit_idx = 0; circuit_idx < NUM_CIRCUITS; ++circuit_idx) { | ||
|
||
// Construct and accumulate a mock function circuit | ||
// Construct and accumulate a mock function circuit containing both arbitrary arithmetic gates and goblin | ||
// ecc op gates to make it a meaningful test | ||
GoblinUltraCircuitBuilder function_circuit{ goblin.op_queue }; | ||
MockCircuits::construct_arithmetic_circuit(function_circuit, /*target_log2_dyadic_size=*/8); | ||
MockCircuits::construct_goblin_ecc_op_circuit(function_circuit); | ||
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. Same here |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,16 +62,15 @@ class MockCircuits { | |
} | ||
|
||
/** | ||
* @brief Populate a builder with some arbitrary goblinized ECC ops | ||
* @brief Populate a builder with some arbitrary goblinized ECC ops, one of each type | ||
* | ||
* @param builder | ||
*/ | ||
static void construct_goblin_ecc_op_circuit(GoblinUltraCircuitBuilder& builder) | ||
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. Maybe we should keep this function but expand it to include at least one of each type of op (mul, add, eq) and use this in the Goblin-specific places I mentioned to continue to ensure we're getting robust testing that's not implicitly tied to the _add_gates_to_ensure functionality. |
||
{ | ||
// Add a mul accum op and an equality op | ||
auto point = Point::one() * FF::random_element(); | ||
auto scalar = FF::random_element(); | ||
builder.queue_ecc_mul_accum(point, scalar); | ||
// Add a mul accum op, an add accum op and an equality op | ||
builder.queue_ecc_add_accum(Point::one() * FF::random_element()); | ||
builder.queue_ecc_mul_accum(Point::one() * FF::random_element(), FF::random_element()); | ||
builder.queue_ecc_eq(); | ||
} | ||
}; | ||
|
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.
The comments on this function may be a bit confusing/misleading - maybe we can change to say something like "default gates added to avoid nonzero polynomials will bump size to next power of 2"