1882 Commits

Author SHA1 Message Date
Daniel Lubarov
595e751ac1 Shrink STARK proofs to a constant degree
The goal here is to end up with a single "root" circuit representing any EVM proof. I.e. it must verify each STARK, but be general enough to work with any combination of STARK sizes (within some range of sizes that we chose to support). This root circuit can then be plugged into our aggregation circuit.

In particular, for each STARK, and for each initial `degree_bits` (within a range that we choose to support), this adds a "shrinking chain" of circuits. Such a chain shrinks a STARK proof from that initial `degree_bits` down to a constant, `THRESHOLD_DEGREE_BITS`.

The root circuit then combines these shrunk-to-constant proofs for each table. It's similar to `RecursiveAllProof::verify_circuit`; I adapted the code from there and I think we can remove it after. The main difference is that now instead of having one verification key per STARK, we have several possible VKs, one per initial `degree_bits`. We bake the list of possible VKs into the root circuit, and have the prover indicate the index of the VK they're actually using.

This also partially removes the default feature of CTLs. So far we've used filters instead of defaults. Until now it was easy to keep supporting defaults just in case, but here maintaining support would require some more work. E.g. we couldn't use `exp_u64` any more, since the size delta is now dynamic, it can't be hardcoded. If there are no concerns, I'll fully remove the feature after.
2023-01-01 23:11:39 -08:00
Dmitry Vagner
5cd86b6652 names and format 2022-12-30 20:58:04 -08:00
Dmitry Vagner
2b91a1a664 simplify miller loop 2022-12-30 20:08:22 -08:00
Dmitry Vagner
de494dcf3b remove prints 2022-12-29 14:12:36 -08:00
Dmitry Vagner
77798f889e remove loop endpoint 2022-12-29 14:12:03 -08:00
Dmitry Vagner
de8637ce8c name 2022-12-29 14:03:52 -08:00
Dmitry Vagner
cca75c7713 remove redundant definition 2022-12-27 18:42:34 -08:00
Dmitry Vagner
c0744d76b9 TATE TEST PASSES 2022-12-27 18:38:20 -08:00
Dmitry Vagner
1f17673457 better vec to fp12 2022-12-27 16:28:20 -08:00
Dmitry Vagner
9beca707e5 clean 2022-12-27 16:21:56 -08:00
Dmitry Vagner
84fab8d6be clean 2022-12-27 16:19:08 -08:00
Dmitry Vagner
d4d80f3528 rearrange 2022-12-27 16:02:55 -08:00
Dmitry Vagner
826702a756 clean 2022-12-27 16:00:16 -08:00
Dmitry Vagner
f1d5c6bfb9 tuck const 2022-12-27 15:10:59 -08:00
Dmitry Vagner
e35644e9e0 miller test passes 2022-12-27 14:55:47 -08:00
Dmitry Vagner
ef824110fd miller in rust 2022-12-27 14:16:22 -08:00
Dmitry Vagner
f2787a06a0 more clean 2022-12-22 17:39:18 -08:00
Dmitry Vagner
31ee898770 clippy 2022-12-22 17:15:21 -08:00
Dmitry Vagner
b1f31cafec more cleaning 2022-12-22 17:07:24 -08:00
Dmitry Vagner
89093b4df5 clean up 2022-12-22 15:10:29 -08:00
Dmitry Vagner
7af11f4340 clean up prover code 2022-12-21 14:55:07 -08:00
Dmitry Vagner
d5cec0e68f clean up code org 2022-12-21 14:52:54 -08:00
Dmitry Vagner
3c566e987c tangent and cords work 2022-12-20 21:53:52 -08:00
Dmitry Vagner
bde569a2f3 it runs 2022-12-20 18:36:00 -08:00
Dmitry Vagner
bf7da1c205 POP 2022-12-20 18:31:26 -08:00
Dmitry Vagner
41476ce451 fix 2022-12-20 17:32:06 -08:00
Dmitry Vagner
cee6c6539e hex 2022-12-20 17:27:12 -08:00
Dmitry Vagner
a99b7d51b1 setup miller 2022-12-20 17:23:05 -08:00
Dmitry Vagner
6a93a6bee8 rename 2022-12-20 16:57:54 -08:00
Dmitry Vagner
e88e28a19c POWER WORKS 2022-12-20 16:33:28 -08:00
Dmitry Vagner
e9e5528cc8 space 2022-12-20 15:56:07 -08:00
Dmitry Vagner
5aab8ac06a first part works 2022-12-20 15:37:41 -08:00
Dmitry Vagner
bc3adc1663 debug pow 2022-12-20 15:10:53 -08:00
Dmitry Vagner
05e835267a test 2022-12-20 12:47:36 -08:00
Dmitry Vagner
7cd0dbaed9 setup pow 2022-12-20 12:47:09 -08:00
Dmitry Vagner
32758829ba refactor 2022-12-20 12:29:48 -08:00
Dmitry Vagner
950771a6ea clean up inverse 2022-12-20 12:21:27 -08:00
Dmitry Vagner
95383db49d inverse edits 2022-12-20 11:57:45 -08:00
Dmitry Vagner
c4e512ef9f Merge branch 'main' of github.com:mir-protocol/plonky2 into non-inv 2022-12-20 11:45:55 -08:00
Dmitry Vagner
c246297158 inverse works 2022-12-20 00:47:57 -08:00
Dmitry Vagner
7788a29f4a skeleton inv 2022-12-20 00:22:59 -08:00
Daniel Lubarov
b8e97aaaf8 Fix logic and Keccak CTLs
Lots of little bugs!

- The Keccak sponge table's padding logic was wrong, it was mixing up the number of rows with the number of hashes.
- The Keccak sponge table's Keccak-looking data was wrong - input to Keccak-f should be after xor'ing in the block.
- The Keccak sponge table's logic-looking filter was wrong. We do 5 logic CTLs for any final-block row, even if some of the xors are with 0s from Keccak padding.
- The CPU was using the wrong/outdated output memory channel for its Keccak sponge and logic CTLs.
- The Keccak table just didn't have a way to filter out padding rows. I added a filter column for this.
- The Keccak table wasn't remembering the original preimage of a permutation; lookers were seeing the preimage of the final step. I added columns for the original preimage.
- `ctl_data_logic` was using the wrong memory channel
- Kernel bootloading generation was using the wrong length for its Keccak sponge CTL, and its `keccak_sponge_log` was seeing the wrong clock since it was called after adding the final bootloading row.
2022-12-19 15:42:59 -08:00
Dmitry Vagner
a503b05813 fix 2022-12-19 14:39:23 -08:00
Dmitry Vagner
15ee75f2ea all but inv 2022-12-16 17:46:50 -08:00
Dmitry Vagner
d6c7e319bd all but inv 2022-12-16 17:35:52 -08:00
Dmitry Vagner
cefbe248fa frob tests work 2022-12-15 17:00:38 -08:00
Dmitry Vagner
c598b94204 refactor 2022-12-15 14:08:23 -08:00
Dmitry Vagner
14982d480f naming 2022-12-15 13:20:16 -08:00
Dmitry Vagner
d0247017e2 delete dead code 2022-12-15 13:18:20 -08:00
Dmitry Vagner
9063e900fb streamline tests 2022-12-15 13:18:00 -08:00