For the cream, whisk the cornstarch into a few tablespoons of the milk until smooth, then whisk that into the egg yolks. Heat the remaining milk with the sugar and vanilla in a medium saucepan just until the sugar dissolves and the milk is hot but not vigorously boiling.
Temper the yolks by whisking in a ladleful of the hot milk, then return the tempered yolks to the pan. Cook over medium heat, whisking constantly, until the mixture thickens to a pudding-like consistency and you can draw a line across the back of the spoon.
Remove from the heat, press plastic wrap directly onto the surface to prevent a skin, and chill until cold and firm.
For the dough, warm the milk to about body temperature. In the bowl of a stand mixer fitted with the dough hook (or in a large bowl if kneading by hand), combine the flour, sugar, and yeast. Add the warm milk and eggs and mix on low until a shaggy dough forms. Add the cold butter in pieces and continue to knead until the dough is smooth, elastic, and slightly tacky, 8 to 10 minutes by machine or 12 to 15 minutes by hand.
Transfer the dough to a lightly oiled bowl, cover with plastic wrap and a towel, and let rise in a warm place until doubled in size, about 1 to 1 1/2 hours.
Gently deflate the dough and divide into pieces of about 2 ounces/60 grams for small donuts (or larger if preferred). Shape each piece into a tight round so the surface is smooth. Place rounds on lightly greased parchment squares, spray or brush lightly with oil, cover with plastic wrap and a towel, and proof until puffy and slightly jiggly, about 35 to 45 minutes.
Heat the oil to 320°F/160°C and maintain that temperature as steadily as possible; if the oil browns the donuts too quickly, lower the heat. Fry a few donuts at a time, turning to brown evenly, until golden and cooked through, 2 to 3 minutes per side depending on size. Transfer to a wire rack to drain.
Fill each donut with chilled pastry cream using a piping bag fitted with a small plain tip.
In a small, clean saucepan, melt the sugar over medium heat without stirring until it becomes a clear amber liquid; swirl the pan gently to encourage even melting. Remove from the heat and stir in a pinch of salt. Working very carefully—caramel is extremely hot—dip the tops of the warm donuts into the caramel and return to the rack. Allow the caramel to set slightly.
Serve the donuts the day they are filled for best texture. Store filled donuts refrigerated for up to 48 hours; bring to room temperature briefly before serving. Unfilled donuts can be frozen in an airtight container for up to one month.