Skip to content

Conversation

@iovoid
Copy link
Contributor

@iovoid iovoid commented Dec 9, 2025

Motivation

Currently if the state trie root does not match with the one being used for execution, we fail due to various errors that happen as a result of executing from incorrect state (invalid nonces, incorrect gas, state root mismatch) instead of alerting about the real error.

While this should only happen due to a bug, it has happened several times.

Description

Errors if the state root being used for execution isn't found.

Checklist

  • Updated STORE_SCHEMA_VERSION (crates/storage/lib.rs) if the PR includes breaking changes to the Store requiring a re-sync.

@github-actions github-actions bot added the L1 Ethereum client label Dec 9, 2025
@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Lines of code report

Total lines added: 13
Total lines removed: 3
Total lines changed: 16

Detailed view
+-------------------------------------------------------+-------+------+
| File                                                  | Lines | Diff |
+-------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/blockchain.rs                | 1578  | +1   |
+-------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/vm.rs                        | 150   | +12  |
+-------------------------------------------------------+-------+------+
| ethrex/tooling/ef_tests/state/utils.rs                | 59    | -1   |
+-------------------------------------------------------+-------+------+
| ethrex/tooling/ef_tests/state_v2/src/modules/utils.rs | 45    | -2   |
+-------------------------------------------------------+-------+------+

@iovoid iovoid marked this pull request as ready for review December 10, 2025 15:58
@ethrex-project-sync ethrex-project-sync bot moved this to In Review in ethrex_l1 Dec 10, 2025
Copy link
Collaborator

@MegaRedHand MegaRedHand left a comment

Choose a reason for hiding this comment

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

Great improvement!

@github-actions
Copy link

github-actions bot commented Dec 10, 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 2.972 ± 0.024 2.948 3.032 1.01 ± 0.01
main_levm_BubbleSort 3.085 ± 0.032 3.054 3.157 1.04 ± 0.01
pr_revm_BubbleSort 2.953 ± 0.024 2.929 2.999 1.00
pr_levm_BubbleSort 3.112 ± 0.016 3.093 3.140 1.05 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Approval 978.0 ± 11.6 966.4 995.2 1.01 ± 0.01
main_levm_ERC20Approval 1095.6 ± 8.0 1085.0 1112.8 1.13 ± 0.01
pr_revm_ERC20Approval 966.1 ± 6.4 959.0 980.4 1.00
pr_levm_ERC20Approval 1095.7 ± 7.5 1089.1 1113.8 1.13 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 134.0 ± 1.6 132.3 137.7 1.02 ± 0.01
main_levm_ERC20Mint 165.1 ± 0.6 164.4 166.3 1.25 ± 0.01
pr_revm_ERC20Mint 131.9 ± 0.9 130.7 133.2 1.00
pr_levm_ERC20Mint 162.5 ± 0.8 161.6 164.0 1.23 ± 0.01

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 230.6 ± 1.1 229.6 233.3 1.00 ± 0.01
main_levm_ERC20Transfer 279.2 ± 3.1 275.8 286.9 1.21 ± 0.02
pr_revm_ERC20Transfer 230.1 ± 3.2 226.7 236.0 1.00
pr_levm_ERC20Transfer 277.4 ± 5.6 273.4 292.4 1.21 ± 0.03

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 225.8 ± 1.9 224.2 230.4 1.01 ± 0.01
main_levm_Factorial 271.2 ± 8.2 264.4 291.8 1.21 ± 0.04
pr_revm_Factorial 224.4 ± 1.5 221.8 227.3 1.00
pr_levm_Factorial 266.4 ± 2.8 264.0 272.7 1.19 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.624 ± 0.031 1.568 1.672 1.00 ± 0.04
main_levm_FactorialRecursive 8.328 ± 0.050 8.260 8.418 5.14 ± 0.16
pr_revm_FactorialRecursive 1.621 ± 0.051 1.513 1.693 1.00
pr_levm_FactorialRecursive 8.301 ± 0.055 8.221 8.378 5.12 ± 0.16

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 206.4 ± 0.8 205.3 207.6 1.00 ± 0.01
main_levm_Fibonacci 261.6 ± 2.0 257.4 263.5 1.27 ± 0.02
pr_revm_Fibonacci 205.5 ± 2.6 202.2 212.0 1.00
pr_levm_Fibonacci 263.2 ± 2.4 259.9 267.6 1.28 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 846.9 ± 9.5 836.2 862.7 1.14 ± 0.02
main_levm_FibonacciRecursive 746.5 ± 3.9 742.6 752.6 1.00 ± 0.01
pr_revm_FibonacciRecursive 842.9 ± 10.9 830.5 862.3 1.13 ± 0.02
pr_levm_FibonacciRecursive 743.9 ± 8.6 732.6 761.8 1.00

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.2 ± 0.1 8.1 8.4 1.00 ± 0.01
main_levm_ManyHashes 9.3 ± 1.0 8.9 12.0 1.13 ± 0.12
pr_revm_ManyHashes 8.2 ± 0.1 8.1 8.4 1.00
pr_levm_ManyHashes 9.0 ± 0.1 8.8 9.2 1.09 ± 0.02

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 262.9 ± 7.0 257.0 276.3 1.10 ± 0.03
main_levm_MstoreBench 238.7 ± 1.1 237.2 240.6 1.00
pr_revm_MstoreBench 266.2 ± 5.6 260.7 277.9 1.12 ± 0.02
pr_levm_MstoreBench 252.1 ± 37.2 237.7 357.8 1.06 ± 0.16

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 291.4 ± 1.7 287.6 294.2 1.00
main_levm_Push 310.1 ± 2.7 307.9 315.4 1.06 ± 0.01
pr_revm_Push 294.1 ± 3.4 292.2 303.6 1.01 ± 0.01
pr_levm_Push 310.9 ± 2.6 308.7 317.5 1.07 ± 0.01

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 172.5 ± 6.8 167.7 185.7 1.91 ± 0.09
main_levm_SstoreBench_no_opt 94.2 ± 7.0 89.2 112.4 1.04 ± 0.08
pr_revm_SstoreBench_no_opt 168.0 ± 4.2 161.5 176.4 1.86 ± 0.07
pr_levm_SstoreBench_no_opt 90.5 ± 2.4 86.9 96.0 1.00

@MegaRedHand MegaRedHand changed the title chore(l1): error on missing parent fix(l1): error on missing parent Dec 11, 2025
Comment on lines +23 to +24
let vm_db: DynVmDatabase =
Box::new(StoreVmDatabase::new(storage.clone(), genesis.get_block().header).unwrap());
Copy link
Collaborator

Choose a reason for hiding this comment

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

All unwraps are just in tooling/bench code right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Note: crates/vm/levm/runner/ is also tooling even if the path might imply otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created issue (#5610) to move them so we can avoid confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

5 participants