mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
Improve parent lookup logging (#5451)
* upgrade parent lookup result processing logs to debug, use display instead of debug for BlockError in case a blob parent unknown error is hit, add block root to BlockIsAlreadyKnown * fix compile * fix compile * fix compile
This commit is contained in:
@@ -811,7 +811,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
||||
let root = lookup.block_root();
|
||||
trace!(self.log, "Single block processing failed"; "block" => %root, "error" => %e);
|
||||
match e {
|
||||
BlockError::BlockIsAlreadyKnown => {
|
||||
BlockError::BlockIsAlreadyKnown(_) => {
|
||||
// No error here
|
||||
return Ok(None);
|
||||
}
|
||||
@@ -898,17 +898,17 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
||||
match &result {
|
||||
BlockProcessingResult::Ok(status) => match status {
|
||||
AvailabilityProcessingStatus::Imported(block_root) => {
|
||||
trace!(self.log, "Parent block processing succeeded"; &parent_lookup, "block_root" => ?block_root)
|
||||
debug!(self.log, "Parent block processing succeeded"; &parent_lookup, "block_root" => ?block_root)
|
||||
}
|
||||
AvailabilityProcessingStatus::MissingComponents(_, block_root) => {
|
||||
trace!(self.log, "Parent missing parts, triggering single block lookup "; &parent_lookup,"block_root" => ?block_root)
|
||||
debug!(self.log, "Parent missing parts, triggering single block lookup "; &parent_lookup,"block_root" => ?block_root)
|
||||
}
|
||||
},
|
||||
BlockProcessingResult::Err(e) => {
|
||||
trace!(self.log, "Parent block processing failed"; &parent_lookup, "error" => %e)
|
||||
debug!(self.log, "Parent block processing failed"; &parent_lookup, "error" => %e)
|
||||
}
|
||||
BlockProcessingResult::Ignored => {
|
||||
trace!(
|
||||
debug!(
|
||||
self.log,
|
||||
"Parent block processing job was ignored";
|
||||
"action" => "re-requesting block",
|
||||
@@ -954,7 +954,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
||||
self.request_parent(parent_lookup, cx);
|
||||
}
|
||||
BlockProcessingResult::Ok(AvailabilityProcessingStatus::Imported(_))
|
||||
| BlockProcessingResult::Err(BlockError::BlockIsAlreadyKnown { .. }) => {
|
||||
| BlockProcessingResult::Err(BlockError::BlockIsAlreadyKnown(_)) => {
|
||||
// Check if the beacon processor is available
|
||||
let Some(beacon_processor) = cx.beacon_processor_if_enabled() else {
|
||||
return trace!(
|
||||
|
||||
@@ -458,7 +458,11 @@ fn test_parent_lookup_happy_path() {
|
||||
rig.expect_empty_network();
|
||||
|
||||
// Processing succeeds, now the rest of the chain should be sent for processing.
|
||||
bl.parent_block_processed(chain_hash, BlockError::BlockIsAlreadyKnown.into(), &mut cx);
|
||||
bl.parent_block_processed(
|
||||
chain_hash,
|
||||
BlockError::BlockIsAlreadyKnown(block_root).into(),
|
||||
&mut cx,
|
||||
);
|
||||
rig.expect_parent_chain_process();
|
||||
let process_result = BatchProcessResult::Success {
|
||||
was_non_empty: true,
|
||||
@@ -1117,7 +1121,11 @@ fn test_same_chain_race_condition() {
|
||||
// the processing result
|
||||
if i + 2 == depth {
|
||||
// one block was removed
|
||||
bl.parent_block_processed(chain_hash, BlockError::BlockIsAlreadyKnown.into(), &mut cx)
|
||||
bl.parent_block_processed(
|
||||
chain_hash,
|
||||
BlockError::BlockIsAlreadyKnown(block.canonical_root()).into(),
|
||||
&mut cx,
|
||||
)
|
||||
} else {
|
||||
bl.parent_block_processed(
|
||||
chain_hash,
|
||||
|
||||
Reference in New Issue
Block a user