Skip to content

Conversation

@iovoid
Copy link
Contributor

@iovoid iovoid commented Nov 13, 2025

Motivation

Currently in prepare_execution we are, for each transaction, calculating the blob base fee which is consistent across the block.

Description

This was already cached for BLOBBASEFEE in #5288, but it could be unified across all users by making part of the Environment.

@iovoid iovoid requested a review from a team as a code owner November 13, 2025 18:51
@github-actions github-actions bot added levm Lambda EVM implementation performance Block execution throughput and performance in general labels Nov 13, 2025
@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Lines of code report

Total lines added: 21
Total lines removed: 10
Total lines changed: 31

Detailed view
+--------------------------------------------------------+-------+------+
| File                                                   | Lines | Diff |
+--------------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/levm/mod.rs                  | 635   | +5   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/environment.rs               | 94    | +1   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/hooks/default_hook.rs        | 349   | -1   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/block.rs     | 117   | -7   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/vm.rs                        | 455   | -2   |
+--------------------------------------------------------+-------+------+
| ethrex/tooling/ef_tests/state/runner/levm_runner.rs    | 448   | +8   |
+--------------------------------------------------------+-------+------+
| ethrex/tooling/ef_tests/state_v2/src/modules/runner.rs | 213   | +7   |
+--------------------------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Benchmark Results Comparison

No significant difference was registered for any benchmark run.

Detailed Results

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
main_revm_BubbleSort 2.982 ± 0.015 2.958 3.011 1.00 ± 0.01
main_levm_BubbleSort 3.084 ± 0.028 3.051 3.145 1.04 ± 0.02
pr_revm_BubbleSort 2.974 ± 0.036 2.949 3.070 1.00
pr_levm_BubbleSort 3.075 ± 0.036 3.033 3.139 1.03 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Approval 969.2 ± 8.9 961.5 991.9 1.00
main_levm_ERC20Approval 1085.9 ± 7.6 1076.9 1096.5 1.12 ± 0.01
pr_revm_ERC20Approval 974.7 ± 8.0 964.8 985.6 1.01 ± 0.01
pr_levm_ERC20Approval 1085.5 ± 19.8 1067.0 1138.7 1.12 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 135.1 ± 3.0 132.9 143.5 1.01 ± 0.02
main_levm_ERC20Mint 163.9 ± 1.5 162.0 166.5 1.23 ± 0.01
pr_revm_ERC20Mint 133.5 ± 0.6 132.4 134.2 1.00
pr_levm_ERC20Mint 163.1 ± 2.1 161.6 169.0 1.22 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 231.2 ± 2.8 229.1 238.8 1.00
main_levm_ERC20Transfer 278.7 ± 3.1 275.6 284.2 1.21 ± 0.02
pr_revm_ERC20Transfer 233.2 ± 8.1 228.8 255.6 1.01 ± 0.04
pr_levm_ERC20Transfer 277.4 ± 2.2 274.7 282.7 1.20 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 228.2 ± 0.9 226.6 229.8 1.00 ± 0.02
main_levm_Factorial 271.0 ± 1.8 268.0 274.3 1.19 ± 0.02
pr_revm_Factorial 227.6 ± 3.6 225.1 236.6 1.00
pr_levm_Factorial 264.5 ± 1.9 262.2 268.1 1.16 ± 0.02

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.664 ± 0.059 1.559 1.782 1.03 ± 0.04
main_levm_FactorialRecursive 8.387 ± 0.050 8.315 8.492 5.18 ± 0.07
pr_revm_FactorialRecursive 1.620 ± 0.020 1.598 1.655 1.00
pr_levm_FactorialRecursive 8.287 ± 0.045 8.198 8.355 5.12 ± 0.07

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 208.0 ± 2.2 206.5 214.0 1.01 ± 0.01
main_levm_Fibonacci 254.7 ± 2.0 253.1 259.0 1.24 ± 0.02
pr_revm_Fibonacci 206.2 ± 1.9 201.9 209.8 1.00
pr_levm_Fibonacci 254.7 ± 2.8 250.0 258.4 1.23 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 855.5 ± 8.8 837.3 866.5 1.13 ± 0.01
main_levm_FibonacciRecursive 778.0 ± 16.2 762.2 820.9 1.03 ± 0.02
pr_revm_FibonacciRecursive 841.9 ± 7.8 834.1 859.5 1.11 ± 0.01
pr_levm_FibonacciRecursive 757.4 ± 3.3 751.6 761.5 1.00

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.2 ± 0.1 8.1 8.4 1.00
main_levm_ManyHashes 9.3 ± 0.1 9.2 9.5 1.13 ± 0.02
pr_revm_ManyHashes 8.3 ± 0.1 8.2 8.5 1.00 ± 0.02
pr_levm_ManyHashes 9.1 ± 0.1 9.1 9.3 1.11 ± 0.01

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 268.9 ± 5.3 264.7 278.0 1.12 ± 0.02
main_levm_MstoreBench 241.3 ± 2.7 237.7 245.5 1.00 ± 0.01
pr_revm_MstoreBench 267.8 ± 4.9 263.6 277.4 1.11 ± 0.02
pr_levm_MstoreBench 241.0 ± 1.6 238.0 243.5 1.00

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 295.5 ± 1.1 294.1 297.8 1.00 ± 0.01
main_levm_Push 297.3 ± 2.5 294.3 302.6 1.01 ± 0.01
pr_revm_Push 294.3 ± 1.3 293.2 297.3 1.00
pr_levm_Push 298.7 ± 3.7 296.1 308.1 1.02 ± 0.01

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 174.1 ± 2.9 167.5 176.1 1.94 ± 0.04
main_levm_SstoreBench_no_opt 89.6 ± 1.3 88.4 92.1 1.00
pr_revm_SstoreBench_no_opt 176.8 ± 8.8 168.0 199.7 1.97 ± 0.10
pr_levm_SstoreBench_no_opt 90.4 ± 1.9 88.6 94.9 1.01 ± 0.03

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Benchmark Block Execution Results Comparison Against Main

Command Mean [s] Min [s] Max [s] Relative
base 59.884 ± 0.313 59.289 60.388 1.00 ± 0.01
head 59.762 ± 0.299 59.393 60.356 1.00

Co-authored-by: Tomás Grüner <[email protected]>
@github-project-automation github-project-automation bot moved this to In Review in ethrex_l1 Nov 13, 2025
@jrchatruc jrchatruc enabled auto-merge November 14, 2025 00:14
@jrchatruc jrchatruc added this pull request to the merge queue Nov 14, 2025
Merged via the queue into main with commit e071bd5 Nov 14, 2025
54 of 55 checks passed
@jrchatruc jrchatruc deleted the env_blobgasfee branch November 14, 2025 00:55
@github-project-automation github-project-automation bot moved this from Todo to Done in ethrex_performance Nov 14, 2025
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Nov 14, 2025
lakshya-sky pushed a commit to lakshya-sky/ethrex that referenced this pull request Nov 17, 2025
…aclass#5328)

**Motivation**

Currently in prepare_execution we are, for each transaction, calculating
the blob base fee which is consistent across the block.

**Description**

This was already cached for `BLOBBASEFEE` in lambdaclass#5288, but it could be
unified across all users by making part of the Environment.

---------

Co-authored-by: Tomás Grüner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

levm Lambda EVM implementation performance Block execution throughput and performance in general

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants