Thank you for using the Apple Support Communities. I understand you have a problem with your iPhone 8 as it restarts unexpectedly. I understand the need to use your iPhone without any problems and I will be more than glad to provide you with some additional information that can help.
You previously mentioned that you've done an update to your phone. I want to make sure you're running the latest iOS version 11.1.1
Update the iOS on your iPhone, iPad, or iPod touch
If you're fully updated, please do a backup of your data: How to back up your iPhone, iPad, and iPod touch and please reinstall your operative system without restoring your device: Restore your iPhone, iPad, or iPod to factory settings
The last steps will allow you to determine if the issue is related to the previous installation you had or if the issue could be a hardware issue.
If the issue does not occur on a new device, then you can restore from your previous backup:
Restore your iPhone, iPad, or iPod touch from a backup
Hope this will be helpful.