mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Log range sync download errors (#6991)
Currently range sync download log errors just say `error: rpc_error` which isn't helpful. The actual error is suppressed unless logged somewhere else. Log the actual error that caused the batch download to fail as part of the log that states that the batch download failed.
This commit is contained in:
@@ -10,8 +10,7 @@
|
|||||||
|
|
||||||
use crate::network_beacon_processor::ChainSegmentProcessId;
|
use crate::network_beacon_processor::ChainSegmentProcessId;
|
||||||
use crate::sync::manager::BatchProcessResult;
|
use crate::sync::manager::BatchProcessResult;
|
||||||
use crate::sync::network_context::RangeRequestId;
|
use crate::sync::network_context::{RangeRequestId, RpcResponseError, SyncNetworkContext};
|
||||||
use crate::sync::network_context::SyncNetworkContext;
|
|
||||||
use crate::sync::range_sync::{
|
use crate::sync::range_sync::{
|
||||||
BatchConfig, BatchId, BatchInfo, BatchOperationOutcome, BatchProcessingResult, BatchState,
|
BatchConfig, BatchId, BatchInfo, BatchOperationOutcome, BatchProcessingResult, BatchState,
|
||||||
};
|
};
|
||||||
@@ -375,6 +374,7 @@ impl<T: BeaconChainTypes> BackFillSync<T> {
|
|||||||
batch_id: BatchId,
|
batch_id: BatchId,
|
||||||
peer_id: &PeerId,
|
peer_id: &PeerId,
|
||||||
request_id: Id,
|
request_id: Id,
|
||||||
|
err: RpcResponseError,
|
||||||
) -> Result<(), BackFillError> {
|
) -> Result<(), BackFillError> {
|
||||||
if let Some(batch) = self.batches.get_mut(&batch_id) {
|
if let Some(batch) = self.batches.get_mut(&batch_id) {
|
||||||
// A batch could be retried without the peer failing the request (disconnecting/
|
// A batch could be retried without the peer failing the request (disconnecting/
|
||||||
@@ -385,7 +385,7 @@ impl<T: BeaconChainTypes> BackFillSync<T> {
|
|||||||
if !batch.is_expecting_block(&request_id) {
|
if !batch.is_expecting_block(&request_id) {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
debug!(batch_epoch = %batch_id, error = "rpc_error", "Batch failed");
|
debug!(batch_epoch = %batch_id, error = ?err, "Batch download failed");
|
||||||
if let Some(active_requests) = self.active_requests.get_mut(peer_id) {
|
if let Some(active_requests) = self.active_requests.get_mut(peer_id) {
|
||||||
active_requests.remove(&batch_id);
|
active_requests.remove(&batch_id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1288,7 +1288,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(_) => match range_request_id.requester {
|
Err(e) => match range_request_id.requester {
|
||||||
RangeRequestId::RangeSync { chain_id, batch_id } => {
|
RangeRequestId::RangeSync { chain_id, batch_id } => {
|
||||||
self.range_sync.inject_error(
|
self.range_sync.inject_error(
|
||||||
&mut self.network,
|
&mut self.network,
|
||||||
@@ -1296,16 +1296,22 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
|||||||
batch_id,
|
batch_id,
|
||||||
chain_id,
|
chain_id,
|
||||||
range_request_id.id,
|
range_request_id.id,
|
||||||
|
e,
|
||||||
);
|
);
|
||||||
self.update_sync_state();
|
self.update_sync_state();
|
||||||
}
|
}
|
||||||
RangeRequestId::BackfillSync { batch_id } => match self
|
RangeRequestId::BackfillSync { batch_id } => {
|
||||||
.backfill_sync
|
match self.backfill_sync.inject_error(
|
||||||
.inject_error(&mut self.network, batch_id, &peer_id, range_request_id.id)
|
&mut self.network,
|
||||||
{
|
batch_id,
|
||||||
Ok(_) => {}
|
&peer_id,
|
||||||
Err(_) => self.update_sync_state(),
|
range_request_id.id,
|
||||||
},
|
e,
|
||||||
|
) {
|
||||||
|
Ok(_) => {}
|
||||||
|
Err(_) => self.update_sync_state(),
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use super::batch::{BatchInfo, BatchProcessingResult, BatchState};
|
|||||||
use super::RangeSyncType;
|
use super::RangeSyncType;
|
||||||
use crate::metrics;
|
use crate::metrics;
|
||||||
use crate::network_beacon_processor::ChainSegmentProcessId;
|
use crate::network_beacon_processor::ChainSegmentProcessId;
|
||||||
use crate::sync::network_context::RangeRequestId;
|
use crate::sync::network_context::{RangeRequestId, RpcResponseError};
|
||||||
use crate::sync::{network_context::SyncNetworkContext, BatchOperationOutcome, BatchProcessResult};
|
use crate::sync::{network_context::SyncNetworkContext, BatchOperationOutcome, BatchProcessResult};
|
||||||
use beacon_chain::block_verification_types::RpcBlock;
|
use beacon_chain::block_verification_types::RpcBlock;
|
||||||
use beacon_chain::BeaconChainTypes;
|
use beacon_chain::BeaconChainTypes;
|
||||||
@@ -879,6 +879,7 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
|
|||||||
batch_id: BatchId,
|
batch_id: BatchId,
|
||||||
peer_id: &PeerId,
|
peer_id: &PeerId,
|
||||||
request_id: Id,
|
request_id: Id,
|
||||||
|
err: RpcResponseError,
|
||||||
) -> ProcessingResult {
|
) -> ProcessingResult {
|
||||||
let batch_state = self.visualize_batch_state();
|
let batch_state = self.visualize_batch_state();
|
||||||
if let Some(batch) = self.batches.get_mut(&batch_id) {
|
if let Some(batch) = self.batches.get_mut(&batch_id) {
|
||||||
@@ -901,9 +902,10 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
|
|||||||
debug!(
|
debug!(
|
||||||
batch_epoch = %batch_id,
|
batch_epoch = %batch_id,
|
||||||
batch_state = ?batch.state(),
|
batch_state = ?batch.state(),
|
||||||
|
error = ?err,
|
||||||
%peer_id,
|
%peer_id,
|
||||||
%request_id,
|
%request_id,
|
||||||
"Batch failed. RPC Error"
|
"Batch download error"
|
||||||
);
|
);
|
||||||
if let Some(active_requests) = self.peers.get_mut(peer_id) {
|
if let Some(active_requests) = self.peers.get_mut(peer_id) {
|
||||||
active_requests.remove(&batch_id);
|
active_requests.remove(&batch_id);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ use super::chain_collection::{ChainCollection, SyncChainStatus};
|
|||||||
use super::sync_type::RangeSyncType;
|
use super::sync_type::RangeSyncType;
|
||||||
use crate::metrics;
|
use crate::metrics;
|
||||||
use crate::status::ToStatusMessage;
|
use crate::status::ToStatusMessage;
|
||||||
use crate::sync::network_context::SyncNetworkContext;
|
use crate::sync::network_context::{RpcResponseError, SyncNetworkContext};
|
||||||
use crate::sync::BatchProcessResult;
|
use crate::sync::BatchProcessResult;
|
||||||
use beacon_chain::block_verification_types::RpcBlock;
|
use beacon_chain::block_verification_types::RpcBlock;
|
||||||
use beacon_chain::{BeaconChain, BeaconChainTypes};
|
use beacon_chain::{BeaconChain, BeaconChainTypes};
|
||||||
@@ -348,10 +348,11 @@ where
|
|||||||
batch_id: BatchId,
|
batch_id: BatchId,
|
||||||
chain_id: ChainId,
|
chain_id: ChainId,
|
||||||
request_id: Id,
|
request_id: Id,
|
||||||
|
err: RpcResponseError,
|
||||||
) {
|
) {
|
||||||
// check that this request is pending
|
// check that this request is pending
|
||||||
match self.chains.call_by_id(chain_id, |chain| {
|
match self.chains.call_by_id(chain_id, |chain| {
|
||||||
chain.inject_error(network, batch_id, &peer_id, request_id)
|
chain.inject_error(network, batch_id, &peer_id, request_id, err)
|
||||||
}) {
|
}) {
|
||||||
Ok((removed_chain, sync_type)) => {
|
Ok((removed_chain, sync_type)) => {
|
||||||
if let Some((removed_chain, remove_reason)) = removed_chain {
|
if let Some((removed_chain, remove_reason)) = removed_chain {
|
||||||
|
|||||||
Reference in New Issue
Block a user