diff --git a/crates/cli/commands/src/stage/run.rs b/crates/cli/commands/src/stage/run.rs index 1fb2e2886ce9..254b5fe6483e 100644 --- a/crates/cli/commands/src/stage/run.rs +++ b/crates/cli/commands/src/stage/run.rs @@ -189,9 +189,15 @@ impl let fetch_client = Arc::new(network.fetch_client().await?); // Use `to` as the tip for the stage - let tip: P::BlockHeader = fetch_client - .get_header(BlockHashOrNumber::Number(self.to)) - .await? + let tip: P::BlockHeader = loop { + match fetch_client.get_header(BlockHashOrNumber::Number(self.to)).await { + Ok(header) => break header, + Err(error) if error.is_retryable() => { + warn!(target: "reth::cli", "Error requesting header: {error}. Retrying...") + } + Err(error) => return Err(error.into()), + } + } .into_data() .ok_or(StageError::MissingSyncGap)?; let (_, rx) = watch::channel(tip.hash_slow());