fix(root): send error on failure to retrieve provider (#13426)

This commit is contained in:
Roman Krasiuk
2024-12-17 15:39:25 +01:00
committed by GitHub
parent 30d48cc97f
commit abc4ff9779
3 changed files with 7 additions and 7 deletions

1
Cargo.lock generated
View File

@ -7406,7 +7406,6 @@ dependencies = [
"reth-errors",
"reth-ethereum-engine-primitives",
"reth-evm",
"reth-execution-errors",
"reth-exex-types",
"reth-metrics",
"reth-network-p2p",

View File

@ -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

View File

@ -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,
@ -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
@ -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;
}
};
@ -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()));
}
}
});