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

ConcurrentState #66

Merged
merged 9 commits into from
Dec 16, 2024
Merged

ConcurrentState #66

merged 9 commits into from
Dec 16, 2024

Conversation

prestwich
Copy link
Contributor

Adds a concurrently accessible version of the State<Db> from Revm. This manages a cache that can be updated by multiple threads via dashmap and an rwlock. The transitions can NOT be shared and require &mut self. The idea is that we should Arc it and then drop the users and use Arc::get_mut to manage transitions

@prestwich prestwich self-assigned this Dec 2, 2024
@prestwich prestwich force-pushed the prestwich/sync-state branch 3 times, most recently from 51cfb76 to 506dcc1 Compare December 2, 2024 02:35
@prestwich prestwich force-pushed the prestwich/sync-state branch from 4a8857c to 0cdc489 Compare December 2, 2024 02:45
@Evalir Evalir self-requested a review December 2, 2024 14:15
Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

So this seems sound to me, as dashmap does a lot of the heavy lifting here and allows us to Arc this easily, and we're concentrating on concurrent reads.

/// ## Panics
///
/// If the State has not been built with StateBuilder::with_bundle_update.
/// If the State has not been built with
Copy link
Contributor Author

@prestwich prestwich Dec 3, 2024

Choose a reason for hiding this comment

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

this is a drive-by docs-only change. underlying revm behavior changed

@prestwich prestwich merged commit b0c340d into main Dec 16, 2024
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