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

State changes difference at mainnet's block 3101467 #806

Closed
roman-khimov opened this issue Mar 28, 2020 · 6 comments · Fixed by #808
Closed

State changes difference at mainnet's block 3101467 #806

roman-khimov opened this issue Mar 28, 2020 · 6 comments · Fixed by #808
Labels
bug Something isn't working
Milestone

Comments

@roman-khimov
Copy link
Member

Ours:

 {
  "block": 3101467,
  "size": 11,
  "storage": [
   {
    "state": "Added",
    "key": "97210e7c98582151ceb37f9748c9a1d27d9ae6fd206761735f707269636500000000000006",
    "value": "000400b4c40400"
   },
   {
    "state": "Added",
    "key": "97210e7c98582151ceb37f9748c9a1d27d9ae6fd207364735f707269636500000000000006",
    "value": "000300350c00"
   },
   {
    "state": "Added",
    "key": "97210e7c98582151ceb37f9748c9a1d27d9ae6fd10736e656f5f7072696365611df35019009588bbb136bdde68fa6909e2f4594b0001",
    "value": "00010100"
   },
   {
    "state": "Added",
    "key": "97210e7c98582151ceb37f9748c9a1d27d9ae6fd037364735f707269636500000000000006",
    "value": "001d8201000300350c0014611df350199588bbb136bdde68fa6909e2f4594b00"
   },
   {
    "state": "Added",
    "key": "97210e7c98582151ceb37f9748c9a1d27d9ae6fd106761735f7072696365611df35019950088bbb136bdde68fa6909e2f4594b000002",
    "value": "00010100"
   },
   {
    "state": "Changed",
    "key": "d2e0d02009fc103037dae5bc66568c2a11ca7c4c21ca80e820379cbc743aab726189616600529bc491c44ab9a83997e5aca6a51dbc000de3c7064df7db3024b32e92c28b6a420004dbc31bf100000000000000000000000b",
    "value": "000480f0fa0200"
   },
   {
    "state": "Added",
    "key": "97210e7c98582151ceb37f9748c9a1d27d9ae6fd106e656f5f7072696365611df35019950088bbb136bdde68fa6909e2f4594b000002",
    "value": "00010100"
   },
   {
    "state": "Changed",
    "key": "d2e0d02009fc103037dae5bc66568c2a11ca7c4c02ca80e820379cbc743aab726189616600529bc491c44ab9a83997e5aca6a51dbc000d0000000000000000000000000000000f",
    "value": "008c800a0020ca80e820379cbc743aab7261896166529bc491c44ab9a83997e5aca6a51dbc0d0014e3c7064df7db3024b32e92c28b6a4204dbc31bf1002073ef176d9f12809e64363b2b5f4553abecca7aae157327f190323cfa0e42c81500046564656e010002037e332f0000020480f0fa020014e3c7064df7db3024b32e92c28b6a4204dbc31bf102031a532f00"
   },
   {
    "state": "Changed",
    "key": "d2e0d02009fc103037dae5bc66568c2a11ca7c4c11e3c7064df7db3024b32e92c28b6a420004dbc31bf100000000000000000000000b",
    "value": "00042067460500"
   },
   {
    "state": "Added",
    "key": "97210e7c98582151ceb37f9748c9a1d27d9ae6fd036761735f707269636500000000000006",
    "value": "001e8201000400b4c4040014611df350199588bbb136bdde68fa6909e2f4594b00"
   },
   {
    "state": "Added",
    "key": "97210e7c98582151ceb37f9748c9a1d27d9ae6fd107364735f7072696365611df35019950088bbb136bdde68fa6909e2f4594b000002",
    "value": "00010100"
   }
  ]
 },

Theirs:

   {
      "storage" : [
         {
            "value" : "00010100",
            "key" : "97210e7c98582151ceb37f9748c9a1d27d9ae6fd106761735f7072696365611df35019950088bbb136bdde68fa6909e2f4594b000002",
            "state" : "Added"
         },
         {
            "key" : "97210e7c98582151ceb37f9748c9a1d27d9ae6fd036761735f707269636500000000000006",
            "value" : "001e82010014611df350199588bbb136bdde68fa6909e2f4594b000400b4c40400",
            "state" : "Added"
         },
         {
            "state" : "Added",
            "value" : "000400b4c40400",
            "key" : "97210e7c98582151ceb37f9748c9a1d27d9ae6fd206761735f707269636500000000000006"
         },
         {
            "key" : "d2e0d02009fc103037dae5bc66568c2a11ca7c4c11e3c7064df7db3024b32e92c28b6a420004dbc31bf100000000000000000000000b",
            "value" : "00042067460500",
            "state" : "Changed"
         },
         {
            "state" : "Changed",
            "key" : "d2e0d02009fc103037dae5bc66568c2a11ca7c4c02ca80e820379cbc743aab726189616600529bc491c44ab9a83997e5aca6a51dbc000d0000000000000000000000000000000f",
            "value" : "008c800a0020ca80e820379cbc743aab7261896166529bc491c44ab9a83997e5aca6a51dbc0d0014e3c7064df7db3024b32e92c28b6a4204dbc31bf1002073ef176d9f12809e64363b2b5f4553abecca7aae157327f190323cfa0e42c81500046564656e010002037e
332f0000020480f0fa020014e3c7064df7db3024b32e92c28b6a4204dbc31bf102031a532f00"
         },
         {
            "state" : "Changed",
            "value" : "000480f0fa0200",
            "key" : "d2e0d02009fc103037dae5bc66568c2a11ca7c4c21ca80e820379cbc743aab726189616600529bc491c44ab9a83997e5aca6a51dbc000de3c7064df7db3024b32e92c28b6a420004dbc31bf100000000000000000000000b"
         },
         {
            "key" : "97210e7c98582151ceb37f9748c9a1d27d9ae6fd106e656f5f7072696365611df35019950088bbb136bdde68fa6909e2f4594b000002",
            "value" : "00010100",
            "state" : "Added"
         },
         {
            "value" : "00010100",
            "key" : "97210e7c98582151ceb37f9748c9a1d27d9ae6fd107364735f7072696365611df35019950088bbb136bdde68fa6909e2f4594b000002",
            "state" : "Added"
         },
         {
            "value" : "001d82010014611df350199588bbb136bdde68fa6909e2f4594b000300350c00",
            "key" : "97210e7c98582151ceb37f9748c9a1d27d9ae6fd037364735f707269636500000000000006",
            "state" : "Added"
         },
         {
            "key" : "97210e7c98582151ceb37f9748c9a1d27d9ae6fd207364735f707269636500000000000006",
            "value" : "000300350c00",
            "state" : "Added"
         },
         {
            "state" : "Added",
            "value" : "00010100",
            "key" : "97210e7c98582151ceb37f9748c9a1d27d9ae6fd10736e656f5f7072696365611df35019009588bbb136bdde68fa6909e2f4594b0001"
         }
      ],
      "block" : 3101467,
      "size" : 11
   },
@roman-khimov roman-khimov added the bug Something isn't working label Mar 28, 2020
@roman-khimov roman-khimov added this to the v0.74.1 milestone Mar 28, 2020
@roman-khimov
Copy link
Member Author

There is absolutely zero difference in application logs for all transactions from this block.

@roman-khimov
Copy link
Member Author

Some values differ, like 001e82010014611df350199588bbb136bdde68fa6909e2f4594b000400b4c40400 vs 001e8201000400b4c4040014611df350199588bbb136bdde68fa6909e2f4594b00. And it looks like it's actually a swapping problem for some two components:

001e820100 14611df350199588bbb136bdde68fa6909e2f4594b00 0400b4c40400
001e820100 0400b4c40400 14611df350199588bbb136bdde68fa6909e2f4594b00

@roman-khimov
Copy link
Member Author

Or even

001e 82 01 0014611df350199588bbb136bdde68fa6909e2f4594b 000400b4c40400

It's a serialized map with one KV pair.

roman-khimov added a commit that referenced this issue Mar 28, 2020
C# pushes value and key to the stack of non-serialized items, so key gets
serialized first followed by value. Fixes #806.

Notice though that neither IDictionary in C#, nor map in Go have elements
ordered, so we can easily get a difference in KV pairs order and it would be
impossible to fix.
@roman-khimov
Copy link
Member Author

Confirming the fix in #808.

@roman-khimov
Copy link
Member Author

Unfortunately we have a case of different elements order at block 3101822:

ours:   008e8205001414604c33f7a5ec514460ed30d699a3139e12f74500047bec332300142611c6e5721067c92a675f67c65b2275512d3a390004963d2223001447b2dfa3a04d2bbc42d179a2468246ace58b79e2000442b6fd220014d09f4e3258bb1fc2b302c59f99c777a18c10e93e00046ac9fc220014611df350199588bbb136bdde68fa6909e2f4594b0004d0af832400
theirs: 008e82050014611df350199588bbb136bdde68fa6909e2f4594b0004d0af8324001414604c33f7a5ec514460ed30d699a3139e12f74500047bec332300142611c6e5721067c92a675f67c65b2275512d3a390004963d2223001447b2dfa3a04d2bbc42d179a2468246ace58b79e2000442b6fd220014d09f4e3258bb1fc2b302c59f99c777a18c10e93e00046ac9fc2200

And it's not clear how to fix that.

@roman-khimov
Copy link
Member Author

@fyrchik: I plan to rework comparison tool for this case, I don't think we can reliably reproduce C# element order (it's not sorted in any way).

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

Successfully merging a pull request may close this issue.

1 participant