Soak the mushrooms overnight — the night before. Put the dried mushrooms in a bowl and cover them with 500 ml (2 cups) of cold water. Cover and leave somewhere cool for 8 to 12 hours, or overnight. The mushrooms will swell soft, and the dark soaking water holds half the flavour of the filling, so do not throw it away. In a hurry, cover them with boiling water and soak for 30 minutes instead — it works, but the flavour is milder.
Cook the mushrooms in their soaking liquid. Lift the mushrooms out with your hands, leaving any grit behind. Strain the soaking liquid through a fine sieve lined with a coffee filter or clean paper towel and keep it. Simmer the mushrooms with about 1 cup of the strained liquid for 20 minutes until tender. Drain, keeping the liquid, and chop them very finely.
Simmer the sauerkraut for 50 minutes. Taste a small piece of sauerkraut. If it is sharply salty or sour, rinse it briefly under cold water; if you like its full tang, just drain it. Squeeze out as much liquid as you can, then chop it into short strands — this helps the filling stay compact and makes the dumplings easier to seal. Put it in a wide pot with the bay leaves, the allspice berries and about 1 cup of the strained mushroom liquid. Simmer on low for 50 minutes, stirring now and then, until soft. Drain well and press out the last of the liquid.
Fry the onions golden. Melt the butter with the oil in a wide skillet over medium heat. Add the onions and cook for 8 minutes, stirring now and then, until soft and just turning golden. Stir in the mushrooms and cook for 5 minutes more.
Combine the filling and dry it out. Add the drained sauerkraut to the skillet with the onion and mushroom mixture. Cook everything together for 15 minutes on low heat, stirring often, until the filling is moist but not wet — it should hold together on a spoon without releasing any liquid. This is the dryness test: wet filling is the reason pierogi burst in the pot. Take the pan off the heat, fish out the bay leaves and allspice berries, and season with the black pepper. Taste it now for salt, and add a pinch only if it needs it.
Cool the filling completely. Spread it on a plate or tray so it cools fast, and leave it until completely cold, about 30 minutes. Warm filling melts the dough and tears the seals. It can be made a day ahead and kept covered in the fridge — it is often better the next day.
Make the dough. While the filling cools, stir the flour and salt together in a large bowl. Pour in the hot water and oil and stir with a spoon until a shaggy dough forms. Turn it out onto a lightly floured surface and knead for 5 to 7 minutes until smooth, soft and no longer sticky. Wrap in cling film and rest for 30 minutes — the rest relaxes the dough so it rolls out thin without springing back.
Roll and cut the circles. Work with one third of the dough at a time and keep the rest covered. Roll it out on a lightly floured surface to about 2 mm thick — thin, but not so thin it tears. Cut circles about 7 to 8 cm across with a round cutter or a glass. Gather the scraps, rest them 5 minutes, and re-roll them.
Fill and seal. Put about one heaped teaspoon of the cold filling in the centre of each circle — do not overfill, or the pierogi will burst. Fold in half and press the edges together firmly, pushing out any air. Pinch the edge into a little crimped rope, or press it with a fork. Give each seal a gentle tug: if it opens, dab the edge with water and pinch again. Lay the finished pierogi on a floured tray, not touching each other.
Boil in batches, then pan-fry and serve. Bring a large pot of salted water to a gentle boil — a rolling boil knocks the pierogi around and splits the seals. Drop them in one at a time, about 12 per batch, and stir very gently once so they do not stick. When they rise, cook 2 to 3 minutes more, then lift them out with a slotted spoon. For the classic finish, melt the butter in a wide skillet, fry the serving onion until golden, and toss the pierogi in the butter and onions for 2 to 3 minutes until lightly crisped. Serve hot, with sour cream and dill.