  We characterized the transiting planetary system orbiting the G2V star K2-38
using the new-generation echelle spectrograph ESPRESSO. We carried out a
photometric analysis of the available K2 photometric light curve of this star
to measure the radius of its two known planets. Using 43 ESPRESSO
high-precision radial velocity measurements taken over the course of 8 months
along with the 14 previously published HIRES RV measurements, we modeled the
orbits of the two planets through a MCMC analysis, significantly improving
their mass measurements. Using ESPRESSO spectra, we derived the stellar
parameters, $T_{\rm eff}$=5731$\pm$66, $\log g$=4.38$\pm$0.11~dex, and
$[Fe/H]$=0.26$\pm$0.05~dex, and thus the mass and radius of K2-38,
$M_{\star}$=1.03 $^{+0.04}_{-0.02}$~M$_{\oplus}$ and $R_{\star}$=1.06
$^{+0.09}_{-0.06}$~R$_{\oplus}$. We determine new values for the planetary
properties of both planets. We characterize K2-38b as a super-Earth with
$R_{\rm P}$=1.54$\pm$0.14~R$_{\rm \oplus}$ and $M_{\rm
p}$=7.3$^{+1.1}_{-1.0}$~M$_{\oplus}$, and K2-38c as a sub-Neptune with $R_{\rm
P}$=2.29$\pm$0.26~R$_{\rm \oplus}$ and $M_{\rm
p}$=8.3$^{+1.3}_{-1.3}$~M$_{\oplus}$. We derived a mean density of $\rho_{\rm
p}$=11.0$^{+4.1}_{-2.8}$~g cm$^{-3}$ for K2-38b and $\rho_{\rm
p}$=3.8$^{+1.8}_{-1.1}$~g~cm$^{-3}$ for K2-38c, confirming K2-38b as one of the
densest planets known to date. The best description for the composition of
K2-38b comes from an iron-rich Mercury-like model, while K2-38c is better
described by a rocky model with a H2 envelope. The maximum collision stripping
boundary shows how giant impacts could be the cause for the high density of
K2-38b. The irradiation received by each planet places them on opposite sides
of the radius valley. We find evidence of a long-period signal in the radial
velocity time-series whose origin could be linked to a 0.25-3~M$_{\rm J}$
planet or stellar activity.
