Skip to content
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

fix(levm): fix withdrawals hive tests #1594

Merged
merged 3 commits into from
Jan 2, 2025
Merged

fix(levm): fix withdrawals hive tests #1594

merged 3 commits into from
Jan 2, 2025

Conversation

JereSalo
Copy link
Contributor

@JereSalo JereSalo commented Jan 2, 2025

Motivation

Description

  • Hive tests with levm weren't executing correctly because of how we handled withdrawals, this fixes it.

Closes #issue_number

@JereSalo JereSalo added the levm Lambda EVM implementation label Jan 2, 2025
@JereSalo JereSalo self-assigned this Jan 2, 2025
@mpaulucci
Copy link
Collaborator

Is this specific to levm? It doesn't seem that way?

@JereSalo
Copy link
Contributor Author

JereSalo commented Jan 2, 2025

Is this specific to levm? It doesn't seem that way?

This change is specific to LEVM because withdrawal processing was working right with REVM.
The main difference is that LEVM implementation doesn't update the db, it just computes AccountUpdates and after the whole execution we update the database outside of execute_block(). I still have to see what we want the execute_block function to do, my goal was to return AccountUpdates alongside Receipts and after that update the state.
This is a quick fix for the hive tests but I think that I'll have to make some changes to the add_block and execute_block functions so that we can use them indistinctively.

@JereSalo JereSalo marked this pull request as ready for review January 2, 2025 15:02
@JereSalo JereSalo requested a review from a team as a code owner January 2, 2025 15:02
crates/vm/vm.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@maximopalopoli maximopalopoli left a comment

Choose a reason for hiding this comment

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

LGTM, left you some comments:

crates/vm/vm.rs Outdated
(withdrawal.amount as u128 * GWEI_TO_WEI as u128),
)
})
.collect::<Vec<_>>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we specify the type when declaring balance_increments to avoid using ::<Vec<_>>? Or do you think the current way of doing it is better?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also in my opinion it would be good to avoid "as" conversions, and use from, or try_from if necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@ilitteri ilitteri left a comment

Choose a reason for hiding this comment

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

LGTM

@ilitteri ilitteri enabled auto-merge January 2, 2025 15:47
@ilitteri ilitteri disabled auto-merge January 2, 2025 15:49
@ilitteri ilitteri enabled auto-merge January 2, 2025 15:53
@ilitteri ilitteri added this pull request to the merge queue Jan 2, 2025
Merged via the queue into main with commit f361556 Jan 2, 2025
18 checks passed
@ilitteri ilitteri deleted the levm/fix_withdrawals branch January 2, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
levm Lambda EVM implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants