Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

feat(mpt): Simplify TrieDB#198

Merged
clabby merged 1 commit intomainfrom
cl/trie-state
Jun 4, 2024
Merged

feat(mpt): Simplify TrieDB#198
clabby merged 1 commit intomainfrom
cl/trie-state

Conversation

@clabby
Copy link
Contributor

@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
Contributor Author

clabby commented Jun 1, 2024

@clabby clabby self-assigned this Jun 1, 2024
@clabby clabby added A-mpt K-feature Kind: feature labels Jun 1, 2024
@clabby clabby force-pushed the cl/hide-recursive-params branch from 5573789 to 92f9394 Compare June 1, 2024 22:05
@clabby clabby force-pushed the cl/hide-recursive-params branch from 92f9394 to 2901cba Compare June 1, 2024 22:09
@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/hide-recursive-params branch from 2901cba to 3dbcf50 Compare June 1, 2024 22:27
@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
@clabby clabby force-pushed the cl/hide-recursive-params branch from 3dbcf50 to c349b63 Compare June 3, 2024 22:50
@clabby clabby force-pushed the cl/hide-recursive-params branch from c349b63 to 9ff3949 Compare June 3, 2024 22:56
@clabby clabby force-pushed the cl/hide-recursive-params branch from 9ff3949 to ff35886 Compare June 4, 2024 15:12
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
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
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Dec 10, 2025
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`.
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 14, 2026
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`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

K-feature Kind: feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants