33 Commits

Author SHA1 Message Date
Dmitry Vagner
57113905de redundant 2023-04-27 16:26:40 -07:00
Dmitry Vagner
ae4b509139 neutral name 2023-04-27 16:24:36 -07:00
Robin Salen
e857c020bf
Make hash functions generic 2023-03-31 18:55:06 -04:00
BGluth
3c7bc8835c Removed a type alias
- Was conflicting with the trait `PartialTrie` and also making the types
  harder to follow.
2023-03-28 14:38:58 -06:00
BGluth
60ad9e03ba Bumped eth_trie_utils to 0.5.0 2023-03-27 17:30:11 -06:00
Dmitry Vagner
143225f449 finish 2023-03-21 19:19:02 -07:00
Dmitry Vagner
503880731a rename 2023-03-20 11:55:43 -07:00
Dmitry Vagner
6ac59f1652 arithmetic skeleton 2023-02-27 22:38:37 -08:00
Dmitry Vagner
769c615cf1 cleanup 2023-01-21 14:17:01 +07:00
Dmitry Vagner
922d3ebca8 add module and fix errors 2023-01-20 15:43:17 +07:00
Dmitry Vagner
9977ae03bd new inverse 2023-01-18 14:41:09 +07:00
Dmitry Vagner
31c5db91a5 rename module 2023-01-17 16:11:15 +07:00
Dmitry Vagner
93a363c100 Merge branch 'main' of github.com:mir-protocol/plonky2 into non-inv 2023-01-11 17:54:22 +04: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
Dmitry Vagner
d5cec0e68f clean up code org 2022-12-21 14:52:54 -08:00
Daniel Lubarov
fbb26546dd Jemalloc for EVM
Also update the version used elsewhere.
2022-12-04 10:15:28 -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
82d0f08193 clippies 2022-12-02 17:06:30 -08:00
Jacqueline Nabaglo
87a9c002c9 Compiler errors + refactor 2022-11-28 13:19:40 -08: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
BGluth
ccc2a56b81 Added let_chains feature gates
- Nightly decided to move this behind a feature gate and caused builds
  to fail.
2022-09-01 09:40:39 -07:00
Daniel Lubarov
522cac5e15 Keccak memory stark 2022-08-24 09:29:17 -07:00
Daniel Lubarov
e7b480deaf Begin work on witness generation and kernel bootstrapping 2022-07-01 10:09:57 -07:00
Hamish Ivey-Law
aa42312126
EVM Arithmetic Stark table (#559)
* First draft of 256-bit addition.

* Update comment.

* cargo fmt

* Rename addition evaluation file.

* Port ALU logic from SZ.

* Give a name to some magic numbers.

* `addition.rs` -> `add.rs`; fix carry propagation in add; impl sub.

* Clippy.

* Combine hi and lo parts of the output.

* Implement MUL.

* Suppress Clippy's attempt to make my code even harder to read.

* Next draft of MUL.

* Make all limbs (i.e. input and output) 16-bits.

* Tidying.

* Use iterators instead of building arrays.

* Documentation.

* Clippy is wrong; also cargo fmt.

* Un-refactor equality checking, since it was wrong for sub.

* Daniel comments.

* Daniel comments.

* Rename folder 'alu' -> 'arithmetic'.

* Rename file.

* Finish changing name ALU -> Arithmetic Unit.

* Finish removing dependency on array_zip feature.

* Remove operations that will be handled elsewhere.

* Rename var; tidy up.

* Clean up columns; mark places where range-checks need to be done.

* Import all names in 'columns' to reduce verbiage.

* cargo fmt

* Fix aux_in calculation in mul.

* Remove redundant 'allow's; more precise range-check size.

* Document functions.

* Document MUL instruction verification technique.

* Initial tests for ADD.

* Minor test fixes; add test for SUB.

* Fix bugs in generate functions.

* Fix SUB verification; refactor equality verification.

* cargo fmt

* Add test for MUL and fix some bugs.

* Update doc.

* Quiet incorrect clippy error.

* Clean up 'decode.rs'.

* Fold 'decode.rs' into 'arithmetic_stark.rs'.

* Force limb size to divide EVM register size.

* Document range-check warning and fix end value calc.

* Convert `debug_assert!`s into `assert!`s.

* Clean up various kinds of iterator usage.

* Remove unnecessary type spec.

* Document unexpected use of `collect`.
2022-06-29 11:56:48 +10:00
Nicholas Ward
9434819829 addressed comments 2022-06-23 14:01:22 -07:00
Nicholas Ward
d2eb3b141b addressed comments 2022-06-23 14:01:22 -07:00
Nicholas Ward
7ba0652c01 all_stark 2022-06-23 14:00:44 -07:00
Nicholas Ward
7c2cfebdee memory 2022-06-23 13:59:06 -07:00
Jacqueline Nabaglo
732002691b
Logic stark (#562)
* Logic stark

* Refactor for style
2022-06-13 10:34:33 -07:00
Nicholas Ward
85d84a130f moved back haha 2022-06-07 14:20:51 -07:00
Nicholas Ward
9c6e650916 moved allow to local 2022-06-07 14:15:28 -07:00
Nicholas Ward
315d088204 ignore silly clippy warning 2022-06-07 13:58:49 -07:00
Daniel Lubarov
c54896dcb8
Rename starky2 -> evm (#547) 2022-05-18 10:32:14 -07:00