Skip to content

Commit

Permalink
fix(root): send error on failure to retrieve provider
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk committed Dec 17, 2024
1 parent 30d48cc commit 7a03aed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/engine/tree/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ reth-consensus.workspace = true
reth-engine-primitives.workspace = true
reth-errors.workspace = true
reth-evm.workspace = true
reth-execution-errors.workspace = true
reth-network-p2p.workspace = true
reth-payload-builder-primitives.workspace = true
reth-payload-builder.workspace = true
Expand Down
12 changes: 7 additions & 5 deletions crates/engine/tree/src/tree/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
use alloy_primitives::map::HashSet;
use rayon::iter::{ParallelBridge, ParallelIterator};
use reth_errors::ProviderError;
use reth_evm::system_calls::OnStateHook;
use reth_execution_errors::StateProofError;
use reth_provider::{
providers::ConsistentDbView, BlockReader, DBProvider, DatabaseProviderFactory,
StateCommitmentProvider,
Expand Down Expand Up @@ -89,7 +89,7 @@ pub enum StateRootMessage<BPF: BlindedProviderFactory> {
/// Proof calculation completed for a specific state update
ProofCalculated(Box<ProofCalculated>),
/// Error during proof calculation
ProofCalculationError(StateProofError),
ProofCalculationError(ProviderError),
/// State root calculation completed
RootCalculated {
/// The updated sparse trie
Expand Down Expand Up @@ -346,6 +346,8 @@ where
Ok(provider) => provider,
Err(error) => {
error!(target: "engine::root", ?error, "Could not get provider");
let _ = state_root_message_sender
.send(StateRootMessage::ProofCalculationError(error));
return;
}
};
Expand All @@ -368,9 +370,9 @@ where
}),
));
}
Err(e) => {
let _ =
state_root_message_sender.send(StateRootMessage::ProofCalculationError(e));
Err(error) => {
let _ = state_root_message_sender
.send(StateRootMessage::ProofCalculationError(error.into()));
}
}
});
Expand Down

0 comments on commit 7a03aed

Please sign in to comment.