Random constraint satisfaction problems and high-dimensional estimation