Updated Understanding and debugging Nimbus EVM JSON tests (markdown)

andri lim 2020-02-19 20:56:32 +07:00
parent cb492a3fd2
commit a5215a9286
1 changed files with 21 additions and 3 deletions

@ -9,7 +9,7 @@ Run example:
mkdir -p build
nim c -r -o:build/decompile_smart_contract examples/decompile_smart_contract.nim
```
## General State Tests
Run Ethereum [JSON-based general state tests](https://github.com/ethereum/tests/):
```
mkdir -p build
@ -21,13 +21,31 @@ Build and run an individual test (with tracing enabled):
```
nim c -r -d:chronicles_log_level=TRACE -o:build/test_generalstate_json tests/test_generalstate_json.nim stAttackTest/ContractCreationSpam.json
```
(this particular test needs to be commented out of "tests/test_generalstate_failing.nim" before running it)
Individual tests are default only tested on Frontier fork. You can change the fork with `--fork:`, e.g.:
```
nim c -d:release -r -o:build/test_generalstate_json tests/test_generalstate_json.nim stCallCreateCallCodeTest/Call1024BalanceTooLow.json --fork:Byzantium
```
Subtest for this individual test can be selected using `--index:number`, and the number start from 1.
```
nim c -d:release -r -o:build/test_generalstate_json tests/test_generalstate_json.nim stSStoreTest/InitCollision.json --fork:Byzantium --index:1
```
Every time you run this individual test, it will dump debugging data/VM trace in json formatted file.
If you only need short dump instead of long dump, you can use `--trace:on/off` or `--trace:true/false`.
## Block Chain Tests
The same CLI are used both by General State Tests and Block Chain Tests. They differ in the input path and doesn't accept fork argument.
```
nim c -d:release -r tests/test_blockchain_json.nim GeneralStateTests/stSStoreTest/InitCollision.json --index:1
```
Addition input path prefix are:
* GeneralStateTests
* InvalidBlocks
* TransitionTests
* ValidBlocks
## VMTests
### JSON structure