2) Meanwhile, pour about 2cm depth of olive oil into a large saucepan. Heat over medium heat until a slice of onion bubbles gently when placed in the oil, about 150C. Add the onions and fry, stirring occasionally until just golden, about 8 minutes. Scoop the onions from the oil with a slotted spoon and drain on a paper-towel lined baking tray.
3) Add about half the potatoes, and fry until lightly golden and a little puffy, about 10 minutes. Scoop the potatoes from the oil and add to the onions. Repeat with the rest of the potatoes. Reserve the oil.
4) Season the vegetables with 3 tsp of the salt. The preparation of the vegetables can be done up to 2 hours ahead.
5) Break the eggs into a large bowl. Whisk just enough to combine but not so much that they become loose and runny, about 15 times. Add the vegetables and remaining 1 tsp salt.
6) Heat a medium (25cm) nonstick omelette pan over a medium heat. Add 2 tbsp of the reserved oil and heat. Add the tortilla mixture and stir briskly with a spatula to get peaks and valleys in the folds of the egg, about 2 to 3 minutes.
7) Stop stirring and reduce the heat to low, cover and cook until the eggs are set but still pretty loose, about 5 minutes. Lay a flat pan lid or a plate on top and invert the tortilla. Add more oil to the pan if needed, and slide the tortilla back into the pan, cover and finish cooking until set and lightly brown, about 3 minutes more.
8) Slide the tortilla out of the pan to a cutting board to cool slightly. Cut into cubes or thin wedges and serve warm or at room temperature. Add one of the suggested toppings, if desired.
For the sofritto:
1) Heat the olive oil in a medium pan over a medium heat. Add the onions and sugar and half the salt. Cook, stirring occasionally, until golden and sweet, about 1 hour. If the onions begin to get really brown, add a splash of water to slow them down.
2) Meanwhile, cut the tomatoes, crosswise. Grate them on the cut side on the largest holes of a box grater into a bowl, all the way down to the skins. Discard skins.
3) Add the tomato puree, pimenton and bay leaf to the caramelised onions, and continue to cook until quite thick and the tomato separates from the oil, about 10 to 15 minutes more. Season with the remaining salt or to taste. Serve warm or at room temperature.
Cook's notes: Yes that's a lot of oil. But you can reuse it for other tortillas and in sauces, dressing or salads. It has a wonderful onion flavor that is great tossed on roasted potatoes or chicken.
We love the sofrito as a topper to grilled bread, with cheese, or as an alternative to cocktail sauce with prawns or other seafood.