Preheat oven to 350F (175F). Prepare an 11x7 or 9x9 inch pan by lightly greasing and lining with parchment paper or flouring to prevent sticking.
Whisk together the dry ingredients in a bowl (flour, baking powder, baking soda, cinnamon, ginger, and salt), and set aside.
In the bowl of an electric mixer, whisk the eggs and sugar for 2 minutes on medium speed or so until well combined. Add the vanilla and the vegetable oil and mix until combined.
Reduce the speed to low, and add the dry ingredients all at once until incorporated. Don't over mix, a few flour streaks are ok.
Add the grated carrots and walnuts if using and fold in with a spatula. Don't mix too much. Pour the batter into the prepared pan and bake for around 25 minutes or until a toothpick inserted near the center comes out clean. Let cake cool completely before frosting.