Prepare for Baking:
Preheat your oven to 350°F (175°C) and grease a 13x18-inch rimmed baking sheet.
Make the Cake Batter:
In a large mixing bowl, whisk together flour, sugar, baking soda, and salt.
In a medium saucepan, combine butter, water, and cocoa powder. Heat over medium, stirring, until the mixture comes to a gentle boil. Remove from heat.
Pour the chocolate mixture into the dry ingredients and mix until combined.
Add sour cream, eggs, and vanilla extract. Mix until smooth.
Bake the Cake:
Pour the batter into the prepared baking sheet and spread evenly. Bake for 18–20 minutes or until a toothpick inserted in the center comes out clean.
Prepare the Frosting:
While the cake bakes, melt the butter in a medium saucepan over medium heat. Stir in cocoa powder and milk, bringing the mixture to a gentle boil.
Remove from heat and whisk in powdered sugar and vanilla extract until smooth.
Frost the Cake:
As soon as the cake comes out of the oven, pour the warm frosting over the hot cake. Spread evenly with an offset spatula or knife. Sprinkle chopped pecans over the frosting if desired.
Cool and Serve:
Allow the cake to cool completely in the pan before slicing into squares. Serve at room temperature.