For drumsticks, score the thickest part of the meat on either side of the chicken, about 1 cm deep, to help the marinade penetrate and to help it cook faster. For thighs, trim off any hanging excess skin, then flip the chicken so the meat side is up, then make a 1 cm incision on either side of the bone.
Pound white peppercorns until fine, then add garlic and cilantro stems and pound into a fine paste. Add sugar and swirl the pestle around to help further grind the herbs.
Add fish sauce, soy sauce, and water and stir to mix; then pour into a large zip-top bag or a mixing bowl. Add the chicken, mix well, and let marinate for at least 4 hours, preferably overnight. Flip the chicken halfway through.
Slice shallots evenly, crosswise, into 2mm thick pieces and place them in a bowl. Add a pinch of salt and give it all a toss to mix, then let it sit for about 10 mins.
Spread the shallots out on a paper-towel-lined plate and press another piece of paper towel on top to dry off the drawn out moisture.
Add about 2 inches of frying oil in a wok or a large pot, then add one test piece of shallot into the oil. Turn the heat on high and keep an eye on it. Once the test shallot has a constant stream of bubbles coming out, turn the heat down to low and add the remaining shallots, stirring them frequently as they fry, about 5-8 minutes.
Once the shallots are golden, scoop them out with a mesh skimmer and drain them on the paper towel.
Heat 2 inches of oil in a wok or a large pot to 375°F (190°C) on medium heat. Meanwhile, if the chicken is in a bag, transfer them into a large mixing bowl and add about ¾ cup of the rice flour and mix until there are no more lumps.
Once the oil is ready, add half of the chicken and allow the oil temp to drop to about 300°F/150°C. Fry the chicken, flipping them every 1-2 minutes until dark meat reaches 175°F/79°C internal temp, and breast reaches 155°F/68°C.
Let the chicken cool for 5-10 minutes before eating. Serve with sticky rice and fried shallots.
