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(mpt): Simplify TrieDB #198

Merged
merged 1 commit into from
Jun 4, 2024
Merged

feat(mpt): Simplify TrieDB #198

merged 1 commit into from
Jun 4, 2024

Conversation

clabby
Copy link
Collaborator

@clabby clabby commented Jun 1, 2024

Overview

Simplifies TrieDB by assuming it will be wrapped with revm::State. The State handles the cache layer for in-memory accounts / storage, allowing the TrieDB to focus solely on caching open trie state and state root recomputation.

The State struct in revm is better for our usecase, since it allows for merging a BundleState after a full block's execution. The previous implementation had the fatal flaw having to recompute the state root every time the DatabaseCommit trait implementation was invoked, which was not suitable.

Examples of usage may be found within the rustdoc for TrieDB.

Copy link
Collaborator Author

clabby commented Jun 1, 2024

@clabby clabby self-assigned this Jun 1, 2024
@clabby clabby added A-mpt Area: kona-mpt crate K-feature Kind: feature labels Jun 1, 2024
@clabby clabby force-pushed the cl/trie-state branch 2 times, most recently from c46842f to e9e160a Compare June 1, 2024 22:26
@clabby clabby force-pushed the cl/trie-state branch 2 times, most recently from db8e6f9 to 222e7f9 Compare June 2, 2024 01:52
@clabby clabby requested a review from refcell June 2, 2024 05:53
Simplifies `TrieDB` by assuming it will be wrapped with
[`revm::State`](https://github.com/bluealloy/revm/blob/fadf6fbe43a3022c1406c0d8ee062a83e951d4d3/crates/revm/src/db/states/state.rs#L29).

The `State` struct in `revm` is better for our usecase, since it allows
for merging a `BundleState` after a full block's execution. The previous
implementation had the fatal flaw having to recompute the state root
every time the `DatabaseCommit` trait implementation was invoked, which
was not suitable.

Examples of usage may be found within the rustdoc for `TrieDB`.
@clabby clabby changed the base branch from cl/hide-recursive-params to main June 4, 2024 15:32
@clabby clabby added this pull request to the merge queue Jun 4, 2024
Merged via the queue into main with commit 3b6c4d8 Jun 4, 2024
13 checks passed
This was referenced Jun 4, 2024
@clabby clabby added this to the Phase 3: Kona Client & Host milestone Jun 11, 2024
This was referenced Jun 11, 2024
@github-actions github-actions bot mentioned this pull request Jun 22, 2024
@clabby clabby deleted the cl/trie-state branch July 2, 2024 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mpt Area: kona-mpt crate K-feature Kind: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants