I've recently been trying to wrap my head around the notion of virtual particles, which as far as I understand live in quantum histories which can never be observed directly and which are not bound by certain laws of physics, but which may evolve into physically possible histories and thus produce a noticeable effect on the expectation value of quantum observables through interference. The equation I've seen which separates "real" states which we can potentially observe from "virtual" ones which we can't is the "mass shell equation"
$$E^2=m_0^2c^4+{\bf p}^2c^2.$$
This reminds me of Richard Feynman's informal derivation of the action principle towards the end of this lecture https://www.feynmanlectures.caltech.edu/II_19.html , where by treating both physically possible and impossible histories on equal footing, he gives a reason why histories with non-stationary action should be vanishingly unlikely. Can a relativistic version of this approach give us the mass shell equation on top of the Euler-Lagrange equations? Can the mass shell equation be derived from the action principle somehow? Am I seeing a connection where there isn't one and the virtual particles of QFT are different from Feynman's non-stationary paths?