64 Commits

Author SHA1 Message Date
Robin Salen
9ee47ab745
Move HashConfig into GenericConfig associated types 2023-04-01 09:54:14 -04:00
Robin Salen
e857c020bf
Make hash functions generic 2023-03-31 18:55:06 -04:00
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
76b3eb304c more 2023-01-03 12:43:05 -08:00
Daniel Lubarov
fbb72e16bb warning 2023-01-03 12:29:14 -08:00
Daniel Lubarov
6655e776a8 Remove CTL defaults
We ended up not needing the feature.
2023-01-03 11:36:42 -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
b8b2fefe52 Use Keccak sponge table for bootloading
And get rid of the deprecated Keccak memory table.
2022-12-03 11:21:31 -08:00
Daniel Lubarov
1f92d73177 Misc fixes 2022-12-02 14:31:18 -08:00
Daniel Lubarov
a63b73a851 Misc fixes 2022-12-02 13:56:52 -08:00
wborgeaud
668957176a PR feedback 2022-10-03 11:44:52 +02:00
wborgeaud
cb620bc55a Simplify num_ctl_zs 2022-09-29 16:32:41 +02:00
wborgeaud
6cf6b56aa0 Method to compute verifier data without proving 2022-09-26 15:47:35 +02:00
wborgeaud
0053a02119 Cleaning 2022-09-23 16:28:20 +02:00
wborgeaud
502305146f Working 2022-09-23 16:25:02 +02:00
wborgeaud
a63ed60401 Add CTL verification 2022-09-23 15:50:57 +02:00
wborgeaud
c320a9e8ae Merge branch 'main' into per_table_recursion
# Conflicts:
#	evm/src/all_stark.rs
#	evm/src/proof.rs
2022-09-05 08:34:52 +02:00
Daniel Lubarov
c9cfcecc9f Logic CTL for xor 2022-09-04 16:53:04 -07:00
Daniel Lubarov
2c77247d43 Keccak sponge STARK
It contains a row for each absorb step of the sponge.
2022-09-01 09:41:19 -07:00
wborgeaud
05c3c4d907 First pass 2022-08-26 10:12:45 +02:00
wborgeaud
c4fc9b0ae4 Merge conflicts 2022-08-26 09:42:55 +02:00
wborgeaud
8600a5a46f Merge branch 'main' into per_table_recursion
# Conflicts:
#	evm/src/proof.rs
2022-08-26 09:41:00 +02:00
Daniel Lubarov
aa87f2c3ba Public memory 2022-08-25 20:19:18 -07:00
wborgeaud
9e9ff9872b Per table recursion 2022-08-25 22:04:28 +02: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
Daniel Lubarov
782d7d0e18
Revert "Support accessing local row in CTLs" 2022-08-23 12:22:54 -07:00
Daniel Lubarov
00081890f3 feedback 2022-08-23 10:23:28 -07:00
Daniel Lubarov
a37dec9881 Support accessing previous row in CTLs 2022-08-22 15:20:10 -07:00
wborgeaud
d35d3e2095 PR feedback + underflow check 2022-07-11 19:53:00 +02:00
wborgeaud
5e27e7264d unwrap_or_else -> unwrap_or 2022-07-11 14:56:27 +02:00
wborgeaud
50ebf39d37 Comment 2022-07-11 14:24:12 +02:00
wborgeaud
3ff67e38dc Minor 2022-07-11 14:16:58 +02:00
wborgeaud
36c8aa34c1 Comments 2022-07-11 14:13:07 +02:00
wborgeaud
91fcf26289 Better CTL error 2022-07-11 11:07:16 +02: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
wborgeaud
b9265ccf0e Sanity check 2022-06-16 02:15:40 +02:00
wborgeaud
29f750ed51 Fix CTL verification 2022-06-16 02:06:43 +02:00
wborgeaud
0d8461d66d PR feedback 2022-06-15 17:01:30 +02:00
wborgeaud
6a13ecf164 Remove enum and use Option for filter 2022-06-14 19:09:03 +02:00
wborgeaud
499d2d07bf Minor 2022-06-14 16:30:34 +02:00
wborgeaud
1dce18495a Remove Keccak input limbs 2022-06-14 01:21:17 +02:00
wborgeaud
d626679c6c Column enum 2022-06-14 00:53:31 +02:00
wborgeaud
e969f10b20 PR feedback 2022-06-13 18:54:12 +02:00
wborgeaud
4e848c77db Merge conflicts 2022-06-09 18:13:41 +02:00
wborgeaud
afda9db00a Merge branch 'evm_keccak_stark' into filtered_ctl
# Conflicts:
#	evm/src/all_stark.rs
#	evm/src/cross_table_lookup.rs
2022-06-09 18:04:58 +02:00
wborgeaud
f36c012e9c Checks 2022-06-07 23:37:35 +02:00
wborgeaud
05d2c69eb0 Add constraints 2022-06-07 23:09:09 +02:00