Preheat your oven to 350°F (175°C) and line a baking sheet with parchment paper.
In a large mixing bowl, cream together the softened butter, granulated sugar, and brown sugar until light and fluffy.
Add the eggs one at a time, mixing well after each addition, then stir in the vanilla extract.
In a separate bowl, whisk together the flour, baking powder, baking soda, and salt.
Gradually add the dry ingredients to the wet mixture, alternating with the sour cream, starting and ending with the flour mixture. Mix until just combined.
If using, fold in the chopped walnuts.
In a small bowl, combine the brown sugar, cinnamon, and flour for the topping. Stir in the melted butter until crumbly.
Drop tablespoon-sized portions of cookie dough onto the prepared baking sheet, spacing them about 2 inches apart. Sprinkle the topping mixture generously over each cookie.
Bake for 12-15 minutes or until the edges are lightly golden.
Allow the cookies to cool on the baking sheet for 5 minutes before transferring them to a wire rack to cool completely.