Skip to content

feat: cow #93

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

Merged
merged 5 commits into from
Mar 27, 2025
Merged

feat: cow #93

merged 5 commits into from
Mar 27, 2025

Conversation

prestwich
Copy link
Member

Cache-on-write database. Like CacheDb, but only caches via DatabaseCommit. this prevents cache duplication when wrapping another caching DB like State

@prestwich prestwich self-assigned this Mar 20, 2025
@prestwich
Copy link
Member Author

should go in after #94 , will need significant updates

self.cache.insert_contract(&mut account.info);

let db_account = self.cache.accounts.entry(address).or_default();
db_account.info = account.info;
Copy link
Member

Choose a reason for hiding this comment

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

I assume this is safe even in the SelfDestructed case?

Copy link
Member Author

Choose a reason for hiding this comment

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

this code is reproduced from revm directly. which reminds me i need to add a note and a copyright notice

Copy link
Member Author

Choose a reason for hiding this comment

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

done 🫡

@prestwich prestwich enabled auto-merge (squash) March 27, 2025 11:36
@prestwich prestwich merged commit 247e156 into main Mar 27, 2025
5 checks passed
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