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 revert cases for contracts to run correctly #1090

Open
wants to merge 73 commits into
base: main
Choose a base branch
from

Conversation

JereSalo
Copy link
Contributor

@JereSalo JereSalo commented Nov 6, 2024

Motivation

Fix errors encountered when trying to execute solidity contracts with LEVM.

Description

  • Fixes gas consumption in transaction report -> This fix enables us to correclty execute a contract that triggers an OutOfGas
  • Balance substraction is now done after executing the contract code. It will be only performed if the execution result was successful. -> This fix enables us to run a contract that involves a transfer of value and reverts.

Disclaimer:

  • The PR could be improved because the code is pretty messy but I think there are other priorities right now so I didn't focus on coding it the best way possible. There are a few unwraps out there

Closes #issue_number

jrchatruc and others added 21 commits October 30, 2024 18:59
**Motivation**

<!-- Why does this pull request exist? What are its goals? -->
fix some things generic_call in l1 integration because of merge.

**Description**

<!-- A clear and concise general description of the changes this PR
introduces -->

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

Closes #issue_number
**Motivation**

<!-- Why does this pull request exist? What are its goals? -->

Eventually, we want to stop using revm and replace it with levm. The
integration is a work in progress in this PR
#1029.

This PR aims to be the first step. It aims to prepare the current
codebase so that both implementations can coexist while levm continues
to be developed and does not disturb the rest of the development. When
the time to remove revm comes, it'd be easier with this proposal since
it'd require removing the code under the #[cfg(not(feature = "levm"))]
and after that, to remove the feature flag definitively.

**Description**

<!-- A clear and concise general description of the changes this PR
introduces -->

- Adds the `levm` feature flag to the `vm` and `blockchain` packages,
and to the `ethereum_rust` binary.
- In `vm`, add `execute_block` implementation that uses `levm` and use
it when `levm` feature flag is set. Use the original implementation if
not.
- In `blockchain`, add `add_block` implementation that uses `levm` and
use it when `levm` feature flag is set. Use the original implementation
if not.

---------

Co-authored-by: Jeremías Salomón <[email protected]>
Co-authored-by: JereSalo <[email protected]>
@JereSalo JereSalo requested a review from a team as a code owner November 6, 2024 14:54
@JereSalo JereSalo added the levm Lambda EVM implementation label Nov 6, 2024
crates/vm/levm/src/vm.rs Outdated Show resolved Hide resolved
Base automatically changed from levm-ethereum-rust-integration to main November 6, 2024 20:30
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.

5 participants