Variational principle for Hamiltonian mechanics

See also Hamiltonian systems in contact geometry.
(From C. Rovelli "Forget time")
Denote γ~ as a curve in the phase space Ω (observables and momenta) and γ its restriction to C (observables alone, configuration manifold). The Hamiltonian H:ΩR determines the physical motions via the following variational principle:
A curve γ connecting the events qa1 and qa2 is a physical motion if γ~ extremizes the action

S[γ~]=γ~padqa

in the class of the curves γ~ satisfying H(qa,pa)=0 whose restriction γ to C connects qa1 and qa2. The action is the integration of the tautological 1-form along the curve γ~!!!
I think that this can be formulated without the clause "in the class of the curves γ~ satisfying H(qa,pa)=0" by means of contact geometry. I think we must consider this setup and define the total action

S=α.

All known physical (relativistic and nonrelativistic) Hamiltonian systems can be formulated in this manner.
See relativistic Hamiltonian mechanics.

This is equivalent to the variational principle of Lagrangian Mechanics. The Hamiltonian is given by:

H(qa,pa)=paq˙aL(qa,q˙a),

so the constraint H(qa,pa)=0 becomes paq˙a=L(qa,q˙a).
Therefore,

S[γ~]=γ~padqa=paq˙adt.

and substituting paq˙a=L(qa,q˙a) from the Hamiltonian constraint:

S[γ~]=L(qa,q˙a)dt.

Thus, the action in the Hamiltonian formalism reduces to the action in the Lagrangian formalism:

S[γ]=L(qa,q˙a)dt.