Preheat your oven to 350°F and grease a 9-inch cake pan.
In a medium bowl, whisk together the gluten-free flour, baking powder, baking soda, spices, and salt.
In a separate large bowl, whisk together the vegetable oil, sugar, eggs, and vanilla extract until well combined.
Gradually mix in the dry ingredients until well combined.
Fold in the grated carrots and chopped walnuts (if using) until evenly distributed.
Pour the batter into the prepared cake pan and smooth the top with a spatula.
Bake the cake for 35-40 minutes, or until a toothpick inserted into the center comes out clean.
Let the cake cool in the pan for 10 minutes, then carefully remove it from the pan and let it cool completely on a wire rack.
Once the cake has cooled, you can frost it with your favorite cream cheese frosting recipe or serve it plain.