-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Use evmone-t8n
to fill tests
#142
Conversation
Update default evm to create txs json file from rlp. For evmone-t8n, add sender to all txs, make sure all inputs are hex. Start on generating v, r & s. Update evm integration after new updates to evmone-t8n. evmone-t8n works with b11r Test evm vs evmone output. t8n: evm one improvements pytest: test-filler plugin: detect t8n tool
@chfast @winsvega Evmone it's almost fully working now! To run all tests using evmone-t8n use this branch and run: fill --evm-bin=evmone-t8n
All but two pre-Cancun tests are filling correctly:
It seems like an account with an zero-value withdrawal remains in the state. To run: fill tests/shanghai/eip4895_withdrawals/test_withdrawals.py::test_zero_amount[fork=Shanghai-four_withdrawals_one_with_value_one_with_max] --evm-bin=evmone-t8n and fill tests/shanghai/eip4895_withdrawals/test_withdrawals.py::test_zero_amount[fork=Shanghai-four_withdrawals_one_with_value_one_with_max_reversed_order] --evm-bin=evmone-t8n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Love how easy it is to add a new transition tool.
I would suggest we split src/evm_transition_tool/__init__.py
into multiple files. Typically, we've only defined the module/package namespaces in our init files; I think this is the only init that defines objects within it.
➜ find src -name __init__.py -exec wc -c '{}' \;
1270 src/ethereum_test_forks/__init__.py
50 src/ethereum_test_forks/tests/__init__.py
53 src/ethereum_test_forks/forks/__init__.py
467 src/ethereum_test_tools/spec/__init__.py
287 src/ethereum_test_tools/reference_spec/__init__.py
313 src/ethereum_test_tools/code/__init__.py
84 src/ethereum_test_tools/filling/__init__.py
1709 src/ethereum_test_tools/__init__.py
1520 src/ethereum_test_tools/common/__init__.py
50 src/ethereum_test_tools/tests/__init__.py
148 src/ethereum_test_tools/vm/__init__.py
186 src/pytest_plugins/spec_version_checker/__init__.py
86 src/pytest_plugins/test_filler/__init__.py
67 src/pytest_plugins/__init__.py
167 src/pytest_plugins/forks/__init__.py
13592 src/evm_transition_tool/__init__.py <--------------------------------------------------------- !
How about moving:
TransitionTool
intotransition_tool.py
EvmTransitionTool
intogeth.py
(and perhaps rename the class toGethTransitionTool
- EvmOneTransitionTool into
evmone.py
?
Otherwise, couple of minor comments below.
@danceratopz Thanks for the review! :) Thanks to this handy stackoverflow response https://stackoverflow.com/a/66883553, I've added a dynamic method to load all transition tools automatically. Check it out: https://github.com/marioevz/execution-spec-tests/blob/3a28c9c50d3c905d39add0c7c2e12974d0043d22/src/evm_transition_tool/transition_tool.py#L37 |
Then simplify transition tool constructors by removing type str for binary argument.
Otherwise, the error is raised in every test.
This is awesome! I went a step further and modified Additionally:
2ccb377 was necessary because i removed the tracing option when instantiating the t8n tool in Hope you don't mind me just jumping in on this?! 🙏 Just one comment. |
I've harden the tool detection in 622f181. Turns out, all current evm tools handle |
Co-authored-by: Dan <danceratopz@gmail.com>
This broke --collect-only with --evm-bin=~/bin/evm as the result of expanduser result was not saved.
There's no need to run error-checking or report versions in the header when running `fill --collect-only`.
Ensure the file opened by popen is closed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice. My only concern is the silent exception, see below. I don't think it's too serious though, this shouldn't break too often.
This should fix it (but untested): ethereum/evmone#670. Is this enough to |
Hi @chfast,
Nice! I confirmed that the errors are indeed fixed in your branch (0.11.0-dev+commit.436f5f18).
Yes, if Just to clarify as to whether it's good enough, as I'm sure you're aware,
It's not considered the full test (as defined by the corresponding JSON fixture that it generates). |
For the reference, I can run it as described. It works very good (a lot of failures to fix) however debugging is difficult. |
Use https://github.com/ethereum/evmone to fill tests.
Builds on top of work started by @spencer-tb.
Also implements transaction signing for all transaction types.