1506 Commits

Author SHA1 Message Date
Hamy Ratoanina
4b40bc0313
Remerge context flags (#1292)
* Remerge context flags

* Apply comments and revert some unwanted changes
2023-10-30 12:56:11 -04:00
Robin Salen
0258ad4a3d
Merge pull request #1314 from topos-protocol/refactor_wcopy
Refactor `%wcopy` and unify {ext}codecopy related code
2023-10-27 11:47:42 -04:00
Robin Salen
6f52b76d03
Review 2023-10-27 11:16:47 -04:00
Robin Salen
7447959fad
Fix kexit_info in test 2023-10-27 11:15:23 -04:00
Linda Guiga
666a155d4a
Remove new_stack_top_channel from StackBehavior (#1296) 2023-10-26 17:52:54 -04:00
Robin Salen
15a9e9928a
Fix test on interpreter side 2023-10-26 17:08:40 -04:00
Robin Salen
75fdd342f5
Fix calldatacopy 2023-10-26 15:59:40 -04:00
Robin Salen
ade5b8c39b
Fix 2023-10-26 15:46:55 -04:00
Robin Salen
a9e47afc07
Refactor codecopy 2023-10-26 15:24:53 -04:00
Robin Salen
a1b178f6c7
Refactor memcpy 2023-10-26 11:47:21 -04:00
Robin Salen
3feb04d252
Refactor wcopy syscalls 2023-10-26 11:47:21 -04:00
Hamy Ratoanina
3aeec83a05
Add missing constraints for DUP/SWAP (#1310) 2023-10-26 09:59:02 -04:00
Robin Salen
c1c1ab6d0f
Fix wcopy and extcodecopy for ranges over code limit 2023-10-24 18:10:06 -04:00
Robin Salen
b31f70612e
Apply rustfmt with latest nightly 2023-10-24 07:26:45 -04:00
Robin Salen
60811d083f
Also for memset 2023-10-23 19:40:32 -04:00
Robin Salen
83054b0ffe
Handle empty case for memcpy_bytes 2023-10-23 19:12:54 -04:00
Robin Salen
385ab3c64f
Remove redundant 2023-10-23 08:15:10 -04:00
Robin Salen
d185d30e89
Speed-up memset and fix it to write 0 values 2023-10-23 07:55:09 -04:00
Robin Salen
0300a322de
Merge pull request #1304 from topos-protocol/memcpy_bytes
Add macro for copying sequences of bytes
2023-10-23 07:32:07 -04:00
Robin Salen
4140eb54f4
Fix 2023-10-23 07:20:52 -04:00
Robin Salen
503a31b6f0
Reviews 2023-10-23 07:16:39 -04:00
Robin Salen
e2b662062a
Merge pull request #1302 from topos-protocol/remove_kernel_memory_zeroing 2023-10-23 06:33:05 -04:00
Robin Salen
9607a41b84
Merge pull request #1303 from topos-protocol/amortize_receipt_reset 2023-10-23 06:32:27 -04:00
Robin Salen
ba61d15cf9
Add macro for copying sequences of bytes 2023-10-21 16:36:41 -04:00
Robin Salen
6d2586ef58
Amortize bloom reset 2023-10-21 14:39:34 -04:00
Robin Salen
40de505954
Remove outdated code 2023-10-21 13:36:22 -04:00
Robin Salen
07ffe4f591
Combine stack macros for fewer operations 2023-10-21 13:04:27 -04:00
Robin Salen
6ca9970a3b
Alter stack to remove SWAPs for SUBMOD 2023-10-21 12:17:04 -04:00
Robin Salen
29005dc586
Use SUBMOD in Kernel 2023-10-21 11:44:23 -04:00
Robin Salen
49976ea2a9
Check gas in sys_stop (#1297) 2023-10-19 07:55:39 -04:00
Linda Guiga
817e3e78e0
Combine DUP and SWAP (#1254)
* Combine dup and swap flags.

* Add comments
2023-10-18 17:32:43 -04:00
Hamy Ratoanina
1d60431992
Store top of the stack in memory channel 0 (#1215)
* Store top of the stack in memory channel 0

* Fix interpreter

* Apply comments

* Remove debugging code

* Merge commit

* Remove debugging comments

* Apply comments

* Fix witness generation for exceptions

* Fix witness generation for exceptions (again)

* Fix modfp254 constraint
2023-10-11 16:28:49 -04:00
wborgeaud
762e6f07b8
Fix hash node case in mpt_delete_branch (#1278)
* Fix

* Add test

* Fix test

* Clippy
2023-10-11 18:57:17 +02:00
Linda Guiga
d7990ee137
Add journal entry for logs (#1286)
* Add journal entry for logs

* Move journal labels to another file.

* Minor cleanup
2023-10-11 10:36:23 -04:00
wborgeaud
9fd0425f67
Fix journal order in sys_selfdestruct (#1287)
* Fix

* Minor
2023-10-11 16:24:00 +02:00
Hamy Ratoanina
49ca63ee0f
Fix sys_blockhash (#1285) 2023-10-11 10:23:09 -04:00
Linda Guiga
2aeecc3dd8
Fix failed receipt. (#1284) 2023-10-11 10:02:24 -04:00
Robin Salen
b4203c3d47
Make sure success is 0 in contract failure (#1283) 2023-10-10 06:23:20 -04: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
Robin Salen
8a5eed9d1c
Fix shift constraint (#1280) 2023-10-09 07:41:30 -04:00
Linda Guiga
0de6f94962
Remove extra SHL/SHR CTL. (#1270)
* Remove extra shift CTL.

* Change order of inputs for the arithmetic shift operations. Add SHR test. Fix max number of bit shifts. Cleanup.

* Fix SHR in the case shift >= 256

* Limit visibility of helper functions
2023-10-05 09:56:56 -04: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
Alonso González
f49fbc8e9b
Transactions trie support (#1232)
* Implement transactions.

* Fix receipts and transactions

* Add some fixes

* Update tests

* Remove changes added for debugging purposes only

* Clippy

* Remove additional debug changes

* Remove unused

* Apply comments

---------

Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>
Co-authored-by: Robin Salen <salenrobin@gmail.com>
2023-09-27 10:00:16 -04:00
Robin Salen
03a9558198
Handle additional panics (#1250)
* Remove some panic risks

* Remove more panics

* Handle jump with empty stack

* Handle last expect

* More panics

* Handle from_big_endian

* Handle from_little_endian

* Remove remaining risky as_usize()

* Remove explicit panic

* Clippy

* Handle unwrap

* Make error messages more explicit

* Simplify u256 to usize conversion
2023-09-26 11:13:57 -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
Robin Salen
0abc3b9210
Apply comments (#1248) 2023-09-22 10:14:47 -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
Robin Salen
053553d4d7
Reuse new packing instructions for MLOAD and MSTORE 2023-09-18 16:31:46 -04:00
Robin Salen
f3ea95cacc
Merge branch 'main' into error_vs_panic 2023-09-18 09:59:52 -04:00
Robin Salen
8903aec129
Change padding rule for CPU (#1234)
* Change padding rule for CPU

* Disable memory channels for padding rows

* Apply some of Jacqueline's comments

* Update halt routine

* Add clarifying comment

* Redundant constraints and padding bug

* Revert "Remove is_bootstrap_kernel column"

This reverts commit 49d92cb8f1b0ae9de76872f76af4429699ff692f.

* Make halt_state implicit

* Move halting logic constraints to dedicated module

* Include new module

* Update some comments
2023-09-15 17:46:58 -04:00