34 Commits

Author SHA1 Message Date
Daniel Lubarov
137bc78565 Prep for publishing to crates.io 2023-01-30 13:18:06 -08:00
Daniel Lubarov
df2ba7a384 Basic smart contract test 2023-01-14 21:18:58 -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
6f841678a5 More timing for zkEVM proofs 2022-12-09 21:48:36 -08:00
Daniel Lubarov
b8b2fefe52 Use Keccak sponge table for bootloading
And get rid of the deprecated Keccak memory table.
2022-12-03 11:21:31 -08: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
wborgeaud
a5a4098d7a Merge branch 'main' into per_table_recursion
# Conflicts:
#	evm/src/all_stark.rs
#	evm/src/generation/mod.rs
#	evm/src/recursive_verifier.rs
2022-10-03 11:49:26 +02:00
wborgeaud
3579f9e875 state() -> compact() 2022-10-03 10:53:33 +02:00
Daniel Lubarov
b6d71a7008 Keccak benchmark
And reworking things a bit to include the timing data we want.
2022-09-23 10:54:17 -07:00
wborgeaud
6e6c2daf29 Add challenger state 2022-09-22 11:01:27 +02:00
wborgeaud
e7edfdd6a3 Minor 2022-08-26 18:30:26 +02:00
wborgeaud
05c3c4d907 First pass 2022-08-26 10:12:45 +02:00
Daniel Lubarov
b829b44dcf Fix test 2022-08-25 22:11:25 -07:00
Daniel Lubarov
aa87f2c3ba Public memory 2022-08-25 20:19:18 -07:00
Daniel Lubarov
522cac5e15 Keccak memory stark 2022-08-24 09:29:17 -07:00
Daniel Lubarov
8e220ac623 Fix for CTL challenges
See this line -

```rust
challenges: ctl_data.challenges.challenges[i % config.num_challenges],
```

This doesn't work if we have multiple lookers from the same table; then `zs_columns` will contain multiple contiguous entries for the same challenge.

We could fix the index calculation, but it seems a bit error-prone. Seems easier to store the specific challenge as part of `zs_columns`.
2022-08-23 23:30:52 -07:00
Sladuca
ca35502660 fmt 2022-08-19 17:54:48 -04:00
Sladuca
3eadc27be5 add fix to evm 2022-08-19 17:53:12 -04:00
Sebastien La Duca
e48bfa837f fmt 2022-07-24 18:06:03 -04:00
Sebastien La Duca
c9d610ec10 use maybe_rayon in starky and evm 2022-07-24 17:47:14 -04:00
Daniel Lubarov
7221c96440 Use FFTs to get subgroup evaluations in check_constraints
Instead of quadratic evaluation. Should speed up `test_all_stark`.
2022-07-12 15:29:27 -07:00
Daniel Lubarov
28603b85d1 fixes 2022-07-01 10:09:57 -07:00
Daniel Lubarov
e73d01a037
packed_field -> packed (#584)
* `packed_field` -> `packed`

For cleaner imports; "field" is usually clear from context

* fix
2022-06-27 15:07:52 -07:00
Daniel Lubarov
3346d3f902
field_types -> types (#583)
* `field_types` -> `types`

Here too, I think "field" is usually clear from context, e.g. in `use plonky2::field::types::Field;`.

* fixes

* fmt
2022-06-27 12:24:09 -07: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
Nicholas Ward
03112f898a updated all_stark framework to include memory stark (doesn't pass yet) 2022-06-23 13:59:57 -07:00
Daniel Lubarov
2797000377
Fix check_constraints to only look at subgroup points, vs coset points (#572) 2022-06-17 15:12:54 -07:00
Jacqueline Nabaglo
1cc000d3e1
Connect logic stark to CPU (#569)
* WIP: connect logic stark to CPU

* Tests passing
2022-06-17 11:57:14 -07:00
wborgeaud
918201d0f9 Fix new lints 2022-06-15 17:23:04 +02:00
wborgeaud
d626679c6c Column enum 2022-06-14 00:53:31 +02:00
wborgeaud
05d2c69eb0 Add constraints 2022-06-07 23:09:09 +02:00
wborgeaud
2ecca92bf6 Minor 2022-06-01 20:17:21 +02:00
wborgeaud
9f01840a57 Make evm structs more generic 2022-05-19 09:41:15 +02:00
Daniel Lubarov
c54896dcb8
Rename starky2 -> evm (#547) 2022-05-18 10:32:14 -07:00