From multiple sites, but for the following quote, ScienceMag.org references a laser altimeter: (emphasis mine)
The data began to trickle in at 6:40 a.m. ET, relayed by the
Perseverance rover to orbiters above and back to Earth. Cheers erupted
12 minutes later among Ingenuity’s small team of engineers and
scientists when confirmation of a successful flight came, first from a
laser altimeter showing that the helicopter had risen about 3 meters
in the air. That data was followed by a picture from a camera on the
helicopter's belly, showing its shadow directly below on the surface.
Additional research would indicate that the laser altimeter is a Garmin LIDAR-Lite V3. From the linked site:
So how is Garmin involved? Our technology — LIDAR-Lite v3 — will be
measuring the distance from the helicopter to the ground. Ingenuity’s
flight altitude goal is to get up to 15 feet (or 5 meters) from the
surface of Mars for a flight lasting up to 90 seconds.
The link internal to the quote points to a purchase-related webpage:

- Weight: 22 g (0.77 oz)
- Resolution: 1 cm
- Accuracy: +/- 2.5 cm at distances greater than 1 meter. Refer to operating manual for complete operating specifications.
- Range: 5 cm to 40 meters
- Update rate: up to 500 Hz
- Interface: I2C or PWM
- Power (operating voltage): 4.75-5 VDC; 6 V Max
- Current consumption: 105ma, idle; 130ma, continuous
- Operating temperature: -20 to 60° C
- Laser wave length/Peak power: 905 nm/1.3 watts