Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request 0xPolygonZero#37 from topos-protocol/update_latest
Browse files Browse the repository at this point in the history
Update with latest plonky2 and rely on BlockchainTests instead
  • Loading branch information
Nashtare authored Nov 30, 2023
2 parents ae799c2 + b8b17fd commit c87a49f
Show file tree
Hide file tree
Showing 25 changed files with 568 additions and 1,349 deletions.
434 changes: 10 additions & 424 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions README.md
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.
6 changes: 2 additions & 4 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ edition = "2021"
[dependencies]
anyhow = { version = "1.0.71", features = ["backtrace"] }
ethereum-types = "0.14.1"
eth_trie_utils = "0.6.0"
eth_trie_utils = { git = "https://github.com/0xPolygonZero/eth_trie_utils.git", rev = "e9ec4ec2aa2ae976b7c699ef40c1ffc716d87ed5" }
flexi_logger = { version = "0.25.4", features = ["async"] }
plonky2_evm = { git = "https://github.com/mir-protocol/plonky2.git", rev = "6f98fd762885e9b5343af5f0e3f0c9c90e8cf3ab" }
plonky2_evm = { git = "https://github.com/0xPolygonZero/plonky2.git", rev = "5572da30d7ab818594cf8659839fa832dfcf1d3d" }
serde = {version = "1.0.163", features = ["derive"] }
revm = { version = "3.3.0", features = ["serde"] }
ruint = { version = "1.8.0", features = ["primitive-types"] }
1 change: 1 addition & 0 deletions common/src/config.rs
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;
1 change: 0 additions & 1 deletion common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub mod config;
pub mod revm;
pub mod types;
pub mod utils;
135 changes: 0 additions & 135 deletions common/src/revm/cache_db.rs

This file was deleted.

40 changes: 0 additions & 40 deletions common/src/revm/mod.rs

This file was deleted.

Loading

0 comments on commit c87a49f

Please sign in to comment.