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

fix(l1, levm): solve hive regression #1868

Merged
merged 34 commits into from
Feb 3, 2025
Merged

Conversation

tomip01
Copy link
Contributor

@tomip01 tomip01 commented Feb 3, 2025

Motivation

This PR fix the last test of the regression when using LEVM with the feature flag.

Description

Enhancements to nonce handling:

  • Added a tx_nonce field to the Environment struct .
  • Introduced a new NonceMismatch variant in the TxValidationError enum to handle nonce mismatch errors.
  • Added check for mismatch nonce value in the prepare_execution.

Closes #1865

tomip01 and others added 30 commits January 27, 2025 18:46
Co-authored-by: Tomas Fabrizio Orsi <tomas.orsi@lambdaclass.com>

Update crates/blockchain/payload.rs

Co-authored-by: Tomas Fabrizio Orsi <tomas.orsi@lambdaclass.com>

Update crates/blockchain/payload.rs

Co-authored-by: Tomas Fabrizio Orsi <tomas.orsi@lambdaclass.com>

Update crates/blockchain/payload.rs

Co-authored-by: Tomas Fabrizio Orsi <tomas.orsi@lambdaclass.com>

Update crates/blockchain/payload.rs

Co-authored-by: Tomas Fabrizio Orsi <tomas.orsi@lambdaclass.com>

Update crates/blockchain/payload.rs

Co-authored-by: Tomas Fabrizio Orsi <tomas.orsi@lambdaclass.com>
Co-authored-by: Tomas Fabrizio Orsi <tomas.orsi@lambdaclass.com>
@tomip01 tomip01 changed the title Fix/l1/revm levm hive diff fix(l1, levm): solve hive regression Feb 3, 2025
@tomip01 tomip01 self-assigned this Feb 3, 2025
@tomip01 tomip01 added bug Something isn't working levm Lambda EVM implementation L1 labels Feb 3, 2025
Copy link

github-actions bot commented Feb 3, 2025

| File                                                                    | Lines | Diff |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ef_tests/levm/runner/levm_runner.rs | 395   | +3   |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/environment.rs       | 37    | +1   |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/errors.rs            | 241   | +2   |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/vm.rs                | 705   | +3   |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/vm.rs                         | 839   | +1   |
+-------------------------------------------------------------------------+-------+------+

Total lines added: +10
Total lines removed: 0
Total lines changed: 10

@tomip01 tomip01 marked this pull request as ready for review February 3, 2025 17:59
@tomip01 tomip01 requested a review from a team as a code owner February 3, 2025 17:59
Copy link
Contributor

@lima-limon-inc lima-limon-inc left a comment

Choose a reason for hiding this comment

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

Besides that question, looks good to me ^_^

Copy link

github-actions bot commented Feb 3, 2025

Benchmark Results Comparison

PR Results

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Factorial 237.5 ± 0.6 236.8 238.3 1.00
levm_Factorial 918.5 ± 21.9 900.1 959.9 3.87 ± 0.09

Benchmark Results: Factorial - Recursive

Command Mean [s] Min [s] Max [s] Relative
revm_FactorialRecursive 1.542 ± 0.096 1.422 1.706 1.00
levm_FactorialRecursive 15.731 ± 0.019 15.703 15.763 10.20 ± 0.64

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Fibonacci 208.3 ± 0.8 206.6 209.7 1.00
levm_Fibonacci 911.5 ± 14.6 896.1 942.4 4.38 ± 0.07

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ManyHashes 8.7 ± 0.1 8.6 8.8 1.00
levm_ManyHashes 18.2 ± 0.1 17.9 18.4 2.09 ± 0.02

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
revm_BubbleSort 3.231 ± 0.014 3.208 3.247 1.00
levm_BubbleSort 6.066 ± 0.030 6.033 6.109 1.88 ± 0.01

Benchmark Results: ERC20 - Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Transfer 252.5 ± 1.4 251.2 255.9 1.00
levm_ERC20Transfer 3216.1 ± 21.3 3191.5 3248.4 12.74 ± 0.11

Benchmark Results: ERC20 - Mint

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Mint 143.1 ± 2.5 140.7 148.4 1.00
levm_ERC20Mint 1692.6 ± 10.6 1678.5 1703.1 11.83 ± 0.22

Benchmark Results: ERC20 - Approval

Command Mean [s] Min [s] Max [s] Relative
revm_ERC20Approval 1.059 ± 0.012 1.043 1.078 1.00
levm_ERC20Approval 11.396 ± 0.078 11.275 11.479 10.76 ± 0.14

Main Results

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Factorial 239.0 ± 1.3 237.4 241.6 1.00
levm_Factorial 914.0 ± 19.8 899.9 964.2 3.82 ± 0.09

Benchmark Results: Factorial - Recursive

Command Mean [s] Min [s] Max [s] Relative
revm_FactorialRecursive 1.532 ± 0.093 1.393 1.688 1.00
levm_FactorialRecursive 15.636 ± 0.035 15.565 15.677 10.21 ± 0.62

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Fibonacci 209.3 ± 1.0 207.5 210.7 1.00
levm_Fibonacci 906.3 ± 30.1 893.3 991.5 4.33 ± 0.15

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ManyHashes 8.7 ± 0.1 8.6 8.8 1.00
levm_ManyHashes 18.2 ± 0.3 18.0 18.9 2.10 ± 0.04

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
revm_BubbleSort 3.212 ± 0.028 3.172 3.269 1.00
levm_BubbleSort 6.075 ± 0.027 6.042 6.127 1.89 ± 0.02

Benchmark Results: ERC20 - Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Transfer 252.1 ± 1.4 249.7 253.6 1.00
levm_ERC20Transfer 3207.7 ± 24.5 3180.5 3241.9 12.73 ± 0.12

Benchmark Results: ERC20 - Mint

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Mint 144.4 ± 4.2 141.3 154.4 1.00
levm_ERC20Mint 1694.4 ± 12.6 1675.2 1705.9 11.73 ± 0.35

Benchmark Results: ERC20 - Approval

Command Mean [s] Min [s] Max [s] Relative
revm_ERC20Approval 1.043 ± 0.005 1.037 1.052 1.00
levm_ERC20Approval 11.360 ± 0.111 11.241 11.521 10.89 ± 0.12

Copy link
Contributor

@fborello-lambda fborello-lambda left a comment

Choose a reason for hiding this comment

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

Nice. About returning the exec_result, i think both perspectives are valid.

@tomip01 tomip01 enabled auto-merge February 3, 2025 18:31
@tomip01 tomip01 added this pull request to the merge queue Feb 3, 2025
Merged via the queue into main with commit fde6d41 Feb 3, 2025
34 checks passed
@tomip01 tomip01 deleted the fix/l1/revm-levm-hive-diff branch February 3, 2025 18:45
fkrause98 added a commit that referenced this pull request Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working L1 levm Lambda EVM implementation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

LEVM: Fix regression on hive test Replace Blob Transactions
3 participants