evmone icon indicating copy to clipboard operation
evmone copied to clipboard

Implement EIP-663 variant C

Open chfast opened this issue 6 years ago • 2 comments

This implement the variant C of the EIP-663 by adding 4 new instructions for EVM stack manipulation: DUPN, SWAPN, DUPSN, SWAPSN.

The function change is only done in the analysis phase when the instruction argument (stack item index) is decode. During execution the same procedure is used as for legacy DUP and SWAP instructions.

Closes #84.

chfast avatar Jul 18 '19 11:07 chfast

Codecov Report

Merging #98 into master will decrease coverage by 3.05%. The diff coverage is 100%.

@@            Coverage Diff            @@
##           master     #98      +/-   ##
=========================================
- Coverage   93.46%   90.4%   -3.06%     
=========================================
  Files          18      18              
  Lines        1866    1938      +72     
  Branches      197     202       +5     
=========================================
+ Hits         1744    1752       +8     
- Misses         97     161      +64     
  Partials       25      25

codecov-io avatar Jul 18 '19 11:07 codecov-io

Unit test suggestions:

  • check the case with implicit zero bytes (check at least that it completes sucessfully, maybe check that it's the same gas used as with actual zero args)
  • check that it's undefined isntructions before Istanbul
  • Two test cases from the EIP spec

gumb0 avatar Jul 18 '19 17:07 gumb0

Can I close this?

chfast avatar Aug 24 '22 11:08 chfast