Preheat the oven to 350°F. Grease and flour two 9-inch round cake pans.
In a medium bowl, whisk together the flour, baking powder, baking soda, cinnamon, and salt.
In a large bowl, beat together the vegetable oil, granulated sugar, brown sugar, eggs, and vanilla extract until smooth.
Gradually add the dry ingredients to the wet ingredients, mixing until just combined.
Fold in the grated carrots and chopped walnuts (if using) until evenly distributed.
Pour the batter into the prepared pans and bake for 30-35 minutes, or until a toothpick inserted in the center comes out clean.
Let the cakes cool in the pans for 10 minutes, then remove and let cool completely on wire racks.
Once the cakes are completely cool, spread a layer of frosting on one cake, then top with the other cake. Spread the remaining frosting on top and around the sides of the cake.
Serve and enjoy!