nspcc-dev / neo-go

Go Node and SDK for the Neo blockchain
MIT License
124 stars 79 forks source link

Testnet state mismatch at block 1 #3703

Open AliceInHunterland opened 1 week ago

AliceInHunterland commented 1 week ago

Current Behavior

Different state found.

(base) ekaterinapavlova@MacBook-Air-4 neo-go % go run ./scripts/compare-states/compare-states.go http://localhost:20332 https://rpc.t5.n3.nspcc.ru:20331
at 0: 62fd8ff9b0543aea352257db5b00bbb01d1bc0d2cc665e1f24cf5de0d16ebc7b vs 62fd8ff9b0543aea352257db5b00bbb01d1bc0d2cc665e1f24cf5de0d16ebc7b
at 5024731: c62d1314a11a140c5f0932212959565889c1ec0982ca18bf22405aa33a6ddb61 vs d06cafdf52c4f9199e4f11fec3f3b85096cec941d32f911f5d9cb42fb3ab926e
at 2512365: 84bb096b1efaeb223571832acb0cd96ee94557ef5f8d631ace92928f6e749c36 vs 86b4e0412c663d2aa8fa5a5ccf3d0e8624b46bf0698e7fef36fba25e0b978582
at 1256182: cb04979a573741391aa3a3f56cd79cd1eb4d3d8b0fa7ffbdb2129e50f8f648ac vs 4d212bf675454b1cbc13ea35ace0ccb18548007e5d26e00fe06db4500325324e
at 628091: de8fbc6141ff362a47c24b1eff17e0cdd7f90791ff44c55847ca14a37f18aa1e vs fa37b588be122e7a8ac0ab44da24f4bed72a56d5e2b106a717570b542dce2458
at 314045: 432e6c218e8685d2d4caedb33b2531699a7e743657252e02502d447aea25cbef vs 8a7caf58e717d7838136a55946b7d48bcdf057f1ea9f95484c687e1b450ffe01
at 157022: 6576db255183e3bd5d78b21b77e20622a8097ab78e67a2bbb8af1abf10e7d7f5 vs 71bcbf50b6e7bf5b8ed314ec20d224654f3d9ea16a8ea3a019b14f100c900b6b
at 78511: 42f8c637b70fffd6ccd8efc415840448f8104a03e8c17320fa233dc241e8368e vs 334c8fcf0ac265ec46fc09d4eebd727ce52162da0bf049bcc1f0472c7ef46974
at 39255: a266cd38964ad083d6c7a49eca9d06888234b9e8c03c17e50ec400435c2b386b vs 755b42aa406413d895e34d244073401a3804678e720640e8c405e8f7d2fe2f95
at 19627: 93db1af950d9e4982b3dd4ba7d33274df086e1e2215a36aeb78514a8551e815b vs c00ced7bffc91e93f6d891f8d23c66174dcb511229be21c4bebd9675b013c0f7
at 9813: d4cc9fb5514ba322634188f6334cc19fcb6f4c4ea309cb6ee47430a97df3dfc4 vs 2ff37da74791158e7da7d685b01b0474a79014efc1cd7c076224b3f9a668ca53
at 4906: ebd3843134286b5bab76645a6475afd3ebd0495922fcd0989738a5cfe303a257 vs 2f39d838b405cd96f328b6ecd4ec50dd4f14a28aff5627eaab1e7a2d7519afd5
at 2453: 1083a31ef79564053b356376c21849105349cf00c5ab6c65b803bf728d6d31eb vs a9f74ef455c931e7e6728cd90163c669c94f59a5af393d27bb8b3013716c4593
at 1226: c4c9a38f8e5e328b922e3d2ce9d03ed383a4a3cb2a1c0a1a4abf2e2cfeb25ca2 vs 02c375d2212572e2717391d94efbd76bf4f7d689887614cf90440bbd2116031a
at 613: e7d5636cb7d783b5b6f5b899f5ca4abc8ad502fd3f014fe122b35ea12edad8a4 vs a46dc7519fdf41acd370a012c73afc006fa029f75bee81d65cce84472a610477
at 306: 647f3c65bb2572271721795f68c24e5adb7aa7df5844381d737faf643a78550d vs 47084cd0ebfde0b4b07c22b08193ea957edd189726b58aec09234f3beda5a317
at 153: 779d47aa1d56098d62c3dd567aef83180626a297bf9fda5c8c8e2bdee58bad4d vs 0b441186cc28e93095dc6545ca8cdad36773d9a130b1f3ac21d0cd33dcebb3f1
at 76: ce97e1c8e051b7c01f8ead9f5f00c52acb062f4f46cc0755ccef2c09bcb59d81 vs fee6cb368ac5e2b9b8d2470746201724543066e83b67b64a8c8a16a326eb955f
at 38: b868881d07e418b11963a7e3df61725040e7dcddaea1ab6f68cda2c4c6b69ad0 vs 76f254dc83103ed4a28e8bbbd45a762809767e505c3a4535b7eb794b25ce36c2
at 19: 88f7978c247f736bf018b40369b4085e952b75f2fd31e4dce2bea03aff18b52d vs a02bba990dc16b0b1ffd3d5b0978e7c26c3084042f85c13a68db33b1777173cc
at 9: a4d498ff3905c3a7e75b98163233802a9347ed0469ce894f187b15fb3c62abb3 vs efa4a85a195934517ddc2aff905ec90768ede57c4f8b3f27535e07291918bd57
at 4: f07aacaa95c06d8851be24ae71d4fd6596a9969bfbec7c759ab9650e48d5b520 vs a5c9ba504cc0d0096a84a4ace3a7684e3a8a401b050ec440cdff49e410c4c33d
at 2: 0c65e20eb821d018cb11ed77938ef5243a63dd847812cda0d26dfaa27c59d57a vs b794622ff9483ec9a1a0e72b939beb01faed0a61fed4891edfe08ba2b123acd5
at 1: ba8377c07cafe5f612128e09ad76dcd1cdfc130de3370c826d5815245838e4f5 vs 7e31a84a95a2ed9e4d097692797580e65ac80475a829767f7b6343e626127737
state differs at 1, block 577ee5cf7c589f608937287f11da965c0462a8fae77f29959c834cbce38cacac
block 577ee5cf7c589f608937287f11da965c0462a8fae77f29959c834cbce38cacac:
--- http://localhost:20332
+++ https://rpc.t5.n3.nspcc.ru:20331
@@ -1,2 +1,2 @@
-(*result.ApplicationLog)(0x140002af000)({
+(*result.ApplicationLog)(0x14000598280)({
  Container: (util.Uint256) (len=32 cap=32) acac8ce3bc4c839c95297fe7faa862045c96da117f283789609f587ccfe57e57,
@@ -24,3 +24,3 @@
      Name: (string) (len=8) "Transfer",
-     Item: (*stackitem.Array)(0x1400058da70)(Array)
+     Item: (*stackitem.Array)(0x140001cb230)(Array)
     }

different state found
exit status 1

Expected Behavior

Possible Solution

Steps to Reproduce

  1. Testnet

Context

Regression

Your Environment

AnnaShaleva commented 1 week ago

I run the node locally on fresh master (ff15e39363ea44cbe337f493c434304de38b2382), got no diff:

anna@kiwi:~/Documents/GitProjects/nspcc-dev/neo-go$ go run ./scripts/compare-states/compare-states.go --ignore-height http://localhost:20332 http://seed1t5.neo.org:20332
at 0: 62fd8ff9b0543aea352257db5b00bbb01d1bc0d2cc665e1f24cf5de0d16ebc7b vs 62fd8ff9b0543aea352257db5b00bbb01d1bc0d2cc665e1f24cf5de0d16ebc7b
at 58273: 30de25edabe594dbf6d8790724cc7e5d37b1341043a4ff65b62e2085764005c2 vs 30de25edabe594dbf6d8790724cc7e5d37b1341043a4ff65b62e2085764005c2

Are you sure your DB is not malformed? Save the node's DB to a different directory and rerun node from clear DB, check if this problem is reproduced.

AnnaShaleva commented 1 week ago

Also attach application logs for block 1 and block 1 itself got from both C# seed and your node.

AliceInHunterland commented 1 week ago

My DB could be malformed as I was testing Blockfetcher with several interruptions. And yes, I am rerunning it now (second time)- still no error.

AnnaShaleva commented 1 week ago

I was testing Blockfetcher with several interruptions.

Blockfetcher must not break the DB in any way but TBH, I don't see how it's possible, because Blockfetcher is just an alternative source of blocks for the node. But let's keep this issue open, just in case.

AliceInHunterland commented 1 week ago
(base) ekaterinapavlova@MacBook-Air-4 neo-go % curl -X POST  http://localhost:20332 -H 'Content-Type: application/json' -d '{
  "jsonrpc": "2.0",
  "method": "getblock",
  "params": ["0x577ee5cf7c589f608937287f11da965c0462a8fae77f29959c834cbce38cacac", 1],
  "id": 1
}'| json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1528  100  1372  100   156   110k  12913 --:--:-- --:--:-- --:--:--  135k
{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : {
      "confirmations" : 5024811,
      "hash" : "0x577ee5cf7c589f608937287f11da965c0462a8fae77f29959c834cbce38cacac",
      "index" : 1,
      "merkleroot" : "0x0000000000000000000000000000000000000000000000000000000000000000",
      "nextblockhash" : "0xc77f88ea63c593a045e74ad041d7d343ec91eacc1a5ed2cc7447b60ed4bde1ed",
      "nextconsensus" : "NZHf1NJvz1tvELGLWZjhpb3NqZJFFUYpxT",
      "nonce" : "220F1C0AE004D552",
      "previousblockhash" : "0x9d3276785e7306daf59a3f3b9e31912c095598bbfb8a4476b821b0e59be4c57a",
      "primary" : 0,
      "size" : 697,
      "time" : 1650637687704,
      "tx" : [],
      "version" : 0,
      "witnesses" : [
         {
            "invocation" : "DECKcAUgm3Wr/U4aw52mVqheobvslZNtdyi8vac2zPVfCyvXLVZzkxe4ZqLF6qT01xX3efMU8eP5a8X7Ee8ilhXpDED+/dpsuuck9zkp7EF3vvADzXX6UQisEKPDpFFTsDrBfTpFN+O7+PKZEstHzFkTDnhggPiXAs6RNpTCRlpX+bGFDEDI4wMpE94KTKEuozDVOxbp7izVB2bpHJoPp30J3ednoXooVQTLRdYa7jMakNdG5lgAcEAUYjQnvosCFsTQHXBwDEDp6V6z1aLR45CteSCyTF0/hT4rrzqKw52FBGXIz6OtFH9bDdpfd2+sSYCRiBTI9roze0EZbZOsjyDD8IQTA+jbDECRQHx7dVyHA8nXXaZjJocSNVSPVDRNAdZHEXy+zftVSdNL50ogbybxqEXg2SNjqOsreCnyS5B+xCNIDofcrCJd",
            "verification" : "FQwhAwCbdUDhDyVi5f2PrJ6uwlFmpYsm5BI0j/WoaSe/rCKiDCEDAgXpzvrqWh38WAryDI1aokaLsBSPGl5GBfxiLIDmBLoMIQIUuvDO6jpm8X5+HoOeol/YvtbNgua7bmglAYkGX0T/AQwhAj6bMuqJuU0GbmSbEk/VDjlu6RNp6OKmrhsRwXDQIiVtDCEDQI3NQWOW9keDrFh+oeFZPFfZ/qiAyKahkg6SollHeAYMIQKng0vpsy4pgdFXy1u9OstCz9EepcOxAiTXpE6YxZEPGwwhAroscPWZbzV6QxmHBYWfriz+oT4RcpYoAHcrPViKnUq9F0Ge0Nw6"
         }
      ]
   }
}
(base) ekaterinapavlova@MacBook-Air-4 neo-go % curl -X POST  http://seed1t5.neo.org:20332 -H 'Content-Type: application/json' -d '{
  "jsonrpc": "2.0",
  "method": "getblock",
  "params": ["0x577ee5cf7c589f608937287f11da965c0462a8fae77f29959c834cbce38cacac", 1],
  "id": 1
}'| json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1582    0  1426  100   156   1561    170 --:--:-- --:--:-- --:--:--  1732
{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : {
      "confirmations" : 5024819,
      "hash" : "0x577ee5cf7c589f608937287f11da965c0462a8fae77f29959c834cbce38cacac",
      "index" : 1,
      "merkleroot" : "0x0000000000000000000000000000000000000000000000000000000000000000",
      "nextblockhash" : "0xc77f88ea63c593a045e74ad041d7d343ec91eacc1a5ed2cc7447b60ed4bde1ed",
      "nextconsensus" : "NZHf1NJvz1tvELGLWZjhpb3NqZJFFUYpxT",
      "nonce" : "220F1C0AE004D552",
      "previousblockhash" : "0x9d3276785e7306daf59a3f3b9e31912c095598bbfb8a4476b821b0e59be4c57a",
      "primary" : 0,
      "size" : 697,
      "time" : 1650637687704,
      "tx" : [],
      "version" : 0,
      "witnesses" : [
         {
            "invocation" : "DECKcAUgm3Wr/U4aw52mVqheobvslZNtdyi8vac2zPVfCyvXLVZzkxe4ZqLF6qT01xX3efMU8eP5a8X7Ee8ilhXpDED+/dpsuuck9zkp7EF3vvADzXX6UQisEKPDpFFTsDrBfTpFN+O7+PKZEstHzFkTDnhggPiXAs6RNpTCRlpX+bGFDEDI4wMpE94KTKEuozDVOxbp7izVB2bpHJoPp30J3ednoXooVQTLRdYa7jMakNdG5lgAcEAUYjQnvosCFsTQHXBwDEDp6V6z1aLR45CteSCyTF0/hT4rrzqKw52FBGXIz6OtFH9bDdpfd2+sSYCRiBTI9roze0EZbZOsjyDD8IQTA+jbDECRQHx7dVyHA8nXXaZjJocSNVSPVDRNAdZHEXy+zftVSdNL50ogbybxqEXg2SNjqOsreCnyS5B+xCNIDofcrCJd",
            "verification" : "FQwhAwCbdUDhDyVi5f2PrJ6uwlFmpYsm5BI0j/WoaSe/rCKiDCEDAgXpzvrqWh38WAryDI1aokaLsBSPGl5GBfxiLIDmBLoMIQIUuvDO6jpm8X5+HoOeol/YvtbNgua7bmglAYkGX0T/AQwhAj6bMuqJuU0GbmSbEk/VDjlu6RNp6OKmrhsRwXDQIiVtDCEDQI3NQWOW9keDrFh+oeFZPFfZ/qiAyKahkg6SollHeAYMIQKng0vpsy4pgdFXy1u9OstCz9EepcOxAiTXpE6YxZEPGwwhAroscPWZbzV6QxmHBYWfriz+oT4RcpYoAHcrPViKnUq9F0Ge0Nw6"
         }
      ]
   }
}
(base) ekaterinapavlova@MacBook-Air-4 neo-go % curl -X POST  http://localhost:20332 -H 'Content-Type: application/json' -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getapplicationlog",
  "params": ["0x577ee5cf7c589f608937287f11da965c0462a8fae77f29959c834cbce38cacac"]
}' | json_pp

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   725  100   575  100   150  76340  19915 --:--:-- --:--:-- --:--:--  101k
{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : {
      "blockhash" : "0x577ee5cf7c589f608937287f11da965c0462a8fae77f29959c834cbce38cacac",
      "executions" : [
         {
            "exception" : null,
            "gasconsumed" : "0",
            "notifications" : [],
            "stack" : [],
            "trigger" : "OnPersist",
            "vmstate" : "HALT"
         },
         {
            "exception" : null,
            "gasconsumed" : "0",
            "notifications" : [
               {
                  "contract" : "0xd2a4cff31913016155e38e474a2c06d08be276cf",
                  "eventname" : "Transfer",
                  "state" : {
                     "type" : "Array",
                     "value" : [
                        {
                           "type" : "Any"
                        },
                        {
                           "type" : "ByteString",
                           "value" : "gSvnpwgsmEL8Ks76QRi4vFpbkYs="
                        },
                        {
                           "type" : "Integer",
                           "value" : "50000000"
                        }
                     ]
                  }
               }
            ],
            "stack" : [],
            "trigger" : "PostPersist",
            "vmstate" : "HALT"
         }
      ]
   }
}
(base) ekaterinapavlova@MacBook-Air-4 neo-go % curl -X POST  http://seed1t5.neo.org:20332 -H 'Content-Type: application/json' -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getapplicationlog",
  "params": ["0x577ee5cf7c589f608937287f11da965c0462a8fae77f29959c834cbce38cacac"]
}' | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   690    0   540  100   150   1436    398 --:--:-- --:--:-- --:--:--  1835
{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : {
      "blockhash" : "0x577ee5cf7c589f608937287f11da965c0462a8fae77f29959c834cbce38cacac",
      "executions" : [
         {
            "gasconsumed" : "0",
            "notifications" : [],
            "stack" : [],
            "trigger" : "OnPersist",
            "vmstate" : "HALT"
         },
         {
            "gasconsumed" : "0",
            "notifications" : [
               {
                  "contract" : "0xd2a4cff31913016155e38e474a2c06d08be276cf",
                  "eventname" : "Transfer",
                  "state" : {
                     "type" : "Array",
                     "value" : [
                        {
                           "type" : "Any"
                        },
                        {
                           "type" : "ByteString",
                           "value" : "gSvnpwgsmEL8Ks76QRi4vFpbkYs="
                        },
                        {
                           "type" : "Integer",
                           "value" : "50000000"
                        }
                     ]
                  }
               }
            ],
            "stack" : [],
            "trigger" : "PostPersist",
            "vmstate" : "HALT"
         }
      ]
   }
}
AnnaShaleva commented 1 week ago

Don't see any difference in application log. How about the contract storage state changes for the same block?