-
Notifications
You must be signed in to change notification settings - Fork 95
Description
Currently, if anything wrong is happening when sending a websocket request to MC and processing the result, the only error indication explicitly written in the traces is a 'Connection Error', even in case of internal error.
For instance if the response got from the MC contains a block hex which can not be successfully parsed, we have an internal error which is not traced. The relevant method is:
MainchainNodeChannelImpl.processBlockResponsePayload
In ForgeMessageBuilder.tryToForgeNextBlock currently we have:
log.info(s"Forge result is: $result")
And the initial IllegalStateException exception details are lost:
[INFO ] 2022-04-01 12:07:59:496 +0000 [2-Hop-akka.actor.default-dispatcher-204188] com.horizen.forge.ForgeMessageBuilder - Forge result is: Failed block generation due java.lang.IllegalStateException: Can't retrieve MainchainBlockReference for hash ByteArrayWrapper[00006f8d2d5ce628381e965c0babddd01d73b41887399f4862a487baae4b817b]. Connection error.
[ERROR] 2022-04-01 12:07:59:503 +0000 [scala-execution-context-global-80] com.horizen.forge.Forger - Forging had been failed. Reason: Can't retrieve MainchainBlockReference for hash ByteArrayWrapper[00006f8d2d5ce628381e965c0babddd01d73b41887399f4862a487baae4b817b]. Connection error.
Moreover, some websocket tracing can be improved, for instance, in WebSocketConnectorImpl.sendMessage method, add debug info on what message is being processed.