Skip to content
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

Generate Copier files #890

Closed
wants to merge 15 commits into from
Closed

Generate Copier files #890

wants to merge 15 commits into from

Conversation

hugo-dc
Copy link
Member

@hugo-dc hugo-dc commented May 14, 2024

Generates ethereum tests "Copier" files by executing evmone-unittests when an output path is defined in the EVMONE_EXPORT_TESTS env variable.

Related PRs

Generated Copier Tests

This generates 2 directories containing the copier files:

  • eof_validation
  • state_transition

Optionally, these directories can be symlinks to the corresponding directories in the ethereum tests:

  • eof_validation -> <ethereum_tests_path>/src/EOFTestsFiller/efValidation/
    • eof_validation/stack -> ../efStack
  • state_transition -> <ethereum_tests_path>/src/EIPTestsFiller/StateTests/stEOF/

This is the list of generated state tests generated (See ethereum tests PR:

eof_validation:

  • efStack (src Copier files already existed, Copier files were filled)
  • efValidation

state_transition:

  • block
    • Skipped
      • A flag was added in order to skip generating tests not accepted by ethereum state because of using withdrawals, BLOCKHASH, ommer blocks, blob base fee.
  • call
  • create
  • eip663
  • eof_calls
  • eof_create
    • OSAKA tests were skipped (currently not accepted by retesteth)
  • extcode
  • selfdestruct
  • touch
  • trace
  • transient_storage

Other changes

  • Changed integration tests, previously it was looking for generated tests for the block state transition tests, but they are currently skipped, instead it is now checking for the call state tests.
  • Allow hashes and bytes to be without leading zeros, which is valid for retesteth.
  • Generate empty objects in the output json, when there are no objects in the tests, i.e.: pre: {}, storage: {}.
  • Change senderSecretKey, retesteth does not accept secret keys to have leading zeroes.
    • This change required changing the expected created address/expected final hash depending on creator address.

Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.14%. Comparing base (63d6d3d) to head (6367fbd).
Report is 111 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #890      +/-   ##
==========================================
- Coverage   98.26%   98.14%   -0.12%     
==========================================
  Files         130      130              
  Lines       15677    15753      +76     
==========================================
+ Hits        15405    15461      +56     
- Misses        272      292      +20     
Flag Coverage Δ
ethereum-tests 27.78% <5.95%> (-0.12%) ⬇️
ethereum-tests-silkpre 19.58% <5.95%> (-0.08%) ⬇️
execution-spec-tests 18.93% <6.74%> (-0.07%) ⬇️
unittests 94.03% <100.00%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
test/statetest/statetest.hpp 100.00% <100.00%> (ø)
test/statetest/statetest_export.cpp 93.33% <100.00%> (+1.02%) ⬆️
test/statetest/statetest_loader.cpp 95.71% <100.00%> (-1.02%) ⬇️
test/unittests/eof_validation.cpp 94.28% <100.00%> (ø)
test/unittests/eof_validation.hpp 60.00% <ø> (ø)
test/unittests/eof_validation_test.cpp 100.00% <100.00%> (ø)
test/unittests/exportable_fixture.cpp 100.00% <100.00%> (ø)
test/unittests/state_transition.cpp 96.12% <100.00%> (-2.28%) ⬇️
test/unittests/state_transition.hpp 0.00% <ø> (ø)
test/unittests/state_transition_block_test.cpp 100.00% <100.00%> (ø)
... and 4 more

... and 2 files with indirect coverage changes

@@ -13,6 +13,7 @@ TEST_F(state_transition, block_apply_withdrawal)
static constexpr auto withdrawal_address = 0x8888_address;

block.withdrawals = {{0, 0, withdrawal_address, 3}};
block.timestamp = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can put this as a default to state_transition.block definition in state_transition.cpp

@hugo-dc hugo-dc closed this Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants