Skip to content

Conversation

@pablodeymo
Copy link
Contributor

Motivation

We want to use secp256k crate original version in case we call ecrecover without SP1.

Description

This PR aims to call the right version of ecrecover depending on the enviroment.

Closes #issue_number

@github-actions github-actions bot added the levm Lambda EVM implementation label Sep 17, 2025
@github-actions
Copy link

github-actions bot commented Sep 17, 2025

Lines of code report

Total lines added: 285
Total lines removed: 5
Total lines changed: 290

Detailed view
+------------------------------------------------------------+-------+------+
| File                                                       | Lines | Diff |
+------------------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/l2/options.rs                            | 1025  | -3   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/blockchain.rs                     | 966   | +12  |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/common.rs                             | 13    | +1   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/crypto/kzg.rs                         | 246   | +84  |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/errors.rs                             | 9     | +9   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/types/blobs_bundle.rs                 | 373   | +12  |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/types/block.rs                        | 861   | -1   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/types/transaction.rs                  | 2842  | +4   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/common/src/utils.rs                       | 65    | +49  |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/monitor/widget/rich_accounts.rs           | 157   | +3   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/networking/rpc/l2/transaction.rs          | 241   | +1   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/config.rs                      | 11    | -1   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/guest_program/src/execution.rs | 421   | +10  |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/guest_program/src/input.rs     | 42    | +8   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/prover.rs                      | 151   | +1   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/block_producer.rs               | 259   | +2   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/l1_committer.rs                 | 983   | +1   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/setup.rs                        | 99    | +1   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/constants.rs                     | 60    | +3   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/precompiles.rs                   | 1627  | +65  |
+------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/utils.rs                         | 517   | +18  |
+------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/vm.rs                            | 456   | +1   |
+------------------------------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Sep 17, 2025

Benchmark Results Comparison

Benchmark Results: Push

Command Mean [s] Min [s] Max [s] Relative
main_revm_Push 288.0 ± 3.1 284.6 295.6 1.00
main_levm_Push 888.2 ± 7.5 880.0 906.9 3.08 ± 0.04
pr_revm_Push 345.1 ± 181.4 286.4 861.4 1.20 ± 0.63
Detailed Results

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
main_revm_BubbleSort 4.718 ± 0.019 4.682 4.757 1.00
main_levm_BubbleSort 4.846 ± 0.007 4.831 4.854 1.03 ± 0.00
pr_revm_BubbleSort 4.720 ± 0.015 4.705 4.759 1.00 ± 0.01
pr_levm_BubbleSort 4.800 ± 0.016 4.776 4.826 1.02 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.533 ± 0.009 1.526 1.549 1.01 ± 0.01
main_levm_ERC20Approval 1.679 ± 0.011 1.664 1.701 1.10 ± 0.01
pr_revm_ERC20Approval 1.521 ± 0.003 1.516 1.527 1.00
pr_levm_ERC20Approval 1.666 ± 0.013 1.653 1.698 1.10 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 181.6 ± 1.4 180.4 185.2 1.01 ± 0.01
main_levm_ERC20Mint 205.0 ± 0.7 203.4 205.9 1.14 ± 0.01
pr_revm_ERC20Mint 180.1 ± 0.6 179.4 181.3 1.00
pr_levm_ERC20Mint 207.4 ± 2.0 204.6 211.3 1.15 ± 0.01

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 347.8 ± 1.9 346.3 352.5 1.01 ± 0.01
main_levm_ERC20Transfer 400.6 ± 18.5 391.3 453.1 1.16 ± 0.05
pr_revm_ERC20Transfer 345.5 ± 1.1 344.3 348.0 1.00
pr_levm_ERC20Transfer 393.4 ± 7.2 388.0 412.7 1.14 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 230.6 ± 0.7 229.1 232.0 1.00
main_levm_Factorial 302.4 ± 4.3 290.5 305.6 1.31 ± 0.02
pr_revm_Factorial 239.0 ± 18.4 228.6 290.5 1.04 ± 0.08
pr_levm_Factorial 310.8 ± 1.4 309.0 313.5 1.35 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.590 ± 0.051 1.463 1.631 1.02 ± 0.04
main_levm_FactorialRecursive 8.029 ± 0.111 7.877 8.257 5.16 ± 0.12
pr_revm_FactorialRecursive 1.557 ± 0.028 1.505 1.590 1.00
pr_levm_FactorialRecursive 7.898 ± 0.070 7.776 7.963 5.07 ± 0.10

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 214.2 ± 17.3 206.7 263.3 1.02 ± 0.08
main_levm_Fibonacci 305.0 ± 2.8 300.6 308.1 1.45 ± 0.02
pr_revm_Fibonacci 210.3 ± 1.5 208.8 213.6 1.00
pr_levm_Fibonacci 307.1 ± 3.4 302.4 315.7 1.46 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 850.1 ± 12.4 834.1 868.3 1.03 ± 0.02
main_levm_FibonacciRecursive 1081.1 ± 11.0 1071.1 1110.7 1.30 ± 0.02
pr_revm_FibonacciRecursive 828.9 ± 13.3 801.1 841.8 1.00
pr_levm_FibonacciRecursive 1079.8 ± 6.8 1073.2 1097.1 1.30 ± 0.02

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 12.0 ± 0.3 11.5 12.1 1.00
main_levm_ManyHashes 14.3 ± 0.2 14.0 14.4 1.19 ± 0.03
pr_revm_ManyHashes 12.1 ± 0.1 12.0 12.2 1.01 ± 0.02
pr_levm_ManyHashes 13.9 ± 0.0 13.9 14.0 1.16 ± 0.02

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 262.9 ± 3.5 259.1 268.9 1.00 ± 0.02
main_levm_MstoreBench 770.0 ± 9.2 761.2 790.8 2.93 ± 0.06
pr_revm_MstoreBench 262.7 ± 4.4 258.4 270.9 1.00
pr_levm_MstoreBench 766.5 ± 5.2 760.3 776.9 2.92 ± 0.05

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 288.0 ± 3.1 284.6 295.6 1.00
main_levm_Push 888.2 ± 7.5 880.0 906.9 3.08 ± 0.04
pr_revm_Push 345.1 ± 181.4 286.4 861.4 1.20 ± 0.63
pr_levm_Push 891.4 ± 14.8 878.8 926.8 3.10 ± 0.06

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 216.7 ± 1.4 214.3 218.1 2.67 ± 0.03
main_levm_SstoreBench_no_opt 81.2 ± 0.9 80.6 83.4 1.00 ± 0.02
pr_revm_SstoreBench_no_opt 216.6 ± 1.5 214.3 218.5 2.67 ± 0.03
pr_levm_SstoreBench_no_opt 81.2 ± 0.8 79.6 82.3 1.00

@ilitteri ilitteri changed the title feat(levm): ecrecover multiple versions feat(l1,l2,levm): ecrecover multiple versions Oct 28, 2025
@github-actions github-actions bot added L1 Ethereum client L2 Rollup client labels Oct 28, 2025
@ilitteri ilitteri changed the title feat(l1,l2,levm): ecrecover multiple versions feat(l1,l2,levm): ensure optimal compilation for each use case Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client L2 Rollup client levm Lambda EVM implementation

Projects

Status: No status
Status: No status

Development

Successfully merging this pull request may close these issues.

7 participants