Warm the oil in large sauté pan and add the chopped onions. Cook the onions for 18-20 minutes, stirring occasionally, until they start to brown. As the onions brown evenly and begin to caramelize stir frequently.
Add the garlic and ginger and stir-fry for 1-2 minutes. Next add the tomatoes and cook for another 5-8 minutes or until the tomatoes cook down and starts to loose it’s moisture. Stir the bottom of the pot to scrape off any brown bits. Sprinkle a little water if the vegetables catch to the bottom.
Add all the ground spices, give everything a good stir, to mix evenly. Cover and cook for 5-7 minutes, checking and stirring occasionally.
Cool for about 10 minutes. Blend the masala in a blender or use an immersion blender( (smooth or a little chunky). The sauce will continue to thicken a bit as it cools. Spoon into the silicone molds and freeze. It can be done in batches, transfer the remaining to a container and keep refrigerated until the first batch freezes. Then repeat freezing with the remaining paste
Once frozen transfer into freezer safe zip bags and use within 6-8 months. I’ve used them after 8 months they’re still good to use.