Skip to content

fix(l2): fixes and cleanup of to_execution_db()#2482

Merged
jrchatruc merged 4 commits into
mainfrom
l2/fix-to-exec-db
Apr 21, 2025
Merged

fix(l2): fixes and cleanup of to_execution_db()#2482
jrchatruc merged 4 commits into
mainfrom
l2/fix-to-exec-db

Conversation

@xqft

@xqft xqft commented Apr 16, 2025

Copy link
Copy Markdown
Contributor

Motivation

Prover's execution was failing because of wrong data in the ExecutionDB. There were also some cases where data was missing but the current tests didn't catch it.

Description

  • fixes saving final storage values instead of initial ones.
  • fixes saving only touched storage values, instead of read ones too.
  • removes unused new_store
  • simplifies code

@xqft xqft requested a review from a team as a code owner April 16, 2025 14:13
@github-actions

github-actions Bot commented Apr 16, 2025

Copy link
Copy Markdown

Lines of code report

Total lines added: 0
Total lines removed: 49
Total lines changed: 49

Detailed view
+---------------------------------------+-------+------+
| File                                  | Lines | Diff |
+---------------------------------------+-------+------+
| ethrex/crates/vm/backends/levm/db.rs  | 214   | -1   |
+---------------------------------------+-------+------+
| ethrex/crates/vm/backends/levm/mod.rs | 642   | -48  |
+---------------------------------------+-------+------+

@xqft

xqft commented Apr 16, 2025

Copy link
Copy Markdown
Contributor Author

I'm not sure yet if "written" values (the ones included in execution_updates) are included in the "accessed" values set, if so then the function could be simplified a lot, but that depends in the LEVM implementation (if it always calls a getter for an updated value), so for now the function chains both sets and gets every value.

@tomip01 tomip01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

@jrchatruc jrchatruc added this pull request to the merge queue Apr 21, 2025
Merged via the queue into main with commit 05c0508 Apr 21, 2025
@jrchatruc jrchatruc deleted the l2/fix-to-exec-db branch April 21, 2025 18:17
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
**Motivation**

Prover's execution was failing because of wrong data in the ExecutionDB.
There were also some cases where data was missing but the current tests
didn't catch it.

**Description**

- fixes saving final storage values instead of initial ones.
- fixes saving only touched storage values, instead of read ones too.
- removes unused `new_store`
- simplifies code
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