Why does stability of $\varphi(x,y)$ imply that for the Shelah local-2-rank, $R_\varphi(x=x)$ is finite . I was reading Artem Chernikov's "Lecture notes on stability theory".
He defines Shelah's local-2-rank $R_{\Delta}$ (taking values in $\mathbb{N}\cup\{\pm \infty\}$) recursively. By definition, $R_\Delta(p) \ge 0$ if the type $p(x)$ is consistent, and $R_\Delta(p) \ge n + 1$ if for some $\Delta$-formula $\varphi(x,a)$ (with $a$ being a parameter), both $R_\Delta\left(p\cup\{\varphi\}\right)\ge n$ and $R_\Delta\left(p\cup\{\neg\varphi\}\right)\ge n$.
The text proceeds to prove (2.17) that a formula $\varphi(x, y)$ is stable (that is, satisfies the $m$-order property) iff $R_\varphi(x=x) < \infty$.
There is a part in the "only if" direction I am having trouble with. The idea is to show that for some set of parameters $B$, $\left|B\right| < \left|S_\varphi(B)\right|$ where $S_\varphi(B)$ is the set of $\{\varphi\}$-types over $B$. The proof goes:

Conversely, assume that the rank is infinite, then we can find an infinite tree of parameters $B = (B^\eta: \eta \in 2^{<\omega})$ such that for every $\eta \in 2\omega$ the set of formulas $\{\varphi^{\eta(i)}(x, b_{\eta \| i}): i<\omega\}$ is consistent (rank being $\ge k$ guarantees that we can find such a tree of height $k$, and then use compactness to find one of infinite height).

How is compactness used here? I couldn't fill in the details.

We can express the properties of the tree we want with a set $\Sigma$ of first-order formulas. Introduce a constant symbol $b_\sigma$ for every $\sigma \in 2^{<\omega}$. Then for every branch $\eta \in {}^2 \omega$ we can add formulas to $\Sigma$ saying that every finite part of that branch is consistent. That is, for every $n < \omega$ we add
$$
\exists x \bigwedge_{0 \leq i \leq n} \varphi^{\eta(i)}(x, b_{\eta |_i})
$$
to $\Sigma$.
Every finite part of $\Sigma$ will only say something about finitely many $b_\sigma$, say up to height $k$. Then using the assumption on the rank we can already build a tree of height $k$ (as the proof you quoted suggests). So $\Sigma$ is finitely consistent, and hence by compactness $\Sigma$ is consistent.
Any realisation of $\Sigma$ then assigns actual elements to the $b_\sigma$ such that $\{\varphi^{\eta(i)}(x, b_{\eta |_i}) : i < \omega\}$ is consistent for all branches $\eta \in {}^2 \omega$, as required.
