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

revm: Update account storage methods in CacheDB #171

Merged
merged 2 commits into from
Aug 12, 2022

Conversation

ngotchac
Copy link
Contributor

So this PR does 2 things in revm::CachDB:

  1. It updates the insert_account_storage so that it doesn't override the underlying account info
  2. It adds a new method replace_account_storage to completely replace the account storage

For (1), I don't actually know whether it was intentional to override the account info with the default (empty) value. I don't quite see when this would be useful.

For (2), it would be useful for implementing the StateOverride that's in geth, where there is an option to completely override the storage.

I added tests for both methods.

@rakita
Copy link
Member

rakita commented Aug 12, 2022

I added CacheDb as i needed utility for tests and didnt think about implication if it is used by others, but it has changed to something usable as foundry is relaying on it. Both changes make sense.

@onbjerg this shouldn't change anything major, but just wanted to notify you as it can has different side effect.

@rakita rakita merged commit a54ce98 into bluealloy:main Aug 12, 2022
@ngotchac ngotchac deleted the ngotchac/revm-cache-db branch August 12, 2022 16:05
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.

2 participants