744 Commits

Author SHA1 Message Date
Nicholas Ward
badbf01021 store and unpack at end 2023-04-28 11:01:51 -07:00
Nicholas Ward
998cd8ab77 addressed comments 2023-04-28 10:37:37 -07:00
Nicholas Ward
96742f2946 addressed comments 2023-04-28 07:05:54 -07:00
Nicholas Ward
b4e06271df fix 2023-04-26 11:14:29 -07:00
Nicholas Ward
1e9db2924f fixes 2023-04-26 09:46:29 -07:00
Nicholas Ward
0d98e4b8ee formatting 2023-04-25 17:47:19 -07:00
Nicholas Ward
dc91554da2 expmod precompile 2023-04-25 17:19:44 -07:00
Nicholas Ward
11a03c5ebc
Merge pull request #1005 from mir-protocol/precompile-fixes
Minor optimizations to precompile call code
2023-04-24 22:21:09 -07:00
Nicholas Ward
137a9966e0
Merge pull request #998 from mir-protocol/even-smaller-bignum-modexp-test
even smaller bignum modexp test, and fixes
2023-04-24 15:48:30 -07:00
Nicholas Ward
1eba893e61 mload_packing macro 2023-04-24 11:25:38 -07:00
Nicholas Ward
ffc5d6d6c2 Merge branch 'main' into precompile-fixes 2023-04-24 11:24:39 -07:00
wborgeaud
b7e93511e4
New contract hook (#1002)
* New contract hook

* Minor

* PR feedback
2023-04-24 09:07:00 +02:00
wborgeaud
a4b714e64d
EIP-3541: Reject new contract code starting with the 0xEF byte (#1003)
* EIP-3541: Reject new contract code starting with the 0xEF byte

* Panic instead

* PR feedback
2023-04-24 07:55:04 +02:00
wborgeaud
472face2a5
EIP-3860: Limit and meter initcode (#999)
* EIP3860

* Contract creation tx

* Minor
2023-04-24 07:17:47 +02:00
Nicholas Ward
d5060ecd60 precompile optimizations 2023-04-21 18:00:52 -07:00
wborgeaud
1a0a63003d
EIP170 (#1000) 2023-04-20 17:28:33 +02:00
wborgeaud
6edd589138
Gas and more for CREATE(2) (#995)
* Gas

* Codehash

* Minor
2023-04-20 07:00:15 +02:00
wborgeaud
a8e5613bc5
EOA to precompiles logic (#993)
* Start

* Progress

* Comments

* Minor
2023-04-20 06:56:47 +02:00
Nicholas Ward
df4a6f0105 fix for full modexp test 2023-04-19 15:27:49 -07:00
Nicholas Ward
6d84b988ba fmt 2023-04-19 14:56:08 -07:00
Nicholas Ward
cb23bfcade check for special cases and align with yellow paper 2023-04-19 14:55:19 -07:00
Hamish Ivey-Law
2e16ab0489
Replace %stack calls with equivalent opcodes. (#994) 2023-04-20 01:34:04 +10:00
Daniel Lubarov
67593f162a Labels for failed MPT read/insert 2023-04-17 17:27:55 -07:00
wborgeaud
b721236eb3
Precompiles interface (#983)
* Start

* Some sha256 test passing

* precompiles folder

* Files reorg

* Progress

* Minor

* Start of sha2 interface

* All call opcodes

* ecrec

* rip160

* Fix copy_returndata_to_mem

* id

* bn_add

* bn_mul

* TODOs for snarkv and blake2

* Comments

* Use charge_gas_const when possible

* Minor

* Minor

* Minor

* PR feedback
2023-04-14 12:20:28 +02:00
Daniel Lubarov
58f4568e7c
Merge pull request #982 from toposware/sys_chainid
Use Block chain id for sys_chainid
2023-04-12 14:43:43 -07:00
Hamy Ratoanina
92d94dc60d
Use Block chain id for sys_chainid 2023-04-12 15:25:06 -04:00
wborgeaud
475b2ba0cb
Fix copy_returndata_to_mem (#976) 2023-04-12 16:41:36 +02:00
wborgeaud
c7e60073f0
Check if context is static for state-changing opcodes (#973)
* Check if context is static for state-changing opcodes

* PR feedback
2023-04-12 08:24:33 +02:00
wborgeaud
142be4e114
Implement rest of *CALL opcodes (#972)
* Implement rest of *CALL opcodes

* Use set_new_ctx_code_size macro
2023-04-12 08:04:39 +02:00
wborgeaud
5b1fd5f2af
CALL gas (#969)
* (Non)ZeroValue_CALL pass

* Memory expansion costs (callcall_00 pass)

* Cleaning

* Minor

* PR feedback
2023-04-11 08:41:45 +02:00
Daniel Lubarov
042c004237
Merge pull request #965 from mir-protocol/fix_run_constructor
Fix `run_constructor`
2023-04-08 08:41:23 -07:00
Daniel Lubarov
31e134f0e3 Delete %set_new_ctx_parent_ctx 2023-04-08 08:40:37 -07:00
wborgeaud
1a9f010484
Fix call logic (#963)
* Working callcall_00 (modulo gas)

* Add TODO for call depth

* Add TODO for insufficient balance panic

* Add TODO for subcontext gas limit

* Minor

* Minor

* Copy returndata to memory

* PR feedback
2023-04-08 10:28:01 +02:00
wborgeaud
ab692252ba
Minor fixes to context creation (#961) 2023-04-08 09:06:02 +02:00
Daniel Lubarov
cfc54f95a0 Fix run_constructor
Fixes the crash due to a huge allocation in `returndatacopyPythonBug_Tue_03_48_41-1432`.
2023-04-07 10:20:40 -07:00
wborgeaud
af3fa1426e
Implement sys_return and sys_revert (#959)
* Fix gas and copy returndata in sys_return

* Also revert

* mstore_parent_context_metadata macros
2023-04-06 07:22:16 +02:00
wborgeaud
5ac12de990
Fix sys_exp (#958) 2023-04-05 19:07:47 +02:00
wborgeaud
923722b1e4
Fix copy opcodes when offset is large (#957)
* Fix wcopy

* Fix extcodecopy and use memset

* Comments
2023-04-05 06:24:26 +02:00
Nicholas Ward
d59fa59af8
Merge pull request #925 from mir-protocol/bignum-modexp
Bignum modexp
2023-04-04 13:37:48 -07:00
Nicholas Ward
90f7ba9a23 addressed final comments 2023-04-04 13:33:20 -07:00
Daniel Lubarov
9690b60b80
Merge pull request #956 from mir-protocol/doubly_encode_storage_values
Doubly RLP-encode storage values
2023-04-04 07:40:11 -07:00
Daniel Lubarov
e70e4fca06 Doubly RLP-encode storage values 2023-04-03 21:51:17 -07:00
wborgeaud
6fa59d204f
Fix MSTORE8 (#955)
* Fix MSTORE8

* Small optimization
2023-04-03 16:39:18 +02:00
wborgeaud
f9217272d1
Fix signed syscalls stack (#954) 2023-04-03 13:40:36 +02:00
wborgeaud
46d5e62a13
Copy txn data to calldata (#935) 2023-04-01 07:34:38 +02:00
wborgeaud
8e04cbfe8d
Self-destruct list (#948) 2023-04-01 07:29:22 +02:00
wborgeaud
a926dcad22
Transaction validity checks (#949) 2023-04-01 07:24:02 +02:00
wborgeaud
2ca00a9ad4
Selfdestruct gas and set (#947)
* Add new segment and global metadata

* Insert into self-destruct set

* Implement sys_selfdestruct

* PR feedback

* Fix stack underflow

* Forgot that NOT 1 ≠ 0. Added %not_bit macro for that.
2023-03-31 11:13:36 +02:00
wborgeaud
56bf08921b
Charge gas for extcodecopy (#942)
* Charge gas for extcodecopy

* Check for size=0
2023-03-30 06:46:26 +02:00
Daniel Lubarov
f71d364237
Merge pull request #945 from mir-protocol/remove_CONSUME_GAS
Remove `CONSUME_GAS`
2023-03-29 13:17:06 -07:00