mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 12:11:59 +00:00
Make more noise when the EL is broken (#3986)
## Issue Addressed Closes #3814, replaces #3818. ## Proposed Changes * Add a WARN log for the case where we are attempting to sync chain segments but can't process them because they're building on an invalid parent. The most common case where we see this is when the execution node database is corrupt, causing sync to stall mysteriously (because we're currently logging the failure only at debug level). * Additionally I've bumped up the logging for invalid execution payloads to `WARN`. This may result in some duplicate logs as we log errors from the `beacon_chain` and then again from the beacon processor. Invalid payloads and corrupt DBs _should_ be rare enough that this doesn't produce overwhelming log volume.
This commit is contained in:
@@ -834,7 +834,6 @@ impl<T: BeaconChainTypes> Worker<T> {
|
||||
| Err(e @ BlockError::WeakSubjectivityConflict)
|
||||
| Err(e @ BlockError::InconsistentFork(_))
|
||||
| Err(e @ BlockError::ExecutionPayloadError(_))
|
||||
// TODO(merge): reconsider peer scoring for this event.
|
||||
| Err(e @ BlockError::ParentExecutionPayloadInvalid { .. })
|
||||
| Err(e @ BlockError::GenesisBlock) => {
|
||||
warn!(self.log, "Could not verify block for gossip. Rejecting the block";
|
||||
|
||||
@@ -513,6 +513,21 @@ impl<T: BeaconChainTypes> Worker<T> {
|
||||
})
|
||||
}
|
||||
}
|
||||
ref err @ BlockError::ParentExecutionPayloadInvalid { ref parent_root } => {
|
||||
warn!(
|
||||
self.log,
|
||||
"Failed to sync chain built on invalid parent";
|
||||
"parent_root" => ?parent_root,
|
||||
"advice" => "check execution node for corruption then restart it and Lighthouse",
|
||||
);
|
||||
Err(ChainSegmentFailed {
|
||||
message: format!("Peer sent invalid block. Reason: {err:?}"),
|
||||
// We need to penalise harshly in case this represents an actual attack. In case
|
||||
// of a faulty EL it will usually require manual intervention to fix anyway, so
|
||||
// it's not too bad if we drop most of our peers.
|
||||
peer_action: Some(PeerAction::LowToleranceError),
|
||||
})
|
||||
}
|
||||
other => {
|
||||
debug!(
|
||||
self.log, "Invalid block received";
|
||||
|
||||
Reference in New Issue
Block a user