Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Testing our evm intepreter #4

Open
loiluu opened this issue Sep 24, 2016 · 2 comments
Open

Testing our evm intepreter #4

loiluu opened this issue Sep 24, 2016 · 2 comments

Comments

@loiluu
Copy link
Contributor

loiluu commented Sep 24, 2016

There are existing tests built for evm virtual machines https://github.com/ethereum/tests/tree/develop/VMTests
We may use these tests to test the correctness of our vm implementation.

@loiluu
Copy link
Contributor Author

loiluu commented Mar 12, 2017

Currently, the basic logic for testing EVM interpreter already exists. Function compare_stack_unit_test in symExec.py is triggered when a program path is terminated (Line 474) and the flag UNIT_TEST is set. This is because normally a unit test's code has only one branch and is meant to check only one opcode. What do we want to check in our evm interpreter:

  • The stack implementation (how many items left after the execution and the values of such items)
  • The storage implementation (how many new variables are stored/ removed and their values)
  • We may also want to care about the account balance, gas after each opcode.

Thus, for this issue, we have to implement two major things. First, we need to create a lot of test cases for most of our opcodes. For each test case, we need to prepare:

  • The environment (initial stack, storage, etc)
  • The opcode being checked
  • The post-condition (stack state, storage state, account balance, etc).

To make our job easy, we should the existing evm tests in https://github.com/ethereum/tests/tree/develop/VMTests. We only need to modify the json files and make it compatible with our codebase.
Second, we need to implement the code to setup the environment and the checks for the stack, storage and account balances, etc in our codebase.

@loiluu
Copy link
Contributor Author

loiluu commented Mar 17, 2017

This issue was moved to enzymefinance/oyente#4

@loiluu loiluu closed this as completed Mar 17, 2017
@loiluu loiluu reopened this Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant