zchn / eth-acl2

An ACL2 formalization of the Ethereum VM, aiming to be both executable and suitable for proving interesting properties of EVM contracts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add all of VM Tests

zchn opened this issue · comments

There is a nice collection of VM Tests at https://github.com/ethereum/tests/wiki/VM-Tests.

I added a PoC script to convert them: ./scripts/gen_acl2_from_vmtest.py, example: ./books/evm/test/add0.lisp, but not all test cases are supported, for example, ./books/evm/test/div1.lisp is incorrectly generated because the script does not support "logs" or "out" in the json file.

Most of the VMTests has been enabled (except for the ones that gen_acl2_from_vmtest.py can not generate and a few unsupported opcodes). I will summarize the unsupported features in a followup comment.

$ find repos/tests/VMTests/ -name "*.json" -exec ./scripts/gen_acl2_from_vmtest.py {} ; 2>&1 | sort | uniq
INFO:root:non-self address is not supported:
INFO:root:Unsupported: ['balance', 'code', 'nonce']
INFO:root:Unsupported: exec.data:
INFO:root:Unsupported: ['_info']
INFO:root:Unsupported: ['_info', 'callcreates', 'gas', 'logs']