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

Storage mismatch @testnet's block 2400921 #994

Closed
roman-khimov opened this issue May 27, 2020 · 6 comments
Closed

Storage mismatch @testnet's block 2400921 #994

roman-khimov opened this issue May 27, 2020 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@roman-khimov
Copy link
Member

neo-go version 0.74.1-pre-245-g0da1935e, importing testnet from scratch:

file BlockStorage_2500000/dump-block-2401000.json: block 2400921, changes number mismatch: 3 vs 0

Ours:

 {
  "block": 2400921,
  "size": 3,
  "storage": [
   {
    "state": "Changed",
    "key": "acdbf5346b59185b0e0df88fead2a7e856df1ab562616c616e63655f00937d87615f1a9d00839388b88b0692f402262e9cf000000003",
    "value": "0006003820023f0700"
   },
   {
    "state": "Changed",
    "key": "acdbf5346b59185b0e0df88fead2a7e856df1ab56c6f636b7570735f937d87615f1a9d83009388b88b0692f402262e9cf0af14030001",
    "value": "00fd0f0180040203b014030203af14030205004429353a8219020107000500e40b5402020108000500e40b5402020109000500e40b540202010a000500e40b540202010b000500e40b540202010c000500e40b540202010d000500e40b540202010e000500e40b540202010f000500e40b5402020110000500e40b5402020111000500e40b5402020112000500e40b5402020113000500e40b5402020114000500e40b5402020115000500e40b5402020116000500e40b5402020117000500e40b5402020118000500e40b5402020119000500e40b540202011a000500e40b540202011b000500e40b540202011c000500e40b540202011d000500e40b540202011e000500e40b540202011f000500e40b540200"
   },
   {
    "state": "Added",
    "key": "acdbf5346b59185b0e0df88fead2a7e856df1ab562616c616e63655f0070901d9c6f03be00e2fdcd89104df3d0888d56767900000003",
    "value": "000500f2052a0100"
   }
  ]
 }

Theirs:

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

There are two transactions in this block and both invoke the same contract as in #977.

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

Ours:

{
   "id" : 1,
   "result" : {
      "txid" : "0x2a85697b9fe83e6ebe0be0d0382eb59016da164bbea0dc43cbb4621ea2239d63",
      "executions" : [
         {
            "stack" : [],
            "vmstate" : "HALT",
            "notifications" : [
               {
                  "contract" : "0xb51adf56e8a7d2ea8ff80d0e5b18596b34f5dbac",
                  "state" : {
                     "type" : "Array",
                     "value" : [
                        {
                           "type" : "ByteArray",
                           "value" : "7472616e73666572"
                        },
                        {
                           "value" : "937d87615f1a9d839388b88b0692f402262e9cf0",
                           "type" : "ByteArray"
                        },
                        {
                           "type" : "ByteArray",
                           "value" : "70901d9c6f03bee2fdcd89104df3d0888d567679"
                        },
                        {
                           "value" : "00f2052a01",
                           "type" : "ByteArray"
                        }
                     ]
                  }
               }
            ],
            "gas_consumed" : "6.964",
            "contract" : "0x392dc9d09ffbc21ae46c0c41f80931e094d33ae2",
            "trigger" : "Application"
         }
      ]
   },
   "jsonrpc" : "2.0"
}

Theirs:

{
   "jsonrpc" : "2.0",
   "id" : 1,
   "result" : {
      "executions" : [
         {
            "contract" : "0x392dc9d09ffbc21ae46c0c41f80931e094d33ae2",
            "notifications" : [],
            "stack" : [],
            "vmstate" : "FAULT",
            "gas_consumed" : "5.645",
            "trigger" : "Application"
         }
      ],
      "txid" : "0x2a85697b9fe83e6ebe0be0d0382eb59016da164bbea0dc43cbb4621ea2239d63"
   }
}

The other transaction is treated the same way, ours:

{
   "result" : {
      "executions" : [
         {
            "stack" : [],
            "vmstate" : "FAULT",
            "notifications" : [],
            "contract" : "0xa47e014e096043b6e0728e4f3716c8dc79bafb42",
            "trigger" : "Application",
            "gas_consumed" : "5.645"
         }
      ],
      "txid" : "0x313f8f2e05f5f5c6165af5f797ce74a211276e49133275bf5b6e09871cacf71d"
   },
   "id" : 1,
   "jsonrpc" : "2.0"
}

Theirs:

{
   "result" : {
      "txid" : "0x313f8f2e05f5f5c6165af5f797ce74a211276e49133275bf5b6e09871cacf71d",
      "executions" : [
         {
            "vmstate" : "FAULT",
            "contract" : "0xa47e014e096043b6e0728e4f3716c8dc79bafb42",
            "trigger" : "Application",
            "notifications" : [],
            "stack" : [],
            "gas_consumed" : "5.645"
         }
      ]
   },
   "jsonrpc" : "2.0",
   "id" : 1
}

@roman-khimov
Copy link
Member Author

0x313f8f2e05f5f5c6165af5f797ce74a211276e49133275bf5b6e09871cacf71d is the first one in the block.

@roman-khimov
Copy link
Member Author

And the scripts are the same up to THROWIFNOT (the rest is nonce effectively).

@roman-khimov
Copy link
Member Author

Looks like cache change from the first tx leaking into the second.

@roman-khimov
Copy link
Member Author

Logging returned values from both iterators for these two transactions:

create iterator
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0111503 : 80040203121503020311150302064066748a2201820102010502064066748a2201
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0121503 : 8004020100020312150302064066748a2201820102010502064066748a2201
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0af1403 : 80040203b014030203af14030205002835893c821a020106000500e40b5402020107000500e40b5402020108000500e40b5402020109000500e40b540202010a000500e40b540202010b000500e40b540202010c000500e40b540202010d000500e40b540202010e000500e40b540202010f000500e40b5402020110000500e40b5402020111000500e40b5402020112000500e40b5402020113000500e40b5402020114000500e40b5402020115000500e40b5402020116000500e40b5402020117000500e40b5402020118000500e40b5402020119000500e40b540202011a000500e40b540202011b000500e40b540202011c000500e40b540202011d000500e40b540202011e000500e40b540202011f000500e40b5402
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0b01403 : 80040203b514030203b01403020500601de1378218020101000500e40b5402020102000500e40b5402020103000500e40b5402020104000500e40b5402020105000500e40b5402020106000500e40b5402020107000500e40b5402020108000500e40b5402020109000500e40b540202010a000500e40b540202010b000500e40b540202010c000500e40b540202010d000500e40b540202010e000500e40b540202010f000500e40b5402020110000500e40b5402020111000500e40b5402020112000500e40b5402020113000500e40b5402020114000500e40b5402020115000500e40b5402020116000500e40b5402020117000500e40b5402020118000500e40b5402
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0b51403 : 80040203b614030203b514030206800401cc200182010201050206800401cc2001
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0b61403 : 80040203b714030203b614030206800401cc200182010201050206800401cc2001
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0b71403 : 80040203b814030203b7140302064066748a2201820102010502064066748a2201
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0b81403 : 800402031115030203b8140302064066748a2201820102010502064066748a2201
cached 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0af1403 : 80040203b014030203af14030205004429353a8219020107000500e40b5402020108000500e40b5402020109000500e40b540202010a000500e40b540202010b000500e40b540202010c000500e40b540202010d000500e40b540202010e000500e40b540202010f000500e40b5402020110000500e40b5402020111000500e40b5402020112000500e40b5402020113000500e40b5402020114000500e40b5402020115000500e40b5402020116000500e40b5402020117000500e40b5402020118000500e40b5402020119000500e40b540202011a000500e40b540202011b000500e40b540202011c000500e40b540202011d000500e40b540202011e000500e40b540202011f000500e40b5402
2020-05-27T17:48:29.145+0300    INFO    runtime log     {"script": "acdbf5346b59185b0e0df88fead2a7e856df1ab5", "logs": "\"Transfer is failed. fromBalance < value\""}
2020-05-27T17:48:29.145+0300    WARN    contract invocation failed      {"tx": "313f8f2e05f5f5c6165af5f797ce74a211276e49133275bf5b6e09871cacf71d", "block": 2400921, "error": "error encountered at instruction 80 (THROWIFNOT): THROWIFNOT"}
create iterator
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0111503 : 80040203121503020311150302064066748a2201820102010502064066748a2201
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0121503 : 8004020100020312150302064066748a2201820102010502064066748a2201
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0b01403 : 80040203b514030203b01403020500601de1378218020101000500e40b5402020102000500e40b5402020103000500e40b5402020104000500e40b5402020105000500e40b5402020106000500e40b5402020107000500e40b5402020108000500e40b5402020109000500e40b540202010a000500e40b540202010b000500e40b540202010c000500e40b540202010d000500e40b540202010e000500e40b540202010f000500e40b5402020110000500e40b5402020111000500e40b5402020112000500e40b5402020113000500e40b5402020114000500e40b5402020115000500e40b5402020116000500e40b5402020117000500e40b5402020118000500e40b5402
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0b51403 : 80040203b614030203b514030206800401cc200182010201050206800401cc2001
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0b61403 : 80040203b714030203b614030206800401cc200182010201050206800401cc2001
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0b71403 : 80040203b814030203b7140302064066748a2201820102010502064066748a2201
stored 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0b81403 : 800402031115030203b8140302064066748a2201820102010502064066748a2201
cached 6c6f636b7570735f937d87615f1a9d839388b88b0692f402262e9cf0af1403 : 80040203b014030203af14030205002835893c821a020106000500e40b5402020107000500e40b5402020108000500e40b5402020109000500e40b540202010a000500e40b540202010b000500e40b540202010c000500e40b540202010d000500e40b540202010e000500e40b540202010f000500e40b5402020110000500e40b5402020111000500e40b5402020112000500e40b5402020113000500e40b5402020114000500e40b5402020115000500e40b5402020116000500e40b5402020117000500e40b5402020118000500e40b5402020119000500e40b540202011a000500e40b540202011b000500e40b540202011c000500e40b540202011d000500e40b540202011e000500e40b540202011f000500e40b5402

roman-khimov added a commit that referenced this issue May 27, 2020
Lower Cached state shouldn't be changed until Persist. Fixes #994.
roman-khimov added a commit that referenced this issue May 27, 2020
Lower Cached state shouldn't be changed until Persist. Fixes #994.
@roman-khimov
Copy link
Member Author

Testnet is fine now up to 3684000 after #996.

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