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

refactor(core): further decouple LEVM and rEVM implementations. #2179

Merged
merged 11 commits into from
Mar 10, 2025

Conversation

mpaulucci
Copy link
Collaborator

@mpaulucci mpaulucci commented Mar 7, 2025

Motivation
Separate code from LEVM and rEVM implementations and try not to expose rEVM specific logic outside of vm crate.

Description

  • Moved levm specific code to backends/levm/...
  • Moved revm specific coed to backens/revm/...

@mpaulucci mpaulucci requested a review from a team as a code owner March 7, 2025 18:54
Copy link

github-actions bot commented Mar 7, 2025

Lines of code report

Total lines added: 1954
Total lines removed: 453
Total lines changed: 2407

Detailed view
+----------------------------------------------------+-------+------+
| File                                               | Lines | Diff |
+----------------------------------------------------+-------+------+
| ethrex/cmd/ef_tests/state/utils.rs                 | 77    | +3   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/bench/src/rpc/db.rs        | 416   | +3   |
+----------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/eth/transaction.rs    | 578   | +2   |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/levm/db.rs               | 40    | +40  |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/levm/mod.rs              | 436   | +436 |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/mod.rs                   | 296   | +61  |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/revm/db.rs               | 320   | +320 |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/revm/execution_db.rs     | 175   | +175 |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/revm/execution_result.rs | 116   | +116 |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/revm/helpers.rs          | 93    | +93  |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/revm/mod.rs              | 655   | +655 |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/revm/mods.rs             | 38    | +38  |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/constants.rs                      | 12    | +12  |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/db.rs                             | 7     | -359 |
+----------------------------------------------------+-------+------+
| ethrex/crates/vm/vm.rs                             | 35    | -94  |
+----------------------------------------------------+-------+------+

@mpaulucci mpaulucci enabled auto-merge March 10, 2025 10:26
@mpaulucci mpaulucci added this pull request to the merge queue Mar 10, 2025
Merged via the queue into main with commit 678bc05 Mar 10, 2025
20 checks passed
@mpaulucci mpaulucci deleted the decouple-levm-revm-2 branch March 10, 2025 11:05
github-merge-queue bot pushed a commit that referenced this pull request Mar 14, 2025
**Motivation**

- When executing ethereum/rpc simulation with LEVM we have errors in a
lot of tests. The error is when executing the blocks for the setup for
these tests and how we created the withdrawals requests introduced in
EIP-7002

**Description**
- First, when we execute the transactions, we weren't handling if the
account was delegated and we weren't using the correct bytecode.
For this, we add the check for delegated accounts and get the bytecode.
This is made when creating a new VM and using the function
`eip7702_get_code()`.
- Second, when creating the withdrawals requests, we were overwritting
and loosing some of the new values in the account updates. We now merge
both updates.
- When running the system contract for the withdrawals requests
introduced in EIP 7002, we were creating a new `CacheDB` instead of
using the one with updated values.

**Status**

- All RPC Hive tests were passing, but with the changed made
[here](#2179), 12 are failing
due to a new missing implementation.

Links to #2158

---------

Co-authored-by: Tomás Paradelo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants