430 Commits

Author SHA1 Message Date
Daniel Lubarov
f117d76b73 sys_gas 2023-03-05 22:30:28 -08:00
Daniel Lubarov
c558eedd65 Misc EVM fixes 2023-03-05 09:39:49 -08:00
Daniel Lubarov
29f0692efc Fix a few issues found by EVM tests 2023-02-24 23:37:08 -08:00
Dmitry Vagner
da7a8879c4 make hash functions take a location pointer 2023-02-16 16:59:51 -08:00
Dmitry Vagner
a6ffb4b3c3 simplify byte extraction 2023-02-16 16:30:50 -08:00
Dmitry Vagner
53ab0ada11 remove blake storage 2023-02-15 19:11:22 -08:00
Dmitry Vagner
77a7af76c2 remove sha2 storage 2023-02-15 19:00:52 -08:00
Dmitry Vagner
731c29c43b abstract 2023-02-15 18:47:33 -08:00
Dmitry Vagner
bce867188c simplify ripe md test 2023-02-15 18:18:26 -08:00
Jacqueline Nabaglo
f3946f75bf
Gas constraints (#880)
* Gas constraints

* Bugfix

* make test pass post rebase
2023-02-14 22:30:19 -08:00
wborgeaud
ac40bd5f5d
Optimize ecMul precompile (scalar multiplication on BN254) (#852)
* 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

* Move files and renaming fns

* Testing

* Fix BN GLV

* BN precompute table

* Working precompute

* Working bn tests

* Working

* Minor

* Minor

* Use MULFP254

* Minor

* Merge conflicts

* Remove unused asm file

* ECC fns renaming (#874)

* PR feedback
2023-02-13 20:11:32 +01: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
Daniel Lubarov
f2e40541d9 Increment sender nonce + buy gas 2023-01-17 23:57:53 -08:00
Daniel Lubarov
df2ba7a384 Basic smart contract test 2023-01-14 21:18:58 -08:00
Nicholas Ward
6ab6580058 block_size macro 2022-12-13 14:42:45 -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
Nicholas Ward
fc14475541 documentation 2022-12-13 10:08:36 -08:00
Nicholas Ward
50ffb9072a documentation 2022-12-13 10:08:36 -08:00
Nicholas Ward
778aec627b rename blake -> blake2b 2022-12-13 10:08:36 -08:00
Nicholas Ward
d30a95f7d5 fixes 2022-12-13 10:08:36 -08:00
Nicholas Ward
0d05a4bbbf FIX 2022-12-13 10:08:36 -08:00
Nicholas Ward
49504dde7d fixes 2022-12-13 10:08:36 -08:00
Nicholas Ward
20169a5476 debugging 2022-12-13 10:08:36 -08:00
Nicholas Ward
245e5faa6d fixes galore 2022-12-13 10:08:36 -08:00
Nicholas Ward
d3a7201348 fixes 2022-12-13 10:08:36 -08:00
Nicholas Ward
5759fb7b3c concat 2022-12-13 10:08:36 -08:00
Nicholas Ward
9774b74b90 Blake progress 2022-12-13 10:08:36 -08:00
Nicholas Ward
ebd606621f progress 2022-12-13 10:08:36 -08:00
Nicholas Ward
772dc5c9e7 util file 2022-12-13 10:08:36 -08:00
Nicholas Ward
df932544bd fixes and testing 2022-12-13 10:08:36 -08:00
Nicholas Ward
a38b1fb37c progress 2022-12-13 10:08:36 -08:00
Nicholas Ward
54a2e96473 progress 2022-12-13 10:08:36 -08:00
Nicholas Ward
dd29ec1f46 fixes and test infrastructure 2022-12-13 10:08:30 -08:00
Nicholas Ward
0cfe790210 updates 2022-12-13 10:08:16 -08:00
Nicholas Ward
5fab01b952 fix 2022-12-13 10:08:16 -08:00
Nicholas Ward
609ed6c984 fixes 2022-12-13 10:08:16 -08:00
Nicholas Ward
d3e5feba83 Blake progress 2022-12-13 10:08:16 -08:00
Nicholas Ward
6e782a1a1e Blake progress 2022-12-13 10:08:16 -08:00
Nicholas Ward
0c919443f9 progress 2022-12-13 10:08:16 -08:00
Nicholas Ward
b40338ff2e progress 2022-12-13 10:08:16 -08:00
Nicholas Ward
9a5db4b8d2 progress 2022-12-13 10:08:16 -08:00
Nicholas Ward
a1ea7ff930 progress 2022-12-13 10:08:16 -08:00
Nicholas Ward
1089bbf29e blake initial 2022-12-13 10:08:16 -08:00
Nicholas Ward
efa80edaa9 blake initial 2022-12-13 10:08:16 -08:00
Daniel Lubarov
7557f320d4 Fix to add_eth
It was creating a new account with the hash of an empty storage trie, when really it should be a pointer to an empty storage trie. We can use 0 as this pointer since `@SEGMENT_TRIE_DATA[0] = 0 = @MPT_NODE_EMPTY`.

Also a couple tweaks that helped me debug, like moving the memory value range checks from the interpreter into `MemoryState`, so they're done in actual witness generation as well as interpreter tests.
2022-12-09 18:58:48 -08:00
Daniel Lubarov
f4ab65f973 Fixes to get test_simple_transfer working 2022-12-08 23:27:20 -08:00
Daniel Lubarov
b96c22a4f4 Interpreter fixes 2022-12-02 19:18:37 -08:00
Daniel Lubarov
05ab3d7933 Fixes 2022-12-01 16:23:39 -08:00