public static boolean isInSync(
      final ChainHead localChain, final ChainHeadEstimate remoteChain, final long syncTolerance) {
    final boolean inSyncByHeight =
        remoteChain.getEstimatedHeight() - localChain.getHeight() <= syncTolerance;
    return inSyncByHeight || !remoteChain.chainIsBetterThan(localChain);
  }
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