-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
it seems that this code https://github.com/flashbots/op-rbuilder/blob/main/crates/op-rbuilder/src/builders/flashblocks/payload.rs#L1041
used the database to calculate state root. in reth's implementation, they used
fn overlay_root_from_nodes_with_updates(
tx: &'a TX,
input: TrieInput,
) -> Result<(B256, TrieUpdates), StateRootError> {
let state_sorted = input.state.into_sorted();
let nodes_sorted = input.nodes.into_sorted();
StateRoot::new(
InMemoryTrieCursorFactory::new(DatabaseTrieCursorFactory::new(tx), &nodes_sorted),
HashedPostStateCursorFactory::new(DatabaseHashedCursorFactory::new(tx), &state_sorted),
)
.with_prefix_sets(input.prefix_sets.freeze())
.root_with_updates()
}
which can used cached trie input. should this be optimized to same as how reth's doing it?
Metadata
Metadata
Assignees
Labels
No labels