1625 Commits

Author SHA1 Message Date
4l0n50
dfcf276dab Refactor encode_empty_node and encode_branch_node
Clean code

Not important

Restore jumpdets_analysis.asm

Refactor encode_empty_node and encode_branch_node
2023-12-21 16:15:36 +01:00
4l0n50
3e78865d64 Remove aborts for invalid jumps and Rebase 2023-12-20 15:02:32 +01:00
4l0n50
11d668f5e6 Remove aborts for invalid jumps 2023-12-20 14:29:57 +01:00
4l0n50
4e569484c2 Improve proof generation 2023-12-20 14:29:57 +01:00
4l0n50
5acabad72d Eliminate nested simulations 2023-12-20 14:29:54 +01:00
Alonso González
0bec627899 Apply suggestions from code review
Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>
2023-12-20 14:29:08 +01:00
4l0n50
ed260980b2 Fix jumpdest analisys test 2023-12-20 14:29:08 +01:00
4l0n50
ff3dc2e516 Refactor run_next_jumpdest_table_proof 2023-12-20 14:29:04 +01:00
4l0n50
9e39d88ab8 Rebase to main 2023-12-20 14:28:38 +01:00
Robin Salen
7cb0488429
Minor cleanup (#1435) 2023-12-19 11:06:54 +01:00
Hamy Ratoanina
096c7456bb
Constrain new top to loaded value in MLOAD_GENERAL (#1434) 2023-12-19 09:57:20 +01:00
Linda Guiga
f67ee258a1
Add exceptions handling to the interpreter (#1393)
* Add exceptions handling to the interpreter

* Apply comments

* Fix comments
2023-12-18 19:11:16 +01:00
wborgeaud
f8f6b07a39
Change context to current context for BN precompiles (#1428)
* Change context to current for BN precompiles

* Rename segments

* rustfmt
2023-12-16 17:02:56 +01:00
Hamy Ratoanina
68b9f0ad1c
Add ERC721 test (#1425)
* Add ERC721 test

* Add IS_READ column to BytePacking CTL

* Apply comment
2023-12-15 19:44:59 -05:00
Hamy Ratoanina
71dff6e982
Constrain MSTORE_32BYTES new offset limbs (#1415) 2023-12-13 18:35:17 -05:00
Linda Guiga
bc1a3c4851
Merge push and prover_input flags (#1417)
* Merge PUSH and PROVER_INPUT flags

* Apply comment
2023-12-13 16:21:24 +01:00
Hamy Ratoanina
3195c205df
Merge MSTORE_32BYTES and MLOAD_32BYTES columns (#1414)
* Merge MSTORE_32BYTES and MLOAD_32BYTES columns

* Fix circuit functions

* Apply comments
2023-12-08 17:57:45 -05:00
yanziseeker
43ecf1dff3 chore: fix some comment typos 2023-12-08 10:17:07 +00:00
Linda Guiga
7efd147e08
Use mstore_32bytes to optimize decode_int_given_len (#1413) 2023-12-07 21:48:37 +01:00
Hamy Ratoanina
edfc86c393
Remove is_keccak_sponge (#1410)
* Remove is_keccak_sponge

* Apply comment
2023-12-07 13:07:06 -05:00
Hamy Ratoanina
170ce5f27c
Preinitialize all code segments (#1409)
* Preinitialize all code segments

* Add zero writes after code_size

* Use preinitializing for extcodesize

* Fix gas calculation

* Extend logic to extcodecopy

* Apply comments
2023-12-07 12:49:46 -05:00
Linda Guiga
a90aa40b7a
Implement MPT preinitialization (#1406)
* Implement MPT preinitialization

* Apply comments

* Replace GlobalMetadata reads with stores in the kernel

* Change memory specs

* Remove trie data length as a prover input
2023-12-07 12:08:47 -05:00
Hamy Ratoanina
4ba7718e66
Optimize asserts (#1411) 2023-12-07 02:46:20 -05:00
Hamy Ratoanina
46b6aa108d
Implement degree 2 filters (#1404)
* Implement degree 2 filters

* Apply comments
2023-12-05 17:02:37 -05:00
Robin Salen
2d36559dad
Make some functions const (#1407) 2023-12-05 13:41:31 -05:00
Robin Salen
cb2a22a5f6
Update stack op cost (#1402)
* Update stack op cost

* Update from review
2023-12-04 10:32:52 -05:00
Hamy Ratoanina
d682769b2e
Fix set_context constraints (#1401)
* Fix set_context constraints

* Apply comment
2023-12-01 19:12:59 -05:00
Robin Salen
32d009671a
Fix kernel codehash discrepancy (#1400) 2023-12-01 14:34:19 -05: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
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
Alonso González
471ff68d51
Optimize num_bytes and hex_prefix_rlp (#1384)
* Compute num_bytes non-deterministically

* Optimize hex_prefix_rlp

* Clean code

* Clippy

* Apply suggestions

Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>

* Clean

* Add endline

* Change 1^256 to U256_MAX

* Apply suggestions from code review

Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>

---------

Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>
2023-11-29 10:43:50 -05:00
Hamy Ratoanina
64cc1000e7
Move stack_len_bounds_aux to general columns (#1360)
* Move stack_len_bounds_aux to general columns

* Update specs

* Apply comments

* Apply comment
2023-11-28 14:14:47 -05:00
Linda Guiga
96f3faf26e
Changes in interpreter and implement interpreter version for add11 (#1359)
* Fix interpreter, turn syscall opcodes into actual syscalls, create interpreter test for add11

* Rename test_add11 to test_add11_yml

* Apply comments

* Cleanup add11_yml interpreter test

* Make stack_top() return a Result, and remove Result from add11_yml test

* Apply comment
2023-11-28 13:35:40 -05:00
Linda Guiga
ab70bc536d
Fix run_syscall in interpreter. (#1351)
* Fix syscall and change sload test to catch the error

* Update comment

* Cleanup
2023-11-27 12:34:41 -05:00
Hamy Ratoanina
d4b05f3730
Add specs for stack handling (#1381)
* Add specs for stack handling

* Apply comments
2023-11-22 18:55:53 -05:00
Linda Guiga
a736458617
Backporting gas handling to the specs (#1379)
* Backporting gas handling to the specs

* Fix typo and syscall handling
2023-11-22 18:35:49 -05:00
Hamy Ratoanina
fe311c7f90
Check is_kernel_mode when halting (#1369) 2023-11-22 15:44:11 -05:00
Hamy Ratoanina
1f65a8a863
Add exceptions to specs (#1372)
* Add exceptions to specs

* Apply comments
2023-11-21 15:20:07 -05:00
Robin Salen
b9328815e6
Reduce visibility (#1364) 2023-11-17 15:45: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
Hamy Ratoanina
eda7fd659e
Constrain is_keccak_sponge (#1357) 2023-11-15 16:17:31 -05:00
Hamy Ratoanina
0e63e66196
Implement out of gas exception (#1328)
* Implement out of gas exception

* Use gas constants in gas_cost_for_opcode

* Remove comment
2023-11-15 11:20:14 -05:00
Robin Salen
01f229a8e1
Add push constraints (#1352)
* Add push constraints

* Fix ranges

* Add stack constraints
2023-11-15 11:15:14 -05:00
Hamy Ratoanina
a0876d73f7
Refactor JUMPDEST analysis (#1347)
* Use table for JUMPDEST

* Refactor jumpdest loop

* Update comment

---------

Co-authored-by: Robin Salen <salenrobin@gmail.com>
2023-11-15 11:12:07 -05:00
Robin Salen
f7d5e7c47c
Fix MSTORE_32BYTES in interpreter (#1354) 2023-11-14 17:19:19 -05:00
Hamy Ratoanina
6d751b13c1
Remove values of last memory channel (#1291)
* Remove values of last memory channel

Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>

* Fix merge

* Apply comments

* Fix ASM

* Top stack documentation (#7)

* Add doc file

* Apply comments

* Apply comments

* Fix visibility

* Fix visibility

---------

Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>
2023-11-13 11:03:50 -05:00
David
75ae0eb59f
Merge pull request #1346 from 0xPolygonZero/dp-unwrap-hunting
Root out some unwraps
2023-11-13 14:28:17 +00: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
Linda Guiga
5800e6ad64
Add run_syscall and tests for sload and sstore (#1344)
* Add run_syscall and tests for sload and sstore

* Replace panics with errors and address comments

* Apply comments

* Change last addr name in prepare_interpreter

* Fix kernel_mode in tests

* Minor cleanup
2023-11-10 19:19:00 -05:00
Robin Salen
cc0cdd0783
Remove unnecessary code duplication (#1349)
* Remove unnecessary code duplication

* Clippy
2023-11-10 17:12:44 -05:00