Skip to content

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

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

Merged
merged 11 commits into from
Apr 15, 2025

Conversation

JulianVentura
Copy link
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
Copy link

github-actions bot commented Apr 10, 2025

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
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
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
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
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
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
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
Contributor Author

Choose a reason for hiding this comment

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

Done!

}
}

pub fn parse_and_execute_with_filter(path: &Path, evm: EvmEngine, skipped_tests: &[&str]) {
Copy link
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.

Copy link
Contributor Author

@JulianVentura JulianVentura Apr 15, 2025

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

Copy link
Collaborator

@mpaulucci mpaulucci left a comment

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
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
19 checks passed
@jrchatruc jrchatruc deleted the chore/ef-blockchain-tests-execution-with-levm branch April 15, 2025 20:50
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