Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception handling and traces should be improved in the code path related to Forging process #349

Open
alsala opened this issue Apr 5, 2022 · 0 comments

Comments

@alsala
Copy link
Contributor

alsala commented Apr 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant