-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Adapt testeth to be used with evmlab #5804
Comments
This looks done, output currently looks like this
with disabled memory dump:
Note 1. Note 2. cc @holiman would be great if this is useful |
Problem, when I run it (and also in your dump above)
Geth outputs |
Hmm, I seem to recall that there's some special build-flag to remove those, right? |
This summarizes the requirements for a tool that could be used to conveniently run the state test files and possibly be used by fuzzing infrastructure as mentioned by @holiman #4613 (comment)
It looks like testeth currently is not too far from these requirements.
Summary of requirements
Input
--statetest <path>
--json
- boolean flag, output json output for each opcode or not (it's useful to disable json when benchmarking)--nomemory
- disable showing the full memory output for each opOutput
It should output a
json
object for each operation. Example:Required:
pc
,op
,gas
,stack
,depth
Optional:
opName
,gasCost
,error
The
stack
,memory
andmemSize
are the values before execution of the op.At the end of execution, some summarical info is good, e.g.
Another thing mentioned by Martin #4613 (comment) :
testeth status
--testfile
parameter -- should work after fix testeth -t <TestSuite> -- --singletest <path> <testname> running a test from file #5750 is finished. However-t GeneralStateTests
probably will still be required, for now it's easier for us to leave it.So the command line to run a test would look like
--jsontrace
disables it.However, it will not output any summary (
output
,gasUsed
,stateRoot
etc.) either in this case.We need to fix this (always output json summary in
--testfile
mode)--jsontrace '{"disableMemory" : true}'
(there're also options to disable stack and storage output)
This looks close, but
a. There are additional lines on top and at the bottom. They come from boost.test, but we could look into how to suppress them if that's important.
b. We need to add
memSize
field (add this inStandardTrace::operator()
)c.
op
should have opcode number andopName
the mnemonicd.
depth
is off-by-one comparing to Martin's examples. This also can be adjusted inStandardTrace::operator()
e. We need to add the summary line
{"output":"","gasUsed":"0x3","time":141485}
That should be added here:
aleth/test/tools/libtesteth/ImportTest.cpp
Lines 351 to 359 in 9f31c8b
The required data (except execution time) is returned from
State::execute
. Execution time is probably not so important (but it's easy to add, too)StandartTrace
class to have an option to output immediately.@holiman To summarize, there's somewhat quirky CLI to run it, there are some additional non-json lines in the output, the rest will be fixed to match the requirements of evmlab.
cc @winsvega
TODO
memSize
fieldopName
field and changeop
to have numberdepth
start with 1output
andgasUsed
--testfile
mode even without--jsontrace
The text was updated successfully, but these errors were encountered: