Skip to content

Conversation

@iovoid
Copy link
Contributor

@iovoid iovoid commented Nov 5, 2025

Motivation

Currently for every transaction being executed, we get the transitions and send the updates to the merkelization thread.

However this has two drawbacks:

  • getting the update list isn't cheap, taking up 10% of block execution
  • unbatched requests cause more work to be done, increasing total merkelization time

The merkelization queue often had dozens of requests by the end of block execution.

Description

We delay calculating and sending updates until the merkelizer is ready (queue is empty), which causes the changes to the batched.

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

Lines of code report

Total lines added: 0
Total lines removed: 32
Total lines changed: 32

Detailed view
+---------------------------------------+-------+------+
| File                                  | Lines | Diff |
+---------------------------------------+-------+------+
| ethrex/crates/vm/backends/levm/mod.rs | 618   | -32  |
+---------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

Benchmark Block Execution Results Comparison Against Main

Command Mean [s] Min [s] Max [s] Relative
base 61.060 ± 0.183 60.816 61.412 1.02 ± 0.00
head 59.879 ± 0.212 59.694 60.333 1.00

@iovoid iovoid marked this pull request as ready for review November 11, 2025 14:21
@iovoid iovoid requested a review from a team as a code owner November 11, 2025 14:21
@ethrex-project-sync ethrex-project-sync bot moved this to In Review in ethrex_l1 Nov 11, 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.

🔥

@jrchatruc jrchatruc added this pull request to the merge queue Nov 11, 2025
Merged via the queue into main with commit 49d69bd Nov 11, 2025
44 checks passed
@jrchatruc jrchatruc deleted the merkelization_backpressure branch November 11, 2025 18:14
@github-project-automation github-project-automation bot moved this from Todo to Done in ethrex_performance Nov 11, 2025
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Nov 11, 2025
xqft pushed a commit that referenced this pull request Nov 11, 2025
**Motivation**

Currently for every transaction being executed, we get the transitions
and send the updates to the merkelization thread.

However this has two drawbacks:
- getting the update list isn't cheap, taking up 10% of block execution
- unbatched requests cause more work to be done, increasing total
merkelization time

The merkelization queue often had dozens of requests by the end of block
execution.

**Description**

We delay calculating and sending updates until the merkelizer is ready
(queue is empty), which causes the changes to the batched.

---------

Co-authored-by: Javier Rodríguez Chatruc <49622509+jrchatruc@users.noreply.github.com>
Co-authored-by: Javier Chatruc <jrchatruc@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client performance

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants