Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Adapt testeth to be used with evmlab - part 1 #5837

Merged
merged 6 commits into from
Nov 20, 2019
Merged

Conversation

gumb0
Copy link
Member

@gumb0 gumb0 commented Nov 19, 2019

Addresses 5 out of 6 tasks in #5804

  1. Add memSize field
  2. Always output memory unless disabled; not only for memory-changing opcodes.
  3. depth starts with 1
  4. Rename op to opName and output opcode number in op
  5. Output line with output, gasUsed, error after the execution

Examples of output:

> test/testeth -t GeneralStateTests -- --testfile /home/andrei/dev/sar00.json  --jsontrace {}
Test Case "customTestSuite": 
{"depth":"1","gas":"379000","gasCost":"3","memSize":0,"memory":[],"op":96,"opName":"PUSH1","pc":"0","stack":[],"storage":{"0x00":"0x03"}}
{"depth":"1","gas":"378997","gasCost":"3","memSize":0,"memory":[],"op":96,"opName":"PUSH1","pc":"2","stack":["0x00"]}
{"depth":"1","gas":"378994","gasCost":"3","memSize":0,"memory":[],"op":29,"opName":"SAR","pc":"4","stack":["0x00","0x00"]}
{"depth":"1","gas":"378991","gasCost":"3","memSize":0,"memory":[],"op":96,"opName":"PUSH1","pc":"5","stack":["0x00"]}
{"depth":"1","gas":"378988","gasCost":"0","memSize":0,"memory":[],"op":85,"opName":"SSTORE","pc":"7","stack":["0x00","0x00"]}
{"depth":"1","gas":"373988","gasCost":"0","memSize":0,"memory":[],"op":0,"opName":"STOP","pc":"8","stack":[],"storage":{}}
{"output": "", "gasUsed": "13006"}
{"stateRoot": "a4b37b548bc12ee198ce885d83b511302d9d8f6b2ec5775618b3893c60e0dc75"}

*** No errors detected
> test/testeth -t GeneralStateTests -- --testfile /home/andrei/dev/randomStatetestmartin-Wed_10_02_29-14338-0.json  --jsontrace {}
Test Case "customTestSuite": 
{"depth":"1","gas":"2956484","gasCost":"1","memSize":0,"memory":[],"op":91,"opName":"JUMPDEST","pc":"0","stack":[],"storage":{}}
{"depth":"1","gas":"2956483","gasCost":"2","memSize":0,"memory":[],"op":61,"opName":"RETURNDATASIZE","pc":"1","stack":[]}
{"depth":"1","gas":"2956481","gasCost":"2","memSize":0,"memory":[],"op":48,"opName":"ADDRESS","pc":"2","stack":["0x00"]}
{"depth":"1","gas":"2956479","gasCost":"3","memSize":0,"memory":[],"op":172,"opName":"PUSHC","pc":"3","stack":["0x00","0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b"]}
{"depth":"1","gas":"2956476","gasCost":"3","memSize":0,"memory":[],"op":172,"opName":"PUSHC","pc":"30","stack":["0x00","0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b","0xc940b5f2046740058558468f238b85db7f6bbe3f3d51e92a3e32"]}
{"depth":"1","gas":"2956473","gasCost":"3","memSize":0,"memory":[],"op":83,"opName":"MSTORE8","pc":"40","stack":["0x00","0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b","0xc940b5f2046740058558468f238b85db7f6bbe3f3d51e92a3e32","0xb7f7c4147541c695f3"]}
{"output": "", "gasUsed": "3000000", "error": "OutOfGas"}
{"stateRoot": "a2b3391f7a85bf1ad08dc541a1b99da3c591c156351391f26ec88c557ff12134"}

*** No errors detected

Output of geth's evm for comparison: https://github.com/holiman/goevmlab/blob/master/evms/testdata/statetest1_geth_stderr.jsonl

@codecov-io
Copy link

codecov-io commented Nov 20, 2019

Codecov Report

Merging #5837 into master will decrease coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5837      +/-   ##
==========================================
- Coverage    64.1%   64.08%   -0.03%     
==========================================
  Files         362      362              
  Lines       30903    30906       +3     
  Branches     3429     3432       +3     
==========================================
- Hits        19811    19806       -5     
- Misses       9865     9871       +6     
- Partials     1227     1229       +2

@gumb0 gumb0 changed the title Adapt testeth to be used with evmlab Adapt testeth to be used with evmlab - part 1 Nov 20, 2019
@gumb0 gumb0 merged commit 0c73561 into master Nov 20, 2019
@gumb0 gumb0 deleted the testeth-for-evmlab branch November 20, 2019 18:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants