Skip to content

refactor(l2): simplify l2 hook #3392

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 6 commits into from
Jul 3, 2025
Merged

refactor(l2): simplify l2 hook #3392

merged 6 commits into from
Jul 3, 2025

Conversation

iovoid
Copy link
Contributor

@iovoid iovoid commented Jun 30, 2025

Motivation

We want to reuse the default hook as much as possible. Since only privileged transactions need special handling, the l2 hook should focus on them.

Description

  • Gas is not paid by privileged transactions
    • Therefore gas prices are irrelevant
  • We don't want to overflow block limits. This is the only case when a privileged transaction can error out
  • Privileged transactions can't fail as that would cause them to not be included, stalling deposits
    • Instead, we make the transaction revert

Closes #3343

@iovoid iovoid requested review from jrchatruc, ManuelBilbao and a team as code owners June 30, 2025 13:51
@ManuelBilbao ManuelBilbao added the L2 Rollup client label Jun 30, 2025
@iovoid iovoid force-pushed the refactor/l2-hook branch from 2587796 to 6522c59 Compare June 30, 2025 14:44
Copy link

github-actions bot commented Jun 30, 2025

Lines of code report

Total lines added: 0
Total lines removed: 45
Total lines changed: 45

Detailed view
+--------------------------------------------+-------+------+
| File                                       | Lines | Diff |
+--------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/hooks/l2_hook.rs | 62    | -45  |
+--------------------------------------------+-------+------+

Copy link

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 3.157 ± 0.041 3.130 3.271 1.01 ± 0.01
main_levm_BubbleSort 4.515 ± 0.031 4.488 4.594 1.44 ± 0.01
pr_revm_BubbleSort 3.140 ± 0.023 3.123 3.195 1.00
pr_levm_BubbleSort 4.438 ± 0.040 4.396 4.506 1.41 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.042 ± 0.010 1.030 1.056 1.00
main_levm_ERC20Approval 1.583 ± 0.004 1.577 1.591 1.52 ± 0.01
pr_revm_ERC20Approval 1.043 ± 0.010 1.032 1.066 1.00 ± 0.01
pr_levm_ERC20Approval 1.578 ± 0.136 1.526 1.965 1.52 ± 0.13

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 138.7 ± 1.0 137.7 140.9 1.00
main_levm_ERC20Mint 267.4 ± 11.6 259.4 298.5 1.93 ± 0.08
pr_revm_ERC20Mint 139.5 ± 1.6 137.9 142.3 1.01 ± 0.01
pr_levm_ERC20Mint 256.9 ± 3.2 254.4 264.4 1.85 ± 0.03

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 244.6 ± 3.6 240.9 251.1 1.00 ± 0.02
main_levm_ERC20Transfer 416.5 ± 4.1 412.6 424.8 1.71 ± 0.03
pr_revm_ERC20Transfer 243.5 ± 2.7 241.9 250.6 1.00
pr_levm_ERC20Transfer 402.2 ± 3.0 398.5 407.6 1.65 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 234.8 ± 1.7 231.6 237.8 1.00 ± 0.02
main_levm_Factorial 443.8 ± 6.3 437.6 459.8 1.90 ± 0.04
pr_revm_Factorial 234.0 ± 4.2 230.1 245.5 1.00
pr_levm_Factorial 444.9 ± 7.5 437.7 463.4 1.90 ± 0.05

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.619 ± 0.017 1.583 1.647 1.00
main_levm_FactorialRecursive 2.705 ± 0.025 2.675 2.742 1.67 ± 0.02
pr_revm_FactorialRecursive 1.628 ± 0.029 1.575 1.674 1.01 ± 0.02
pr_levm_FactorialRecursive 2.683 ± 0.052 2.626 2.788 1.66 ± 0.04

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 208.1 ± 2.1 205.5 213.1 1.01 ± 0.01
main_levm_Fibonacci 442.8 ± 14.2 433.2 473.3 2.15 ± 0.07
pr_revm_Fibonacci 205.7 ± 1.3 202.3 207.4 1.00
pr_levm_Fibonacci 434.9 ± 12.0 418.0 464.6 2.11 ± 0.06

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.9 ± 0.2 8.7 9.3 1.00
main_levm_ManyHashes 14.1 ± 0.3 13.7 14.5 1.58 ± 0.04
pr_revm_ManyHashes 9.0 ± 0.1 8.9 9.2 1.01 ± 0.02
pr_levm_ManyHashes 13.5 ± 0.2 13.4 13.9 1.52 ± 0.04

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 298.0 ± 2.1 295.2 301.7 1.01 ± 0.01
main_levm_Push 1106.6 ± 24.2 1077.4 1167.9 3.73 ± 0.09
pr_revm_Push 296.3 ± 2.0 294.5 299.9 1.00
pr_levm_Push 1049.0 ± 7.2 1044.7 1068.0 3.54 ± 0.03

iovoid and others added 2 commits July 1, 2025 14:37
Co-authored-by: Tomás Grüner <[email protected]>
Co-authored-by: Tomás Grüner <[email protected]>
Copy link

github-actions bot commented Jul 1, 2025

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 3.206 ± 0.165 3.143 3.674 1.02 ± 0.05
main_levm_BubbleSort 4.447 ± 0.023 4.420 4.491 1.41 ± 0.01
pr_revm_BubbleSort 3.154 ± 0.023 3.135 3.203 1.00
pr_levm_BubbleSort 4.467 ± 0.061 4.410 4.583 1.42 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.047 ± 0.011 1.037 1.069 1.01 ± 0.01
main_levm_ERC20Approval 1.543 ± 0.031 1.522 1.621 1.49 ± 0.03
pr_revm_ERC20Approval 1.038 ± 0.006 1.031 1.049 1.00
pr_levm_ERC20Approval 1.541 ± 0.025 1.521 1.597 1.48 ± 0.03

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 138.4 ± 4.4 136.1 150.9 1.00
main_levm_ERC20Mint 261.1 ± 14.2 253.3 300.5 1.89 ± 0.12
pr_revm_ERC20Mint 139.2 ± 2.4 136.0 143.9 1.01 ± 0.04
pr_levm_ERC20Mint 257.0 ± 2.4 254.7 261.4 1.86 ± 0.06

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 244.9 ± 3.9 242.1 255.1 1.00 ± 0.02
main_levm_ERC20Transfer 402.4 ± 5.9 398.1 416.9 1.65 ± 0.03
pr_revm_ERC20Transfer 244.3 ± 2.2 241.6 246.5 1.00
pr_levm_ERC20Transfer 406.2 ± 4.3 401.7 413.2 1.66 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 233.1 ± 3.6 229.8 240.8 1.00
main_levm_Factorial 448.9 ± 9.9 442.9 476.6 1.93 ± 0.05
pr_revm_Factorial 233.8 ± 0.9 232.8 235.4 1.00 ± 0.02
pr_levm_Factorial 441.6 ± 7.0 435.5 457.9 1.89 ± 0.04

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.616 ± 0.015 1.585 1.633 1.01 ± 0.01
main_levm_FactorialRecursive 2.757 ± 0.019 2.728 2.791 1.72 ± 0.02
pr_revm_FactorialRecursive 1.602 ± 0.017 1.584 1.630 1.00
pr_levm_FactorialRecursive 2.720 ± 0.035 2.683 2.805 1.70 ± 0.03

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 207.7 ± 3.1 205.3 214.3 1.01 ± 0.02
main_levm_Fibonacci 437.4 ± 4.0 433.6 445.6 2.12 ± 0.02
pr_revm_Fibonacci 206.6 ± 1.3 205.5 209.1 1.00
pr_levm_Fibonacci 454.1 ± 76.5 428.4 671.7 2.20 ± 0.37

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 878.7 ± 7.2 868.1 889.9 1.01 ± 0.01
main_levm_FibonacciRecursive 1659.4 ± 20.3 1638.2 1696.9 1.91 ± 0.03
pr_revm_FibonacciRecursive 870.7 ± 5.0 864.9 880.3 1.00
pr_levm_FibonacciRecursive 1698.8 ± 25.5 1664.8 1741.8 1.95 ± 0.03

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.7 ± 0.1 8.7 8.8 1.00
main_levm_ManyHashes 13.3 ± 0.1 13.2 13.5 1.52 ± 0.02
pr_revm_ManyHashes 8.7 ± 0.1 8.5 8.8 1.00 ± 0.01
pr_levm_ManyHashes 13.5 ± 0.1 13.4 13.7 1.55 ± 0.01

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 293.7 ± 1.1 292.4 295.5 1.00
main_levm_Push 1082.5 ± 6.1 1076.7 1094.4 3.69 ± 0.02
pr_revm_Push 294.8 ± 1.3 293.3 297.4 1.00 ± 0.01
pr_levm_Push 1049.7 ± 5.2 1043.7 1059.2 3.57 ± 0.02

Copy link

github-actions bot commented Jul 1, 2025

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 3.162 ± 0.017 3.142 3.189 1.01 ± 0.01
main_levm_BubbleSort 4.461 ± 0.027 4.433 4.519 1.42 ± 0.01
pr_revm_BubbleSort 3.138 ± 0.013 3.125 3.166 1.00
pr_levm_BubbleSort 4.422 ± 0.044 4.385 4.511 1.41 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.057 ± 0.015 1.041 1.079 1.02 ± 0.02
main_levm_ERC20Approval 1.582 ± 0.015 1.568 1.622 1.52 ± 0.02
pr_revm_ERC20Approval 1.038 ± 0.011 1.030 1.064 1.00
pr_levm_ERC20Approval 1.512 ± 0.008 1.498 1.524 1.46 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 137.7 ± 1.4 136.0 141.4 1.00
main_levm_ERC20Mint 266.8 ± 1.4 264.6 268.6 1.94 ± 0.02
pr_revm_ERC20Mint 138.0 ± 0.9 137.2 140.3 1.00 ± 0.01
pr_levm_ERC20Mint 254.1 ± 2.1 251.1 257.5 1.85 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 246.6 ± 3.4 242.9 252.1 1.02 ± 0.02
main_levm_ERC20Transfer 413.4 ± 1.2 411.3 414.7 1.71 ± 0.01
pr_revm_ERC20Transfer 242.3 ± 1.9 240.9 246.6 1.00
pr_levm_ERC20Transfer 396.3 ± 5.4 391.6 409.2 1.64 ± 0.03

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 232.6 ± 3.0 229.4 239.9 1.01 ± 0.01
main_levm_Factorial 447.7 ± 1.8 445.9 452.3 1.95 ± 0.01
pr_revm_Factorial 230.2 ± 1.1 228.0 232.5 1.00
pr_levm_Factorial 442.1 ± 8.9 434.4 456.1 1.92 ± 0.04

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.606 ± 0.029 1.529 1.635 1.00
main_levm_FactorialRecursive 2.793 ± 0.036 2.757 2.872 1.74 ± 0.04
pr_revm_FactorialRecursive 1.617 ± 0.033 1.569 1.667 1.01 ± 0.03
pr_levm_FactorialRecursive 2.689 ± 0.069 2.615 2.799 1.67 ± 0.05

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 213.2 ± 15.5 206.7 257.0 1.03 ± 0.08
main_levm_Fibonacci 440.4 ± 8.4 433.8 463.8 2.13 ± 0.04
pr_revm_Fibonacci 206.6 ± 1.3 204.9 208.8 1.00
pr_levm_Fibonacci 433.9 ± 11.9 422.3 457.9 2.10 ± 0.06

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 861.8 ± 16.9 832.6 885.4 1.00
main_levm_FibonacciRecursive 1723.2 ± 5.3 1716.2 1731.9 2.00 ± 0.04
pr_revm_FibonacciRecursive 866.6 ± 19.4 838.4 908.0 1.01 ± 0.03
pr_levm_FibonacciRecursive 1639.0 ± 10.2 1625.6 1656.2 1.90 ± 0.04

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.7 ± 0.1 8.6 9.0 1.00
main_levm_ManyHashes 14.1 ± 0.2 13.9 14.5 1.63 ± 0.03
pr_revm_ManyHashes 8.7 ± 0.0 8.6 8.8 1.00 ± 0.01
pr_levm_ManyHashes 13.1 ± 0.2 13.0 13.5 1.51 ± 0.03

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 295.1 ± 2.3 292.2 299.5 1.00
main_levm_Push 1104.7 ± 7.2 1097.9 1121.6 3.74 ± 0.04
pr_revm_Push 295.3 ± 2.2 293.4 300.9 1.00 ± 0.01
pr_levm_Push 1091.8 ± 11.5 1079.8 1118.7 3.70 ± 0.05

@MegaRedHand MegaRedHand moved this to In Review in ethrex_l2 Jul 1, 2025
@iovoid iovoid enabled auto-merge July 3, 2025 15:22
Copy link

github-actions bot commented Jul 3, 2025

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 3.201 ± 0.018 3.175 3.238 1.02 ± 0.01
main_levm_BubbleSort 4.575 ± 0.038 4.533 4.656 1.46 ± 0.01
pr_revm_BubbleSort 3.137 ± 0.008 3.127 3.148 1.00
pr_levm_BubbleSort 4.574 ± 0.052 4.499 4.645 1.46 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.071 ± 0.017 1.029 1.090 1.03 ± 0.02
main_levm_ERC20Approval 1.576 ± 0.007 1.569 1.588 1.51 ± 0.01
pr_revm_ERC20Approval 1.043 ± 0.009 1.031 1.059 1.00
pr_levm_ERC20Approval 1.569 ± 0.009 1.558 1.579 1.50 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 138.5 ± 0.8 137.5 139.7 1.00 ± 0.01
main_levm_ERC20Mint 265.1 ± 2.8 261.8 268.4 1.92 ± 0.03
pr_revm_ERC20Mint 138.1 ± 1.6 136.8 142.2 1.00
pr_levm_ERC20Mint 267.6 ± 6.0 263.4 284.0 1.94 ± 0.05

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 249.7 ± 1.8 246.8 253.0 1.02 ± 0.02
main_levm_ERC20Transfer 413.8 ± 3.5 409.8 422.4 1.69 ± 0.04
pr_revm_ERC20Transfer 244.3 ± 4.9 241.1 253.7 1.00
pr_levm_ERC20Transfer 410.4 ± 1.2 408.1 412.1 1.68 ± 0.03

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 235.8 ± 7.5 232.6 257.0 1.02 ± 0.03
main_levm_Factorial 461.6 ± 3.8 458.9 470.8 1.99 ± 0.02
pr_revm_Factorial 231.4 ± 1.4 229.6 233.9 1.00
pr_levm_Factorial 464.0 ± 5.2 459.7 476.5 2.01 ± 0.03

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.619 ± 0.026 1.587 1.665 1.00
main_levm_FactorialRecursive 2.829 ± 0.057 2.782 2.957 1.75 ± 0.04
pr_revm_FactorialRecursive 1.635 ± 0.029 1.577 1.671 1.01 ± 0.02
pr_levm_FactorialRecursive 2.896 ± 0.033 2.862 2.971 1.79 ± 0.04

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 205.6 ± 2.3 204.2 211.8 1.00
main_levm_Fibonacci 454.3 ± 8.4 449.5 476.7 2.21 ± 0.05
pr_revm_Fibonacci 205.8 ± 0.8 205.1 207.3 1.00 ± 0.01
pr_levm_Fibonacci 444.5 ± 16.7 429.3 469.8 2.16 ± 0.08

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 868.3 ± 12.9 838.6 880.9 1.00
main_levm_FibonacciRecursive 1512.3 ± 26.6 1489.2 1554.8 1.74 ± 0.04
pr_revm_FibonacciRecursive 885.5 ± 18.5 863.6 926.1 1.02 ± 0.03
pr_levm_FibonacciRecursive 1755.0 ± 15.3 1736.4 1777.0 2.02 ± 0.03

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.8 ± 0.1 8.7 9.1 1.00
main_levm_ManyHashes 13.7 ± 0.2 13.5 14.0 1.55 ± 0.03
pr_revm_ManyHashes 8.8 ± 0.1 8.7 9.1 1.00 ± 0.02
pr_levm_ManyHashes 14.2 ± 0.2 14.1 14.7 1.61 ± 0.03

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 293.5 ± 1.9 291.8 298.5 1.00
main_levm_Push 1041.4 ± 8.8 1036.8 1065.7 3.55 ± 0.04
pr_revm_Push 296.5 ± 3.7 294.3 304.6 1.01 ± 0.01
pr_levm_Push 1083.5 ± 11.7 1068.4 1098.4 3.69 ± 0.05

@iovoid iovoid added this pull request to the merge queue Jul 3, 2025
Copy link

github-actions bot commented Jul 3, 2025

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 3.268 ± 0.293 3.143 4.100 1.03 ± 0.09
main_levm_BubbleSort 4.600 ± 0.021 4.574 4.634 1.45 ± 0.01
pr_revm_BubbleSort 3.171 ± 0.026 3.144 3.220 1.00
pr_levm_BubbleSort 4.504 ± 0.038 4.461 4.576 1.42 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.064 ± 0.025 1.050 1.132 1.00
main_levm_ERC20Approval 1.558 ± 0.010 1.548 1.579 1.46 ± 0.04
pr_revm_ERC20Approval 1.068 ± 0.013 1.058 1.090 1.00 ± 0.03
pr_levm_ERC20Approval 1.530 ± 0.008 1.520 1.538 1.44 ± 0.03

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 139.5 ± 1.1 138.6 142.5 1.00
main_levm_ERC20Mint 261.6 ± 2.0 259.8 266.8 1.88 ± 0.02
pr_revm_ERC20Mint 139.7 ± 0.6 139.0 140.8 1.00 ± 0.01
pr_levm_ERC20Mint 259.6 ± 4.6 255.5 270.5 1.86 ± 0.04

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 246.3 ± 0.8 245.5 247.9 1.00
main_levm_ERC20Transfer 408.7 ± 4.5 405.3 420.4 1.66 ± 0.02
pr_revm_ERC20Transfer 246.8 ± 1.3 243.8 248.6 1.00 ± 0.01
pr_levm_ERC20Transfer 402.4 ± 1.9 399.4 404.8 1.63 ± 0.01

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 233.8 ± 1.0 232.5 235.7 1.01 ± 0.01
main_levm_Factorial 475.0 ± 1.4 473.3 477.1 2.04 ± 0.01
pr_revm_Factorial 232.3 ± 1.2 230.8 234.7 1.00
pr_levm_Factorial 445.2 ± 7.3 439.5 457.7 1.92 ± 0.03

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.632 ± 0.025 1.583 1.668 1.01 ± 0.02
main_levm_FactorialRecursive 2.765 ± 0.017 2.739 2.789 1.72 ± 0.02
pr_revm_FactorialRecursive 1.609 ± 0.017 1.585 1.646 1.00
pr_levm_FactorialRecursive 2.733 ± 0.163 2.653 3.190 1.70 ± 0.10

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 205.1 ± 1.1 203.7 207.5 1.00
main_levm_Fibonacci 454.0 ± 6.0 447.8 467.7 2.21 ± 0.03
pr_revm_Fibonacci 208.7 ± 1.2 207.9 212.0 1.02 ± 0.01
pr_levm_Fibonacci 464.7 ± 6.7 459.4 481.2 2.27 ± 0.03

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 885.4 ± 25.5 864.8 955.2 1.02 ± 0.03
main_levm_FibonacciRecursive 1488.5 ± 35.9 1458.7 1572.2 1.72 ± 0.05
pr_revm_FibonacciRecursive 866.9 ± 13.1 842.7 882.5 1.00
pr_levm_FibonacciRecursive 1676.0 ± 22.7 1650.3 1720.1 1.93 ± 0.04

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.7 ± 0.1 8.6 9.1 1.00
main_levm_ManyHashes 13.6 ± 0.1 13.5 13.8 1.56 ± 0.03
pr_revm_ManyHashes 8.8 ± 0.1 8.7 8.9 1.01 ± 0.02
pr_levm_ManyHashes 13.7 ± 0.1 13.5 13.8 1.57 ± 0.03

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 292.7 ± 0.8 291.6 293.9 1.00
main_levm_Push 1104.6 ± 4.0 1095.6 1110.8 3.77 ± 0.02
pr_revm_Push 294.7 ± 0.9 293.2 296.1 1.01 ± 0.00
pr_levm_Push 1078.5 ± 8.1 1063.9 1094.1 3.69 ± 0.03

Merged via the queue into main with commit f5cac07 Jul 3, 2025
36 of 38 checks passed
@iovoid iovoid deleted the refactor/l2-hook branch July 3, 2025 15:48
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l2 Jul 3, 2025
d-roak pushed a commit to 1sixtech/ethrex that referenced this pull request Jul 17, 2025
**Motivation**

We want to reuse the default hook as much as possible. Since only
privileged transactions need special handling, the l2 hook should focus
on them.

**Description**

- Gas is not paid by privileged transactions
    - Therefore gas prices are irrelevant
- We don't want to overflow block limits. This is the only case when a
privileged transaction can error out
- Privileged transactions can't _fail_ as that would cause them to not
be included, stalling deposits
    - Instead, we make the transaction revert

Closes lambdaclass#3343

---------

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
L2 Rollup client
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Simplify L2 EVM hook
4 participants