-
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
Question about verify
for native contracts
#1995
Comments
It use neo/src/neo/Network/P2P/Payloads/OracleResponse.cs Lines 67 to 75 in ab7ec04
neo/src/neo/SmartContract/Native/Oracle/OracleContract.cs Lines 164 to 167 in ab7ec04
|
That's attribute, OK, but witnesses are still being verified, aren't they? And we have the following witness at the moment:
Nothing in invocation and something like this in verification:
Which matches oracle contract's hash, but it effectively invokes this:
And it doesn't have any "name" to use. Or am I missing something? Then we wanted to do something like
To leverage this snippet from
But it effectively creates the same situation as the script is the same and So what we have at the moment in nspcc-dev/neo-go#1427 is this:
Meaning zero verification script and an invocation script that pushes the method name onto the stack. This approach works (in that transaction passes verification), but something tells me it's not the way it's supposed to work. |
We can also reuse our |
How does
verify
method for native contracts work?By default invocation script contains arguments and verification script start with some offset in contract script.
https://github.com/neo-project/neo/blob/master/src/neo/SmartContract/Helper.cs#L175
When we have native contract,
verify
has ho offset in the script, because it is simplyNative.Call
.In the oracle PR there is custom logic with pushing method name together with parameters.
https://github.com/neo-project/neo-modules/pull/326/files#diff-cb9c5c742827ddb7719d684b62664515R275
But I don't see this in this repo.
So how do oracle transactions pass verification?
The text was updated successfully, but these errors were encountered: