diff --git a/beacon_node/network/src/beacon_processor/worker/sync_methods.rs b/beacon_node/network/src/beacon_processor/worker/sync_methods.rs index a27ba7bfa..3b2429ee9 100644 --- a/beacon_node/network/src/beacon_processor/worker/sync_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/sync_methods.rs @@ -7,10 +7,10 @@ use crate::beacon_processor::DuplicateCache; use crate::metrics; use crate::sync::manager::{BlockProcessType, SyncMessage}; use crate::sync::{BatchProcessResult, ChainId}; +use beacon_chain::CountUnrealized; use beacon_chain::{ BeaconChainError, BeaconChainTypes, BlockError, ChainSegmentResult, HistoricalBlockError, }; -use beacon_chain::{CountUnrealized, ExecutionPayloadError}; use lighthouse_network::PeerAction; use slog::{debug, error, info, warn}; use std::sync::Arc; @@ -467,24 +467,22 @@ impl Worker { mode: FailureMode::ConsensusLayer, }) } - BlockError::ExecutionPayloadError(e) => match &e { - ExecutionPayloadError::NoExecutionConnection { .. } - | ExecutionPayloadError::RequestFailed { .. } => { + ref err @ BlockError::ExecutionPayloadError(ref epe) => { + if !epe.penalize_peer() { // These errors indicate an issue with the EL and not the `ChainSegment`. // Pause the syncing while the EL recovers debug!(self.log, "Execution layer verification failed"; "outcome" => "pausing sync", - "err" => ?e + "err" => ?err ); Err(ChainSegmentFailed { - message: format!("Execution layer offline. Reason: {:?}", e), + message: format!("Execution layer offline. Reason: {:?}", err), // Do not penalize peers for internal errors. peer_action: None, mode: FailureMode::ExecutionLayer { pause_sync: true }, }) - } - err => { + } else { debug!(self.log, "Invalid execution payload"; "error" => ?err @@ -498,7 +496,7 @@ impl Worker { mode: FailureMode::ExecutionLayer { pause_sync: false }, }) } - }, + } other => { debug!( self.log, "Invalid block received";