Skip to content

Commit

Permalink
chore: do not warn when the chain is syncing normally (#4458)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected authored Sep 2, 2023
1 parent 6bb94af commit 19e03ee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/consensus/beacon/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,11 +914,11 @@ where
error: Error,
) -> PayloadStatus {
debug_assert!(self.sync.is_pipeline_idle(), "pipeline must be idle");
warn!(target: "consensus::engine", ?error, ?state, "Failed to canonicalize the head hash");

// check if the new head was previously invalidated, if so then we deem this FCU
// as invalid
if let Some(invalid_ancestor) = self.check_invalid_ancestor(state.head_block_hash) {
warn!(target: "consensus::engine", ?error, ?state, ?invalid_ancestor, head=?state.head_block_hash, "Failed to canonicalize the head hash, head is also considered invalid");
debug!(target: "consensus::engine", head=?state.head_block_hash, current_error=?error, "Head was previously marked as invalid");
return invalid_ancestor
}
Expand All @@ -930,12 +930,19 @@ where
..
}),
) => {
warn!(target: "consensus::engine", ?error, ?state, "Failed to canonicalize the head hash");
return PayloadStatus::from_status(PayloadStatusEnum::Invalid {
validation_error: error.to_string(),
})
.with_latest_valid_hash(H256::zero())
}
Error::Execution(BlockExecutionError::BlockHashNotFoundInChain { .. }) => {
// This just means we couldn't find the block when attempting to make it canonical,
// so we should not warn the user, since this will result in us attempting to sync
// to a new target and is considered normal operation during sync
}
_ => {
warn!(target: "consensus::engine", ?error, ?state, "Failed to canonicalize the head hash");
// TODO(mattsse) better error handling before attempting to sync (FCU could be
// invalid): only trigger sync if we can't determine whether the FCU is invalid
}
Expand Down Expand Up @@ -976,6 +983,7 @@ where
self.sync.download_full_block(target);
}

debug!(target: "consensus::engine", ?target, "Syncing to new target");
PayloadStatus::from_status(PayloadStatusEnum::Syncing)
}

Expand Down

0 comments on commit 19e03ee

Please sign in to comment.