764 Commits

Author SHA1 Message Date
Dmitry Vagner
84f17699be comments 2023-04-28 21:57:10 -07:00
Dmitry Vagner
f9aad433fe neutral input 2023-04-28 18:23:08 -07:00
Dmitry Vagner
9b18b3aeec fix unit 2023-04-27 18:24:08 -07:00
wborgeaud
4ad8520e34
SNARKV precompile (#1010)
* Serialize impls, and use in Fibonacci example

* seralizing

* cleanup

* don't serialize challenges

* deterministic build function

* cleanup

* cleanup

* cleanup

* fix

* cleanup

* fmt

* rename

* Unpacking and storing inputs

* Finish snarkv interface

* Failing test

* move serialization to separate example

* Imaginary part in front of real

* serialize ProofChallenges

* remove build_without_randomizing (no longer needed)

* fix

* Fix kernel peak

* Fix stack comments

* Minor

* SSTORE gas (#1007)

* Update storage access list and sload

* Add noop for sys_sstore

* Comments

* Fix access list test

* PR feedback

---------

Co-authored-by: Nicholas Ward <npward@berkeley.edu>
2023-04-27 19:21:26 +02:00
Dmitry Vagner
b28e3e0db7 minor 2023-04-27 07:45:35 -07:00
Dmitry Vagner
89122a3d73 it works 2023-04-26 15:29:53 -07:00
Dmitry Vagner
4c235e5a4b Merge branch 'main' of github.com:mir-protocol/plonky2 into pairing-test 2023-04-26 14:16:08 -07:00
Dmitry Vagner
d31c60a045 clean up 2023-04-26 09:57:36 -07:00
wborgeaud
67a3edb2f1
Precompiles exist (#1008)
* Precompiles exist

* Fix
2023-04-26 06:26:41 +02: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
Dmitry Vagner
f225ea495d add comment 2023-04-24 13:44:31 -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
Dmitry Vagner
0f662ed043 fixes 2023-04-24 08:08:26 -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
Dmitry Vagner
2620446128 it works 2023-04-21 13:31:51 -07:00
Dmitry Vagner
dd58b9b5d8 dont panic 2023-04-21 12:02:36 -07:00
Dmitry Vagner
26d99a9b15 memory compress 2023-04-20 20:54:13 -07:00
Dmitry Vagner
5075224665 clean 2023-04-20 20:33:49 -07:00
Dmitry Vagner
ff0695d760 renumber memory 2023-04-20 20:31:26 -07:00
Dmitry Vagner
f1bbf66cda it works 2023-04-20 20:02:15 -07:00
Dmitry Vagner
c01b2bf2c2 minor 2023-04-20 19:56:54 -07:00
Dmitry Vagner
44a623d453 initialize out in asm 2023-04-20 14:07:45 -07:00
Dmitry Vagner
4e0be66432 Merge branch 'main' of github.com:mir-protocol/plonky2 into pairing-test 2023-04-20 13:46:07 -07:00
wborgeaud
1a0a63003d
EIP170 (#1000) 2023-04-20 17:28:33 +02:00
Dmitry Vagner
099c4b9702 msg 2023-04-19 23:34:50 -07:00
Dmitry Vagner
82bca7fa34 error 2023-04-19 23:09:27 -07:00
Dmitry Vagner
b661a70904 twisted check 2023-04-19 23:06:02 -07: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
Dmitry Vagner
bbe64674d0 tests passing 2023-04-19 14:51:25 -07:00
Dmitry Vagner
d6584dcb7c restructure tate test 2023-04-19 14:09:05 -07:00
Dmitry Vagner
9b54ee43db refactor 2023-04-19 13:12:47 -07:00
Dmitry Vagner
0e08243275 reorg 2023-04-19 10:40:39 -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