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): add legacy test to the LEVM EF tests suite #1723

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

LucasUTNFRD
Copy link
Contributor

@LucasUTNFRD LucasUTNFRD commented Jan 15, 2025

Motivation

The idea is to add LegacyTests/Constantinople/GeneralStateTests/, and LegacyTests/Cancun/GeneralStateTests/ to our suite.

Description

  • The Makefile to get this was updated, i have work in progress related to parse legacy tests.
  • EFTest struct is being correctly parsed

You can test this code running the following command, make sure you download tests in crates/vm/levm

make download-evm-ef-tests
make run-evm-ef-tests

Closes #issue_number

Copy link

Copy link

github-actions bot commented Jan 15, 2025

| File                                                                    | Lines | Diff |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ef_tests/levm/deserialize.rs        | 428   | +57  |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ef_tests/levm/report.rs             | 878   | +30  |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ef_tests/levm/runner/levm_runner.rs | 423   | +33  |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ef_tests/levm/runner/revm_runner.rs | 513   | +51  |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ef_tests/levm/types.rs              | 302   | -31  |
+-------------------------------------------------------------------------+-------+------+

Total lines added: +171
Total lines removed: 31
Total lines changed: 202

Copy link

github-actions bot commented Jan 15, 2025

Benchmark Results Comparison

PR Results

Benchmark Results: Factorial

Command Mean [s] Min [s] Max [s] Relative
revm_factorial 7.525 ± 0.791 7.246 9.776 1.00
levm_factorial 26.378 ± 0.171 26.174 26.640 3.51 ± 0.37

Benchmark Results: Fibonacci

Command Mean [s] Min [s] Max [s] Relative
revm_fibonacci 7.389 ± 0.062 7.350 7.558 1.00
levm_fibonacci 24.282 ± 0.380 24.014 25.273 3.29 ± 0.06

Main Results

Benchmark Results: Factorial

Command Mean [s] Min [s] Max [s] Relative
revm_factorial 7.252 ± 0.027 7.225 7.306 1.00
levm_factorial 26.910 ± 0.295 26.439 27.399 3.71 ± 0.04

Benchmark Results: Fibonacci

Command Mean [s] Min [s] Max [s] Relative
revm_fibonacci 7.688 ± 0.131 7.493 7.927 1.00
levm_fibonacci 23.987 ± 0.087 23.877 24.140 3.12 ± 0.05

Copy link

Copy link

Copy link

Copy link

@@ -218,11 +277,23 @@ where
Vec::<String>::deserialize(deserializer)?
.iter()
.map(|s| {
U256::from_str(s.trim_start_matches("0x:bigint ")).map_err(|err| {
let mut s = s.trim_start_matches("0x:bigint ");
// if the len of the string could not 64 hex characters, it is invalid, so we want to skip it
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was throwing a invalid string lenght when using U256::from_str()

      "value": [
        "0x:bigint 10000000000000000000000000000000000000000000000000000000000000001"
      ]

Copy link

Copy link

Copy link

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.

1 participant