Preheat oven to 350°F (175°C). Grease and flour a 9x13-inch baking dish.
In a large bowl, whisk together flour, sugar, baking soda, baking powder, salt, and cinnamon.
In another bowl, beat eggs, oil, and vanilla extract until combined. Gradually mix into the dry ingredients.
Fold in grated carrots and walnuts (if using).
Pour batter into the prepared baking dish and smooth the top.
Bake for 35-40 minutes or until a toothpick inserted in the center comes out clean.
Allow the cake to cool completely before frosting.