Skip to content

Conversation

@iovoid
Copy link
Contributor

@iovoid iovoid commented Oct 27, 2025

Motivation

Currently to get a storage we are:

  • getting the block header to obtain the state root
  • getting the account to get the storage root
  • reading the value

The first step isn't needed because the state root is the same through the block, and the second isn't needed because since we're using a path-based DB we can directly get the value (without even using the trie, if the FKVs are computed).

Description

Implements a RocksDB-specific VM backend.

@github-actions github-actions bot added L1 Ethereum client performance Block execution throughput and performance in general labels Oct 27, 2025
@github-actions
Copy link

github-actions bot commented Oct 27, 2025

Lines of code report

Total lines added: 355
Total lines removed: 4
Total lines changed: 359

Detailed view
+---------------------------------------------------------------+-------+------+
| File                                                          | Lines | Diff |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/blockchain.rs                        | 966   | +11  |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/payload.rs                           | 658   | -1   |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/l2/based/block_fetcher.rs                       | 495   | +1   |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/eth/transaction.rs               | 576   | +1   |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/storage/api.rs                                  | 247   | +4   |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/storage/store.rs                                | 1541  | +8   |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/storage/store_db/rocksdb.rs                     | 1548  | +8   |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/storage/trie_db/generic_vm.rs                   | 101   | +101 |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/storage/trie_db/mod.rs                          | 8     | +3   |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/storage/trie_db/rocksdb_vm.rs                   | 205   | +205 |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/mod.rs                              | 169   | +13  |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/bench/revm_comparison/src/levm_bench.rs | 84    | -1   |
+---------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/runner/src/main.rs                      | 270   | -1   |
+---------------------------------------------------------------+-------+------+
| ethrex/tooling/ef_tests/state/utils.rs                        | 60    | -1   |
+---------------------------------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Oct 27, 2025

Benchmark Block Execution Results Comparison Against Main

Command Mean [s] Min [s] Max [s] Relative
base 64.896 ± 0.142 64.721 65.249 1.01 ± 0.00
head 64.208 ± 0.176 63.881 64.433 1.00

@github-actions
Copy link

github-actions bot commented Oct 28, 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.716 ± 0.007 4.706 4.727 1.00 ± 0.00
main_levm_BubbleSort 4.725 ± 0.021 4.704 4.767 1.01 ± 0.01
pr_revm_BubbleSort 4.705 ± 0.006 4.690 4.712 1.00 ± 0.00
pr_levm_BubbleSort 4.694 ± 0.016 4.675 4.728 1.00

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.538 ± 0.012 1.527 1.556 1.00
main_levm_ERC20Approval 1.695 ± 0.012 1.681 1.714 1.10 ± 0.01
pr_revm_ERC20Approval 1.542 ± 0.007 1.530 1.553 1.00 ± 0.01
pr_levm_ERC20Approval 1.684 ± 0.005 1.674 1.695 1.09 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 183.1 ± 1.3 182.0 186.7 1.00
main_levm_ERC20Mint 203.3 ± 1.0 202.0 205.4 1.11 ± 0.01
pr_revm_ERC20Mint 184.6 ± 4.3 181.8 196.5 1.01 ± 0.02
pr_levm_ERC20Mint 203.0 ± 1.8 201.2 207.7 1.11 ± 0.01

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 350.4 ± 3.0 348.1 357.8 1.00
main_levm_ERC20Transfer 396.3 ± 5.5 390.7 410.5 1.13 ± 0.02
pr_revm_ERC20Transfer 350.8 ± 3.5 348.1 360.5 1.00 ± 0.01
pr_levm_ERC20Transfer 397.3 ± 5.6 390.7 411.0 1.13 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 233.9 ± 2.9 231.5 239.0 1.00 ± 0.02
main_levm_Factorial 276.2 ± 2.3 274.3 281.7 1.18 ± 0.02
pr_revm_Factorial 233.9 ± 2.2 232.0 239.1 1.00
pr_levm_Factorial 275.2 ± 0.5 274.6 276.3 1.18 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.669 ± 0.042 1.565 1.717 1.00
main_levm_FactorialRecursive 8.200 ± 1.064 5.181 8.627 4.91 ± 0.65
pr_revm_FactorialRecursive 1.695 ± 0.027 1.656 1.741 1.02 ± 0.03
pr_levm_FactorialRecursive 8.625 ± 0.133 8.437 8.869 5.17 ± 0.15

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 212.3 ± 2.1 209.5 216.8 1.00
main_levm_Fibonacci 258.7 ± 5.4 253.3 266.6 1.22 ± 0.03
pr_revm_Fibonacci 213.0 ± 3.3 210.2 220.7 1.00 ± 0.02
pr_levm_Fibonacci 258.6 ± 4.0 251.9 263.4 1.22 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 902.7 ± 6.5 895.0 915.9 1.19 ± 0.02
main_levm_FibonacciRecursive 764.1 ± 6.9 757.9 778.8 1.01 ± 0.01
pr_revm_FibonacciRecursive 908.3 ± 13.5 887.6 926.7 1.20 ± 0.02
pr_levm_FibonacciRecursive 756.2 ± 8.8 745.7 775.1 1.00

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 12.6 ± 0.2 12.4 13.0 1.01 ± 0.02
main_levm_ManyHashes 13.8 ± 0.2 13.6 14.3 1.10 ± 0.02
pr_revm_ManyHashes 12.6 ± 0.1 12.4 12.7 1.00
pr_levm_ManyHashes 13.9 ± 0.2 13.7 14.1 1.11 ± 0.02

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 270.1 ± 5.7 266.0 279.4 1.08 ± 0.02
main_levm_MstoreBench 249.7 ± 1.3 247.4 251.2 1.00
pr_revm_MstoreBench 267.7 ± 3.6 264.4 274.6 1.07 ± 0.02
pr_levm_MstoreBench 251.7 ± 2.2 249.2 256.0 1.01 ± 0.01

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 295.3 ± 2.3 293.1 300.5 1.00 ± 0.01
main_levm_Push 310.2 ± 5.2 302.8 317.6 1.05 ± 0.02
pr_revm_Push 294.6 ± 2.5 292.6 301.3 1.00
pr_levm_Push 340.6 ± 27.7 324.1 417.6 1.16 ± 0.09

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 219.2 ± 0.6 218.4 220.6 2.62 ± 0.03
main_levm_SstoreBench_no_opt 83.8 ± 1.0 81.7 84.9 1.00
pr_revm_SstoreBench_no_opt 221.1 ± 5.3 218.0 235.7 2.64 ± 0.07
pr_levm_SstoreBench_no_opt 84.4 ± 1.0 82.2 86.1 1.01 ± 0.02

@iovoid iovoid marked this pull request as ready for review October 28, 2025 14:08
@iovoid iovoid requested a review from a team as a code owner October 28, 2025 14:08
@ethrex-project-sync ethrex-project-sync bot moved this to In Review in ethrex_l1 Oct 28, 2025
Copy link
Collaborator

@jrchatruc jrchatruc left a comment

Choose a reason for hiding this comment

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

Blocking this merge until we discuss how to properly refactor this to avoid adding a new rocksdb vm

@github-project-automation github-project-automation bot moved this from In Review to In Progress in ethrex_l1 Oct 28, 2025
@iovoid
Copy link
Contributor Author

iovoid commented Oct 31, 2025

Superceded by #5145

@iovoid iovoid closed this Oct 31, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in ethrex_performance Oct 31, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in ethrex_l1 Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client performance Block execution throughput and performance in general

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants