-
Notifications
You must be signed in to change notification settings - Fork 598
feat: Protogalaxy Decider and complete folding tests #3657
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
6313f15
40cedd0
c7cc936
59c69f2
aed27df
265f248
44da63f
7ffc364
62df97a
9d1b5c6
42ac7e2
75221fb
bc63909
7d3e01b
2287a76
86963a5
a816c4b
91ca591
abb6ed2
81f7d89
73068a6
a86a9b4
a51d686
df7a62c
1ff05b6
1ed19f2
dea27c1
05bf621
073db88
e9079f3
348f561
c380cea
068ea31
cbec5d6
9d16416
0472c10
2ae95d2
a2da6d4
c0d39d8
740d1c8
985c006
a19ae07
fdb9b6c
4581a0c
aa0acca
a13ee93
5634ed1
ae55902
d1f7246
4fa6c3d
d43677d
4adac47
c2e78b5
5c29867
c5c7c61
ff37810
9796186
649fdeb
1d24643
a720c80
e6e5db3
ee926f8
89bf847
828ab91
ac8b77c
4cc7742
3e96712
4c62760
c8909d0
35c20e7
98a7b6c
9b49bab
81845c9
4bce6e8
1cfabf9
79408ed
ba7ecf5
a1d44a7
bcfd79a
fdd9311
afd16d5
de77d6e
dd0505e
c7dec72
413a801
8debe53
c765771
62baf45
a8812f6
8cb1d9e
4900dae
be3a223
deb239e
ecf84ce
5cc73f1
4c4d664
65c6aeb
4f7d79b
7ae0880
066f35c
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 |
|---|---|---|
|
|
@@ -351,8 +351,7 @@ | |
| "acvm_backend.wasm", | ||
| "barretenberg", | ||
| "wasi", | ||
| "env", | ||
| "honk_tests" | ||
| "env" | ||
| ] | ||
| }, | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,9 +7,6 @@ | |
| * simplify the codebase. | ||
| */ | ||
|
|
||
| #include "barretenberg/ecc/curves/bn254/bn254.hpp" | ||
|
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. discovered a couple of places that could do with less include statements |
||
| #include "barretenberg/ecc/curves/bn254/pairing.hpp" | ||
| #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" | ||
| #include "barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp" | ||
| #include "barretenberg/numeric/bitop/pow.hpp" | ||
| #include "barretenberg/polynomials/polynomial.hpp" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| #pragma once | ||
| #include "thread.hpp" | ||
|
|
||
| namespace barretenberg::thread_utils { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,7 +68,6 @@ class GoblinUltra { | |
|
|
||
| static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>(); | ||
| static constexpr size_t MAX_TOTAL_RELATION_LENGTH = compute_max_total_relation_length<Relations>(); | ||
| static constexpr size_t NUMBER_OF_SUBRELATIONS = compute_number_of_subrelations<Relations>(); | ||
|
|
||
| // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta` | ||
| // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation | ||
|
|
@@ -77,6 +76,12 @@ class GoblinUltra { | |
| static constexpr size_t BATCHED_RELATION_TOTAL_LENGTH = MAX_TOTAL_RELATION_LENGTH + 1; | ||
| static constexpr size_t NUM_RELATIONS = std::tuple_size_v<Relations>; | ||
|
|
||
| // For instances of this flavour, used in folding, we need a unique sumcheck batching challenges for each | ||
| // subrelation. This | ||
| // is because using powers of alpha would increase the degree of Protogalaxy polynomial $G$ (the combiner) to much. | ||
| static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>(); | ||
| using RelationSeparator = std::array<FF, NUM_SUBRELATIONS - 1>; | ||
|
|
||
| template <size_t NUM_INSTANCES> | ||
| using ProtogalaxyTupleOfTuplesOfUnivariates = | ||
| decltype(create_protogalaxy_tuple_of_tuples_of_univariates<Relations, NUM_INSTANCES>()); | ||
|
|
@@ -85,7 +90,6 @@ class GoblinUltra { | |
|
|
||
| // Whether or not the first row of the execution trace is reserved for 0s to enable shifts | ||
| static constexpr bool has_zero_row = true; | ||
|
|
||
| /** | ||
| * @brief A base class labelling precomputed entities and (ordered) subsets of interest. | ||
| * @details Used to build the proving key and verification key. | ||
|
|
@@ -448,14 +452,58 @@ class GoblinUltra { | |
| this->lagrange_ecc_op = verification_key->lagrange_ecc_op; | ||
| this->databus_id = verification_key->databus_id; | ||
| } | ||
|
|
||
| VerifierCommitments_(const std::shared_ptr<VerificationKey>& verification_key, | ||
| const WitnessCommitments& witness_commitments) | ||
| { | ||
| this->q_m = verification_key->q_m; | ||
| this->q_l = verification_key->q_l; | ||
| this->q_r = verification_key->q_r; | ||
| this->q_o = verification_key->q_o; | ||
| this->q_4 = verification_key->q_4; | ||
| this->q_c = verification_key->q_c; | ||
| this->q_arith = verification_key->q_arith; | ||
| this->q_sort = verification_key->q_sort; | ||
| this->q_elliptic = verification_key->q_elliptic; | ||
| this->q_aux = verification_key->q_aux; | ||
| this->q_lookup = verification_key->q_lookup; | ||
| this->q_busread = verification_key->q_busread; | ||
| this->q_poseidon2_external = verification_key->q_poseidon2_external; | ||
| this->q_poseidon2_internal = verification_key->q_poseidon2_internal; | ||
| this->sigma_1 = verification_key->sigma_1; | ||
| this->sigma_2 = verification_key->sigma_2; | ||
| this->sigma_3 = verification_key->sigma_3; | ||
| this->sigma_4 = verification_key->sigma_4; | ||
| this->id_1 = verification_key->id_1; | ||
| this->id_2 = verification_key->id_2; | ||
| this->id_3 = verification_key->id_3; | ||
| this->id_4 = verification_key->id_4; | ||
| this->table_1 = verification_key->table_1; | ||
| this->table_2 = verification_key->table_2; | ||
| this->table_3 = verification_key->table_3; | ||
| this->table_4 = verification_key->table_4; | ||
| this->lagrange_first = verification_key->lagrange_first; | ||
| this->lagrange_last = verification_key->lagrange_last; | ||
| this->lagrange_ecc_op = verification_key->lagrange_ecc_op; | ||
| this->databus_id = verification_key->databus_id; | ||
|
|
||
| this->w_l = witness_commitments.w_l; | ||
| this->w_r = witness_commitments.w_r; | ||
| this->w_o = witness_commitments.w_o; | ||
| this->sorted_accum = witness_commitments.sorted_accum; | ||
| this->w_4 = witness_commitments.w_4; | ||
| this->z_perm = witness_commitments.z_perm; | ||
| this->z_lookup = witness_commitments.z_lookup; | ||
| this->ecc_op_wire_1 = witness_commitments.ecc_op_wire_1; | ||
| this->ecc_op_wire_2 = witness_commitments.ecc_op_wire_2; | ||
| this->ecc_op_wire_3 = witness_commitments.ecc_op_wire_3; | ||
| this->calldata = witness_commitments.calldata; | ||
| this->calldata = witness_commitments.calldata_read_counts; | ||
| this->lookup_inverses = witness_commitments.lookup_inverses; | ||
| } | ||
| }; | ||
| // Specialize for GoblinUltra (general case used in GoblinUltraRecursive). | ||
| using VerifierCommitments = VerifierCommitments_<Commitment, VerificationKey>; | ||
| class FoldingParameters { | ||
|
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. established the Folding Parameters shouldn't really be something defined in the flavor because they are the same regardless of what flavor we use |
||
| public: | ||
| std::vector<FF> gate_challenges; | ||
| FF target_sum; | ||
| }; | ||
|
|
||
| /** | ||
| * @brief Derived class that defines proof structure for GoblinUltra proofs, as well as supporting functions. | ||
|
|
||
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.
we don't have honk_tests anymore?