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

Update with latest plonky2 and rely on BlockchainTests instead #37

Merged
merged 31 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9bb9281
Deserialize tests from BlockchainTests folder instead
Nashtare Sep 26, 2023
7887a60
Remove revm variants
Nashtare Sep 28, 2023
7472749
Deserialize from RLPs directly and handle all test cases
Nashtare Sep 29, 2023
db8bf43
Bump deps and process all tests
Nashtare Oct 1, 2023
448575f
Update serialization and cleanup
Nashtare Oct 2, 2023
e897b99
Clippy
Nashtare Oct 2, 2023
19098ee
Move encoding to deserialize file
Nashtare Oct 2, 2023
46e350c
Fix storage keys that are wrongly encoded
Nashtare Oct 3, 2023
60e2710
Clippy
Nashtare Oct 3, 2023
5415f2d
Bump proc-macro2 and update rust-toolchain file
Nashtare Oct 3, 2023
b37420f
Bump plonky2
Nashtare Oct 4, 2023
31a4940
Add logging for failed verification
Nashtare Oct 4, 2023
f9efb50
Ignore malformed txns
Nashtare Oct 4, 2023
95bf77b
Keep original name for test variants
Nashtare Oct 6, 2023
a1c5f36
Bump plonky2 rev
Nashtare Oct 6, 2023
e3c745c
Ignore tests with non-canonical encodings
Nashtare Oct 6, 2023
72c5331
Bump plonky2 version
Nashtare Oct 11, 2023
5a70480
Bump plonky2
Nashtare Oct 12, 2023
a196a1c
Bump with latest plonky2 fix
Nashtare Oct 19, 2023
8ae06dc
Bump plonky2
Nashtare Oct 23, 2023
c564482
Bump plonky2
Nashtare Oct 25, 2023
4763b85
Bump plonky2
Nashtare Nov 3, 2023
4cb91e4
Add withdrawals to generation inputs
Nashtare Nov 7, 2023
b2a1768
Bump plonky2 and update signed_txn type
Nashtare Nov 9, 2023
ace6e02
Bump plonky2
Nashtare Nov 17, 2023
3126e31
Bump
Nashtare Nov 17, 2023
4abd402
Ignore malformed tests with gas > 2^32-1
Nashtare Nov 17, 2023
75f1448
Remove comment
Nashtare Nov 17, 2023
385dcdb
Clippy
Nashtare Nov 17, 2023
f95700d
Bump plonky2
Nashtare Nov 30, 2023
b8b17fd
Final plonky2 bump
Nashtare Nov 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

BGluth marked this conversation as resolved.
Show resolved Hide resolved
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
Loading