70 Commits

Author SHA1 Message Date
Nicholas Ward
998cd8ab77 addressed comments 2023-04-28 10:37:37 -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
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
Nicholas Ward
d59fa59af8
Merge pull request #925 from mir-protocol/bignum-modexp
Bignum modexp
2023-04-04 13:37:48 -07: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
Daniel Lubarov
2d87c5d627 Remove CONSUME_GAS
Now that gas info is in `kexit_info`.
2023-03-29 11:28:05 -07:00
wborgeaud
9f1a5f975c
Charge gas for keccak (#943) 2023-03-29 19:58:29 +02:00
Nicholas Ward
c18377d12f Merge branch 'main' into bignum-modexp 2023-03-28 11:15:27 -07:00
wborgeaud
ce22d94518
Access lists (#937)
* Working linear search

* Working linear search for storage keys

* Macros

* Gas for wextaccount

* Add origin and to to the access list

* Handle precompiles

* Fixes

* Other opcodes

* Access list SLOAD

* Minor

* Add TODO for SSTORE

* Comments

* Clippy

* Minor

* PR feedback: cold_access

* PR feedback: simplify insert_accessed_addresses_no_return macro

* Fix sys_selfdestruct

* Store length in global metadata and store arrays in kernel memory

* Truncate address in all *CALL syscalls
2023-03-23 20:22:25 +01:00
Nicholas Ward
d59501e6a7 fixes, testing, and in-progress debugging 2023-03-21 16:03:54 -07:00
Nicholas Ward
24705e1e39 addressed comments 2023-03-21 10:56:25 -07:00
Nicholas Ward
9803581d0a fix 2023-03-20 14:57:02 -07:00
Nicholas Ward
1a78f40050 restored neq macro 2023-03-20 14:34:17 -07:00
Daniel Lubarov
bdf35374d5 Misc 2023-03-19 23:22:33 -07:00
Daniel Lubarov
47fac8e35b Couple fixes & minor refactor 2023-03-19 22:35:53 -07:00
Daniel Lubarov
f717a40b85 Charge for memory expansion 2023-03-19 20:17:30 -07:00
Dmitry Vagner
dd7948e77b merge 2023-03-14 16:40:58 -07:00
Dmitry Vagner
24e0b29188 Merge branch 'main' of github.com:mir-protocol/plonky2 into non-inv 2023-03-14 13:42:22 -07:00
Nicholas Ward
476a554aea OR -> ADD 2023-03-14 12:29:30 -07:00
Daniel Lubarov
d5003b7cf2 Gas fees go to coinbase 2023-03-12 23:13:19 -07:00
Dmitry Vagner
2a9d4b1a9a minor 2023-02-20 15:19:01 -08:00
Dmitry Vagner
be35111034 Merge branch 'main' of github.com:mir-protocol/plonky2 into non-inv 2023-02-16 19:31:16 -08:00
Dmitry Vagner
a6ffb4b3c3 simplify byte extraction 2023-02-16 16:30:50 -08:00
Dmitry Vagner
e2cac0bb0c Merge branch 'main' of github.com:mir-protocol/plonky2 into non-inv 2023-02-15 12:33:43 -08:00
Jacqueline Nabaglo
f3946f75bf
Gas constraints (#880)
* Gas constraints

* Bugfix

* make test pass post rebase
2023-02-14 22:30:19 -08:00
Dmitry Vagner
cd5c92b574 merge 2023-02-01 08:51:42 -08:00
wborgeaud
ca002aeafa
Optimize ecrecover ASM (#840)
* windowed mul

* Working

* Window of 4 bits

* Fix

* Comments

* Unroll loop

* Unroll loop

* remove global

* Minor

* Minor

* Implement `CALLVALUE, CALLDATALOAD, CALLDATASIZE, CALLDATACOPY` in interpreter

* Minor

* Doesn't work

* Minor

* Minor

* wnaf msm

* Working hardcoded values: 28657 opcodes

* Working wnaf

* Small wnaf optim

* Precompute works

* Working together

* Bump to 129 bits

* Working glv decomposition

* Working MSM with GLV

* Almost working

* Working

* ECC test folder

* Working with real sig data

* Fix tests + Clippy

* Minor

* Cleaning

* Comments

* Cleaning

* Smaller glv test file

* Print opcode count at the end of interpreter run

* More constants

* Add z3 proof that the GLV scalars are 129-bit or less

* Minor change to z3 proof

* Minor

* Hamish's suggestion

* Working

* Cleaning

* Clippy

* PR feedback

* Minor PR feedback
2023-01-31 19:23:54 +01:00
Dmitry Vagner
8c064b8624 merge 2022-12-13 16:32:13 -08:00
Dmitry Vagner
a9f80d383d spacing 2022-12-13 16:31:16 -08:00
Nicholas Ward
53004867b3 macro 2022-12-13 10:08:36 -08:00
Nicholas Ward
a564d7350c fixes and addressed comments 2022-12-13 10:08:36 -08:00
Nicholas Ward
24d6627a62 addressed comments 2022-12-13 10:08:36 -08:00
Daniel Lubarov
f4ab65f973 Fixes to get test_simple_transfer working 2022-12-08 23:27:20 -08:00
wborgeaud
03d7f3d17e Found bug 2022-10-26 16:39:31 +02:00
wborgeaud
6b4cce21d8 Start 2022-10-21 18:00:41 +02:00
Daniel Lubarov
9639ff22dc MPT storage logic 2022-10-17 22:46:48 -07:00
Daniel Lubarov
cad0473e1d More MPT insert logic 2022-10-10 09:40:28 -07:00
Dmitry Vagner
d42250d677 merge 2022-10-03 14:25:33 -07:00
Nicholas Ward
99fb730aea rearranging and cleanup 2022-10-03 14:07:21 -07:00
Nicholas Ward
7eba422792 addressed comments 2022-10-03 13:34:16 -07:00
Nicholas Ward
bff3da1da1 removed duplicate macros 2022-10-03 13:34:16 -07:00
Nicholas Ward
6a31a4b7ec fixes 2022-10-03 13:34:16 -07:00
Nicholas Ward
c24af37288 fixes 2022-10-03 13:34:16 -07:00
Nicholas Ward
aba45e2d2c finished pad 2022-10-03 13:34:16 -07:00
Nicholas Ward
042da0c8e9 starting on sha2 2022-10-03 13:34:16 -07:00
Dmitry Vagner
d6b3522b34 reverse bytes via BYTE code 2022-09-29 16:21:10 -07:00
Dmitry Vagner
abff978826 Daniel's comments 2022-09-29 13:58:49 -07:00
Dmitry Vagner
71d8384a0f Nick's comments 2022-09-27 22:17:48 -07:00
Dmitry Vagner
41ce8e94b9 FIRST UNIT TEST PASSED! 2022-09-23 10:39:49 -07:00