Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Official ethereum/tests StateTests execution#382

Closed
adria0 wants to merge 52 commits into
privacy-ethereum:mainfrom
adria0:evm-testvectors
Closed

Official ethereum/tests StateTests execution#382
adria0 wants to merge 52 commits into
privacy-ethereum:mainfrom
adria0:evm-testvectors

Conversation

@adria0
Copy link
Copy Markdown
Contributor

@adria0 adria0 commented Mar 9, 2022

Integrate the "official" EVM tests located in https://github.com/ethereum/tests

Since we are running our own geth executor to generate the traces, we are using the /src folder and not the retesteth filled tests (located in /BlockchainTests and /GeneralStateTests).

The basic roadmap for this PR is

Note for reviewers

You will find in this PR:

  • A binary in evm-testvectors/src/main.rs that

    • scans all the tests from the evm-testvectors/test folder that is a git submodule
      • there are two types of files to scan: json and .yaml
    • compiles the code inside the tests if not found in the code.cache file
      • this is executed via docker (see docker folder)
    • runs the test if not found in the results.cache file, but skips some tests
      • which ones contains unimplemented opcodes (defined in the OPCODES_UNIMPLEMENTED const) via scanning the geth trace
      • which ones uses too much gas or a maximum of steps (see StateTestConfig)
      • which ones the geth trace is too big ; I had to modify geth-utils/lib/lib.go to skip very big traces (geth crashed)
      • others ( see FILE_IGNORE_LIST)
    • writes the result in the results.cache file
  • Enrich Bytecode by adding a disasm() -> String method as also an iter() that generates an iterator over the bytecode Opcodes. From my previous experience running those tests there are is a lot of cases that you have to analyze and test the code, and I created a small command line tool for generating on-the-fly tests using assembly/bytecode as also to parse bytecode (see --raw option in main.rs)

  • note that this is a first version, probally this is going to change, and eventually we have to move this into a specific repo, but for the moment I prefer to merge this to not having code far from origin/main

  • note2 this code is not critical at this point, so a light review could be done IMO

@github-actions github-actions Bot added crate-eth-types Issues related to the eth-types workspace member crate-zkevm-circuits Issues related to the zkevm-circuits workspace member labels Apr 12, 2022
@adria0 adria0 force-pushed the evm-testvectors branch from 254ba9b to 1a5f455 Compare May 16, 2022 16:21
@github-actions github-actions Bot added the crate-geth-utils Issues related to the geth-utils workspace member label May 16, 2022
Copy link
Copy Markdown
Collaborator

@ChihChengLiang ChihChengLiang left a comment

Choose a reason for hiding this comment

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

Do we intend to check in code.cache and result.cache? Or should we ignore them?

@adria0
Copy link
Copy Markdown
Contributor Author

adria0 commented Aug 12, 2022

Do we intend to check in code.cache and result.cache? Or should we ignore them?

Hi @ChihChengLiang, I absoutely forgot to anwser you comment, sorry!

Those files are just kept to speed up testing process and to check diffs between executions. Maybe we could make a quick meeting with you and @ed255 about how we can improve and make this tests better before a review, starting september? Happy to share some ideas I have :)

@ChihChengLiang
Copy link
Copy Markdown
Collaborator

@adria0 Yeah, sure. We can have a meeting when you and Edu are back.

@ed255
Copy link
Copy Markdown
Contributor

ed255 commented Aug 17, 2022

Those files are just kept to speed up testing process and to check diffs between executions. Maybe we could make a quick meeting with you and @ed255 about how we can improve and make this tests better before a review, starting september? Happy to share some ideas I have :)

Sounds good to me!

@adria0
Copy link
Copy Markdown
Contributor Author

adria0 commented Sep 8, 2022

replaced by #748

@adria0 adria0 closed this Sep 8, 2022
zemse pushed a commit to zemse/zkevm-circuits that referenced this pull request Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

crate-eth-types Issues related to the eth-types workspace member crate-geth-utils Issues related to the geth-utils workspace member crate-zkevm-circuits Issues related to the zkevm-circuits workspace member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants