Reverting unreviewed commit "Removed unused function real_serialized_size."

This reverts commit 4f1b3b7ff2160ae01c3901deca8b34b16528b523.