43 Commits

Author SHA1 Message Date
Daniel Lubarov
ff80f28b93 Revert "Set CI to use an older version of nightly"
This reverts commit da23fb116b934925f8a5cf37c2f1f092452fdc4d.
2023-02-10 23:10:39 -08:00
Daniel Lubarov
137bc78565 Prep for publishing to crates.io 2023-01-30 13:18:06 -08:00
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
Daniel Lubarov
92974aa105 A few more cyclic recursion changes
In preparation for adding the zkEVM aggregation circuit. Mainly,

- Adds a `WitnessWrite` trait, a sub-trait of `Witness`, and move the write methods to it. `GeneratedValues` impls `WitnessWrite`, which lets generators like `DummyProofGenerator` access all our write methods like `set_proof_with_pis_target`. Also removes some duplication.

- Remove `set_cyclic_recursion_data_target` - now that dummy proof data is automatically populated, all that remains is populating `condition` and the cyclic proof + VK. I think it's easy enough for callers to do this; the steps are the same as with `conditionally_verify_proof`. This way there's no cyclic-recursion-specific API to learn about.

- Split `cyclic_recursion` into two variants, one which checks the current circuit or a dummy, and a more general one which checks the current circuit or some other circuit. We can use the latter to build a more efficient aggregation circuit, where we check another aggregation proof or an EVM proof, with no dummy proofs involved.
2022-12-11 22:43:26 -08:00
Nicholas Ward
f0e144bb9b removed confusing grammatical exclamation point from factorial example 2022-12-09 17:29:09 -08:00
Daniel Lubarov
644a8a2336 Make proof_with_pis a reference 2022-11-28 22:18:42 -08:00
Brandon H. Gomes
fc3f63398d
wip: start moving starky to no-std
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 12:17:03 -07:00
Brandon H. Gomes
e2cdd5a954
feat: upgrade Sampling APIs
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 08:26:03 -07:00
Brandon H. Gomes
6fd0da216a
fix: remove unstable features from plonky2
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-02 17:50:31 -07:00
Brandon H. Gomes
11600b93c0
fix: do a first round of a core replacement
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-02 16:54:41 -07:00
wborgeaud
b97ec3bda1 New clippy lint 2022-10-25 10:50:40 +02:00
wborgeaud
0e58efdcc1 Remove Config from CommonCircuitData 2022-10-25 10:08:21 +02:00
wborgeaud
1ae922dd4d Merge branch 'main' into generate_dummy_proof 2022-10-17 10:01:32 +02:00
wborgeaud
69bdbf6bf6 Redundant degree_bits 2022-10-13 18:19:05 +02:00
wborgeaud
816e7db345 Working 2022-10-11 11:02:03 +02:00
Nicholas Ward
e2811550e1 addressed comments 2022-09-26 20:34:17 -07:00
Nicholas Ward
7d7269b26d nit 2022-09-26 16:17:04 -07:00
Nicholas Ward
20053ac4c7 documentation 2022-09-26 15:58:28 -07:00
Nicholas Ward
33d97eff1c moved sqrt to PrimeField 2022-09-26 11:31:11 -07:00
Nicholas Ward
a053372176 cleanup and documentation 2022-09-26 11:19:09 -07:00
Nicholas Ward
3bc1e65a7a fix 2022-09-26 11:11:41 -07:00
Nicholas Ward
59acd9436c fmt 2022-09-26 10:44:51 -07:00
Nicholas Ward
d239d3ffb5 fix 2022-09-26 10:44:43 -07:00
Nicholas Ward
880bc87bb1 sqrt 2022-09-26 10:43:18 -07:00
Nicholas Ward
bda96e84ee working on SquareRootGenerator instead of SquareGenerator 2022-09-25 20:14:23 -07:00
Nicholas Ward
843baf1aa0 documentation 2022-09-25 20:14:23 -07:00
Nicholas Ward
b21883c321 fmt 2022-09-25 20:14:23 -07:00
Nicholas Ward
b271a71a74 square root example: use generator 2022-09-25 20:14:23 -07:00
Nicholas Ward
ecdac53960 fixes to fibonacci and factorial 2022-09-25 20:14:23 -07:00
Nicholas Ward
44a1f4c328 no need to hard-code! 2022-09-25 20:14:23 -07:00
Nicholas Ward
0381641b5c addressed comments 2022-09-25 20:14:23 -07:00
Nicholas Ward
8bd5f43c45 oops, included other examples 2022-09-25 20:14:23 -07:00
Nicholas Ward
6d81968bbb use data.verify 2022-09-25 20:14:23 -07:00
Nicholas Ward
38d6f98f87 fixes, and new examples (fibonacci and square root) 2022-09-25 20:14:23 -07:00
Nicholas Ward
9756e06db2 reformat 2022-09-25 20:14:23 -07:00
Nicholas Ward
556507a9cd public input 2022-09-25 20:14:22 -07:00
Nicholas Ward
849a89105a fmt 2022-09-25 20:14:22 -07:00
Nicholas Ward
2e6480a97f Fibonacci example 2022-09-25 20:14:22 -07:00
Sebastien La Duca
a281e28d54 add rayon shim 2022-07-21 16:59:20 -04:00
Daniel Lubarov
410e03349c
extension_field -> extension (#581)
It seems redundant in most contexts, e.g. `use plonky2::field::extension_field::Extendable;`. One could import `extension_field`, but it's not that common in Rust, and `field::extension` is now about as short.
2022-06-27 07:18:21 -07:00
wborgeaud
c505c6759d Fix new clippy lints 2022-04-29 16:58:41 +02:00
Daniel Lubarov
dbc2d85b78 fmt 2022-04-14 19:24:01 -07:00
Remco Bloemen
9cff202e1a
Move benches to bins (#534)
* Copy recusion bench to bin

* Add command line arguments

* Allow ranges for inner_size

* Accept range for threads

* Log2 inner size

* CLI args for logging

* Update readme

* Use split_once

* Cleanup

* Correct inner proof size

* Shrink public surface

* Print stats on inner proofs
2022-04-14 19:23:43 -07:00