Robin Salen
ae3003a9d7
Add alternative method to prove txs without pre-loaded table circuits ( #1438 )
2023-12-22 17:23:22 +01:00
David
a291d92c01
Merge pull request #1392 from 0xPolygonZero/dp-from_values-take-ref
...
`PolynomialBatch::from_values` takes refs
2023-12-19 12:14:10 +00:00
Linda Guiga
18e08f4f61
Filter range checks ( #1433 )
...
* Add filtering to range-checks
* Cleanup
* Fix Clippy
* Apply comment
2023-12-18 17:27:12 -05:00
Robin Salen
a64311cfd4
Add aborting signal ( #1429 )
...
* Add aborting signal
* Clippy
* Update to Option following comment
2023-12-15 19:35:27 +01:00
Robin Salen
47e24306b7
Remove GenerationOutputs ( #1408 )
2023-12-05 18:10:36 -05:00
Hamy Ratoanina
46b6aa108d
Implement degree 2 filters ( #1404 )
...
* Implement degree 2 filters
* Apply comments
2023-12-05 17:02:37 -05:00
David Palm
e68195fc0d
chore: Remove TODOs about from_values taking a reference
2023-11-30 15:10:34 +01:00
David Palm
37918cccfd
Revert "chore: from_values takes ref"
...
This reverts commit 7cc123e0a442d41a3610a57a2ee4f8008ef5811f.
2023-11-30 15:07:10 +01:00
David Palm
7cc123e0a4
chore: from_values takes ref
2023-11-29 09:09:36 +01:00
shuoer86
a0ea26f4b2
Fix typos in comments
2023-11-04 23:07:36 +08: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
Robin Salen
c9391be024
Update check_ctls with extra looking values ( #1290 )
2023-10-16 08:53:42 -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
ca44187201
Merge branch 'main' into new-logup
2023-09-19 10:58:01 -04:00
Robin Salen
f3ea95cacc
Merge branch 'main' into error_vs_panic
2023-09-18 09:59:52 -04:00
Hamy Ratoanina
1a4caaa08f
Move next row logic inside Column
...
Co-authored-by: Nicholas Ward <npward@berkeley.edu>
2023-09-15 18:59:33 -04:00
Robin Salen
a9b7b5a62f
Revert "Remove where clauses: [(); CpuStark::<F, D>::COLUMNS]"
...
This reverts commit 66f935a7488e0bc862725102aac7a55bf6d83d64.
2023-09-15 17:53:44 -04:00
Linda Guiga
66f935a748
Remove where clauses: [(); CpuStark::<F, D>::COLUMNS]
2023-09-15 15:34:06 +01:00
Linda Guiga
17f661f90f
Fix BytePacking range-check. Fix lookup challenges
2023-09-15 09:00:36 +01: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
Hamy Ratoanina
c27fc96a06
Merge branch 'main' into next_row_ctls
2023-09-13 16:46:30 +02:00
Robin Salen
5a1b05acfb
Remove risks of panic
2023-09-12 19:23:16 -04:00
Robin Salen
9508b49090
Move byte packing / unpacking to a distinct table ( #1212 )
...
* Duplicate Memory trace into BytePacking one
* Add mload_32bytes instruction
* Use dedicated ops for byte packing trace
* Change witness generation to reduce memory reads for MLOAD_32BYTES
* Remove segments
* Fix stack
* Fix extra product when fixing CTL for byte_packing
* Write output value in trace
* Add constraints for BYTE_PACKING table
* Add recursive constraints for BYTE_PACKING table
* Fix constraints
* Add address in trace and constraints
* Add timestamp and batch inputs into BytePackingOp struct
* Add extra column
* Fix BytePackingStark CTL
* Tiny fix in witness generation
* Fix the Memory CTL
* Add constraints for the new columns
* Remove 1 column
* Remove limb columns
* Fix
* Fix recursive circuit of BytePackingTable
* Fix constraints
* Fix endianness
* Add MSTORE_32BYTES instruction and move decomposition to packing table
* Add missing constraint
* Add range-check for all bytes
* Add extra constraint
* Cleanup
* Remove REMAINING_LEN column
* Add corresponding implementations in interpreter
* Fix recursive version
* Remove debug assertion because of CI
* Remove FILTER column
* Update new test from rebasing
* Reorder STARK modules to match TraceCheckPoint ordering
* Address comments
* Pacify clippy
* Add documentation to the packing module
* Fix doctest
2023-09-13 04:45:37 +10:00
Hamy Ratoanina
3c4f938f85
Make next row available to CTLs
2023-09-12 13:59:50 -04:00
Robin Salen
976d752153
Observe public values
2023-08-18 18:59:58 -04:00
wborgeaud
d05db4973d
Don't touch contract address in DELEGATECALL or CALLCODE ( #1036 )
...
* Don't touch address in DELEGATECALL or CALLCODE
* Minor
2023-05-15 18:41:21 +02:00
wborgeaud
bfd6834dc2
Journal of state changes + state reversion ( #1028 )
...
* Add segments and global metadata
* Add journal asm files
* Start revert
* Revert access lists
* Revert balance transfer
* Revert code change
* Revert nonce change
* Revert storage change
* Checkpoints
* Add some journal entries
* Add some journal entries
* Add some journal entries
* Fix revert
* Checkpoint in sys_call
* Minor
* PR feedback
* More checkpoints
* Fix checkpoint check
* Minor
* Checkpoints in precompiles
* Storage change checkpoint
* Add touched addresses
* Add touched addresses revert
* Add touched addresses journal events
* Delete all empty touch addresses
* Implement selfdestruct
* Update aggregator.rs
2023-05-12 13:04:46 +02:00
Hamish Ivey-Law
c134b59763
Cross-table lookup for arithmetic stark ( #905 )
...
* First draft of linking arithmetic Stark into the CTL mechanism.
* Handle {ADD,SUB,MUL}FP254 operations explicitly in `modular.rs`.
* Adjust argument order; add tests.
* Add CTLs for ADD, MUL, SUB, LT and GT.
* Add CTLs for {ADD,MUL,SUB}MOD, DIV and MOD.
* Add CTLs for {ADD,MUL,SUB}FP254 operations.
* Refactor the CPU/arithmetic CTL mapping; add some documentation.
* Minor comment fixes.
* Combine addcy CTLs at the expense of repeated constraint evaluation.
* Combine addcy CTLs at the expense of repeated constraint evaluation.
* Merge `*FP254` CTL into main CTL; rename some registers.
* Connect extra argument from CPU in binary ops to facilitate combining with ternary ops.
* Merge modular ops CTL into main CTL.
* Refactor DIV and MOD code into its own module.
* Merge DIV and MOD into arithmetic CTL.
* Clippy.
* Fixes related to merge.
* Simplify register naming.
* Generate u16 BN254 modulus limbs at compile time.
* Clippy.
* Add degree bits ranges for Arithmetic table.
2023-05-11 03:29:06 +10: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
c8d591f6da
Add a prove_with_outputs method
...
Which returns information about the post-state after execution. This is useful for debugging purposes.
2023-03-16 13:42:59 -07:00
Daniel Lubarov
c558eedd65
Misc EVM fixes
2023-03-05 09:39:49 -08:00
Daniel Lubarov
ff80f28b93
Revert "Set CI to use an older version of nightly"
...
This reverts commit da23fb116b934925f8a5cf37c2f1f092452fdc4d.
2023-02-10 23:10:39 -08:00
Daniel Lubarov
137bc78565
Prep for publishing to crates.io
2023-01-30 13:18:06 -08:00
Daniel Lubarov
df2ba7a384
Basic smart contract test
2023-01-14 21:18:58 -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
Daniel Lubarov
6f841678a5
More timing for zkEVM proofs
2022-12-09 21:48:36 -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
Brandon H. Gomes
6fd0da216a
fix: remove unstable features from plonky2
...
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-02 17:50:31 -07:00
wborgeaud
a5a4098d7a
Merge branch 'main' into per_table_recursion
...
# Conflicts:
# evm/src/all_stark.rs
# evm/src/generation/mod.rs
# evm/src/recursive_verifier.rs
2022-10-03 11:49:26 +02:00
wborgeaud
3579f9e875
state() -> compact()
2022-10-03 10:53:33 +02: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
wborgeaud
6e6c2daf29
Add challenger state
2022-09-22 11:01:27 +02:00
wborgeaud
e7edfdd6a3
Minor
2022-08-26 18:30:26 +02:00
wborgeaud
05c3c4d907
First pass
2022-08-26 10:12:45 +02:00
Daniel Lubarov
b829b44dcf
Fix test
2022-08-25 22:11:25 -07:00
Daniel Lubarov
aa87f2c3ba
Public memory
2022-08-25 20:19:18 -07:00