synchronized void checkState(
      final ChainHead localChain,
      final Optional<ChainHeadEstimate> syncTargetChain,
      final Optional<ChainHeadEstimate> bestPeerChain) {
    final boolean currentSyncStatus =
        currentSyncStatus(localChain, syncTargetChain, bestPeerChain).orElse(true);

    final InSyncState newState = InSyncState.fromInSync(currentSyncStatus);
    if (state != newState) {
      // Sync status has changed, notify listener
      state = newState;
      state.ifKnown(listener::onInSyncStatusChange);
    }
  }
Tracks the sync status of this node within the specified {@code syncTolerance}.
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/state/InSyncTracker.java