Skip to content

Commit

Permalink
chore: add warn logs for fork delegations (#7073)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Feb 10, 2024
1 parent e5f63a2 commit 68c673b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions crates/anvil/src/eth/backend/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1892,10 +1892,10 @@ impl Backend {
}

if let Some(fork) = self.get_fork() {
return fork
.debug_trace_transaction(hash, opts)
.await
.map_err(|_| BlockchainError::DataUnavailable)
return fork.debug_trace_transaction(hash, opts).await.map_err(|err| {
warn!(target: "backend", "error delegating debug_traceTransaction: {:?}", err);
BlockchainError::DataUnavailable
})
}

Ok(GethTrace::Default(Default::default()))
Expand All @@ -1921,7 +1921,10 @@ impl Backend {

if let Some(fork) = self.get_fork() {
if fork.predates_fork(number) {
return fork.trace_block(number).await.map_err(|_| BlockchainError::DataUnavailable)
return fork.trace_block(number).await.map_err(|err| {
warn!(target: "backend", "error delegating trace_block: {:?}", err);
BlockchainError::DataUnavailable
})
}
}

Expand Down

0 comments on commit 68c673b

Please sign in to comment.