Preheat oven to 350°F (175°C). Grease two 9-inch round cake pans and line bottoms with parchment paper.
Peel and grate carrots using a box grater or food processor until you have 2 1/2 cups (250g). Set aside.
In a large bowl, whisk together flour, baking soda, baking powder, salt, cinnamon, nutmeg, and ginger.
In another bowl, whisk granulated sugar, brown sugar, and oil until combined. Add eggs one at a time, then vanilla, and finally sourdough discard, whisking until smooth.
Pour wet into dry and fold gently with a spatula until just combined. Do not overmix.
Fold in grated carrots, walnuts, and raisins until evenly distributed.
Divide batter evenly between prepared pans. Bake for 30-35 minutes, until toothpick comes out clean.
Cool cakes in pans for 10 minutes, then turn out onto wire racks to cool completely.
Beat cream cheese and butter with hand mixer until smooth. Add vanilla and salt. Gradually beat in powdered sugar until fluffy.
Place one cooled layer on a plate. Spread with frosting. Top with second layer. Apply crumb coat, chill 15 minutes, then finish frosting. Garnish with walnuts.