-
Notifications
You must be signed in to change notification settings - Fork 78
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
Various verification fixes 2 #417
Conversation
8303426
to
97bce52
Compare
Codecov Report
@@ Coverage Diff @@
## master #417 +/- ##
==========================================
- Coverage 51.27% 51.04% -0.24%
==========================================
Files 96 97 +1
Lines 6487 6585 +98
==========================================
+ Hits 3326 3361 +35
- Misses 2922 2982 +60
- Partials 239 242 +3
Continue to review full report at Codecov.
|
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 only some nit questions/comments
Fixes script invocations via the APPCALL instruction. Adjust contract state field types accordingly.
The same way C# node does.
This is an opaque data item that is to be used by the interop functions.
This is both for #373 and for interop functions that have to check some inputs.
This function is intended to be ran outside of the execute's panic recovery mechanism, so it shouldn't panic if there is no result.
Switch cases are evaluated sequentially and the fault case is top-priority to handle.
It gives access to the internal value's Value() which is essential for interop functions that need to get something from InteropItems. And it also simplifies some already existing code along the way.
Interop services routinely push such things (block index, blockchain height) onto the stack.
Script can return non-bool results that can still be converted to bool according to the usual VM rules. Unfortunately Bool() panics if this conversion fails which is OK for things done in vm.execute(), but certainly not for VerifyWitnesses(), thus there is a need for TryBool() that will just return an error in this case.
Make Context.Next() return both opcode and instruction parameter if any. This simplifies some code and needed to deal with #295.
Fix #295, deduplicate code and add `inspect` parameter to the vm command to dump AVMs (`contract inspect` works with Go code).
97bce52
to
dca332f
Compare
This focuses on VM improvements necessary to make tx verification work. It's mostly related to interop functionality, but doesn't add interops at the moment (I want to add more of them before the first push). Fixes #295 along the way.