Prep pans & oven: Preheat oven to 350°F (177°C). Grease and line two 9-inch round cake pans with parchment paper.
Mix dry ingredients: In a large bowl, whisk together flour, sugars, cocoa powder, baking soda, and salt.
Add fats: Whisk in melted butter and oil until evenly combined.
Add wet ingredients:
Stir in buttermilk, sourdough discard, eggs, and vanilla until smooth.
Add hot liquid: Slowly pour in hot water or coffee, mixing until batter is fully combined (batter will be thin). Don't overmix.
Bake: Divide batter evenly between pans. Bake 30–35 minutes, or until a toothpick inserted in the center comes out with crumbs.
Make frosting:
Beat butter until smooth. Add powdered sugar and cocoa powder and mix on low. Add heavy cream, vanilla, and salt, then beat until smooth and spreadable.
Cool: Let cakes cool in pans, then turn out onto a rack and cool completely or chill before frosting.
Assemble:
Frost cake once completely cooled and serve.