96 Commits

Author SHA1 Message Date
Hamy Ratoanina
30c944f778
Remove bootstrapping (#1390)
* Start removing bootstrapping

* Change the constraint for kernel code initializing

* Update specs

* Apply comments

* Add new global metadata to circuit methods

* Change zero-initializing constraint

* Apply comment

* Update circuit size range for recursive test
2023-11-30 10:04:08 -05:00
Linda Guiga
48e2b24b49
Add range check constraints for the looked table (#1380)
* Add constraints to check that looked tables are well constructed for range checks

* Fix comments
2023-11-22 15:59:41 -05:00
Robin Salen
88fcc32983
Reduce visibility for a bunch of structs and methods in EVM crate (#1289)
* Reduce visibility for a bunch of structs and methods

* Remove redundant
2023-11-13 09:26:56 -05:00
Hamy Ratoanina
d2b549affc
Constrain uninitialized memory to 0 (#1318) 2023-11-03 19:52:12 -04:00
Robin Salen
0d97b93af5
Add some documentation in EVM crate (#1295)
Co-authored-by: Linda Guiga <linda.guiga@toposware.com>
2023-10-30 14:28:24 -04:00
Linda Guiga
bbc6fe768f
Merge branch 'main' into 'new-logup' 2023-09-25 11:42:11 -04:00
Robin Salen
d6be2b987b
Remove generic_const_exprs feature from EVM crate (#1246)
* Remove const_generic_exprs feature from EVM crate

* Get a generic impl of StarkFrame
2023-09-22 09:19:13 -04:00
Linda Guiga
c9c0f8b7e5
Use CTL challenges for logUP + change comments + add assert 2023-09-15 09:00:35 +01:00
wborgeaud
f65ad58a08
Implement logUp 2023-09-15 09:00:35 +01:00
Robin Salen
b711e5279a
Combine a few constraints 2023-08-18 15:36:46 -04:00
Jacqueline Nabaglo
f3946f75bf
Gas constraints (#880)
* Gas constraints

* Bugfix

* make test pass post rebase
2023-02-14 22:30:19 -08:00
Daniel Lubarov
137bc78565 Prep for publishing to crates.io 2023-01-30 13:18:06 -08:00
Daniel Lubarov
88f64072ef Comments 2022-12-09 08:56:49 -08:00
Daniel Lubarov
1c5590fb22 Add dummy reads to fill any large gaps in memory fields 2022-12-05 15:48:09 -08:00
Daniel Lubarov
1303a83f7f Misc witness generation fixes 2022-12-03 21:09:57 -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
Daniel Lubarov
05ab3d7933 Fixes 2022-12-01 16:23:39 -08:00
Daniel Lubarov
9bf47ef8ac Fixes 2022-12-01 12:46:14 -08:00
Daniel Lubarov
afb3e4b1e1 Misc work on witness generation 2022-11-30 14:58:40 -08: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
Daniel Lubarov
aa87f2c3ba Public memory 2022-08-25 20:19:18 -07:00
Daniel Lubarov
c38a98f9e4 Simpler CPU <-> memory CTL 2022-08-23 23:38:28 -07:00
Nicholas Ward
bbcb419521 fmt 2022-08-04 14:56:16 -04:00
Nicholas Ward
bf4cf1c64f fix 2022-08-04 14:40:34 -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
997453237f Store memory values as U256s
Ultimately they're encoded as `[F; 8]`s in the table, but I don't anticipate that we'll have any use cases where we want to store more than 256 bits. Might as well store `U256` until we actually build the table since they're more compact.
2022-07-17 07:58:28 -07:00
Daniel Lubarov
ab5abc391d Organize segments in an enum
It's a bit more type-safe (can't mix up segment with context or virtual addr), and this way uniqueness of ordinals is enforced, partially addressing a concern raised in #591.

To avoid making `Segment` public (which I don't think would be appropriate), I had to make some other visibility changes, and had to move `generate_random_memory_ops` into the test module.
2022-07-16 10:16:12 -07:00
Daniel Lubarov
bfd924870f Generate most of the memory table while it's in row-wise form
This should improve cache locality - since we generally access several values at a time in a given row, we want themt to be close together in memory.

There are a few steps that make more sense column-wise, though, such as generating the `COUNTER` column. I put those after the transpose.
2022-07-13 13:08:41 -07:00
Daniel Lubarov
678d04e69a fix 2022-07-12 17:52:53 -07:00
Daniel Lubarov
d1afe8129c More realistic padding rows in memory
This adds padding rows which satisfy the ordering checks. To ensure that they also satisfy the value consistency checks, I just copied the address and value from the last operation.

I think this method of padding feels more natural, though it is a bit more code since we need to calculate the max range check in a different way. But on the plus side, the constraints are a bit smaller and simpler.

Also added a few constraints that I think we need for soundness:
- Each `is_channel` flag is bool.
- Sum of `is_channel` flags is bool.
- Dummy operations must be reads (otherwise the prover could put writes in the memory table which aren't in the CPU table).
2022-07-12 17:46:19 -07:00
Daniel Lubarov
1331f992a6 fix 2022-07-12 14:55:34 -07:00
Daniel Lubarov
934f1aeb7e Simplify memory table
By no longer storing unsorted operations; they are effectively stored in the CPU table already.

I ran into some issues with sorting, since the existing sort method didn't include `is_channel` columns. Rather than update the existing method, I removed it and added a sort on the `MemoryOp`s, which I think seems cleaner.
2022-07-12 14:53:34 -07:00
Daniel Lubarov
ef3addea2c Merge branch 'main' into evm_generation 2022-07-11 17:24:37 -07:00
Nicholas Ward
abc729f1d6 TODO 2022-07-11 10:44:48 -07:00
Nicholas Ward
bdae9bc33b update 2022-07-11 10:44:48 -07:00
Nicholas Ward
b935605f69 fmt 2022-07-11 10:44:48 -07:00
Nicholas Ward
467f532024 addressed comments 2022-07-11 10:44:48 -07:00
Nicholas Ward
49c208ec9b addressed comments 2022-07-11 10:44:48 -07:00
Nicholas Ward
9ad2958f73 fix 2022-07-11 10:44:48 -07:00
Nicholas Ward
6655ee68e4 restored timestamp column to CTL 2022-07-11 10:44:48 -07:00
Nicholas Ward
6b2b745291 removed debug prints 2022-07-11 10:44:48 -07:00
Nicholas Ward
3a6f2ef25e clippy 2022-07-11 10:44:48 -07:00
Nicholas Ward
51498eb748 fmt 2022-07-11 10:44:48 -07:00
Nicholas Ward
58c2e7214a another padding-row constraint fix 2022-07-11 10:44:48 -07:00
Nicholas Ward
77a7ace39c updates to recursive constraints 2022-07-11 10:44:48 -07:00
Nicholas Ward
f3ef6c9bf3 fix: ignore padding rows in constraints 2022-07-11 10:44:48 -07:00
Nicholas Ward
83963c3a8f permutation pairs 2022-07-11 10:44:48 -07:00
Nicholas Ward
b467a13d91 fix 2022-07-11 10:44:48 -07:00