feat(trie): integrate TrieInput into ParallelStateRoot & AsyncStateRoot (#10930)

This commit is contained in:
Roman Krasiuk
2024-09-16 12:05:16 +02:00
committed by GitHub
parent 06dbd3a610
commit 605b93a205
6 changed files with 71 additions and 94 deletions

View File

@ -11,6 +11,7 @@ use reth_provider::{
use reth_tasks::pool::BlockingTaskPool;
use reth_trie::{
hashed_cursor::HashedPostStateCursorFactory, HashedPostState, HashedStorage, StateRoot,
TrieInput,
};
use reth_trie_db::{DatabaseHashedCursorFactory, DatabaseStateRoot};
use reth_trie_parallel::{async_root::AsyncStateRoot, parallel_root::ParallelStateRoot};
@ -65,9 +66,7 @@ pub fn calculate_state_root(c: &mut Criterion) {
|| {
ParallelStateRoot::new(
view.clone(),
Default::default(),
updated_state.clone(),
updated_state.construct_prefix_sets().freeze(),
TrieInput::from_state(updated_state.clone()),
)
},
|calculator| async { calculator.incremental_root() },
@ -81,9 +80,7 @@ pub fn calculate_state_root(c: &mut Criterion) {
AsyncStateRoot::new(
view.clone(),
blocking_pool.clone(),
Default::default(),
updated_state.clone(),
updated_state.construct_prefix_sets().freeze(),
TrieInput::from_state(updated_state.clone()),
)
},
|calculator| calculator.incremental_root(),