Purée tomatoes with juices in a blender; setaside. Cook onion, guanciale, pancetta, oil,red pepper flakes, and 1/2 cup water in a largeheavy pot over medium-high heat, stirringoccasionally, until water is evaporated andfat begins to render, 8-10 minutes.
Add tomato paste and cook, stirringoften, until beginning to brown, about2 minutes.
Add wine and cook, stirringoften, until reduced by half, 5-8 minutes.
Add reserved tomato purée and bring toa boil. Cover pan partially with a lid, reduceheat, and simmer until meat is tender andflavors are melded, 40-45 minutes.
Addsugar, if using; season with salt and pepper.
When sauce is almost done, cook pastain a large pot of boiling salted water, stirringoccasionally, until al dente; drain pasta.
Add pasta to sauce and toss to coat.
Serve topped with Pecorino.
DO AHEAD: Sauce can be made 4 daysahead.
Let cool, then chill until cold. Coverand keep chilled.