In a medium bowl, whisk together the flour, baking powder, baking soda and salt. Set aside.
2 ½ cups (300 g) all-purpose flour, 2 teaspoon(s) baking powder, 1 teaspoon(s) baking soda, ½ teaspoon(s) salt
In a separate, large bowl, use an electric mixer to cream the butter and sugar together until light and fluffy, about 3 minutes. Add the eggs and vanilla, and mix on low speed until combined.
½ cup (113 g) unsalted butter, ½ cup (98 g) granulated sugar, 2 (100 g) large eggs, 2 teaspoon(s) pure vanilla extract
Next, pour in the discard and buttermilk. Switch to the dough hook attachment, continue to mix on low speed, add the flour mixture. Beat until just combined and no dry patches remain.
1 cup (227 g) sourdough starter, ¼ cup (57 g) buttermilk
Place the dough on a lightly floured surface, and knead 3 to 4 times. Dust the dough lightly with flour, and roll out to ½ inch thickness. Use a doughnut cutter or another large circular cutter to cut out the doughnuts and a smaller cutter to remove the centers.
Heat a large, heavy bottomed pan with oil until it reaches 350°-375°F. Use a slotted spoon or skimmer to lower the doughnuts into the hot oil. Cook each doughnut for 2 minutes on one side, then flip to cook for another minute on the opposite side.
Remove the doughnuts from the hot oil, and transfer them to the cinnamon sugar to coat. Set them on a cooling rack to cool slightly before serving.
Store leftovers in an airtight container for up to 3 days.