Skip to content

refactor(levm): obtain gas calculation params from auxiliar function #3420

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 2, 2025

Conversation

sofiazcoaga
Copy link
Contributor

@sofiazcoaga sofiazcoaga commented Jul 1, 2025

Motivation

This PR addresses issue.

Description

Opcodes CALL, CALLCODE, DELEGATECALL and STATICCALL had each a custom gas calculation function but used the same input arguments and obtained them with the same process.

Now a new method called get_call_gas_params() includes these common calculations and gets invoked by all opcodes handlers.

@sofiazcoaga sofiazcoaga requested a review from a team as a code owner July 1, 2025 15:40

This comment was marked as outdated.

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.167 ± 0.009 3.153 3.182 1.01 ± 0.01
main_levm_BubbleSort 4.456 ± 0.039 4.429 4.561 1.42 ± 0.01
pr_revm_BubbleSort 3.130 ± 0.013 3.113 3.162 1.00
pr_levm_BubbleSort 4.412 ± 0.052 4.380 4.557 1.41 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.051 ± 0.005 1.044 1.059 1.01 ± 0.01
main_levm_ERC20Approval 1.555 ± 0.009 1.545 1.572 1.50 ± 0.01
pr_revm_ERC20Approval 1.040 ± 0.005 1.031 1.050 1.00
pr_levm_ERC20Approval 1.533 ± 0.020 1.520 1.588 1.48 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 140.8 ± 4.3 138.6 153.0 1.02 ± 0.03
main_levm_ERC20Mint 260.6 ± 1.0 259.4 262.5 1.88 ± 0.01
pr_revm_ERC20Mint 138.7 ± 0.9 137.4 140.6 1.00
pr_levm_ERC20Mint 259.4 ± 4.9 253.8 271.3 1.87 ± 0.04

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 245.7 ± 2.1 244.0 251.0 1.01 ± 0.01
main_levm_ERC20Transfer 406.1 ± 3.1 403.0 413.0 1.67 ± 0.01
pr_revm_ERC20Transfer 242.9 ± 0.2 242.6 243.3 1.00
pr_levm_ERC20Transfer 401.6 ± 1.3 399.6 403.6 1.65 ± 0.01

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 231.9 ± 0.5 231.3 232.9 1.00 ± 0.00
main_levm_Factorial 448.8 ± 1.5 447.1 451.6 1.94 ± 0.01
pr_revm_Factorial 230.9 ± 0.5 230.2 232.0 1.00
pr_levm_Factorial 444.1 ± 1.0 442.8 445.8 1.92 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.633 ± 0.030 1.595 1.698 1.00
main_levm_FactorialRecursive 2.683 ± 0.021 2.650 2.718 1.64 ± 0.03
pr_revm_FactorialRecursive 1.650 ± 0.027 1.605 1.684 1.01 ± 0.02
pr_levm_FactorialRecursive 2.688 ± 0.020 2.667 2.719 1.65 ± 0.03

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 207.1 ± 2.6 205.6 214.2 1.00 ± 0.02
main_levm_Fibonacci 436.2 ± 2.2 434.4 441.5 2.12 ± 0.03
pr_revm_Fibonacci 206.2 ± 3.0 204.5 214.6 1.00
pr_levm_Fibonacci 439.4 ± 2.9 436.9 445.6 2.13 ± 0.03

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 882.4 ± 11.3 866.5 902.8 1.01 ± 0.02
main_levm_FibonacciRecursive 1652.8 ± 13.6 1635.1 1676.2 1.90 ± 0.03
pr_revm_FibonacciRecursive 869.6 ± 12.4 843.0 884.2 1.00
pr_levm_FibonacciRecursive 1663.8 ± 18.6 1638.6 1707.4 1.91 ± 0.03

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 9.0 ± 0.1 8.8 9.1 1.00
main_levm_ManyHashes 14.0 ± 0.6 13.6 15.6 1.56 ± 0.07
pr_revm_ManyHashes 9.2 ± 0.2 8.9 9.4 1.02 ± 0.02
pr_levm_ManyHashes 13.5 ± 0.1 13.3 13.7 1.51 ± 0.02

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 295.4 ± 1.8 293.7 299.2 1.00
main_levm_Push 1132.0 ± 2.9 1128.8 1137.8 3.83 ± 0.03
pr_revm_Push 297.8 ± 5.3 293.8 308.7 1.01 ± 0.02
pr_levm_Push 1089.9 ± 117.5 1048.7 1424.1 3.69 ± 0.40

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.193 ± 0.121 3.140 3.535 1.01 ± 0.04
main_levm_BubbleSort 4.436 ± 0.016 4.419 4.462 1.41 ± 0.01
pr_revm_BubbleSort 3.149 ± 0.025 3.125 3.214 1.00
pr_levm_BubbleSort 4.417 ± 0.028 4.385 4.485 1.40 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.054 ± 0.011 1.037 1.073 1.00 ± 0.01
main_levm_ERC20Approval 1.532 ± 0.010 1.523 1.558 1.46 ± 0.01
pr_revm_ERC20Approval 1.049 ± 0.008 1.041 1.064 1.00
pr_levm_ERC20Approval 1.531 ± 0.011 1.518 1.558 1.46 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 137.6 ± 0.9 136.3 138.9 1.00
main_levm_ERC20Mint 256.1 ± 2.2 254.7 261.9 1.86 ± 0.02
pr_revm_ERC20Mint 137.8 ± 0.6 137.1 139.2 1.00 ± 0.01
pr_levm_ERC20Mint 260.8 ± 12.1 253.4 293.9 1.89 ± 0.09

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 248.6 ± 2.8 244.8 253.9 1.02 ± 0.01
main_levm_ERC20Transfer 401.1 ± 3.9 397.4 410.3 1.64 ± 0.02
pr_revm_ERC20Transfer 244.8 ± 1.9 242.4 247.7 1.00
pr_levm_ERC20Transfer 442.3 ± 125.9 399.0 800.3 1.81 ± 0.51

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 234.3 ± 13.3 228.5 272.2 1.02 ± 0.06
main_levm_Factorial 448.4 ± 9.5 444.5 475.5 1.95 ± 0.04
pr_revm_Factorial 230.3 ± 0.4 229.8 230.9 1.00
pr_levm_Factorial 441.8 ± 2.2 439.0 446.8 1.92 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.612 ± 0.019 1.589 1.641 1.00
main_levm_FactorialRecursive 2.731 ± 0.028 2.699 2.777 1.69 ± 0.03
pr_revm_FactorialRecursive 1.618 ± 0.038 1.547 1.681 1.00 ± 0.03
pr_levm_FactorialRecursive 2.728 ± 0.029 2.696 2.778 1.69 ± 0.03

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 205.4 ± 0.6 203.8 205.9 1.00
main_levm_Fibonacci 440.3 ± 5.0 436.0 448.7 2.14 ± 0.03
pr_revm_Fibonacci 205.6 ± 0.7 204.8 207.1 1.00 ± 0.00
pr_levm_Fibonacci 437.0 ± 3.0 434.7 445.0 2.13 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 867.4 ± 10.2 848.7 879.3 1.00 ± 0.02
main_levm_FibonacciRecursive 1674.4 ± 13.5 1658.0 1705.2 1.94 ± 0.02
pr_revm_FibonacciRecursive 864.3 ± 8.3 852.2 875.8 1.00
pr_levm_FibonacciRecursive 1677.1 ± 22.1 1657.5 1725.1 1.94 ± 0.03

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.7 ± 0.1 8.7 8.9 1.00 ± 0.01
main_levm_ManyHashes 13.9 ± 0.1 13.7 14.1 1.59 ± 0.02
pr_revm_ManyHashes 8.7 ± 0.1 8.6 8.8 1.00
pr_levm_ManyHashes 13.6 ± 0.2 13.4 14.0 1.56 ± 0.02

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 298.6 ± 2.6 295.1 303.3 1.01 ± 0.01
main_levm_Push 1105.7 ± 10.8 1086.5 1126.9 3.75 ± 0.04
pr_revm_Push 294.7 ± 1.1 293.4 296.5 1.00
pr_levm_Push 1036.2 ± 2.2 1032.8 1040.8 3.52 ± 0.02

Copy link
Contributor

@SDartayet SDartayet left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@JereSalo JereSalo left a comment

Choose a reason for hiding this comment

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

Good, just a comment on errors.
We use InternalError for things that shouldn't ever happen and indicate a bug. When we do checked operations in gas costs we tend to use OutOfGas just in case so that we don't accidentally return an InternalError. However, if you are sure that some of these errors should be internal we can clarify that in a comment, otherwise it's safer to leave them as OutOfGas.

Copy link

github-actions bot commented Jul 2, 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.160 ± 0.031 3.138 3.245 1.01 ± 0.01
main_levm_BubbleSort 4.494 ± 0.066 4.447 4.667 1.43 ± 0.02
pr_revm_BubbleSort 3.142 ± 0.020 3.124 3.188 1.00
pr_levm_BubbleSort 4.401 ± 0.012 4.383 4.421 1.40 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.052 ± 0.015 1.035 1.073 1.02 ± 0.02
main_levm_ERC20Approval 1.538 ± 0.009 1.526 1.550 1.49 ± 0.02
pr_revm_ERC20Approval 1.035 ± 0.012 1.022 1.060 1.00
pr_levm_ERC20Approval 1.537 ± 0.018 1.519 1.566 1.49 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 137.7 ± 0.7 137.2 139.1 1.00
main_levm_ERC20Mint 256.8 ± 1.2 255.0 258.3 1.86 ± 0.01
pr_revm_ERC20Mint 137.9 ± 1.0 136.6 140.0 1.00 ± 0.01
pr_levm_ERC20Mint 259.3 ± 3.1 253.6 262.8 1.88 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 247.3 ± 1.9 245.3 250.8 1.02 ± 0.01
main_levm_ERC20Transfer 403.1 ± 2.4 399.4 406.8 1.66 ± 0.02
pr_revm_ERC20Transfer 242.8 ± 2.2 240.8 248.0 1.00
pr_levm_ERC20Transfer 403.4 ± 3.8 399.9 410.9 1.66 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 232.9 ± 2.5 231.2 239.5 1.01 ± 0.01
main_levm_Factorial 451.6 ± 17.5 444.1 501.1 1.95 ± 0.08
pr_revm_Factorial 231.2 ± 1.1 230.3 234.2 1.00
pr_levm_Factorial 448.2 ± 20.7 439.9 507.1 1.94 ± 0.09

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.621 ± 0.034 1.543 1.667 1.00 ± 0.03
main_levm_FactorialRecursive 2.706 ± 0.029 2.653 2.761 1.67 ± 0.04
pr_revm_FactorialRecursive 1.617 ± 0.036 1.522 1.646 1.00
pr_levm_FactorialRecursive 2.657 ± 0.022 2.622 2.694 1.64 ± 0.04

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 210.5 ± 10.0 205.9 238.9 1.02 ± 0.05
main_levm_Fibonacci 435.7 ± 1.8 433.3 438.3 2.10 ± 0.01
pr_revm_Fibonacci 207.1 ± 1.2 205.4 210.1 1.00
pr_levm_Fibonacci 437.2 ± 3.6 434.0 445.6 2.11 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 874.4 ± 5.4 865.0 879.9 1.00
main_levm_FibonacciRecursive 1665.4 ± 8.1 1653.3 1678.1 1.90 ± 0.01
pr_revm_FibonacciRecursive 875.0 ± 7.2 864.9 883.3 1.00 ± 0.01
pr_levm_FibonacciRecursive 1630.5 ± 8.3 1616.5 1639.3 1.86 ± 0.01

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.7 ± 0.0 8.6 8.7 1.00
main_levm_ManyHashes 13.4 ± 0.2 13.3 13.7 1.54 ± 0.02
pr_revm_ManyHashes 8.8 ± 0.2 8.7 9.1 1.01 ± 0.02
pr_levm_ManyHashes 13.6 ± 0.1 13.5 13.8 1.56 ± 0.01

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 296.2 ± 4.7 293.4 309.2 1.00
main_levm_Push 1069.2 ± 9.7 1061.6 1090.7 3.61 ± 0.07
pr_revm_Push 297.4 ± 2.4 294.8 302.2 1.00 ± 0.02
pr_levm_Push 1040.4 ± 1.8 1037.9 1042.8 3.51 ± 0.06

Copy link

github-actions bot commented Jul 2, 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.182 ± 0.015 3.166 3.221 1.01 ± 0.01
main_levm_BubbleSort 4.468 ± 0.041 4.444 4.583 1.43 ± 0.02
pr_revm_BubbleSort 3.135 ± 0.016 3.116 3.176 1.00
pr_levm_BubbleSort 4.436 ± 0.015 4.420 4.465 1.41 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.048 ± 0.007 1.041 1.064 1.00
main_levm_ERC20Approval 1.547 ± 0.007 1.539 1.562 1.48 ± 0.01
pr_revm_ERC20Approval 1.063 ± 0.004 1.058 1.074 1.01 ± 0.01
pr_levm_ERC20Approval 1.526 ± 0.006 1.519 1.537 1.46 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 140.2 ± 0.4 139.5 140.8 1.00
main_levm_ERC20Mint 258.7 ± 0.7 257.7 259.6 1.85 ± 0.01
pr_revm_ERC20Mint 143.5 ± 0.5 142.8 144.3 1.02 ± 0.00
pr_levm_ERC20Mint 257.9 ± 3.4 254.9 266.2 1.84 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 247.4 ± 1.2 246.4 249.9 1.00
main_levm_ERC20Transfer 408.6 ± 4.7 404.1 421.1 1.65 ± 0.02
pr_revm_ERC20Transfer 253.3 ± 2.1 251.0 257.8 1.02 ± 0.01
pr_levm_ERC20Transfer 402.9 ± 3.5 399.4 410.1 1.63 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 231.1 ± 1.0 229.6 233.5 1.00
main_levm_Factorial 449.5 ± 11.0 443.2 480.6 1.95 ± 0.05
pr_revm_Factorial 231.7 ± 1.0 230.5 233.3 1.00 ± 0.01
pr_levm_Factorial 444.2 ± 7.0 440.8 463.3 1.92 ± 0.03

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.626 ± 0.025 1.571 1.663 1.00 ± 0.02
main_levm_FactorialRecursive 2.793 ± 0.021 2.762 2.829 1.72 ± 0.03
pr_revm_FactorialRecursive 1.623 ± 0.029 1.559 1.659 1.00
pr_levm_FactorialRecursive 2.683 ± 0.015 2.663 2.704 1.65 ± 0.03

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 205.6 ± 0.3 205.2 206.1 1.00
main_levm_Fibonacci 438.1 ± 3.5 433.9 445.3 2.13 ± 0.02
pr_revm_Fibonacci 206.8 ± 3.5 204.9 216.1 1.01 ± 0.02
pr_levm_Fibonacci 435.4 ± 2.2 431.8 438.7 2.12 ± 0.01

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 877.4 ± 10.1 857.9 891.5 1.01 ± 0.01
main_levm_FibonacciRecursive 1701.5 ± 8.7 1688.4 1714.9 1.95 ± 0.02
pr_revm_FibonacciRecursive 871.9 ± 7.2 858.8 883.6 1.00
pr_levm_FibonacciRecursive 1664.3 ± 14.8 1641.0 1685.0 1.91 ± 0.02

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.8 ± 0.1 8.7 9.0 1.00
main_levm_ManyHashes 14.1 ± 0.2 13.9 14.5 1.61 ± 0.03
pr_revm_ManyHashes 8.9 ± 0.1 8.8 9.1 1.02 ± 0.02
pr_levm_ManyHashes 13.7 ± 0.1 13.5 13.9 1.56 ± 0.02

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 294.9 ± 2.5 293.6 301.8 1.00
main_levm_Push 1068.0 ± 8.1 1059.7 1084.4 3.62 ± 0.04
pr_revm_Push 295.9 ± 5.7 293.0 311.9 1.00 ± 0.02
pr_levm_Push 1049.3 ± 1.9 1045.4 1052.3 3.56 ± 0.03

Copy link

github-actions bot commented Jul 2, 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.167 ± 0.025 3.137 3.214 1.00 ± 0.01
main_levm_BubbleSort 4.457 ± 0.018 4.438 4.496 1.41 ± 0.02
pr_revm_BubbleSort 3.158 ± 0.040 3.124 3.256 1.00
pr_levm_BubbleSort 4.426 ± 0.015 4.410 4.459 1.40 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.055 ± 0.011 1.039 1.079 1.01 ± 0.01
main_levm_ERC20Approval 1.551 ± 0.006 1.543 1.566 1.49 ± 0.01
pr_revm_ERC20Approval 1.041 ± 0.009 1.034 1.063 1.00
pr_levm_ERC20Approval 1.550 ± 0.021 1.533 1.596 1.49 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 139.6 ± 1.8 137.5 143.3 1.00 ± 0.02
main_levm_ERC20Mint 266.4 ± 3.4 263.5 275.3 1.91 ± 0.03
pr_revm_ERC20Mint 139.4 ± 1.7 138.2 144.1 1.00
pr_levm_ERC20Mint 262.3 ± 4.6 254.3 272.4 1.88 ± 0.04

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 247.2 ± 1.5 244.5 250.0 1.00 ± 0.02
main_levm_ERC20Transfer 409.2 ± 2.0 406.2 411.7 1.66 ± 0.04
pr_revm_ERC20Transfer 246.1 ± 5.6 242.9 261.5 1.00
pr_levm_ERC20Transfer 407.7 ± 2.6 405.6 413.0 1.66 ± 0.04

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 232.5 ± 1.5 231.3 235.3 1.00
main_levm_Factorial 467.6 ± 3.1 464.6 473.5 2.01 ± 0.02
pr_revm_Factorial 233.0 ± 0.7 231.4 233.6 1.00 ± 0.01
pr_levm_Factorial 448.8 ± 1.2 447.4 450.6 1.93 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.635 ± 0.013 1.613 1.662 1.00 ± 0.04
main_levm_FactorialRecursive 2.723 ± 0.021 2.685 2.747 1.67 ± 0.06
pr_revm_FactorialRecursive 1.631 ± 0.057 1.480 1.696 1.00
pr_levm_FactorialRecursive 2.659 ± 0.017 2.634 2.681 1.63 ± 0.06

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 205.7 ± 0.3 205.3 206.2 1.00
main_levm_Fibonacci 437.2 ± 3.5 435.0 446.6 2.13 ± 0.02
pr_revm_Fibonacci 206.0 ± 0.8 204.6 207.4 1.00 ± 0.00
pr_levm_Fibonacci 441.6 ± 1.1 439.9 443.8 2.15 ± 0.01

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 883.3 ± 8.4 872.8 898.4 1.01 ± 0.01
main_levm_FibonacciRecursive 1680.6 ± 11.1 1670.0 1708.8 1.92 ± 0.02
pr_revm_FibonacciRecursive 877.3 ± 7.1 868.4 887.4 1.00
pr_levm_FibonacciRecursive 1642.9 ± 10.0 1626.3 1662.7 1.87 ± 0.02

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.8 ± 0.1 8.7 9.1 1.00 ± 0.02
main_levm_ManyHashes 13.9 ± 0.1 13.8 14.0 1.58 ± 0.02
pr_revm_ManyHashes 8.8 ± 0.1 8.7 9.0 1.00
pr_levm_ManyHashes 13.2 ± 0.1 13.0 13.3 1.49 ± 0.02

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 295.5 ± 0.8 294.3 296.6 1.00 ± 0.00
main_levm_Push 1139.2 ± 5.5 1131.6 1148.3 3.87 ± 0.02
pr_revm_Push 294.4 ± 0.9 293.3 296.3 1.00
pr_levm_Push 1048.1 ± 20.2 1034.2 1102.9 3.56 ± 0.07

Copy link

github-actions bot commented Jul 2, 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.179 ± 0.049 3.151 3.297 1.00
main_levm_BubbleSort 4.477 ± 0.014 4.450 4.491 1.41 ± 0.02
pr_revm_BubbleSort 3.182 ± 0.073 3.133 3.373 1.00 ± 0.03
pr_levm_BubbleSort 4.493 ± 0.020 4.469 4.522 1.41 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.055 ± 0.007 1.048 1.067 1.02 ± 0.01
main_levm_ERC20Approval 1.553 ± 0.012 1.538 1.574 1.50 ± 0.02
pr_revm_ERC20Approval 1.039 ± 0.008 1.029 1.054 1.00
pr_levm_ERC20Approval 1.581 ± 0.015 1.568 1.621 1.52 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 138.4 ± 0.8 137.5 140.6 1.00 ± 0.01
main_levm_ERC20Mint 264.9 ± 2.6 262.4 271.8 1.92 ± 0.03
pr_revm_ERC20Mint 138.2 ± 1.3 136.5 140.2 1.00
pr_levm_ERC20Mint 264.7 ± 2.1 261.8 267.1 1.92 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 246.7 ± 0.8 246.0 248.0 1.01 ± 0.01
main_levm_ERC20Transfer 406.3 ± 1.9 403.9 410.8 1.66 ± 0.01
pr_revm_ERC20Transfer 244.3 ± 1.8 242.5 248.2 1.00
pr_levm_ERC20Transfer 412.6 ± 1.2 410.8 414.3 1.69 ± 0.01

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 232.3 ± 1.2 231.1 235.4 1.00
main_levm_Factorial 449.0 ± 1.5 447.5 451.6 1.93 ± 0.01
pr_revm_Factorial 234.9 ± 0.6 234.2 235.9 1.01 ± 0.01
pr_levm_Factorial 443.9 ± 0.8 443.0 445.8 1.91 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.604 ± 0.046 1.498 1.640 1.00
main_levm_FactorialRecursive 2.802 ± 0.017 2.775 2.826 1.75 ± 0.05
pr_revm_FactorialRecursive 1.637 ± 0.022 1.582 1.662 1.02 ± 0.03
pr_levm_FactorialRecursive 2.839 ± 0.021 2.790 2.866 1.77 ± 0.05

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 206.9 ± 1.6 205.9 210.6 1.00
main_levm_Fibonacci 436.5 ± 3.1 433.8 444.5 2.11 ± 0.02
pr_revm_Fibonacci 207.1 ± 2.8 205.3 214.3 1.00 ± 0.02
pr_levm_Fibonacci 445.3 ± 12.1 434.4 470.3 2.15 ± 0.06

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 874.0 ± 10.1 857.0 885.6 1.00
main_levm_FibonacciRecursive 1737.3 ± 11.4 1726.2 1758.0 1.99 ± 0.03
pr_revm_FibonacciRecursive 876.2 ± 8.7 857.6 886.1 1.00 ± 0.02
pr_levm_FibonacciRecursive 1708.0 ± 16.6 1693.0 1745.9 1.95 ± 0.03

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.8 ± 0.1 8.7 8.9 1.00 ± 0.01
main_levm_ManyHashes 14.2 ± 0.1 14.1 14.4 1.63 ± 0.02
pr_revm_ManyHashes 8.7 ± 0.1 8.6 8.9 1.00
pr_levm_ManyHashes 14.1 ± 0.1 14.0 14.2 1.62 ± 0.02

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 297.8 ± 3.1 295.4 305.7 1.01 ± 0.01
main_levm_Push 1101.2 ± 6.8 1083.6 1107.9 3.73 ± 0.03
pr_revm_Push 295.3 ± 1.4 293.7 297.7 1.00
pr_levm_Push 1045.8 ± 13.6 1032.7 1076.7 3.54 ± 0.05

@sofiazcoaga sofiazcoaga requested a review from JereSalo July 2, 2025 17:25
@sofiazcoaga sofiazcoaga added this pull request to the merge queue Jul 2, 2025
Merged via the queue into main with commit 2983a9b Jul 2, 2025
37 checks passed
@sofiazcoaga sofiazcoaga deleted the levm/refactor-call-opcodes-gas-consumption branch July 2, 2025 18:37
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.

3 participants