3149 Commits

Author SHA1 Message Date
Hamish Ivey-Law
ce786c7a9c
Halve number of columns used by arithmetic table (#813)
* Add comments about number of columns used.

* Split modular operations across two rows.

* Fix test setup.

* Use constraint_transition() in common code.

* Ensure all inputs/outputs are on the first row.

* Fix constraint for single-row ops.

* Tidy up loop; make MODULAR_AUX_INPUT length reflect reality.
2022-12-02 17:11:31 +11:00
Daniel Lubarov
73de231e34
Merge pull request #827 from mir-protocol/cyclic_recursion_tweaks
Cyclic recursion tweaks
2022-11-29 13:19:18 -08:00
Daniel Lubarov
3515fbddac fix 2022-11-29 12:39:53 -08:00
Daniel Lubarov
ad58dcbc0e fix 2022-11-29 12:39:17 -08:00
Daniel Lubarov
c3ae52f5b0 fix 2022-11-29 12:19:40 -08:00
Daniel Lubarov
b23193ba8d use hashmap 2022-11-29 12:17:33 -08:00
Daniel Lubarov
319d9b5a52 Feedback 2022-11-29 12:02:54 -08:00
Daniel Lubarov
7612c39c01
Merge pull request #828 from mir-protocol/proof_with_pis_reference
Make `proof_with_pis` a reference
2022-11-29 08:52:03 -08:00
Daniel Lubarov
5a153278aa fix 2022-11-28 22:34:29 -08:00
Daniel Lubarov
644a8a2336 Make proof_with_pis a reference 2022-11-28 22:18:42 -08:00
Daniel Lubarov
c528da4e66 Cyclic recursion tweaks
- Have the caller to `cyclic_recursion` create and pass in the virtual proof
- Split `dummy_proof` into preprocessing and proving, so that we don't need to redo the preprocessing work in each `set_cyclic_recursion_data_target` call
- Have the caller update `num_public_inputs` instead of doing it in `cyclic_recursion`. This is a little less convenient but I think it's best not to modify the caller's config (principle of least surprise)
- Have `set_cyclic_recursion_data_target` take a sparse set of public inputs. Taking some PIs with the lowest indices didn't seem very general. I still have some reservations about this part of the API - I think it would seem cleaner if PIs of a proof which wasn't selected for verification were simply ignored - but perhaps there are some optimization reasons to keep using them.
2022-11-28 21:02:41 -08:00
BGluth
5ee283b267
Merge pull request #829 from mir-protocol/ci_nightly_freeze
Set CI to use an older version of nightly
2022-11-28 18:07:27 -07:00
BGluth
da23fb116b Set CI to use an older version of nightly
- Needed until https://github.com/rust-lang/rust/issues/105037 is fixed.
2022-11-28 17:47:31 -07:00
Daniel Lubarov
d527073416
Merge pull request #824 from mir-protocol/cyclic_recursion_tweaks
Cyclic recursion tweaks
2022-11-23 10:07:31 -08:00
Daniel Lubarov
964d2bc373 Fix test 2022-11-22 22:33:41 -08:00
Daniel Lubarov
4048107892 Cyclic recursion tweaks 2022-11-22 20:09:10 -08:00
Daniel Lubarov
8c5d6b0af2
Merge pull request #822 from mir-protocol/domain_separator
Domain separator option
2022-11-22 09:13:57 -08:00
Daniel Lubarov
7ec14029c6 Fix comment 2022-11-22 08:04:01 -08:00
Daniel Lubarov
af1b6680e8 Switch to Vec 2022-11-22 08:02:22 -08:00
Daniel Lubarov
1abfb6d913
Merge pull request #823 from mir-protocol/generic_load_code
Make `load_code` a bit more general
2022-11-22 07:35:55 -08:00
Daniel Lubarov
1b4acf5917 Make load_code a bit more general
So that it can be used to load code we're going to execute into the code segment of a certain context.
2022-11-21 13:54:39 -08:00
Daniel Lubarov
108cb83621 Domain separator option 2022-11-21 13:24:46 -08:00
Daniel Lubarov
d1d0893772
Merge pull request #821 from mir-protocol/jumpdest_analysis
Kernel code to do jumpdest analysis
2022-11-21 13:16:50 -08:00
Daniel Lubarov
d23cecfcd8 Kernel code to do jumpdest analysis 2022-11-21 13:06:03 -08:00
Daniel Lubarov
08cabf2ad8
Merge pull request #820 from mir-protocol/serialization_refactor
Serialization refactor
2022-11-21 08:13:19 -08:00
Daniel Lubarov
05f4d2be4e Remove conversion 2022-11-20 09:43:16 -08:00
Daniel Lubarov
b0be6d7e8a Serialization refactor
Followup to #806.

A few goals here
- Zero dependencies on std. (Previously deserialization depended on std for `Cursor`.)
- Provide a single (memory buffering) impl of `Write` to make sure there's no confusion. (Previously `Buffer` and `Vec<u8>` both implemented it.)
- Move closer to the `std::io` APIs. Hopefully they will be available without std at some point (there have been some discussions...).

More specifically, this
- Changes `Buffer` to not use std's `Cursor`.
- Removes `impl Write` for `Buffer`, since it's implemented for `Vec<u8>`.
- Adds a concrete I/O error type to mimic `std::io`'s.
- Combines `Position` and `Size` into `Remaining`.
2022-11-20 09:37:18 -08:00
wborgeaud
c31b0147f4
Implement CALLVALUE, CALLDATALOAD, CALLDATASIZE, CALLDATACOPY in interpreter (#819)
* Implement `CALLVALUE, CALLDATALOAD, CALLDATASIZE, CALLDATACOPY` in interpreter

* PR feedback
2022-11-19 18:58:55 +01:00
Hamish Ivey-Law
2501386004
Add missing feature to field crate. (#818) 2022-11-18 15:00:58 +11:00
Daniel Lubarov
7691758084 Merge branch 'openzklib-feat/no-std-support' 2022-11-17 13:08:27 -08:00
Daniel Lubarov
af2349e924 Imports 2022-11-17 12:49:19 -08:00
Daniel Lubarov
0ed92ab878 workflow_dispatch 2022-11-17 12:28:49 -08:00
Daniel Lubarov
0271817730 workflow_dispatch 2022-11-17 12:27:43 -08:00
Daniel Lubarov
9a43084f94 Merge branch 'feat/no-std-support' of https://github.com/openzklib/plonky2 into openzklib-feat/no-std-support 2022-11-17 12:17:22 -08:00
Daniel Lubarov
7720ff3799
Merge pull request #815 from mir-protocol/fri_pow_in_transcript
Include the FRI prover's PoW witness in the transcript
2022-11-17 12:08:48 -08:00
Daniel Lubarov
1732399f05 Remove comment 2022-11-17 12:08:33 -08:00
Daniel Lubarov
e22da77b34 Include the FRI prover's PoW witness in the transcript
We don't think this is required for soundness, but just to remove any doubt.

Old protocol:
```
...
P sends final_poly
V samples random r
P sends pow_witness (not in transcript)
V computes pow_response = H(r, pow_witness)
V asserts pow_response has N leading 0s
...
```

New protocol:
```
...
P sends final_poly
P sends pow_witness
V samples random pow_response
V asserts pow_response has N leading 0s
...
```
2022-11-17 12:08:11 -08:00
Daniel Lubarov
d2bd64f83f
Merge pull request #814 from mir-protocol/randomize_pi_wires
Randomize unused wires of PublicInputGate
2022-11-17 12:07:49 -08:00
Brandon H. Gomes
65d106bc31
chore: remove derivative dependency as non-crucial
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-15 16:26:43 -05:00
Brandon H. Gomes
2520bd62c6
chore: match hashbrown ahash dependency
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-15 16:14:07 -05:00
Brandon H. Gomes
812a5d468a
chore: merge branch main
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-15 01:54:30 -05:00
Brandon H. Gomes
289498e854
fix: address review comments
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-15 01:52:27 -05:00
Brandon H. Gomes
14c2a6dd1f
Fork Update (#3)
* Use static `KERNEL` in tests

* Print opcode count

* Update criterion

* Combine all syscalls into one flag (#802)

* Combine all syscalls into one flag

* Minor: typo

* Daniel PR comments

* Check that `le_sum` won't overflow

* security notes

* Test reverse_index_bits

Thanks to Least Authority for this

* clippy

* EVM shift left/right operations (#801)

* First parts of shift implementation.

* Disable range check errors.

* Tidy up ASM.

* Update comments; fix some .sum() expressions.

* First full draft of shift left/right.

* Missed a +1.

* Clippy.

* Address Jacqui's comments.

* Add comment.

* Fix missing filter.

* Address second round of comments from Jacqui.

* Remove signed operation placeholders from arithmetic table. (#812)

Co-authored-by: wborgeaud <williamborgeaud@gmail.com>
Co-authored-by: Daniel Lubarov <daniel@lubarov.com>
Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>
Co-authored-by: Hamish Ivey-Law <426294+unzvfu@users.noreply.github.com>
2022-11-15 01:51:29 -05:00
Daniel Lubarov
7eb0c74166 Randomize unused wires of PublicInputGate 2022-11-14 14:53:06 -08:00
Hamish Ivey-Law
56e291cf4e
Remove signed operation placeholders from arithmetic table. (#812) 2022-11-11 15:09:56 +11:00
Hamish Ivey-Law
1c87fbb712
EVM shift left/right operations (#801)
* First parts of shift implementation.

* Disable range check errors.

* Tidy up ASM.

* Update comments; fix some .sum() expressions.

* First full draft of shift left/right.

* Missed a +1.

* Clippy.

* Address Jacqui's comments.

* Add comment.

* Fix missing filter.

* Address second round of comments from Jacqui.
2022-11-09 10:47:15 +11:00
Daniel Lubarov
7126231b52
Merge pull request #811 from mir-protocol/test_reverse_index_bits
Test reverse_index_bits
2022-11-08 13:56:34 -08:00
Daniel Lubarov
624dabb9e3 clippy 2022-11-08 13:06:01 -08:00
Daniel Lubarov
c622e45246 Test reverse_index_bits
Thanks to Least Authority for this
2022-11-08 12:27:55 -08:00
Daniel Lubarov
692ad9399e
Merge pull request #810 from mir-protocol/le_sum_check
Check that `le_sum` won't overflow
2022-11-08 12:20:12 -08:00