Skip to content

ci(l1): enable blockchain ef tests to be run with levm#2440

Merged
jrchatruc merged 11 commits into
mainfrom
chore/ef-blockchain-tests-execution-with-levm
Apr 15, 2025
Merged

ci(l1): enable blockchain ef tests to be run with levm#2440
jrchatruc merged 11 commits into
mainfrom
chore/ef-blockchain-tests-execution-with-levm

Conversation

@JulianVentura

Copy link
Copy Markdown
Contributor

Motivation

We want to run the Ethereum Foundation blockchain tests with LEVM. Currently, we are only running them with REVM.

Description

This PR modifies the EF tests runner so it executes the EF tests with both VMs. The implementation combines both executions on the same command cargo test, but could be easily modified to include a feature flag to separate both executions if that's desired.

@JulianVentura JulianVentura self-assigned this Apr 10, 2025
@github-actions

github-actions Bot commented Apr 10, 2025

Copy link
Copy Markdown

Lines of code report

Total lines added: 18
Total lines removed: 0
Total lines changed: 18

Detailed view
+-----------------------------------------------+-------+------+
| File                                          | Lines | Diff |
+-----------------------------------------------+-------+------+
| ethrex/cmd/ef_tests/blockchain/test_runner.rs | 165   | +18  |
+-----------------------------------------------+-------+------+

@JulianVentura JulianVentura changed the title chore(L1, L2): enable blockchain EF tests to be run with LEVM chore(l1, l2): enable blockchain ef tests to be run with levm Apr 10, 2025
@JulianVentura JulianVentura marked this pull request as ready for review April 10, 2025 20:31
@JulianVentura JulianVentura requested a review from a team as a code owner April 10, 2025 20:31
@mpaulucci mpaulucci changed the title chore(l1, l2): enable blockchain ef tests to be run with levm ci(l1): enable blockchain ef tests to be run with levm Apr 11, 2025
// Discard this test
continue;
}
#[allow(dead_code)]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

instead of allow dead code, you can do #[cfg(not(feature = "levm"))] right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's an alternative, but since the feature flags usually don't go well with LSPs, I tried to use them just on the harness.
I can make the change if you want, just let me know!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd prefer to use actual feature flags, I haven't had any problems with LSP. But if you feel strongly about this you can leave it as is.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The risk of allowing dead code is that it might become actual dead code add some point. And the fact that it is not clear why it was set as dead code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with using the feature flag

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No problem! I'll change it, I'm not strongly about this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

Comment thread cmd/ef_tests/blockchain/test_runner.rs Outdated
}
}

pub fn parse_and_execute_with_filter(path: &Path, evm: EvmEngine, skipped_tests: &[&str]) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: instead of having two functions, I would just have parse_and_execute , with an optional third argument.

@JulianVentura JulianVentura Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I went for this option because it's easier to see in the logs which VM is being executed
Yep, it's a good idea

@mpaulucci mpaulucci left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

some nits but lgtm

// Discard this test
continue;
}
#[allow(dead_code)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with using the feature flag

@jrchatruc jrchatruc added this pull request to the merge queue Apr 15, 2025
Merged via the queue into main with commit 62f8887 Apr 15, 2025
@jrchatruc jrchatruc deleted the chore/ef-blockchain-tests-execution-with-levm branch April 15, 2025 20:50
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
)

**Motivation**

We want to run the Ethereum Foundation blockchain tests with LEVM.
Currently, we are only running them with REVM.

**Description**

This PR modifies the EF tests runner so it executes the EF tests with
both VMs. The implementation combines both executions on the same
command `cargo test`, but could be easily modified to include a feature
flag to separate both executions if that's desired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants