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

feat(levm): ethereum foundation tests setup #1079

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open

Conversation

ilitteri
Copy link
Contributor

@ilitteri ilitteri commented Nov 5, 2024

Warning

DO NOT MERGE UNTIL #1029 IS MERGED.

Motivation

To have a working setup to run the EF tests to ensure the correct implementation of our VM.

Note

This setup only ensures that the pre-state is ok. We need further development on the VM side to ensure the rest.

Description

  • crates/vm/levm/tests/ef/report.rs. Implementation of EFTestsReport. This is a data structure that keeps track of the tests run.
  • crates/vm/levm/tests/ef/runner.rs. Contains the implementation of the EF Tests runner. It downloads the tests and executes each test as it parses them. Test execution runs this flow: "prepare VM" -> "ensure pre state" -> "execute VM" -> "ensure pos state". In this first iteration, we only have the first two working as we need to continue working on developing the VM to have them working.
  • crates/vm/levm/tests/ef/test.rs. Contains all the types that represent the objects from the EF tests .json files.
  • crates/vm/levm/tests/ef/deserialize.rs. Contains the implementation of the deserialization of the above.

Try it yourself

cargo test --release --manfest-dir crates/vm/levm/Cargo.toml testito

maximopalopoli and others added 12 commits November 1, 2024 10:04
**Motivation**

<!-- Why does this pull request exist? What are its goals? -->
fix some things generic_call in l1 integration because of merge.

**Description**

<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #issue_number
**Motivation**

<!-- Why does this pull request exist? What are its goals? -->

Eventually, we want to stop using revm and replace it with levm. The
integration is a work in progress in this PR
#1029.

This PR aims to be the first step. It aims to prepare the current
codebase so that both implementations can coexist while levm continues
to be developed and does not disturb the rest of the development. When
the time to remove revm comes, it'd be easier with this proposal since
it'd require removing the code under the #[cfg(not(feature = "levm"))]
and after that, to remove the feature flag definitively.

**Description**

<!-- A clear and concise general description of the changes this PR
introduces -->

- Adds the `levm` feature flag to the `vm` and `blockchain` packages,
and to the `ethereum_rust` binary.
- In `vm`, add `execute_block` implementation that uses `levm` and use
it when `levm` feature flag is set. Use the original implementation if
not.
- In `blockchain`, add `add_block` implementation that uses `levm` and
use it when `levm` feature flag is set. Use the original implementation
if not.

---------

Co-authored-by: Jeremías Salomón <[email protected]>
Co-authored-by: JereSalo <[email protected]>
@ilitteri ilitteri added ef-tests Hive tests, execution-spec-tests levm Lambda EVM implementation labels Nov 5, 2024
@ilitteri ilitteri self-assigned this Nov 5, 2024
@ilitteri ilitteri requested a review from a team as a code owner November 5, 2024 20:24
Base automatically changed from levm-ethereum-rust-integration to main November 6, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ef-tests Hive tests, execution-spec-tests levm Lambda EVM implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants