Soak the beans overnight. The next day, sweat the veg in the light olive oil over a low heat. Add the chopped rosemary and bay leaves.
Drain the beans and add to the pot with the bicarbonate of soda. Pour in the stock and top up with water - the liquid should rise four inches over the beans.
Bring to the boil, skim the surface, then simmer for around two hours until the beans have wilfully collapsed.
Make the pesto. Roughly blitz the hazelnuts and walnuts. Pour half of the olive oil in a pan on a low heat. Add the nuts and garlic.
Slow fry for 15 minutes, stirring regularly. Once the nuts have coloured, add the chopped herbs and chilli.
Infuse for 10 minutes, then cool.
Pulse in a food processor to a coarse paste. Scoop into a bowl and stir in the rest of the olive oil, vinegar, salt and pepper to taste. Once the beans are soft and mush, stir in the extra virgin olive oil and a splash of the vinegar. If you like, you can encourage the beans to break down further with a potato masher. Season extensively.
You can either serve the pesto as a blob on top of the soup, or stir it inches.