Skip to content

feat(levm): add tool for helping fuzz levm #3206

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

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

Conversation

JereSalo
Copy link
Contributor

@JereSalo JereSalo commented Jun 18, 2025

Motivation

Description

Run with cargo run --bin quickrun <bytecode> <calldata>
The code currently sends a Call transaction with the specified calldata to a contract that's going to have the specified bytecode.

#3179

@JereSalo JereSalo self-assigned this Jun 18, 2025
@JereSalo JereSalo added the levm Lambda EVM implementation label Jun 18, 2025
@JereSalo JereSalo changed the base branch from main to levm/benchmarks_improvements June 18, 2025 14:55
Copy link

Lines of code report

Total lines added: 169
Total lines removed: 195
Total lines changed: 364

Detailed view
+---------------------------------------------------------------+-------+------+
| File                                                          | Lines | Diff |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/bench/revm_comparison/src/benchmark.rs  | 63    | +29  |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/bench/revm_comparison/src/compile.rs    | 43    | -26  |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/bench/revm_comparison/src/levm_bench.rs | 66    | +66  |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/bench/revm_comparison/src/lib.rs        | 2     | -169 |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/bench/revm_comparison/src/quick_run.rs  | 48    | +48  |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/bench/revm_comparison/src/revm_bench.rs | 26    | +26  |
+---------------------------------------------------------------+-------+------+

@JereSalo JereSalo moved this to In Progress in ethrex_l1 Jun 18, 2025
@JereSalo JereSalo mentioned this pull request Jun 18, 2025
Copy link

Benchmark Results Comparison

PR Results

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Factorial 235.8 ± 1.3 233.0 237.3 1.00
levm_Factorial 715.0 ± 9.3 708.6 739.6 3.03 ± 0.04

Benchmark Results: Factorial - Recursive

Command Mean [s] Min [s] Max [s] Relative
revm_FactorialRecursive 1.618 ± 0.027 1.565 1.655 1.00
levm_FactorialRecursive 3.774 ± 0.029 3.737 3.814 2.33 ± 0.04

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Fibonacci 213.0 ± 1.3 209.6 214.6 1.00
levm_Fibonacci 714.1 ± 3.9 710.5 724.0 3.35 ± 0.03

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ManyHashes 8.6 ± 0.0 8.5 8.7 1.00
levm_ManyHashes 15.7 ± 0.1 15.6 15.8 1.83 ± 0.01

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
revm_BubbleSort 3.192 ± 0.024 3.164 3.239 1.00
levm_BubbleSort 5.332 ± 0.066 5.281 5.510 1.67 ± 0.02

Benchmark Results: ERC20 - Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Transfer 240.3 ± 0.8 239.6 241.7 1.00
levm_ERC20Transfer 478.9 ± 4.1 474.0 484.8 1.99 ± 0.02

Benchmark Results: ERC20 - Mint

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Mint 136.1 ± 1.1 135.1 139.0 1.00
levm_ERC20Mint 310.4 ± 2.9 308.0 316.8 2.28 ± 0.03

Benchmark Results: ERC20 - Approval

Command Mean [s] Min [s] Max [s] Relative
revm_ERC20Approval 1.027 ± 0.009 1.020 1.049 1.00
levm_ERC20Approval 1.838 ± 0.020 1.816 1.884 1.79 ± 0.02

Main Results

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Factorial 234.4 ± 1.6 233.3 237.8 1.00
levm_Factorial 716.7 ± 3.7 712.7 722.8 3.06 ± 0.03

Benchmark Results: Factorial - Recursive

Command Mean [s] Min [s] Max [s] Relative
revm_FactorialRecursive 1.418 ± 0.097 1.315 1.546 1.00
levm_FactorialRecursive 3.841 ± 0.025 3.813 3.895 2.71 ± 0.19

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Fibonacci 205.5 ± 0.6 204.7 206.9 1.00
levm_Fibonacci 748.6 ± 82.1 719.8 982.1 3.64 ± 0.40

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ManyHashes 9.0 ± 0.1 8.9 9.1 1.00
levm_ManyHashes 16.1 ± 0.2 16.0 16.6 1.80 ± 0.03

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
revm_BubbleSort 3.212 ± 0.027 3.190 3.282 1.00
levm_BubbleSort 5.294 ± 0.018 5.279 5.335 1.65 ± 0.01

Benchmark Results: ERC20 - Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Transfer 247.6 ± 1.4 246.3 250.7 1.00
levm_ERC20Transfer 479.4 ± 2.0 477.1 484.0 1.94 ± 0.01

Benchmark Results: ERC20 - Mint

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Mint 140.5 ± 0.9 139.3 142.2 1.00
levm_ERC20Mint 310.4 ± 1.9 308.2 313.9 2.21 ± 0.02

Benchmark Results: ERC20 - Approval

Command Mean [s] Min [s] Max [s] Relative
revm_ERC20Approval 1.040 ± 0.010 1.033 1.061 1.00
levm_ERC20Approval 1.825 ± 0.007 1.817 1.839 1.75 ± 0.02

Base automatically changed from levm/benchmarks_improvements to main June 19, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
levm Lambda EVM implementation
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant