Skip to content

Commit

Permalink
use StateHookSender
Browse files Browse the repository at this point in the history
  • Loading branch information
fgimenez committed Dec 6, 2024
1 parent 0551393 commit 2fa2c24
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ use reth_revm::database::StateProviderDatabase;
use reth_stages_api::ControlFlow;
use reth_trie::{
updates::{StorageTrieUpdates, TrieUpdates},
HashedPostState, Nibbles, TrieInput,
Nibbles, TrieInput,
};
use reth_trie_parallel::root::{ParallelStateRoot, ParallelStateRootError};
use revm_primitives::EvmState;
use root::{StateRootConfig, StateRootMessage, StateRootTask};
use root::{StateHookSender, StateRootConfig, StateRootMessage, StateRootTask};
use std::{
cmp::Ordering,
collections::{btree_map, hash_map, BTreeMap, VecDeque},
Expand Down Expand Up @@ -2234,8 +2234,9 @@ where
let state_root_task =
StateRootTask::new(state_root_config, state_root_tx.clone(), state_root_rx);
let state_root_handle = state_root_task.spawn();
let state_hook_sender = StateHookSender::new(state_root_tx);
let state_hook = move |state: &EvmState| {
let _ = state_root_tx.send(StateRootMessage::StateUpdate(state.clone()));
let _ = state_hook_sender.send(StateRootMessage::StateUpdate(state.clone()));
};

let output = self.metrics.executor.execute_metered(
Expand Down Expand Up @@ -2836,7 +2837,7 @@ mod tests {
use reth_primitives::{BlockExt, EthPrimitives};
use reth_provider::test_utils::MockEthProvider;
use reth_rpc_types_compat::engine::{block_to_payload_v1, payload::block_to_payload_v3};
use reth_trie::updates::TrieUpdates;
use reth_trie::{updates::TrieUpdates, HashedPostState};
use std::{
str::FromStr,
sync::mpsc::{channel, Sender},
Expand Down

0 comments on commit 2fa2c24

Please sign in to comment.