Prep time 20 mins, cook 1 hr 30 mins (plus salting, standing, sealing)
This preserve is a very old recipe and, like all sauces, it will only improve with age. Give it at least two months before you crack open the jar. You'll need to begin this recipe a day ahead.
Place mushrooms in a large non-reactive bowl, scatter with 4½ tsp fine sea salt, mix to combine, cover and stand for 24 hours, stirring occasionally. One hour before end of salting period, combine porcini and 750ml hot water in a bowl and stand until rehydrated (1 hour), then remove with a slotted spoon (reserve soaking liquid). Process porcini in a food processor, add liquid and process to combine, then transfer to a large saucepan. Process salted mushrooms in a food processor until a smooth purée forms, add to saucepan.
Process 125ml vinegar in a food processor, with shallot and garlic until finely chopped. Add to mushrooms, with bay leaves, spices and remaining vinegar. Bring to the boil over medium-high heat, reduce heat to low and simmer, stirring frequently, until mushrooms are soft and ketchup is thick (1-1½ hours). To test for correct consistency, place a spoonful onto a saucer and stand for 10 minutes. If very little or no liquid seeps from the ketchup, the ketchup is ready. Press through a coarse sieve (discard solids), then process in batches, in a blender or food processor, until very smooth.
Return ketchup to a clean saucepan and bring it to the boil over medium-high heat, stirring constantly. Stir in sherry, then ladle ketchup into sterilised bottles, leaving a 2cm-gap at the top. Seal bottles, cover with water in a saucepan and simmer for 15 minutes. Cool to room temperature and store in a cool dark place until flavours develop (2-3 weeks). Serve as a condiment to roast meat.