Skip to content
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

Difference in storage changes at mainnet's block 2072033 #735

Closed
roman-khimov opened this issue Mar 9, 2020 · 4 comments
Closed

Difference in storage changes at mainnet's block 2072033 #735

roman-khimov opened this issue Mar 9, 2020 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@roman-khimov
Copy link
Member

C#:

   {
      "block" : 2072033,
      "size" : 2,
      "storage" : [
         {
            "state" : "Added",
            "value" : "00080000f4448291634500",
            "key" : "c0b5342fae238da8c0268a469cc86f99ab89c081b4ce248079e94949f6f6f7503cd55240000e4c77490000000000000000000000000c"
         },
         {
            "state" : "Added",
            "key" : "c0b5342fae238da8c0268a469cc86f99ab89c081746f74616c537570706c79000000000005",
            "value" : "00080000f4448291634500"
         }
      ]
   },

neo-go:

 {
  "block": 2072033,
  "size": 0,
  "storage": []
 },

There is just one invocation transaction in this block, so it's not hard to tell which one behaves in a wrong way.

@roman-khimov roman-khimov added the bug Something isn't working label Mar 9, 2020
@roman-khimov roman-khimov added this to the v0.74.0 milestone Mar 9, 2020
@roman-khimov
Copy link
Member Author

Application log for neo-go:

{
   "jsonrpc" : "2.0",
   "id" : 1,
   "result" : {
      "executions" : [
         {
            "trigger" : "Application",
            "notifications" : [],
            "gas_consumed" : "0.011",
            "vmstate" : "FAULT",
            "stack" : [
               {
                  "value" : [],
                  "type" : "Array"
               },
               {
                  "value" : "6465706c6f79",
                  "type" : "ByteArray"
               }
            ],
            "contract" : "0x075c0fffafddf1a5cd42ce73bd8e11c7eb35e799"
         }
      ],
      "txid" : "0x4bcfd660f46afb159a28e7c7432128595266e30a61e95facb5310eec481318cf"
   }
}

C#:

{
   "result" : {
      "txid" : "0x4bcfd660f46afb159a28e7c7432128595266e30a61e95facb5310eec481318cf",
      "executions" : [
         {
            "vmstate" : "HALT",
            "contract" : "0x99e735ebc7118ebd73ce42cda5f1ddafff0f5c07",
            "trigger" : "Application",
            "notifications" : [
               {
                  "state" : {
                     "type" : "Array",
                     "value" : [
                        {
                           "value" : "7472616e73666572",
                           "type" : "ByteArray"
                        },
                        {
                           "type" : "ByteArray",
                           "value" : ""
                        },
                        {
                           "value" : "b4ce248079e94949f6f6f7503cd552400e4c7749",
                           "type" : "ByteArray"
                        },
                        {
                           "value" : "0000f44482916345",
                           "type" : "ByteArray"
                        }
                     ]
                  },
                  "contract" : "0x81c089ab996fc89c468a26c0a88d23ae2f34b5c0"
               }
            ],
            "gas_consumed" : "2.359",
            "stack" : [
               {
                  "value" : "1",
                  "type" : "Integer"
               }
            ]
         }
      ]
   },
   "jsonrpc" : "2.0",
   "id" : 1
}

It faulted very early on based on GAS values, something went wrong, maybe there is even no contract deployed in our case.

@roman-khimov
Copy link
Member Author

Yeah, it couldn't make an APPCALL based on the stack values it left behind, though I'm wondering why it only consumed 0.011 GAS, it probably should be 0.013 (3 regular instructions and an APPCALL). @fyrchik?

@roman-khimov
Copy link
Member Author

Invocation that creates deploys this contract: https://neoscan.io/transaction/64b32ee43a644ebfcc81532769b4440a1164941032327814914c25e3b7164ee2
neo-go:

{
   "jsonrpc" : "2.0",
   "id" : 1,
   "result" : {
      "txid" : "0x64b32ee43a644ebfcc81532769b4440a1164941032327814914c25e3b7164ee2",
      "executions" : [
         {
            "notifications" : [],
            "gas_consumed" : "500",
            "stack" : [],
            "trigger" : "Application",
            "vmstate" : "HALT",
            "contract" : "0xf47878123e0fcc93ed67447a09844354e055c2c4"
         }
      ]
   }
}

C#:

{
   "jsonrpc" : "2.0",
   "id" : 1,
   "result" : {
      "txid" : "0x64b32ee43a644ebfcc81532769b4440a1164941032327814914c25e3b7164ee2",
      "executions" : [
         {
            "vmstate" : "HALT",
            "contract" : "0xc4c255e0544384097a4467ed93cc0f3e127878f4",
            "trigger" : "Application",
            "gas_consumed" : "500",
            "notifications" : [],
            "stack" : [
               {
                  "type" : "InteropInterface"
               }
            ]
         }
      ]
   }
}

Quite simple:

INDEX    OPCODE         PARAMETER                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
0        PUSHDATA2      456e646f72736974206973206... (very long description)
483      PUSHBYTES16    636f6e74616374406564732e62657374 ("contact@eds.best")                                                                                                                                                                                                                                          
500      PUSHBYTES13    456e646f72736974205465616d ("Endorsit Team")                                                                                                                                                                                                                                                   
514      PUSHBYTES3     312e30 ("1.0")                                                                                                                                                                                                                                                                                 
518      PUSHBYTES15    456e646f7273697420536861726573 ("Endorsit Shares")                                                                                                                                                                                                                                             
534      PUSH1                                                                                                                                                                                                                                                                                                         
535      PUSH5                                                                                                                                                                                                                                                                                                         
536      PUSHBYTES2     0710 ("\a\x10")                                                                                                                                                                                                                                                                                
539      PUSHDATA2      56c56b6c766b00527ac46c766... (contract 81c089ab996fc89c468a26c0a88d23ae2f34b5c0 itself)
2950     SYSCALL        "Neo.Contract.Create"                                                                                                                                                                                                                                                                          

@roman-khimov roman-khimov self-assigned this Mar 9, 2020
@roman-khimov
Copy link
Member Author

Yeah, there is no contract like this in our DB:

$ curl -d '{"jsonrpc":"2.0","id":1,"method":"getcontractstate","params":["81c089ab996fc89c468a26c0a88d23ae2f34b5c0"]}' http://localhost:10332 | json_pp 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   182  100    76  100   106  15200  21200 --:--:-- --:--:-- --:--:-- 36400
{
   "error" : {
      "code" : -100,
      "message" : "Unknown contract"
   },
   "id" : 1,
   "jsonrpc" : "2.0"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant