-
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
Storage fails on a specific contract on Testnet t5 #2890
Comments
Somewhat related to #2829, but a different thing, because NeoGo answers correctly (at least from the first glance).
But we have a stateroot mismatch since 2588120 (nspcc-dev/neo-go#3105), what a coincidence... |
I think i spotted it? "permissions" : [
{
"contract" : "0xfe924b7cfe89ddd271abaf7210a80a7e11178758",
"methods" : "*"
},
{
"contract" : "*",
"methods" : "*"
}
] Also I'm currently unable to work on some projects that use the |
The problem is
Notice that this manifest is decoded successfully and deployment succeeds. It's also correct wrt NEP-15 requirements. But it needs to be stored and to do that it's converted to stackitems and then serialized. Trusts get serialized like this:
which is neo/src/Neo/SmartContract/Manifest/ContractPermissionDescriptor.cs Lines 146 to 153 in 24d1e7f
for each element. So we get
chunk for trusts in C# (an array of two elements, one is a byte array of length 20 and the other is an array of bytes of length zero), while NeoGo produces a bit different one:
which is an array of two elements, one is a byte array of length 20 and the other is Null. Then when C# node tries to decode the thing it freaks out, because zero-length byte array is neither a proper hash, nor a proper key (and we have a broken state stored, similar to #2829). But it's absolutely not a problem in NeoGo case since there we have a Null item that can theoretically (but not practically in C# implementation) be decoded as wildcard trust. Notice that permissions are not a problem since they're serialized differently with proper Null handling: neo/src/Neo/SmartContract/Manifest/ContractPermission.cs Lines 74 to 75 in 24d1e7f
C# node needs to be fixed to store and read wildcard trusts appropriately. @steven1227, @shargon. |
Describe the bug
Contract
0x12fbec62fb765ce3f55845106ccf3717716723ad
ontestnet t5
at block2588120
is causing the problem. The contract permission is empty (has a bad stackitem in it)?Abi shows no contract permissions
*
but neo seems to think it has two.Value does not fall within the expected range. (Parameter 'span')
To Reproduce
Steps to reproduce the behavior:
Any application using this
ListContracts
function will be dead in the water.Rcp Server
RCP Request
RCP Response
Expected behavior
This was working before for the longest time, and now it doesn't. Something somewhere broken Testnet T5. A stackitem, i think with bad data.
Need a hot fix
The text was updated successfully, but these errors were encountered: