-
Notifications
You must be signed in to change notification settings - Fork 765
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
Clean up VmError #219
Clean up VmError #219
Conversation
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.
I got this running. 45 failing tests. I wonder if the VM is actually broken in those.
lib/runCode.js
Outdated
@@ -193,8 +193,7 @@ module.exports = function (opts, cb) { | |||
// run the opcode | |||
var result = opFn.apply(null, args) | |||
} catch (e) { | |||
runState.vmError = e.error | |||
cb() | |||
cb(new VmError(e.error)) |
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.
This actually could be cb(e)
This test run falls in the period where we temporarily had the Promise-version for async/await in |
Ah no, still failing. :-/ |
Looking at the below more carefully:
Shows that |
Can't investigate further - no time - but here are some results when running one failing test with master
error-cb
|
returnDataCopy revert only needed a deepcheck for
|
lib/runCode.js
Outdated
@@ -214,7 +213,7 @@ module.exports = function (opts, cb) { | |||
} | |||
|
|||
function parseVmResults (err) { | |||
err = runState.vmError || err | |||
err = runState.vmError || (err && (err.error || err)) |
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.
Would be nice if the instances not returning an error object would be fixed instead. Do you happen to know which ones?
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.
I was able to remove this. now we are back to the failures that @Silur mentioned.
Hey, @Silur. My apologies, I forgot you had claimed this issue. Were you able to make any progress on the four failing tests? Or can I try and get this finished? |
oh great you found the part where it didn't return with an err! |
@@ -193,8 +193,7 @@ module.exports = function (opts, cb) { | |||
// run the opcode | |||
var result = opFn.apply(null, args) | |||
} catch (e) { | |||
runState.vmError = e.error |
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.
this is where RevertOpcodeCreate
breaks, using new VmError(e)
or new VmError(e.error)
doesn't work, maybe leave the runState error here for e is not in any of the categorized exceptions?
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.
I'm not even sure if vmError
is used anymore after these changes. Ideally, we could remove it.
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.
vmError
is used in the result
output object by users of the VM (such as Remix)
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.
Ah okay. Best to leave it in then :D
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.
Sorry, double checked remix and it uses exceptionError
. Though there might be some other user which uses vmError
, so I should add that back it properly
lib/runCode.js
Outdated
@@ -193,6 +193,7 @@ module.exports = function (opts, cb) { | |||
// run the opcode | |||
var result = opFn.apply(null, args) | |||
} catch (e) { | |||
runState.vmError = e |
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.
any error occurred here does not belong to any of the known exceptions, so excluding them from the runState will break stateroots
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.
I see @axic has incorporated a new type of error INTERNAL_ERROR
(https://github.com/ethereumjs/ethereumjs-vm/blob/35e8ddcc71ae47954d5a2599d784b3e63507df6f/lib/constants.js#L9) in #222 .
Maybe we can pull those changes to this PR, and add a new field that allows us to specify a custom error message for INTERNAL_ERROR
s .
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.
LGTM
@jwasinger didn't know it will dismiss the review :( |
@Silur @jwasinger thanks for fixing this! |
@jwasinger @Silur please review the last commit and merge hopefully |
Pulled from #174.