88 Commits

Author SHA1 Message Date
Daniel Lubarov
ac1872a8c8
FRI tweaks (#111)
- Call `exp_power_of_2` instead of manual squaring
- Replace `evaluations[i]` with `evals`
2021-07-20 12:49:02 -07:00
wborgeaud
0d233505d7 Merge branch 'main' into precomputed_reduced_evals
# Conflicts:
#	src/fri/recursive_verifier.rs
2021-07-20 11:08:53 +02:00
wborgeaud
fbeedd47d3 Minor 2021-07-20 11:02:22 +02:00
wborgeaud
38f4cca3f5 Target version 2021-07-20 10:57:20 +02:00
wborgeaud
97c4cfff7a Fixed bug 2021-07-20 10:44:58 +02:00
Daniel Lubarov
8438d23937
Tree of scopes (#106)
* Tree of scopes

This is an extension of the context concept.

Earlier I was planning to store a simple stack of contexts, but I ended up storing the whole history, in a tree structure. This gives us more control over the output, i.e. we can print the gate count of a parent scope before those of its child scopes, which seems more user-friendly.

Sample gate count output:

    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] 27829 gates to root
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | 2373 gates to evaluate the vanishing polynomial at our challenge point, zeta.
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | 1284 gates to evaluate gate constraints
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | 25312 gates to verify FRI proof
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | 650 gates to verify 0'th FRI query
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | | 96 gates to check FRI initial proof
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | | 65 gates to compute x from its index
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | | 233 gates to combine initial oracles
    ...

Sample copy constraint failure:

    Error: Copy constraint 'root > verify FRI proof > verify 0'th FRI query > check FRI initial proof > verify 0'th initial Merkle proof > check Merkle root: 0-th hash element' between wire 12 of gate #2550 [...] and wire 0 of gate #0 [...] is not satisfied. Got values of 6861386743364621393 and 0 respectively.

* No min

* info -> debug

* Move to its own file
2021-07-19 12:22:18 -07:00
wborgeaud
69dc14f88a Added PrecomputedReducedEvals struct 2021-07-19 20:46:18 +02:00
wborgeaud
8868378fda
Merge pull request #103 from mir-protocol/remove_frobenius_opening
Remove openings at the Frobenius of zeta
2021-07-19 16:57:19 +02:00
wborgeaud
52cc7c79f5 Remove openings at the Frobenius of zeta 2021-07-19 16:45:38 +02:00
wborgeaud
9baea1ae26 Trim final poly and check FRI arity 2021-07-19 16:24:21 +02:00
Daniel Lubarov
d11bcd1928
Optional zk (#101)
* Make ZK optional

* Remove rate from FriConfig

Seems redundant, and we've had some tests break due to the two fields not matching.

* zero_knowledge: false in bench
2021-07-18 23:24:33 -07:00
wborgeaud
461f24a57e Merge branch 'main' into more_recursive_verifier
# Conflicts:
#	src/polynomial/commitment.rs
#	src/proof.rs
2021-07-19 07:08:06 +02:00
Daniel Lubarov
573badc96f
Parallel proof-of-work search (#92) 2021-07-15 07:40:41 -07:00
wborgeaud
4bc06deed8 zs_root -> zs_partial_products_root 2021-07-15 10:59:53 +02:00
wborgeaud
fe05da6720 Clipp 2021-07-15 10:39:57 +02:00
wborgeaud
2e12ee8e82 Minor 2021-07-15 10:13:13 +02:00
wborgeaud
7dec6efc6c Rewrite Markable to avoid Arcs 2021-07-15 09:52:42 +02:00
wborgeaud
0ba5916346 Minor 2021-07-15 09:11:54 +02:00
wborgeaud
92c4bba2a3 Fix bug in GMiMC 2021-07-14 21:16:04 +02:00
wborgeaud
7793b5a956 Identify problem in GMiMc 2021-07-14 20:54:30 +02:00
wborgeaud
5c2c01b1ab Circuit compiles 2021-07-13 15:20:14 +02:00
wborgeaud
ad24f5d4d1 Almost working recursive verifier 2021-07-12 14:25:28 +02:00
wborgeaud
b86e60a397 Open the partial products polynomials only at zeta 2021-07-01 18:24:49 +02:00
wborgeaud
cc3c278a92 Some renaming 2021-07-01 17:34:00 +02:00
wborgeaud
625377b4c0 Merge constant and sigma polynomials 2021-06-25 11:24:26 +02:00
wborgeaud
26e669ddec 2 collects -> 1 collect 2021-06-23 11:33:50 +02:00
wborgeaud
01053ab96a Fix bug 2021-06-23 11:30:57 +02:00
wborgeaud
9db7dce738 scale -> reduce 2021-06-17 22:06:53 +02:00
wborgeaud
92e0f60c23 Clippy 2021-06-17 21:57:31 +02:00
wborgeaud
fe9cd3f76b Working commitments and verifier 2021-06-17 21:34:04 +02:00
wborgeaud
100ab6ce48 Merge branch 'main' into optimize_reductions
# Conflicts:
#	src/fri/verifier.rs
#	src/proof.rs
2021-06-17 19:43:32 +02:00
wborgeaud
f27620ca90 First impl 2021-06-17 19:40:41 +02:00
wborgeaud
bfd5f06384 Hardcode Plonk polynomials indices and blinding flags. 2021-06-17 11:54:31 +02:00
wborgeaud
930e117185 Minor 2021-06-17 11:35:10 +02:00
wborgeaud
5bebc746f6 PR feedback 2021-06-17 11:31:14 +02:00
wborgeaud
eaba5238a6 Change PoW to checking leading zeros 2021-06-17 09:49:41 +02:00
wborgeaud
8d999ab299 Rewrite insert gadget. 2021-06-16 10:43:18 +02:00
wborgeaud
4437012d2a Add num_bits to exp. 2021-06-16 08:56:58 +02:00
wborgeaud
8200bdcedc Add num_bits in split_low_high. 2021-06-16 08:40:28 +02:00
wborgeaud
89b25c528c PR feedback fixes 2021-06-15 19:13:15 +02:00
wborgeaud
b44a01c975 Merge main 2021-06-15 09:20:00 +02:00
wborgeaud
cfa5807556 Add insert gadget to insert inferred leaf in FRI query rounds 2021-06-14 15:15:22 +02:00
wborgeaud
670e48380a Finish recursive verifier 2021-06-14 13:26:22 +02:00
wborgeaud
19b47b5251 Clippy 2021-06-14 10:33:38 +02:00
wborgeaud
5200d70cf0 Add interpolation gadgets 2021-06-11 16:22:29 +02:00
wborgeaud
4b1f368e89 Use Frobenius optimization in the circuit 2021-06-11 14:16:40 +02:00
wborgeaud
20741cfb4a Implement out-of-circuit repeated_frobenius using hardcoded constants 2021-06-11 13:45:51 +02:00
wborgeaud
1ebeab2c3a Implement Frobenius optimization discussed in #61 comments to avoid calling the Frobenius for every wires. 2021-06-11 10:27:03 +02:00
wborgeaud
dea6db00ac Rotation gadgets 2021-06-10 17:45:45 +02:00
wborgeaud
f8dd35b748 Use low-high in query round. 2021-06-10 16:08:57 +02:00