diff --git a/src/Nethermind/Nethermind.Synchronization/ParallelSync/MultiSyncModeSelector.cs b/src/Nethermind/Nethermind.Synchronization/ParallelSync/MultiSyncModeSelector.cs index a9f92bcbaef..9ab19492cd6 100644 --- a/src/Nethermind/Nethermind.Synchronization/ParallelSync/MultiSyncModeSelector.cs +++ b/src/Nethermind/Nethermind.Synchronization/ParallelSync/MultiSyncModeSelector.cs @@ -416,6 +416,14 @@ private bool ShouldBeInFastSyncMode(Snapshot best) notHasJustStartedFullSync && notNeedToWaitForHeaders; + if (_logger.IsInfo && _syncProgressResolver.IsSnapGetRangesFinished()) + { + LogDetailedSyncModeChecks("FAST", + (nameof(notReachedFullSyncTransition), notReachedFullSyncTransition), + (nameof(notInAStickyFullSync), notInAStickyFullSync), + (nameof(notHasJustStartedFullSync), notHasJustStartedFullSync)); + } + if (_logger.IsTrace) { LogDetailedSyncModeChecks("FAST", @@ -460,6 +468,17 @@ private bool ShouldBeInFullSyncMode(Snapshot best) stateSyncFinished && notNeedToWaitForHeaders; + if (_logger.IsInfo && _syncProgressResolver.IsSnapGetRangesFinished()) + { + LogDetailedSyncModeChecks("FULL", + (nameof(postPivotPeerAvailable), postPivotPeerAvailable), + (nameof(hasFastSyncBeenActive), hasFastSyncBeenActive), + (nameof(notInFastSync), notInFastSync), + (nameof(notInStateSync), notInStateSync), + (nameof(stateSyncFinished), stateSyncFinished)); + } + + if (_logger.IsTrace) { LogDetailedSyncModeChecks("FULL", @@ -607,6 +626,15 @@ private bool ShouldBeInStateSyncMode(Snapshot best) notInAStickyFullSync && notNeedToWaitForHeaders; + if (_logger.IsInfo && _syncProgressResolver.IsSnapGetRangesFinished()) + { + LogDetailedSyncModeChecks("STATE", + ($"{nameof(notInFastSync)}||{nameof(stickyStateNodes)}", notInFastSync || stickyStateNodes), + (nameof(stateNotDownloadedYet), stateNotDownloadedYet), + (nameof(notInAStickyFullSync), notInAStickyFullSync), + (nameof(notHasJustStartedFullSync), notHasJustStartedFullSync)); + } + if (_logger.IsTrace) { LogDetailedSyncModeChecks("STATE", @@ -632,6 +660,13 @@ private bool ShouldBeInStateNodesMode(Snapshot best) bool result = isInStateSync && (snapSyncDisabled || snapRangesFinished); + if (_logger.IsInfo && _syncProgressResolver.IsSnapGetRangesFinished()) + { + LogDetailedSyncModeChecks("STATE_NODES", + (nameof(isInStateSync), isInStateSync), + ($"{nameof(snapSyncDisabled)}||{nameof(snapRangesFinished)}", snapSyncDisabled || snapRangesFinished)); + } + if (_logger.IsTrace) { LogDetailedSyncModeChecks("STATE_NODES", @@ -780,7 +815,7 @@ private void LogDetailedSyncModeChecks(string syncType, params (string Name, boo bool result = checks.All(c => c.IsSatisfied); string text = $"{(result ? " * " : " ")}{syncType,-20}: yes({string.Join(", ", matched)}), no({string.Join(", ", failed)})"; - _logger.Trace(text); + _logger.Info(text); } private ref struct Snapshot