4. Glue the bases of two given congruent regular tetrahedra together, precisely to form a hexahedron with all dihedral angles equal, and the length of the shortest edge of this hexahedron is 2. Then the distance between the farthest two vertices is $\qquad$
4. 3.

As shown in the figure, construct $CE \perp AD$, connect $EF$, it is easy to prove that $EF \perp AD$. Therefore, $\angle CEF$ is the plane angle of the dihedral angle formed by plane $ADF$ and plane $ACD$.

Let $G$ be the midpoint of $CD$. Similarly, $\angle AGB$ is the plane angle of the dihedral angle formed by plane $ACD$ and plane $BCD$.
D
Given that $\angle CEF = \angle AGB$.
Let the side length of the base $\triangle CDF$ be $2a$, and the length of the side $AD$ be $b$. In $\triangle ACD$, $CE \cdot b = AG \cdot 2a$.
Thus, $CE = \frac{AG \cdot 2a}{b} = \frac{\sqrt{b^2 - a^2} \cdot 2a}{b}$.
In $\triangle ABC$, it is easy to find that
$AB = 2 \sqrt{b^2 - \left(\frac{2}{3} \sqrt{3} a\right)^2} = 2 \sqrt{b^2 - \frac{4}{3} a^2}$.
Since $\triangle CEF \sim \triangle AGB$, we have $\frac{AB}{CF} = \frac{AG}{CE}$,
which means $\frac{2 \sqrt{b^2 - \frac{4}{3} a^2}}{2a} = \frac{\sqrt{b^2 - a^2}}{\frac{\sqrt{b^2 - a^2} \cdot 2a}{b}}$.
Thus, we find that $b = \frac{4}{3} a$.
Therefore, $b = 2$, and $2a = 3$.
Hence, the distance between the farthest two vertices is 3.