I've never broken an egg, but then my ride to the farmers market is only about 4.5 miles with only a few really jarring bumps.
My panniers are fairly square on the bottoms, bungied at the bottoms so they don't bounce against the rack. I put the egg cartons at the bottom so they can stay flat.
Avoid soggy cardboard cartons if the farmer has other options. A lot of times if I'm on my bike, they'll specifically pull out one of the two-layer PET cartons for me, but if your market allows the farmers to re-use cartons, then they should have lots of EPS cartons, which are almost as protective. If all they have is cardboard, and if the market requires the vendors to refrigerate eggs, then in summer you might need to reinforce your pannier with maybe a piece of plywood, or some of that corrugated plastic signboard, cut to fit, so the carton doesn't sag when the eggs sweat moisture. Or get a top box that will stay flat on top of your rear rack, and cushion it with a piece of EPS packaging material, some foam, or just a folded towel.
But if I had to transport ripe tomatoes, especially slicing tomatoes (vs sturdy paste tomatoes), I'd drive too.
Speed comes from what you put behind you. - Judi Ketteler