Skip to content

refactor(levm): improve error message in nonce mismatch#2698

Merged
jrchatruc merged 2 commits into
mainfrom
levm/improve_error_message
May 8, 2025
Merged

refactor(levm): improve error message in nonce mismatch#2698
jrchatruc merged 2 commits into
mainfrom
levm/improve_error_message

Conversation

@JereSalo

@JereSalo JereSalo commented May 7, 2025

Copy link
Copy Markdown
Contributor

Motivation

  • When running load tests I realized that when there's a nonce mismatch we should give more detail so that the user takes that into account.

Description

Closes #issue_number

@JereSalo JereSalo self-assigned this May 7, 2025
@JereSalo JereSalo marked this pull request as ready for review May 7, 2025 20:47
@JereSalo JereSalo requested a review from a team as a code owner May 7, 2025 20:47
@github-actions

github-actions Bot commented May 7, 2025

Copy link
Copy Markdown

Lines of code report

Total lines added: 6
Total lines removed: 0
Total lines changed: 6

Detailed view
+-------------------------------------------------+-------+------+
| File                                            | Lines | Diff |
+-------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/hooks/default_hook.rs | 342   | +3   |
+-------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/hooks/l2_hook.rs      | 136   | +3   |
+-------------------------------------------------+-------+------+

@github-actions

github-actions Bot commented May 7, 2025

Copy link
Copy Markdown

Benchmark Results Comparison

PR Results

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Factorial 244.0 ± 1.2 242.3 246.8 1.00
levm_Factorial 914.1 ± 16.0 893.6 940.2 3.75 ± 0.07

Benchmark Results: Factorial - Recursive

Command Mean [s] Min [s] Max [s] Relative
revm_FactorialRecursive 1.547 ± 0.087 1.410 1.647 1.00
levm_FactorialRecursive 13.523 ± 0.068 13.438 13.626 8.74 ± 0.49

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Fibonacci 212.5 ± 1.3 209.2 213.8 1.00
levm_Fibonacci 920.0 ± 7.1 907.5 927.5 4.33 ± 0.04

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ManyHashes 8.8 ± 0.1 8.7 9.0 1.00
levm_ManyHashes 18.0 ± 0.1 17.8 18.2 2.03 ± 0.02

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
revm_BubbleSort 3.227 ± 0.010 3.213 3.250 1.00
levm_BubbleSort 5.949 ± 0.033 5.918 6.015 1.84 ± 0.01

Benchmark Results: ERC20 - Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Transfer 251.2 ± 2.2 248.9 255.1 1.00
levm_ERC20Transfer 529.6 ± 28.1 516.9 609.1 2.11 ± 0.11

Benchmark Results: ERC20 - Mint

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Mint 140.4 ± 1.5 139.5 144.5 1.00
levm_ERC20Mint 333.8 ± 4.0 328.5 341.1 2.38 ± 0.04

Benchmark Results: ERC20 - Approval

Command Mean [s] Min [s] Max [s] Relative
revm_ERC20Approval 1.041 ± 0.010 1.029 1.064 1.00
levm_ERC20Approval 1.990 ± 0.025 1.954 2.034 1.91 ± 0.03

Main Results

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Factorial 238.2 ± 1.1 236.8 240.0 1.00
levm_Factorial 876.3 ± 13.7 868.5 913.9 3.68 ± 0.06

Benchmark Results: Factorial - Recursive

Command Mean [s] Min [s] Max [s] Relative
revm_FactorialRecursive 1.498 ± 0.063 1.432 1.603 1.00
levm_FactorialRecursive 13.315 ± 0.291 13.033 13.986 8.89 ± 0.42

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Fibonacci 214.1 ± 0.5 213.4 215.1 1.00
levm_Fibonacci 884.5 ± 41.8 867.8 1003.1 4.13 ± 0.20

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ManyHashes 8.9 ± 0.1 8.6 9.0 1.00
levm_ManyHashes 17.4 ± 0.1 17.3 17.6 1.97 ± 0.03

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
revm_BubbleSort 3.239 ± 0.012 3.222 3.254 1.00
levm_BubbleSort 5.769 ± 0.032 5.718 5.805 1.78 ± 0.01

Benchmark Results: ERC20 - Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Transfer 253.5 ± 2.0 250.2 256.6 1.00
levm_ERC20Transfer 510.3 ± 14.0 499.9 547.5 2.01 ± 0.06

Benchmark Results: ERC20 - Mint

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Mint 143.6 ± 0.7 142.6 145.0 1.00
levm_ERC20Mint 325.1 ± 3.6 321.0 332.5 2.26 ± 0.03

Benchmark Results: ERC20 - Approval

Command Mean [s] Min [s] Max [s] Relative
revm_ERC20Approval 1.063 ± 0.007 1.055 1.081 1.00
levm_ERC20Approval 1.926 ± 0.014 1.904 1.947 1.81 ± 0.02

@jrchatruc jrchatruc added this pull request to the merge queue May 8, 2025
Merged via the queue into main with commit ef8fdb5 May 8, 2025
35 checks passed
@jrchatruc jrchatruc deleted the levm/improve_error_message branch May 8, 2025 19:01
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
…2698)

**Motivation**

<!-- Why does this pull request exist? What are its goals? -->
- When running load tests I realized that when there's a nonce mismatch
we should give more detail so that the user takes that into account.

**Description**

<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 -->

Closes #issue_number
edg-l added a commit that referenced this pull request Apr 22, 2026
Migrate Amsterdam support from bal@v5.6.1 to bal@v5.7.0 (eels_commit
524b44617e410ab21b5122f0be5113b62a0e76ee, devnets/bal/4).

- EIP-7928 (PR #2730): widen BAL index from u16 to u32 across
  StorageChange/CodeChange/BalanceChange/NonceChange, recorder,
  checkpoint, BalAddressIndex and all helpers.
- EIP-8037 (PR #2687): dynamic cost_per_state_byte derived from
  block gas limit. New VM fields for per-block state-gas costs,
  gated by Fork::Amsterdam. 120M block gas keeps cpsb = 1174.
- EIP-8037 (PRs #2698, #2733): SSTORE 0->N->0 reservoir refill via
  clamp-and-spill; per-frame state_gas_refund absorbed on success,
  discarded on revert; remainder spills to VM-level pending reservoir.
- EIP-7976: calldata floor raised from 10 to 16 gas per token
  (Amsterdam-gated), with unweighted token count per spec.
- EIP-7981: access-list data bytes (20/addr, 32/key) folded into
  floor-token count; applies in both regular and floor arms; mempool
  intrinsic-gas path mirrored.
- EIP-8037 (PR #2689): top-level tx failure zeroes execution
  state_gas_used and refunds the reservoir; intrinsic state gas
  preserved. Routed through refund_sender.
- EIP-7708 (PR #2717): audit confirmed invariants (lex-ordered burn
  logs, no coinbase priority-fee log, SELFDESTRUCT-dest coalescing)
  already held; added regression tests.
- EIP-8037 (PR #2595): audit confirmed code-deposit state-gas
  discard on both oversized-code and deposit-OOG halts; added
  regression tests.

Infra: .fixtures_url_amsterdam, Makefile, hive config and docs
bumped to bal@v5.7.0 / devnets/bal/4.

Tests: 185 levm tests green; new files cover EIP-8037 CPSB, refund
clamp-and-spill, top-level reset, code-deposit discard, and combined
EIP-7976+7981 scenarios.
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