48 Commits

Author SHA1 Message Date
Robin Salen
d2598bded0
Revert "Remove StarkProofWithMetadata (#1497)" (#1502)
This reverts commit af0259c5eb010304cfc04a5e2a77e88cf8cc2378.
2024-02-08 08:43:04 -05:00
Robin Salen
af0259c5eb
Remove StarkProofWithMetadata (#1497) 2024-02-04 11:15:02 -05:00
Robin Salen
bfcfcdb498
Add Checkpoint heights (#1418) 2023-12-09 06:26:55 +01:00
Robin Salen
5572da30d7
Remove intermediary block bloom filters (#1395)
* Remove intermediary block blooms

* Update specs

* Regenerate pdf

* Apply comment, remove unneeded segment
2023-11-30 13:11:38 -05:00
Robin Salen
24aa9668f2
Revert "Make gas fit in 2 limbs (#1261)" (#1361)
* Revert "Make gas fit in 2 limbs (#1261)"

This reverts commit 0f19cd0dbc25f9f1aa8fc325ae4dd1b95ca933b3.

* Comment
2023-11-17 10:01:26 -05:00
Robin Salen
41a29f069b
Remove some dead_code in EVM crate (#1281)
* Remove unnecessary CpuArithmeticView.

* Remove AllChallengerState

* Remove RecursiveAllProof

* Remove unused generate methods

* Remove dead_code from cpu/columns

* Remove todo

---------

Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>
2023-10-09 09:07:01 -04:00
wborgeaud
3ac0c4ae18
Fix genesis state trie root when calling prove_root (#1271)
* Fix genesis state trie root in some tests

* Just do it in tests calling prove_block
2023-10-03 17:47:10 +02:00
Robin Salen
0f19cd0dbc
Make gas fit in 2 limbs (#1261)
* Make gas fit in 2 limbs

* Fix recursive challenger

* Fix indices

* Add clarifying comments on ranges supported

* Add mention to revert before production
2023-09-29 14:47:23 -04:00
Linda Guiga
1ff6d4a283
Merge pull request #1235 from topos-protocol/new-logup
Rebased logUp implementation
2023-09-27 15:02:21 +01:00
Linda Guiga
5694af79f9
Merge remote-tracking branch 'mir-plonky2/main' into constrain-genesis-state 2023-09-26 12:24:48 -04:00
Linda Guiga
043d12c20e
Fix observe_block_metadata 2023-09-25 17:30:31 -04:00
wborgeaud
8c78271f5c
Add random value to block metadata and fix sys_prevrandao (#1207)
* Add random to block metadata and fix `sys_prevrandao`

* Minor

* Observe block_random

* Write block_random

* cargo fmt

* block_random: H256

* Move sys_prevrandao to metadata.asm and delete syscall_stubs.asm

* Set block_random in set_block_metadata_target

* Minor

* Minor
2023-09-25 18:20:22 +02:00
Linda Guiga
9d0101d652
Merge branch 'main' into 'constrain-genesis-state' 2023-09-25 10:19:13 -04:00
Linda Guiga
ca44187201
Merge branch 'main' into new-logup 2023-09-19 10:58:01 -04:00
Robin Salen
b5c28bd65e
Rename utility methods for U256 conversion
Co-authored-by: Nicholas Ward <npward@berkeley.edu>
2023-09-18 14:29:11 -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
5a1b05acfb
Remove risks of panic 2023-09-12 19:23:16 -04:00
Linda Guiga
4d7d9ffa3c
Constrain genesis block's state trie. 2023-09-11 19:09:12 +01:00
Linda Guiga
1c01d682aa
Fix overflow check and test. Remove [..8] when using h256_limbs. 2023-09-07 09:44:00 +01:00
Linda Guiga
c30b18346f
Change h256_ulimbs 2023-09-07 09:44:00 +01:00
Linda Guiga
4e0fe74a74
Apply comments 2023-09-07 09:43:59 +01:00
Linda Guiga
42f7038031
Add blockhash sys opcode 2023-09-07 09:43:59 +01:00
Linda Guiga
b07644368f
Add missing links between public values 2023-08-31 13:40:13 +01:00
Robin Salen
9a4500683b
Update BlockBaseFee to fit in 2 limbs 2023-08-19 10:23:24 -04:00
Robin Salen
976d752153
Observe public values 2023-08-18 18:59:58 -04:00
Hamish Ivey-Law
2c5f6fd62a
Fix compile time problems and generic hash implementation (#1024)
* Fix egregious magic number.

* Remove generic consts from core permutations.

* Remove redundant `where` clauses.

* Remove HashConfig and friends.

* Refactor Permutation code.

* Remove redundant `where` clauses and `use`s.

* Introduce AlgebraicPermutation to wrap `[Target; WIDTH]`s.

* Remove `generic_const_expr` feature from plonky2!

* Remove `generic_const_expr` feature from plonky2!

* Compile time fixed! Start removing `generic_const_expr` from evm.

* Remove redundant `where` clauses from Starky.

* Remove `generic_const_expr`s from benchmarks.

* Remove redundant HASH_SIZE `where` clause.

* Clippy.

* Fix unrelated OsRng issue in `bench_recursion`.

* Fix function doc.
2023-05-11 02:59:02 +10:00
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
2133c7f3ba Use new plonky2 2023-02-25 09:36:25 -08:00
Daniel Lubarov
137bc78565 Prep for publishing to crates.io 2023-01-30 13:18:06 -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
wborgeaud
39fc219324 PR feedback 2022-10-06 16:40:03 +02:00
wborgeaud
3579f9e875 state() -> compact() 2022-10-03 10:53:33 +02:00
wborgeaud
0053a02119 Cleaning 2022-09-23 16:28:20 +02:00
wborgeaud
a63ed60401 Add CTL verification 2022-09-23 15:50:57 +02:00
wborgeaud
e712986a92 Challenger state works 2022-09-23 13:41:14 +02:00
wborgeaud
2c43da801e Fix 2022-09-22 11:17:02 +02:00
wborgeaud
6e6c2daf29 Add challenger state 2022-09-22 11:01:27 +02:00
wborgeaud
05c3c4d907 First pass 2022-08-26 10:12:45 +02:00
Daniel Lubarov
aa87f2c3ba Public memory 2022-08-25 20:19:18 -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
ffc5ce2f1a Fix bug. Recursive verifier test passes 2022-05-26 20:37:30 +02:00
wborgeaud
d47b22d2b5 Compiles 2022-05-24 16:24:52 +02:00
wborgeaud
8e8e4daa9c Start of impl 2022-05-20 11:21:13 +02:00
wborgeaud
7cdc72f998 Detupling 2022-05-20 08:37:18 +02:00
wborgeaud
9f01840a57 Make evm structs more generic 2022-05-19 09:41:15 +02:00
Daniel Lubarov
c54896dcb8
Rename starky2 -> evm (#547) 2022-05-18 10:32:14 -07:00