-
Notifications
You must be signed in to change notification settings - Fork 599
feat!: Removes normalize() calls on pairing points #14285
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
1600053
8fea826
4c8e4e1
dd99736
dd6fd77
fc591f8
13f55b8
931c29e
cb4c5a8
3fb7adc
eaf091c
a96c1c4
4a23614
a4cb309
bbcf1a4
6f6e493
badfefc
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 |
|---|---|---|
|
|
@@ -249,7 +249,7 @@ template <typename RecursiveFlavor> class RecursiveVerifierTest : public testing | |
| } | ||
| // Check the size of the recursive verifier | ||
| if constexpr (std::same_as<RecursiveFlavor, MegaZKRecursiveFlavor_<UltraCircuitBuilder>>) { | ||
| uint32_t NUM_GATES_EXPECTED = 871733; | ||
| uint32_t NUM_GATES_EXPECTED = 871531; | ||
|
Contributor
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. drop because we removed normalize() calls |
||
| BB_ASSERT_EQ(static_cast<uint32_t>(outer_circuit.get_num_finalized_gates()), | ||
| NUM_GATES_EXPECTED, | ||
| "MegaZKHonk Recursive verifier changed in Ultra gate count! Update this value if you " | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #include "barretenberg/stdlib/pairing_points.hpp" | ||
| #include "barretenberg/srs/global_crs.hpp" | ||
| #include <gtest/gtest.h> | ||
|
|
||
| namespace bb::stdlib::recursion { | ||
|
|
||
| template <typename Builder> class PairingPointsTests : public testing::Test { | ||
| public: | ||
| static void SetUpTestSuite() { bb::srs::init_file_crs_factory(bb::srs::bb_crs_path()); } | ||
| }; | ||
|
|
||
| using Builders = testing::Types<UltraCircuitBuilder, MegaCircuitBuilder>; | ||
| TYPED_TEST_SUITE(PairingPointsTests, Builders); | ||
|
|
||
| TYPED_TEST(PairingPointsTests, ConstructDefault) | ||
lucasxia01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| TypeParam builder; | ||
| info("Num gates: ", builder.num_gates); | ||
| PairingPoints<TypeParam>::add_default_to_public_inputs(builder); | ||
| info("Num gates after add_default_to_public_inputs: ", builder.num_gates); | ||
| builder.finalize_circuit(/*ensure_nonzero=*/true); | ||
| info("Num gates: ", builder.num_gates); | ||
| EXPECT_TRUE(CircuitChecker::check(builder)); | ||
| } | ||
| } // namespace bb::stdlib::recursion | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,14 @@ template <typename Flavor> bool UltraVerifier_<Flavor>::verify_proof(const HonkP | |
|
|
||
| DeciderVerifier decider_verifier{ verification_key, transcript }; | ||
| auto decider_output = decider_verifier.verify(); | ||
| if (!decider_output.sumcheck_verified) { | ||
|
Contributor
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. because I added an assert to aggregate() that checks that the points are initialized with some real points (and not the points at infinity), we need to return early here, otherwise I would've had to change a bunch of tests from ASSERT_FALSE to ASSERT_DEATH, and I was too lazy to do that |
||
| info("Sumcheck failed!"); | ||
| return false; | ||
| } | ||
| if (!decider_output.libra_evals_verified) { | ||
| info("Libra evals failed!"); | ||
| return false; | ||
| } | ||
|
|
||
| // Extract nested pairing points from the proof | ||
| // TODO(https://github.com/AztecProtocol/barretenberg/issues/1094): Handle pairing points in keccak flavors. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,10 +155,6 @@ AvmRecursiveVerifier_<Flavor>::PairingPoints AvmRecursiveVerifier_<Flavor>::veri | |
| padding_indicator_array, claim_batcher, output.challenge, Commitment::one(&builder), transcript); | ||
|
|
||
| auto pairing_points = PCS::reduce_verify_batch_opening_claim(opening_claim, transcript); | ||
|
|
||
| // TODO(https://github.com/AztecProtocol/barretenberg/issues/1352): Investigate if normalize() calls are needed. | ||
| pairing_points[0] = pairing_points[0].normalize(); | ||
|
Contributor
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. hopefully, we won't hit random maximum_value failures in bigfield now that we set the dummy pairing points to be actual points and not arbitrary values |
||
| pairing_points[1] = pairing_points[1].normalize(); | ||
| return pairing_points; | ||
| } | ||
|
|
||
|
|
||
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.
I think these should be kept in sync with the ones in generate_civc_vks.sh no? We should probably setting this in one location and sharing it where needed