-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deserialize tests from BlockchainTests folder instead
- Loading branch information
Showing
20 changed files
with
463 additions
and
560 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,58 @@ | ||
# EVM Test | ||
|
||
Parses and runs compatible common Ethereum tests from [ethereum/tests](https://github.com/ethereum/tests) against Polygon Zero's EVM. | ||
|
||
> Note: This repo is currently very early in development and is not yet ready to evaluate the EVM completeness! | ||
## Components | ||
|
||
### Parser | ||
|
||
Since the tests from the Ethereum test repo are meant for a full node, only certain tests are compatible with our EVM. Additionally, for the tests that are compatible, they need to be parsed (or converted) into a format that is usable by our EVM. | ||
|
||
The parser has two responsibilities: | ||
|
||
- Query the upstream Ethereum tests repo and check if any tests have been added/updated/removed. | ||
- If there is a change, re-parse the tests. | ||
|
||
### Runner | ||
|
||
The runner feeds the parsed tests into the EVM. Successes are defined as no errors occurring (the tests themselves do not provide an expected final state). If the EVM returns an error or panics, then the test is considered to have failed. | ||
|
||
The runner also outputs a results file (likely as a `*.md`) which contains statistics on the last test run. | ||
|
||
## Quick Start | ||
|
||
*TODO: Add more details...* | ||
|
||
Run the parser to parse the Eth tests into a format usable by `plonky2`: | ||
|
||
```sh | ||
cd eth_test_parser | ||
cargo run | ||
``` | ||
|
||
Then launch the runner pointing it at the parsed tests directory: | ||
|
||
```sh | ||
cd ../evm_test_runner | ||
cargo run --release -- -r summary ../generation_inputs # For a high-level summary report | ||
cargo run --release -- -r test ../generation_inputs # For detailed information per test (likely want to use a filter with `-f`) | ||
cargo run --release -- -r summary ../generation_inputs/BlockchainTests # For a high-level summary report | ||
cargo run --release -- -r test ../generation_inputs/BlockchainTests # For detailed information per test (likely want to use a filter with `-f`) | ||
``` | ||
|
||
## Other | ||
|
||
[Polygon Hermez](https://github.com/0xPolygonHermez) is doing something similar [here](https://github.com/0xPolygonHermez/zkevm-testvectors). | ||
|
||
## License | ||
|
||
Licensed under either of | ||
|
||
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) | ||
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) | ||
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>) | ||
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>) | ||
|
||
at your option. | ||
|
||
## Contribution | ||
|
||
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub const GENERATION_INPUTS_DEFAULT_OUTPUT_DIR: &str = "generation_inputs"; | ||
pub const MAIN_TEST_DIR: &str = "BlockchainTests"; | ||
pub const MATIC_CHAIN_ID: u64 = 137; | ||
pub const ETHEREUM_CHAIN_ID: u64 = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
pub(crate) const ETH_TESTS_REPO_URL: &str = "https://github.com/ethereum/tests.git"; | ||
pub(crate) const ETH_TESTS_REPO_LOCAL_PATH: &str = "eth_tests"; | ||
pub(crate) const GENERAL_GROUP: &str = "BlockchainTests"; | ||
pub(crate) const TEST_GROUPS: [&str; 1] = ["GeneralStateTests"]; | ||
// The following subgroups contain subfolders unlike the other test folders. | ||
pub(crate) const SPECIAL_TEST_SUBGROUPS: [&str; 2] = ["Shanghai", "VMTests"]; |
Oops, something went wrong.