Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasinger committed Sep 27, 2017
1 parent 724c45b commit b3f8f48
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 26 deletions.
10 changes: 5 additions & 5 deletions containers/buildandpushall.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

docker_repo="holiman"
#docker_repo="cdetrio"
#docker_repo="holiman"
docker_repo="cdetrio"

#(cd geth && docker build --no-cache . -t $docker_repo/gethvm && docker push $docker_repo/gethvm)
#(cd parity && docker build --no-cache . -t $docker_repo/parityvm && docker push $docker_repo/parityvm)
(cd testeth && docker build --no-cache . -t $docker_repo/testeth && docker push $docker_repo/testeth)
#(cd testeth && docker build --no-cache . -t $docker_repo/testeth && docker push $docker_repo/testeth)

# build geth docker image
#(cd std-geth && docker build --no-cache . -t $docker_repo/std-gethvm)
(cd std-geth && docker build --no-cache . -t $docker_repo/std-gethvm)
# build cpp docker image
#(cd std-cpp-ethereum && docker build --no-cache . -t $docker_repo/std-cppvm )
# build parity docker image
#(cd std-parity && docker build --no-cache . -t $docker_repo/std-parityvm)
# build python docker image
#(cd pyethereum && docker build --no-cache . -t $docker_repo/std-pyethvm)
# build ethereumjs docker images
#(cd ethereumjs-vm && docker build --no-cache . -t jwasinger/ethereumjs-vm)
(cd ethereumjs-vm && docker build --no-cache . -t jwasinger/ethereumjs-vm)
2 changes: 1 addition & 1 deletion containers/ethereumjs-vm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ from node:alpine

WORKDIR /ethereum

RUN apk update && apk upgrade && apk add --no-cache g++ python python-dev git make bash && git clone https://github.com/jwasinger/ethereumjs-vm && cd ethereumjs-vm && git checkout trace-equivalence-byzantium && npm install
RUN apk update && apk upgrade && apk add --no-cache g++ python python-dev git make bash && git clone --branch state-test-from-source https://github.com/jwasinger/ethereumjs-vm && cd ethereumjs-vm && npm install

ENTRYPOINT ["node", "/ethereum/ethereumjs-vm/tests/tester.js" ]
27 changes: 15 additions & 12 deletions evmlab/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,20 @@ def canonicalized(output):

steps = []
for x in output:
if x[0:2] == "[{":
try:
steps = json.loads(x)
except Exception as e:
logger.info('Exception parsing cpp json:')
logger.info(e)
logger.info('problematic line:')
logger.info(x)
steps = []

logger.debug(output)
try:
if x[0:2] == "[{":
steps = json.loads(x)

if x[0:2] == "{\"":
step = json.loads(x)
if 'stateRoot' in step.keys():
steps.append(step)

except Exception as e:
logger.info('Exception parsing cpp json:')
logger.info(e)
logger.info('problematic line:')
logger.info(x)

canon_steps = []

Expand Down Expand Up @@ -221,7 +224,7 @@ def json_steps():
try:
yield(json.loads(line[json_index:]))
except Exception as e:
logger.info("Exception parsing json:")
logger.info("Exception parsing python output:")
logger.info(e)
logger.info("problematic line:")
logger.info(line)
Expand Down
6 changes: 4 additions & 2 deletions statetests.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[DEFAULT]

fork_config = Byzantium
clients = CPP,GETH,PAR,PY
clients = GETH,JS

tests_path = /ethereum/tests
random_tests = No
prestate_tmp_file = prestate.json
Expand All @@ -12,9 +13,10 @@ docker_repo= cdetrio
pyeth_docker_name = %(docker_repo)s/pyethereum
cpp_docker_name = %(docker_repo)s/std-cpp-ethereum
parity_docker_name= %(docker_repo)s/std-parity
geth_docker_name = %(docker_repo)s/std-geth
geth_docker_name = %(docker_repo)s/std-gethvm

testeth_docker_name = holiman/testeth
js_docker_name = jwasinger/ethereumjs-vm

[martin]

Expand Down
13 changes: 7 additions & 6 deletions trace_statetests.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,16 +355,14 @@ def startGeth(test_file):

return VMUtils.startProc(geth_docker_cmd)

def startJs(single_test_tmp_file, tx_dgv):
[d,g,v] = tx_dgv
def startJs(single_test_tmp_file):
logger.info("running state test in EthereumJS.")

testfile_path = os.path.abspath(single_test_tmp_file)
mount_testfile = testfile_path + ":" + "/ethereum/"+single_test_tmp_file
js_docker_cmd = ["docker", "run", "--rm", "-t", "-v", mount_testfile, cfg["JS_DOCKER_NAME"], "-s", "--stateTestSource", single_test_tmp_file]
js_docker_cmd = ["docker", "run", "--rm", "-t", "-v", mount_testfile, cfg["JS_DOCKER_NAME"], "-s", "--customStateTest", single_test_tmp_file]
js_docker_cmd.extend(['--jsontrace'])
js_docker_cmd.extend(['--fork', cfg['FORK_CONFIG']])
#js_docker_cmd.extend(['--testspath', '"/mounted_tests"'])


logger.info("js_cmd: %s " % " ".join(js_docker_cmd))
Expand Down Expand Up @@ -430,7 +428,8 @@ def startClient(client, single_test_tmp_file, prestate_tmp_file, tx, test_subfol
if client == 'PAR':
return (startParity(single_test_tmp_file), finishParity)
if client == 'JS':
return (startJs(single_test_tmp_file, tx_dgv), finishJs)
import pdb; pdb.set_trace()
return (startJs(single_test_tmp_file), finishJs)

logger.error("ERROR! client not supported:", client)
return []
Expand Down Expand Up @@ -496,7 +495,7 @@ def startClient(client, single_test_tmp_file, prestate_tmp_file, tx, test_subfol
'stackLimitPush32_1024',
'stackLimitPush32_1025', # big trace, onsensus failure
'stackLimitGas_1023',
'stackLimitGas_1024',
'stackLimitGas_1024', # consensus bug
'stackLimitGas_1025'
]

Expand Down Expand Up @@ -629,6 +628,8 @@ def perform_test(f, test_name, test_number = 0):
procs.append( (startPython(prestate_tmpfile, tx), finishPython) )
if client_name == 'PAR':
procs.append( (startParity(test_tmpfile), finishParity) )
elif client_name == 'JS':
procs.append( (startJs(test_tmpfile), finishJs) )

# procs.append(startClient(client_name ,test_tmpfile, prestate_tmpfile, tx, test_subfolder, test_name, tx_dgv, test_case))

Expand Down

0 comments on commit b3f8f48

Please sign in to comment.