Skip to content

LEVM: Separate get_state_transitions from execute_block #2504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JulianVentura opened this issue Apr 21, 2025 · 2 comments · Fixed by #2519
Closed

LEVM: Separate get_state_transitions from execute_block #2504

JulianVentura opened this issue Apr 21, 2025 · 2 comments · Fixed by #2519
Labels
levm Lambda EVM implementation

Comments

@JulianVentura
Copy link
Contributor

Currently, the execute_block function returns the BlockExecutionResult with the account updates, which are calculated by making a call to get_state_transition function. This is ok when we want to execute just one block, but if we want to execute blocks in batches we don't really need to get the account updates after each block execution, we could just obtain it at the end instead.

We want to separate the block execution from the accounts update calculation.

@mpaulucci mpaulucci added the levm Lambda EVM implementation label Apr 21, 2025
@JereSalo
Copy link
Contributor

Yeah, as Juli says. The idea of this is to have execute_block without get_state_transitions. This would mean that in every place that we call execute_block right now we have to do get_state_transitions manually or wrap it into some other function if that's considered appropriate.
The advantage of this is that we won't be getting the account updates in cases in which we don't want to commit to the actual database! And one example of that is what he mentioned, executing blocks in batches and committing only after X blocks.

@JereSalo
Copy link
Contributor

JereSalo commented Apr 21, 2025

A follow up for this PR could be implementing add_blocks_in_batch for LEVM or something like that.

github-merge-queue bot pushed a commit that referenced this issue Apr 23, 2025
)

**Motivation**

Currently during batch processing, the state transitions are calculated
for every block and then merged, when it would be more performant to
calculate them once at the end.

**Description**

This PR removes the account updates from the execution result and makes
every consumer manually request them.

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

Closes #2504
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
levm Lambda EVM implementation
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants