Skip to content

Conversation

@MegaRedHand
Copy link
Collaborator

Motivation

We are checking that ecpairing G2 inputs are in the subgroup before calling compute_batch, which already checks this.

Description

This PR removes the duplicate subgroup check.

Closes #4939

@Copilot Copilot AI review requested due to automatic review settings October 20, 2025 18:19
@MegaRedHand MegaRedHand requested a review from a team as a code owner October 20, 2025 18:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes a redundant subgroup membership check for G2 points in the ecpairing precompile. The check was unnecessary because compute_batch already validates subgroup membership for G2 points.

Key Changes:

  • Removed duplicate is_in_subgroup() validation for G2 points in the pairing check function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

github-actions bot commented Oct 20, 2025

Lines of code report

Total lines added: 0
Total lines removed: 7
Total lines changed: 7

Detailed view
+------------------------------------------+-------+------+
| File                                     | Lines | Diff |
+------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/errors.rs      | 229   | -2   |
+------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/precompiles.rs | 1562  | -5   |
+------------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Oct 20, 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 4.739 ± 0.019 4.715 4.765 1.01 ± 0.01
main_levm_BubbleSort 4.695 ± 0.037 4.668 4.796 1.00
pr_revm_BubbleSort 4.736 ± 0.040 4.701 4.834 1.01 ± 0.01
pr_levm_BubbleSort 4.780 ± 0.047 4.736 4.877 1.02 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.548 ± 0.018 1.531 1.593 1.00
main_levm_ERC20Approval 1.671 ± 0.012 1.659 1.699 1.08 ± 0.01
pr_revm_ERC20Approval 1.550 ± 0.009 1.537 1.569 1.00 ± 0.01
pr_levm_ERC20Approval 1.705 ± 0.015 1.684 1.735 1.10 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 186.1 ± 1.9 184.2 190.6 1.00
main_levm_ERC20Mint 201.3 ± 0.5 200.6 202.2 1.08 ± 0.01
pr_revm_ERC20Mint 187.1 ± 1.4 185.2 189.8 1.01 ± 0.01
pr_levm_ERC20Mint 204.7 ± 2.6 202.3 211.2 1.10 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 354.4 ± 2.4 351.2 358.6 1.00 ± 0.01
main_levm_ERC20Transfer 393.1 ± 2.0 390.6 396.1 1.11 ± 0.01
pr_revm_ERC20Transfer 352.9 ± 1.9 349.6 355.6 1.00
pr_levm_ERC20Transfer 396.9 ± 1.3 394.1 398.6 1.12 ± 0.01

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 233.3 ± 1.0 231.7 235.0 1.00
main_levm_Factorial 284.2 ± 29.7 274.0 368.6 1.22 ± 0.13
pr_revm_Factorial 234.4 ± 1.1 232.9 236.0 1.00 ± 0.01
pr_levm_Factorial 276.3 ± 0.6 275.6 277.4 1.18 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.712 ± 0.030 1.665 1.756 1.00
main_levm_FactorialRecursive 8.800 ± 0.111 8.581 8.996 5.14 ± 0.11
pr_revm_FactorialRecursive 1.721 ± 0.039 1.656 1.767 1.00 ± 0.03
pr_levm_FactorialRecursive 8.731 ± 0.109 8.524 8.865 5.10 ± 0.11

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 211.2 ± 1.0 209.1 213.1 1.00 ± 0.01
main_levm_Fibonacci 260.2 ± 7.2 252.0 275.9 1.23 ± 0.04
pr_revm_Fibonacci 211.2 ± 2.1 209.8 216.4 1.00
pr_levm_Fibonacci 263.4 ± 4.5 254.8 268.8 1.25 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 907.1 ± 17.3 884.8 933.5 1.18 ± 0.03
main_levm_FibonacciRecursive 782.2 ± 13.5 765.2 805.3 1.02 ± 0.02
pr_revm_FibonacciRecursive 897.2 ± 9.1 874.3 908.3 1.17 ± 0.02
pr_levm_FibonacciRecursive 769.1 ± 12.5 755.1 791.7 1.00

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 12.5 ± 0.0 12.5 12.6 1.00 ± 0.01
main_levm_ManyHashes 13.9 ± 0.1 13.8 14.1 1.11 ± 0.01
pr_revm_ManyHashes 12.5 ± 0.1 12.4 12.6 1.00
pr_levm_ManyHashes 14.0 ± 0.1 14.0 14.1 1.12 ± 0.01

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 263.8 ± 1.4 261.3 265.7 1.05 ± 0.02
main_levm_MstoreBench 251.7 ± 5.1 248.4 265.8 1.00
pr_revm_MstoreBench 268.7 ± 4.5 263.5 275.1 1.07 ± 0.03
pr_levm_MstoreBench 253.6 ± 7.8 248.4 275.3 1.01 ± 0.04

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 293.6 ± 0.6 292.8 294.9 1.00
main_levm_Push 309.2 ± 3.2 300.9 313.1 1.05 ± 0.01
pr_revm_Push 295.0 ± 2.6 292.8 301.4 1.00 ± 0.01
pr_levm_Push 313.8 ± 10.5 306.2 341.2 1.07 ± 0.04

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 222.3 ± 4.3 219.9 233.0 2.68 ± 0.07
main_levm_SstoreBench_no_opt 84.2 ± 0.5 83.3 85.2 1.01 ± 0.02
pr_revm_SstoreBench_no_opt 221.9 ± 3.8 219.6 232.4 2.67 ± 0.06
pr_levm_SstoreBench_no_opt 83.0 ± 1.3 81.5 85.0 1.00

@MegaRedHand MegaRedHand marked this pull request as draft October 20, 2025 19:22
@github-actions
Copy link

github-actions bot commented Oct 20, 2025

Benchmark Block Execution Results Comparison Against Main

Command Mean [s] Min [s] Max [s] Relative
base 68.375 ± 0.149 68.124 68.603 1.00
head 68.390 ± 0.154 68.100 68.620 1.00 ± 0.00

@MegaRedHand MegaRedHand marked this pull request as ready for review October 20, 2025 20:25
@MegaRedHand MegaRedHand moved this from Todo to In review in ethrex_performance Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

levm Lambda EVM implementation performance

Projects

Status: No status
Status: In review

Development

Successfully merging this pull request may close these issues.

Remove duplicate subgroup check in ecpairing precompile

1 participant