-
Notifications
You must be signed in to change notification settings - Fork 161
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
feat(vm): implement improved error handling #289
Conversation
I just realized, we can get rid of the manual runtime.abort and call that outside when an error is encountered. |
The reason errors aren't handled here is for one to future proof for when there can be custom execution not to allow a state transition to crash the node. The plan was to have the vm execution wrapped in a Let me know if you think this assumption is bad or that this should and can be handled without catching the panic and handling aborts that way through the runtime. cc: @ec2 @dutterbutter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought about it a bit more, I actually prefer this as well. It was how I wanted this to be setup but I was just trying to match the spec as close as possible
Yeah, we shouldn't panic and catch it when it unwinds... That's not.. natural lol |
thought it had approved this and posted that comment already, guess i misclicked... classic |
Yeah the point is this is supposed to be a VM that is future proofed to run custom code, seems weird to handle errors in specific scenarios, force any code in future to handle errors, and allow the execution to crash the program potentially. I agree this is better for now, but I don't see the big aversion to this or why you didn't say something before |
Regarding catching panics, I would say that all errors that are expected should be handled using regular rust error handling, but that the actual call to apply the message likely should be wrapped into a panic catcher, to ensure that if there is some unexpected behaviour or simply bugs in the implmentation here, they are caught and do not crash the node. This is last measure of defense, and should not be used as the default way of handling errors. |
I agree, but the idea of when custom code is allowed, it isn't written in the spec to use an error type that is serialized consistently for use in multiple language clients, also because the go version handles it with panic. But in any case we agree now this is the best way to handle it, thanks again for the contribution :) |
I expect that when we go to that level this will have to be redone from scratch anyway. |
Summary of changes
Changes introduced in this pull request:
ActorError
and use rust error handling when doing VM invocations.