Cold soak or quick soak the chickpeas and beans together in the same pot.
Cold soak-dump beans into a 2-3 quart container; pour in enough water to cover by at least 4 inches; let soak in a cool place at least 8 hours or up to 24 hours; drain thoroughly.
Quick soak-place beans in a large saucepan, covering them generously with cold water; bring to a boil; boil 1 minute before removing from heat; let stand uncovered 1 hour; then drain.
Heat oil in a 6-quart heavy pot over medium heat.
Stir in the onions and garlic; cook, stirring, until golden, about 10 minutes.
Add in the potato and stir until the pieces begin to stick to the pot, about 3 minutes.
Stir in the carrots; cook until they wilt, about 2 minutes.
Pour the crushed tomatoes with their liquid into the pot and bring to a boil.
Pour in the hot water; add the rosemary, bay leaves, and crushed pepper flakes.
Add salt to taste.
Drain the chickpeas and cannellini and add to the pot.
Bring to a boil, then adjust heat to a gentle boil.
Cook, semicovered, until the chickpeas are tender, about 2 hours (at this point the cannellini will be very tender).
While the soup cooks, check the level of the liquid; there should always be enough liquid to cover the beans generously; if not, add hot water as necessary.
Make pesto-combine the basil and olive oil in the work bowl of a food processor or the blender jar.
Process until the leaves are chopped fine.
Add the grated cheese and continue processing until the mixture forms a rough paste; set aside.
Stir in broken fettuccine into the soup once the beans are tender and cook, stirring often, until the pasta is al dente; add water as necessary, if the soup becomes too thick while cooking the pasta (if you are cooking the soup in advance, do not add the pasta until you reheat the soup).
Serve soup immediately; stir a dollop of basil pesto into the soup pot or spoon a little into each warm soup bowl before ladling in the soup.