How do I know that I have truly lost interest in research and should drop out of a top CS PhD program? I am a second-year CS PhD pre-candidate in a top PhD program. During my first year, I published a first-author paper at the best conference in my area, which I know is a big accomplishment. My advisor is famous in his area and also very caring and supportive, and my labmates are great too.

The thing is my second project didn't go very well, which caused us to change the entire story right before the deadline. I worked more than 70 hours per week and gave all I could, but there was not enough time to get everything we need in a good shape, and my advisor was frustrated with the progress and pointed out problems that I hadn't seen everywhere. I continued to work, but found myself too frustrated and suddenly lost all interest in research, stopped caring about papers, did as best I could to avoid talking to anyone, and want to leave this place and never come back. I know most PhDs somehow have this feeling, but I notice that this time it's quite serious:


Forcing myself to work resulted in a breakdown every night with the feeling that all I did was nonsense and meaningless.
My first paper has now become a joke, laughing at me that I could never publish with my own efforts.
I have no intention to participate in lab communication and truly don't want to talk to anyone. I can't even bear to hear others typing due to the feeling that I am the only one who doesn't make progress.


How can I know if I truly have lost my interest in research (and should drop my Ph.D.), or if this is something that I can overcome? After all,  if this is the best I can do, why not go somewhere else and use my skills to actually contribute rather than wasting everybody's time? I am so tired of receiving new tasks at 4 am or 11 pm due the next day. I would highly appreciate your advice!
If available, I would immediately seek out the university counseling services (as mentioned in a comment by @Nate Eldredge ) The things you are mentioning could be symptoms of depression. Or, you may just need some strategies for coping with failure. Often people with your accomplishments haven't experienced much failure in their lives! 

Taking advantage of the (usually low-cost or free, if you are in the U.S.) counselling services at the university will help you sort out which of these things it is. Your counselor can also help you come up with strategies to make well-reasoned life decisions for yourself (or with your committee). Regardless, don't make any rash decisions. 

In the U.S., it is very common for PhD students to deal with these issues and to seek out counseling. An informal straw poll in my PhD cohort revealed that 90% of us had done so, and approximately 60% were on anti-anxiety medication or continued treatment regimes at any given time. The older students even began to organize a yearly workshop to talk about stress and how to get the help you need!  

An update: This 2018 study finds that graduate students are 6x more likely to experience depression and anxiety, compared to the general population.
https://www.insidehighered.com/news/2018/03/06/new-study-says-graduate-students-mental-health-crisis