Skip to content

Commit

Permalink
chore(tree): use MultiProofTargets for PrefetchProofs (#13717)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected authored Jan 9, 2025
1 parent 1f78b9e commit 986c754
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions crates/engine/tree/src/tree/root.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! State root task related functionality.
use alloy_primitives::{map::HashSet, Address};
use alloy_primitives::map::HashSet;
use derive_more::derive::Deref;
use rayon::iter::{ParallelBridge, ParallelIterator};
use reth_errors::{ProviderError, ProviderResult};
Expand Down Expand Up @@ -101,7 +101,7 @@ impl<Factory> StateRootConfig<Factory> {
#[derive(Debug)]
pub enum StateRootMessage<BPF: BlindedProviderFactory> {
/// Prefetch proof targets
PrefetchProofs(HashSet<Address>),
PrefetchProofs(MultiProofTargets),
/// New state update from transaction execution
StateUpdate(EvmState),
/// Proof calculation completed for a specific state update
Expand Down Expand Up @@ -340,21 +340,19 @@ where
fn on_prefetch_proof(
scope: &rayon::Scope<'env>,
config: StateRootConfig<Factory>,
targets: HashSet<Address>,
targets: MultiProofTargets,
fetched_proof_targets: &mut MultiProofTargets,
proof_sequence_number: u64,
state_root_message_sender: Sender<StateRootMessage<BPF>>,
thread_pool: Arc<rayon::ThreadPool>,
) {
let proof_targets =
targets.into_iter().map(|address| (keccak256(address), Default::default())).collect();
extend_multi_proof_targets_ref(fetched_proof_targets, &proof_targets);
extend_multi_proof_targets_ref(fetched_proof_targets, &targets);

Self::spawn_multiproof(
scope,
config,
Default::default(),
proof_targets,
targets,
proof_sequence_number,
state_root_message_sender,
thread_pool,
Expand Down

0 comments on commit 986c754

Please sign in to comment.