Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading