Optimal and near-optimal broadcast in random graphs