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

feat: State with account status #499

Merged
merged 76 commits into from
Aug 8, 2023
Merged

feat: State with account status #499

merged 76 commits into from
Aug 8, 2023

Conversation

rakita
Copy link
Member

@rakita rakita commented Jun 1, 2023

Model account states to cover all possible state that transaction can change it

Model can be found here
Old model
New model

And create cached/transition/bundle states that can easily create reverts on those states.

States interconnection can be seen here:

EVM State
(It has both original/present storage and new account and storage acts as a access list.)
|
|
V
[Cache State] Fetches data from database and get updated from EVM state. Allows us fewer layer to fetch data from database.
|        \
|         \
|          [Transitions State] contains changes related to transition (Mostly block). It has original account/storage/status (Needed for Loaded account). It is used for creating Reverts. 
|          |
|          V
|          [Bundle state] (It has Reverts and plain state, Original storage is not needed) One of reasons why this is the case, is because when reverting of canonical chain we can't get previous storage value. And it is not needed.
|       /
|    /
v
database

this is still WIP!

@rakita
Copy link
Member Author

rakita commented Aug 8, 2023

tests were checked locally.

@rakita rakita marked this pull request as ready for review August 8, 2023 22:43
Copy link
Member Author

@rakita rakita left a comment

Choose a reason for hiding this comment

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

This PR synced on 17M blocks so we can assume initial sync works as expected.

There are few more bugs found related to reverts (changesets in reth) that still need to be addressed

We are merging this code and will iterate on it so we can unblock other teams that depend on revm.

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.

1 participant