1161 Commits

Author SHA1 Message Date
Daniel Lubarov
dc600d5abf
Hash benchmarks (#295) 2021-10-09 14:07:49 -07:00
Jakub Nabaglo
c55181a4ea
Fix logging in tests (#293)
* Fix logging in tests

* lint
2021-10-08 17:07:03 -07:00
wborgeaud
011429da01
Merge pull request #291 from mir-protocol/fix_path_compression
Fix path compression
2021-10-08 08:25:41 +02:00
wborgeaud
bc95563f43 PR feedback 2021-10-08 08:15:55 +02:00
wborgeaud
64d386051b More cleaning 2021-10-07 22:41:30 +02:00
wborgeaud
e531eda576 Cleaning 2021-10-07 22:32:58 +02:00
wborgeaud
64ad8783eb Fix path compression 2021-10-07 22:19:26 +02:00
wborgeaud
145ee8cb18
Merge pull request #290 from mir-protocol/trivial_random_access
Add check for trivial random access
2021-10-07 08:37:42 +02:00
Nicholas Ward
7f18b21ace minor fix 2021-10-06 12:35:37 -07:00
Nicholas Ward
0f82f41b64
Merge pull request #289 from mir-protocol/secp256k1
Secp256K1Base field
2021-10-06 11:44:17 -07:00
Nicholas Ward
88b528e3fe fix 2021-10-06 11:44:02 -07:00
Nicholas Ward
d2c589e281 addressed comments 2021-10-06 11:42:34 -07:00
Nicholas Ward
695a56c4ca addressed comments 2021-10-06 11:34:50 -07:00
Nicholas Ward
b5fea8d1bb addressed comments 2021-10-06 11:24:24 -07:00
Nicholas Ward
e8805a126a fix 2021-10-06 11:22:21 -07:00
Nicholas Ward
097059e026 switch to u64 array 2021-10-06 11:20:11 -07:00
Nicholas Ward
c625aae87b cleanup and removed tests for now 2021-10-06 11:09:51 -07:00
Nicholas Ward
f79419cca3 add check to primitive_root_order field arithmetic test 2021-10-06 09:50:02 -07:00
wborgeaud
9b098a9fbe Trivial random access 2021-10-06 16:37:27 +02:00
Daniel Lubarov
5098c2a386
Have ArithmeticExtensionGate adapt based on available wires (#287) 2021-10-05 23:28:29 -07:00
Daniel Lubarov
b922def48e
Better errors for insufficient (routed) wires for FRI (#288)
For examlpe, if I change a test to use `ConstantArityBits(4, 5)`, I get

    To efficiently perform FRI checks with an arity of 16, at least 152 wires are needed. Consider reducing arity.
2021-10-05 23:28:04 -07:00
Nicholas Ward
69678f53fc removed prime field tests 2021-10-05 22:02:57 -07:00
Nicholas Ward
5e0d2744d7 fixes 2021-10-05 22:01:18 -07:00
Nicholas Ward
a4c89201f3 fmt 2021-10-05 21:32:23 -07:00
Nicholas Ward
1262c6afd0 fixes 2021-10-05 21:32:18 -07:00
Nicholas Ward
351b92f31f progress towards Secp256K1Base field 2021-10-05 18:02:08 -07:00
Daniel Lubarov
a407e5e1a0 Fix 2021-10-05 16:33:08 -07:00
Daniel Lubarov
2148085725
Give MinSize a max arity option (#284)
* Give MinSize a max arity option

* Add Fixed option

* Fix
2021-10-05 16:18:00 -07:00
wborgeaud
a0c12266f6
Merge pull request #286 from mir-protocol/fix_buggy_split_le
Small overflow-related fixes
2021-10-05 17:51:16 +02:00
wborgeaud
242ee26b6f Generalize to fields with less than 64 bits 2021-10-05 17:50:38 +02:00
Daniel Lubarov
cb129fb095
Refactor recursion tests (#285)
* Refactor recursion tests

E.g. the main part of `test_recursive_recursive_verifier` is now

```rust
let (proof, vd, cd) = dummy_proof::<F, D>(&config, 8_000)?;
let (proof, vd, cd) = recursive_proof(proof, vd, cd, &config, &config, false)?;
let (proof, _vd, cd) = recursive_proof(proof, vd, cd, &config, &config, true)?;
```

Also adds a new `test_size_optimized_recursion` to see how small we can make the final proof in a recursion chain. The final proof is ~74kb (depending on compression luck) and takes ~20s to prove on my M1 (depending on PoW luck).

* Refactor serialization

* Don't log timestamps
2021-10-05 08:36:24 -07:00
wborgeaud
6d601c6113 Overflow fixes 2021-10-05 14:27:30 +02:00
Daniel Lubarov
73f9a0be6b
Allow zero FRI reductions (#283)
In this case we're basically sending the witness. As @wborgeaud mentioned it might make sense for small circuits.
2021-10-04 14:11:53 -07:00
Daniel Lubarov
898cac1709
Automatically select FRI reduction arities (#282)
* Automatically select FRI reduction arities

This way when a proof's degree changes, we won't need to manually update the `FriConfig`s of any recursive proofs on top of it.

For now I've added two methods of selecting arities. The first, `ConstantArityBits`, just applies a fixed reduciton arity until the degree has shrunk below a certain threshold. The second, `MinSize`, searches for the sequence of arities that minimizes proof size.

Note that this optimization is approximate -- e.g. it doesn't account for the effect of compression, and doesn't count some minor contributions to proof size, like the Merkle roots from the commit phase. It also assumes we're not using Merkle caps in serialized proofs, and that we're inferring one of the evaluations, even though we haven't made those changes yet.

I think we should generally use `ConstantArityBits` for proofs that we will recurse on, since using a single arity tends to be more recursion-friendly. We could use `MinSize` for generating final bridge proofs, since we won't do further recursion on top of those.

* Fix tests

* Feedback
2021-10-04 13:52:05 -07:00
wborgeaud
d9634e075e
Merge pull request #279 from mir-protocol/duplicate_indices
Remove duplicate query indices in FRI proofs
2021-10-04 10:40:18 +02:00
wborgeaud
a0554cbb2c
Merge pull request #280 from mir-protocol/custom_serializer
Custom serializer for proofs
2021-10-04 10:32:08 +02:00
wborgeaud
84d1a1586f Merge branch 'duplicate_indices' into custom_serializer 2021-10-04 10:21:53 +02:00
wborgeaud
bce3256c96 PR feedback 2021-10-04 10:21:35 +02:00
wborgeaud
b4614991f7 Useless mut 2021-10-04 10:09:17 +02:00
wborgeaud
bbeb54c910 Remove pruning 2021-10-04 10:03:00 +02:00
Daniel Lubarov
9d8b32c355 fmt 2021-10-03 22:59:10 -07:00
Daniel Lubarov
734a5cef27 Snake case warning 2021-10-03 22:25:07 -07:00
Daniel Lubarov
01c2047a66 Outdated TODO 2021-10-03 22:22:30 -07:00
Daniel Lubarov
dadc1b2add cargo fix 2021-10-03 22:22:10 -07:00
wborgeaud
fbefaa4768 Unused import 2021-10-02 14:01:08 +02:00
wborgeaud
e3b2416025 Merge branch 'duplicate_indices' into custom_serializer 2021-10-02 13:56:46 +02:00
wborgeaud
3859ca2090 PR comments 2021-10-02 10:46:02 +02:00
wborgeaud
0839ed8793 Unused import 2021-10-02 09:55:38 +02:00
wborgeaud
76d3f488bd Fixes 2021-10-02 09:53:31 +02:00
wborgeaud
17ed6a2b04 Clippy 2021-10-01 17:12:46 +02:00