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:
Lion - dapplion
2025-03-13 10:26:43 -03:00
committed by GitHub
parent d60c24ef1c
commit a6bdc474db
4 changed files with 24 additions and 15 deletions

View File

@@ -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 } => {
self.range_sync.inject_error(
&mut self.network,
@@ -1296,16 +1296,22 @@ impl<T: BeaconChainTypes> SyncManager<T> {
batch_id,
chain_id,
range_request_id.id,
e,
);
self.update_sync_state();
}
RangeRequestId::BackfillSync { batch_id } => match self
.backfill_sync
.inject_error(&mut self.network, batch_id, &peer_id, range_request_id.id)
{
Ok(_) => {}
Err(_) => self.update_sync_state(),
},
RangeRequestId::BackfillSync { batch_id } => {
match self.backfill_sync.inject_error(
&mut self.network,
batch_id,
&peer_id,
range_request_id.id,
e,
) {
Ok(_) => {}
Err(_) => self.update_sync_state(),
}
}
},
}
}