Skip to content

Commit

Permalink
Added new ethereumjs-testing args dir, excludeDir, reactivated select…
Browse files Browse the repository at this point in the history
…ed BlockchainTests for travis, circle
  • Loading branch information
holgerd77 committed Sep 7, 2017
1 parent e40c6f1 commit 872d935
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 38 deletions.
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ matrix:
- os: linux
node_js: "8"
env: CXX=g++-4.8 TEST_SUITE=testState
# temporarily disable testBlockchain
# - os: linux
# node_js: "8"
# env: CXX=g++-4.8 TEST_SUITE=testBlockchain
- os: linux
node_js: "8"
env: CXX=g++-4.8 TEST_SUITE=testBlockchainBlockGasLimit
- os: linux
node_js: "8"
env: CXX=g++-4.8 TEST_SUITE=testBlockchainValid
- os: linux
node_js: "8"
env: CXX=g++-4.8 TEST_SUITE=testBlockchainTotalDifficulty
script: npm run $TEST_SUITE
70 changes: 38 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,40 @@ Emits the Transaction that is about to be processed.
#### `afterTx`
Emits the result of the transaction.


# Internal Structure
The VM processes state changes at many levels.

* runBlockchain
* for every block, runBlock
* runBlock
* for every tx, runTx
* pay miner and uncles
* runTx
* check sender balance
* check sender nonce
* runCall
* transfer gas charges
* runCall
* checkpoint state
* transfer value
* load code
* runCode
* materialize created contracts
* revert or commit checkpoint
* runCode
* iterate over code
* run op codes
* track gas usage
* OpFns
* run individual op code
* modify stack
* modify memory
* calculate fee

The opFns for `CREATE`, `CALL`, and `CALLCODE` call back up to `runCall`.


# TESTING

### Running Tests
Expand All @@ -184,6 +218,10 @@ Running all the blockchain tests in a file:

`node ./tests/tester -b --file='randomStatetest303'`

Running tests from a specific directory:

`node ./tests/tester -b --dir='bcBlockGasLimitTest'`

Running a specific state test case:

`node ./tests/tester -s --test='stackOverflow'`
Expand All @@ -201,38 +239,6 @@ All/most State tests are replicated as Blockchain tests in a ``GeneralStateTests

For comparing ``EVM`` traces [here](https://gist.github.com/cdetrio/41172f374ae32047a6c9e97fa9d09ad0) are some instructions for setting up ``pyethereum`` to generate corresponding traces for state tests.

# Internal Structure
The VM processes state changes at many levels.

* runBlockchain
* for every block, runBlock
* runBlock
* for every tx, runTx
* pay miner and uncles
* runTx
* check sender balance
* check sender nonce
* runCall
* transfer gas charges
* runCall
* checkpoint state
* transfer value
* load code
* runCode
* materialize created contracts
* revert or commit checkpoint
* runCode
* iterate over code
* run op codes
* track gas usage
* OpFns
* run individual op code
* modify stack
* modify memory
* calculate fee

The opFns for `CREATE`, `CALL`, and `CALLCODE` call back up to `runCall`.


# LICENSE
[MPL-2.0](https://www.mozilla.org/MPL/2.0/)
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- "npm rebuild"
test:
override:
# testVM disabled. testBlockchain temporarily disabled
# testVM disabled.
# - case $CIRCLE_NODE_INDEX in 0) npm run lint ;; 1) npm run testVM ;; 2) npm run testState ;; 3) npm run testBlockchain ;; esac:
- case $CIRCLE_NODE_INDEX in 0) npm run lint ;; 1) npm run testState ;; esac:
- case $CIRCLE_NODE_INDEX in 0) npm run lint ;; 1) npm run testState ;; 2) npm run testBlockchainBlockGasLimit ;; 3) npm run testBlockchainValid ;; 4) npm run testBlockchainTotalDifficulty ;; esac:
parallel: true
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
"testVM": "node ./tests/tester -v",
"testState": "node ./tests/tester -s",
"testBlockchain": "node --stack-size=1500 ./tests/tester -b",
"testBlockchainBlockGasLimit": "node --stack-size=1500 ./tests/tester -b --dir='bcBlockGasLimitTest'",
"testBlockchainValid": "node --stack-size=1500 ./tests/tester -b --dir='bcValidBlockTest'",
"testBlockchainTotalDifficulty": "node --stack-size=1500 ./tests/tester -b --dir='bcTotalDifficultyTest'",
"lint": "standard",
"test": "node ./tests/tester -a"
},
Expand Down
2 changes: 2 additions & 0 deletions tests/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ function runTests (name, runnerArgs, cb) {
testGetterArgs.forkConfig = FORK_CONFIG
testGetterArgs.file = argv.file
testGetterArgs.test = argv.test
testGetterArgs.dir = argv.dir
testGetterArgs.excludeDir = argv.excludeDir

runnerArgs.forkConfig = FORK_CONFIG
runnerArgs.debug = argv.debug // for BlockchainTests
Expand Down

0 comments on commit 872d935

Please sign in to comment.