Soak the Sichuan peppercorns in the oil for at least 8 hours or overnight.
In a large saucepan, heat the oil and peppercorns over low heat to about 250°F (120°C). Add the ginger, scallions, cloves, cassia bark, star anise, black cardamom, and dried whole red chiles. Simmer in the oil for about 20 minutes.
Put the red chili flakes and powder in a heat-proof 3-quart bowl. Strain the oil through a wire-mesh strainer into the bowl. Discard the strained spices. Let the oil steep overnight before using.
Both the oil and the chili flakes can be used in recipes. Store in a covered glass jar for up to a year.