diff --git a/substrate/client/informant/src/display.rs b/substrate/client/informant/src/display.rs index 2f10130722..722cf56d77 100644 --- a/substrate/client/informant/src/display.rs +++ b/substrate/client/informant/src/display.rs @@ -98,25 +98,36 @@ impl InformantDisplay { let (level, status, target) = match (sync_status.state, sync_status.state_sync, sync_status.warp_sync) { + // Do not set status to "Block history" when we are doing a major sync. + // + // A node could for example have been warp synced to the tip of the chain and + // shutdown. At the next start we still need to download the block history, but + // first will sync to the tip of the chain. ( - _, + sync_status, _, Some(WarpSyncProgress { phase: WarpSyncPhase::DownloadingBlocks(n), .. }), - ) => ("⏩", "Block history".into(), format!(", #{}", n)), + ) if !sync_status.is_major_syncing() => ("⏩", "Block history".into(), format!(", #{}", n)), ( _, _, Some(WarpSyncProgress { phase: WarpSyncPhase::AwaitingTargetBlock, .. }), ) => ("⏩", "Waiting for pending target block".into(), "".into()), - (_, _, Some(warp)) => ( - "⏩", - "Warping".into(), - format!( - ", {}, {:.2} Mib", + // Handle all phases besides the two phases we already handle above. + (_, _, Some(warp)) + if !matches!( warp.phase, - (warp.total_bytes as f32) / (1024f32 * 1024f32) + WarpSyncPhase::AwaitingTargetBlock | WarpSyncPhase::DownloadingBlocks(_) + ) => + ( + "⏩", + "Warping".into(), + format!( + ", {}, {:.2} Mib", + warp.phase, + (warp.total_bytes as f32) / (1024f32 * 1024f32) + ), ), - ), (_, Some(state), _) => ( "⚙️ ", "Downloading state".into(),