kona
kona copied to clipboard
fix(host): Granular error handling in server loop
Overview
Currently, the host does not granularly handle errors in the hint router or preimage server loop. This is an issue, since certain errors should cause a throw, while others (like the file descriptor being closed) should exit gracefully.
Change the loops' error handling to handle File Descriptors being closed and/or EOF being reached, and exit gracefully, while throwing on any other error kinds.
Reference: https://github.com/ethereum-optimism/optimism/blob/develop/op-program/host/host.go#L241