Preheat the oven to 350°F and position a rack in the middle. Prepare two 9-inch round cake pans by greasing, lining with parchment, and greasing again or flouring.
In a medium bowl, whisk together flour, baking soda, salt, and cinnamon until well blended.
In a separate bowl, combine the oil, both sugars, and vanilla. Whisk in eggs one at a time.
Using a rubber spatula, fold in the dry ingredients in three parts until just combined. Stir in grated carrots, and if desired, pecans and raisins.
Evenly distribute the batter into the prepared pans and bake for 35-45 minutes, or until a toothpick comes out clean.
Allow cakes to cool in pans for 15 minutes before transferring to wire racks to cool completely.
For the frosting, beat cream cheese until smooth, then gradually add powdered sugar and cornstarch. Add heavy cream and beat until creamy. Chill until ready to use.
Frost the top of one cake layer, add the second layer, and spread the remaining frosting on top. Garnish with chopped pecans if desired.