-
Notifications
You must be signed in to change notification settings - Fork 105
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
refactor!: Use circuit builders #501
Changes from 3 commits
2b681d2
4fe7ac2
ae2f094
56ebb56
a779895
bfd910f
7b4ed77
bc4bcbe
33f31ab
83412a7
83cf7d9
08e2741
dc05a2c
40e4d69
ecea160
4e7006d
5b10604
e3e1d45
063250b
624b4fa
c32e542
8a4c34c
4b9b7be
e95b048
0fdd8b5
ed6131f
ae5e01f
27f0b68
a084cb7
7d5d87c
9eb2f1e
c0503b8
665a54a
09baba7
44851bd
0d82d1f
9788410
180041f
89c9bde
a9aa020
d0a277f
30e714e
bd46581
e87617c
1fea680
77fbc30
61b2c6c
3773724
0a13946
0493ef0
efb4119
daec1bc
b053b79
02f9bd4
86ed54f
4a642c6
dc25ece
a33cb5b
a6ab841
22d2ff6
63a814d
36a8a24
e3954de
74124ba
77742d6
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 |
---|---|---|
|
@@ -53,6 +53,8 @@ template <typename OuterComposer> class stdlib_verifier : public testing::Test { | |
fr_ct(witness_ct(&composer, 0))); | ||
|
||
big_a* big_b; | ||
|
||
info("Inner circuit size: ", composer.num_gates); | ||
}; | ||
|
||
/** | ||
|
@@ -136,7 +138,8 @@ template <typename OuterComposer> class stdlib_verifier : public testing::Test { | |
verification_key_pt::from_witness(&outer_composer, verification_key_native); | ||
|
||
info("Constructing the ultra (inner) proof ..."); | ||
plonk::proof recursive_proof = prover.construct_proof(); | ||
plonk::proof recursive_proof = | ||
prover.construct_proof(); // WORKTODO: this is the proof that the outer circuit verifies | ||
|
||
{ | ||
// Native check is mainly for comparison vs circuit version of the verifier. | ||
|
@@ -150,7 +153,7 @@ template <typename OuterComposer> class stdlib_verifier : public testing::Test { | |
} | ||
|
||
info("Verifying the ultra (inner) proof natively..."); | ||
auto native_result = native_verifier.verify_proof(recursive_proof); | ||
auto native_result = native_verifier.verify_proof(recursive_proof); // WORKTODO | ||
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. what is the TODO referring to here 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.
|
||
|
||
info("Native result: ", native_result); | ||
} | ||
|
@@ -289,6 +292,9 @@ template <typename OuterComposer> class stdlib_verifier : public testing::Test { | |
|
||
auto circuit_output = create_outer_circuit(inner_composer, outer_composer); | ||
|
||
outer_composer.circuit_constructor.check_circuit(); | ||
info("Checked circuit after creating outer circuit"); | ||
|
||
g1::affine_element P[2]; | ||
P[0].x = barretenberg::fq(circuit_output.aggregation_state.P0.x.get_value().lo); | ||
P[0].y = barretenberg::fq(circuit_output.aggregation_state.P0.y.get_value().lo); | ||
|
@@ -307,21 +313,23 @@ template <typename OuterComposer> class stdlib_verifier : public testing::Test { | |
|
||
EXPECT_EQ(outer_composer.failed(), false); | ||
|
||
info("creating prover for outer circuit"); | ||
info("composer gates = ", outer_composer.get_num_gates()); | ||
auto prover = outer_composer.create_prover(); | ||
info("created prover for outer circuit"); | ||
info("Executing check of full circuit:"); | ||
bool result = outer_composer.circuit_constructor.check_circuit(); | ||
// info("creating prover for outer circuit"); | ||
// info("composer gates = ", outer_composer.get_num_gates()); | ||
// auto prover = outer_composer.create_prover(); | ||
// info("created prover for outer circuit"); | ||
|
||
info("creating verifier for outer proof"); | ||
auto verifier = outer_composer.create_verifier(); | ||
// info("creating verifier for outer proof"); | ||
// auto verifier = outer_composer.create_verifier(); | ||
|
||
info("creating outer proof for outer circuit"); | ||
plonk::proof proof = prover.construct_proof(); | ||
info("created outer proof"); | ||
// info("creating outer proof for outer circuit"); | ||
// plonk::proof proof = prover.construct_proof(); | ||
// info("created outer proof"); | ||
|
||
info("verifying the outer proof"); | ||
bool result = verifier.verify_proof(proof); | ||
info("Outer proof verification result: ", result); | ||
// info("verifying the outer proof"); | ||
// bool result = verifier.verify_proof(proof); // WORKTODO | ||
// info("Outer proof verification result: ", result); | ||
|
||
EXPECT_EQ(result, true); | ||
} | ||
|
@@ -365,7 +373,7 @@ template <typename OuterComposer> class stdlib_verifier : public testing::Test { | |
info("created outer proof"); | ||
|
||
info("verifying the outer proof"); | ||
bool result = verifier.verify_proof(proof); | ||
bool result = verifier.verify_proof(proof); // WORKTODO | ||
info("Outer proof verification result: ", result); | ||
|
||
EXPECT_EQ(result, true); | ||
|
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.
what is the difference between WORKTODO and a regular TODO?
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.
WORKTODO is something I search for and then resolve before putting the PR up for review.
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.
Tbh maybe I should use something shorter like
HEY
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.
Or perhaps
HMM
alla Zac