-
Notifications
You must be signed in to change notification settings - Fork 598
chore: Tube-related clean up #17064
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
Merged
Merged
chore: Tube-related clean up #17064
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ff121a8
Remove references to tube
federicobarbacovi de0fa54
Update assertions in acir format
federicobarbacovi 0b98286
Turn assert into vinfo
federicobarbacovi d1b4167
Update warning message
federicobarbacovi f128754
Trigger CI
federicobarbacovi aae4454
Trigger CI
federicobarbacovi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,122 +85,4 @@ TEST_F(ClientIVCRecursionTests, Basic) | |
| // Print the number of gates post finalization | ||
| info("Recursive Verifier: finalized num gates = ", builder.num_gates); | ||
| } | ||
|
|
||
| TEST_F(ClientIVCRecursionTests, ClientTubeBase) | ||
| { | ||
| using CIVCRecVerifierOutput = ClientIVCRecursiveVerifier::Output; | ||
|
|
||
| // Generate a genuine ClientIVC prover output | ||
| auto [proof, vk] = construct_client_ivc_prover_output(); | ||
|
|
||
| // Construct the ClientIVC recursive verifier | ||
| Builder tube_builder; | ||
| ClientIVCVerifier verifier{ &tube_builder, vk.mega }; | ||
|
|
||
| // Generate the recursive verification circuit | ||
| StdlibProof stdlib_proof(tube_builder, proof); | ||
| CIVCRecVerifierOutput client_ivc_rec_verifier_output = verifier.verify(stdlib_proof); | ||
|
|
||
| { | ||
| // IO | ||
| RollupIO inputs; | ||
| inputs.pairing_inputs = client_ivc_rec_verifier_output.points_accumulator; | ||
| inputs.ipa_claim = client_ivc_rec_verifier_output.opening_claim; | ||
| inputs.set_public(); | ||
| } | ||
|
|
||
| // The tube only calls an IPA recursive verifier once, so we can just add this IPA proof | ||
| tube_builder.ipa_proof = client_ivc_rec_verifier_output.ipa_proof.get_value(); | ||
|
|
||
| info("ClientIVC Recursive Verifier: num prefinalized gates = ", tube_builder.num_gates); | ||
|
|
||
| EXPECT_EQ(tube_builder.failed(), false) << tube_builder.err(); | ||
|
|
||
| // EXPECT_TRUE(CircuitChecker::check(tube_builder)); | ||
|
|
||
| // Construct and verify a proof for the ClientIVC Recursive Verifier circuit | ||
| auto prover_instance = std::make_shared<ProverInstance_<NativeFlavor>>(tube_builder); | ||
| auto native_vk_with_ipa = std::make_shared<NativeFlavor::VerificationKey>(prover_instance->get_precomputed()); | ||
| UltraProver_<NativeFlavor> tube_prover{ prover_instance, native_vk_with_ipa }; | ||
| // Prove the CIVCRecursiveVerifier circuit | ||
| auto native_tube_proof = tube_prover.construct_proof(); | ||
|
|
||
| // Natively verify the tube proof | ||
| VerifierCommitmentKey<curve::Grumpkin> ipa_verification_key(1 << CONST_ECCVM_LOG_N); | ||
| UltraVerifier_<NativeFlavor> native_verifier(native_vk_with_ipa, ipa_verification_key); | ||
| bool native_result = | ||
| native_verifier.template verify_proof<bb::RollupIO>(native_tube_proof, tube_prover.prover_instance->ipa_proof) | ||
| .result; | ||
| EXPECT_TRUE(native_result); | ||
|
|
||
| // Construct a base rollup circuit that recursively verifies the tube proof and forwards the IPA proof. | ||
| Builder base_builder; | ||
| auto tube_vk = std::make_shared<NativeFlavor::VerificationKey>(prover_instance->get_precomputed()); | ||
| auto stdlib_tube_vk_and_hash = std::make_shared<RollupFlavor::VKAndHash>(base_builder, tube_vk); | ||
| stdlib::Proof<Builder> base_tube_proof(base_builder, native_tube_proof); | ||
| UltraRecursiveVerifier base_verifier{ &base_builder, stdlib_tube_vk_and_hash }; | ||
| UltraRecursiveVerifierOutput<Builder> output = base_verifier.template verify_proof<RollupIO>(base_tube_proof); | ||
| info("Tube UH Recursive Verifier: num prefinalized gates = ", base_builder.num_gates); | ||
|
|
||
| { | ||
| // IO | ||
| RollupIO inputs; | ||
| inputs.pairing_inputs = output.points_accumulator; | ||
| inputs.ipa_claim = output.ipa_claim; | ||
| inputs.set_public(); | ||
| } | ||
|
|
||
| base_builder.ipa_proof = tube_prover.prover_instance->ipa_proof; | ||
| EXPECT_EQ(base_builder.failed(), false) << base_builder.err(); | ||
| EXPECT_TRUE(CircuitChecker::check(base_builder)); | ||
|
|
||
| // Natively verify the IPA proof for the base rollup circuit | ||
| auto base_prover_instance = std::make_shared<ProverInstance_<NativeFlavor>>(base_builder); | ||
| auto ipa_transcript = std::make_shared<NativeTranscript>(); | ||
| ipa_transcript->load_proof(base_prover_instance->ipa_proof); | ||
| IPA<curve::Grumpkin>::reduce_verify( | ||
| ipa_verification_key, output.ipa_claim.get_native_opening_claim(), ipa_transcript); | ||
| } | ||
|
|
||
| // Ensure that the Client IVC Recursive Verifier Circuit does not depend on the Client IVC input | ||
| TEST_F(ClientIVCRecursionTests, TubeVKIndependentOfInputCircuits) | ||
|
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. This test is a duplicate of this test in |
||
| { | ||
| // Retrieves the trace blocks (each consisting of a specific gate) from the recursive verifier circuit | ||
| auto get_blocks = [](size_t num_app_circuits) | ||
| -> std::tuple<typename Builder::ExecutionTrace, std::shared_ptr<NativeFlavor::VerificationKey>> { | ||
| auto [proof, ivc_vk] = construct_client_ivc_prover_output(num_app_circuits); | ||
|
|
||
| Builder tube_builder; | ||
| ClientIVCVerifier verifier{ &tube_builder, ivc_vk.mega }; | ||
|
|
||
| StdlibProof stdlib_proof(tube_builder, proof); | ||
| auto client_ivc_rec_verifier_output = verifier.verify(stdlib_proof); | ||
|
|
||
| // IO | ||
| RollupIO inputs; | ||
| inputs.pairing_inputs = client_ivc_rec_verifier_output.points_accumulator; | ||
| inputs.ipa_claim = client_ivc_rec_verifier_output.opening_claim; | ||
| inputs.set_public(); | ||
|
|
||
| // The tube only calls an IPA recursive verifier once, so we can just add this IPA proof | ||
| tube_builder.ipa_proof = client_ivc_rec_verifier_output.ipa_proof.get_value(); | ||
|
|
||
| info("ClientIVC Recursive Verifier: num prefinalized gates = ", tube_builder.num_gates); | ||
|
|
||
| EXPECT_EQ(tube_builder.failed(), false) << tube_builder.err(); | ||
|
|
||
| // Construct and verify a proof for the ClientIVC Recursive Verifier circuit | ||
| auto prover_instance = std::make_shared<ProverInstance_<NativeFlavor>>(tube_builder); | ||
|
|
||
| auto tube_vk = std::make_shared<NativeFlavor::VerificationKey>(prover_instance->get_precomputed()); | ||
|
|
||
| return { tube_builder.blocks, tube_vk }; | ||
| }; | ||
|
|
||
| auto [blocks_4, verification_key_4] = get_blocks(/*num_app_circuits=*/1); | ||
| auto [blocks_5, verification_key_5] = get_blocks(/*num_app_circuits=*/2); | ||
|
|
||
| compare_ultra_blocks_and_verification_keys<NativeFlavor>({ blocks_4, blocks_5 }, | ||
| { verification_key_4, verification_key_5 }); | ||
| } | ||
| } // namespace bb::stdlib::recursion::honk | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
This test is subsided by this test in
civc_recursion_constraints(in that test we prove and verify a circuit containing a CIVC recursive verifier, i.e., a tube circuit) and by ultra recursive verifier tests, which test that an ultra recursive verifier can be proven and verified.Together, these tests ensure that a CIVC recursive verifier can be proven and that its proof can be recursively verified, which are the two cases of interest: