-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Improve ApplicationEngine #2796
Conversation
{ | ||
if (context.EvaluationStack.Count == 0) | ||
Push(StackItem.Null); | ||
else if (context.EvaluationStack.Count > 1) |
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.
Isn't this duplicating https://github.com/neo-project/neo-vm/blob/f48de7e595ade7c72be6ccd5cce0ab99708f0afd/src/Neo.VM/ExecutionEngine.cs#L427 (rvcount normally is 0 or 1 in this case:
rvcount: method.ReturnType == ContractParameterType.Void ? 0 : 1, |
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.
rvcount: method.ReturnType == ContractParameterType.Void ? 0 : 1,
This is in LoadContract()
. For a dynamic script, we have no way of knowing in advance how many values it will return. So set rvcount
to -1
.
https://github.com/neo-project/neo-vm/blob/master/src/Neo.VM/ExecutionEngine.cs#L1580
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.
Yeah. I mean, this change probably can be a part of #2756, it doesn't seem to be useful without 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.
We can use it as a double check.
That are only entry scripts today. See neo-project/neo#2796.
Compatibility test pass. No storage difference. |
Merge? |
src/Neo/Network/P2P/Payloads/Conditions/CalledByEntryCondition.cs
Outdated
Show resolved
Hide resolved
Tested OK. I think we can merge this. |
Some improvements from #2756
CallingContext
toExecutionContextState
. This fixes a potential issue inCalledByEntryCondition
.