Preheat oven to 350°F (175°C). Grease and flour a 9x13-inch pan.
Mix flour, sugar, baking soda, and salt in a large bowl.
In a saucepan, combine Coca-Cola, butter, and cocoa. Heat until butter melts. Bring to boil, remove from heat.
Pour warm cola mixture over dry ingredients; mix well.
Whisk eggs, buttermilk, and vanilla together. Add to batter.
Pour into prepared pan. Bake 30-35 minutes.
For frosting: Heat butter, Coca-Cola, and cocoa until butter melts.
Stir in powdered sugar and vanilla until smooth.
Pour warm frosting over hot cake. Add pecans if desired.