Author Topic: Untidy json moves?  (Read 1860 times)

Snailbrain

  • Developer
  • Hero Member
  • *****
  • Posts: 987
    • View Profile
Untidy json moves?
« on: July 21, 2015, 11:26:24 AM »
I see this a lot in name_pending

   "value" : "{\r\n  \"0\": {\r\n    \"wp\": [\r\n      97,\r\n      484,\r\n      98,\r\n      490\r\n    ]\r\n  }\r\n}",

asking domob - does this bloat the chain, or when the block is processed by a miner does it not make a difference?

not sure why it has all those - is it Mithrilman client or botter?

Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: Untidy json moves?
« Reply #1 on: July 21, 2015, 11:36:17 AM »
I think it's me that use indented json during serialization (\r\n are 2 standard chars that act as "NewLine" ) but can be even unity, i don't know for sure

I'll try to fix the serialization for the next release of my client, anyway it didn't caused any problem so far, i mean i used it since the begin of my client, anyway i agree it's wasted space without meaning
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

domob

  • Developer
  • Sr. Member
  • *****
  • Posts: 284
    • View Profile
Re: Untidy json moves?
« Reply #2 on: July 22, 2015, 06:43:13 AM »
It is "unnecessary" bloat, but perfectly valid.  I would suggest to fix the serialisation in whatever client causes this if possible, but it is not a critical issue.

Of course, we could introduce a new consensus-enforced rule that moves must not contain any whitespace.  This would enforce avoiding this "bloat", but I don't think it is worth the added complexity.  It would be a soft fork.
Use your Namecoin-ID as OpenID: https://nameid.org/
Donations: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | HBkxA5QmYSATFoPN1wFk8eBkgwPpY97Mfu

Snailbrain

  • Developer
  • Hero Member
  • *****
  • Posts: 987
    • View Profile
Re: Untidy json moves?
« Reply #3 on: July 22, 2015, 03:49:45 PM »
I think we should enforce it, but maybe at next hard fork - as someone could do it maliciously

Snailbrain

  • Developer
  • Hero Member
  • *****
  • Posts: 987
    • View Profile
Re: Untidy json moves?
« Reply #4 on: March 21, 2016, 11:58:34 AM »
i can still see a lot of this bloat?

Code: [Select]
@ubuntu-huntercoin:~/huntercoin/src$ ./huntercoind name_pending
[
    {
        "name" : "dsf",
        "txid" : "a875201fe2dad32a0a3f82273bdc7829051f68a17bd379053b23fab693fc4dd9",
        "op" : "name_update",
        "value" : "{\"0\":{\"destruct\":true}}",
        "ismine" : true
    },
    {
        "name" : "gffxx",
        "txid" : "05275dd6566c110cc0c7dba7813ce41b436537e09f9285b4d08726828da8a126",
        "op" : "name_update",
        "value" : "{\"0\":{\"wp\":[38,111]}}",
        "ismine" : true
    },
    {
        "name" : "kadal5",
        "txid" : "7f442d91f599dc8ad6ce7635d510e22aa38825827e069a32cbe5a0988d1f581e",
        "op" : "name_update",
        "value" : "{\r\n  \"0\": {\r\n    \"wp\": [\r\n      428,\r\n      312,\r\n      428,\r\n      311,\r\n      429,\r\n      311,\r\n      432,\r\n      314,\r\n      429,\r\n      314,\r\n      430,\r\n      311,\r\n      428,\r\n      311,\r\n      429,\r\n      314,\r\n      431,\r\n      314,\r\n      431,\r\n      311,\r\n      430,\r\n      311,\r\n      428,\r\n      311,\r\n      428,\r\n      312,\r\n      431,\r\n      312,\r\n      432,\r\n      313,\r\n      428,\r\n      313,\r\n      429,\r\n      314,\r\n      428,\r\n      312,\r\n      428,\r\n      311,\r\n      428,\r\n      314,\r\n      429,\r\n      314,\r\n      429,\r\n      311,\r\n      430,\r\n      311,\r\n      430,\r\n      314,\r\n      431,\r\n      314,\r\n      431,\r\n      311\r\n    ]\r\n  }\r\n}",
        "ismine" : false
    },
    {
        "name" : "naga4",
        "txid" : "fb78481e87f6cb6e8d4eef81970394b16caeba56ed87dc6726e83154b68fcb38",
        "op" : "name_update",
        "value" : "{\r\n  \"0\": {\r\n    \"wp\": [\r\n      247,\r\n      253,\r\n      254,\r\n      253,\r\n      251,\r\n      243,\r\n      253,\r\n      242,\r\n      257,\r\n      242,\r\n      263,\r\n      249,\r\n      257,\r\n      242,\r\n      252,\r\n      242,\r\n      251,\r\n      244,\r\n      254,\r\n      253\r\n    ]\r\n  }\r\n}",
        "ismine" : false
    },
    {
        "name" : "sapi4",
        "txid" : "aa7848d777b5504b4aee0b3bba47c797de238dd9237be8682624f50ede8040f9",
        "op" : "name_update",
        "value" : "{\r\n  \"0\": {\r\n    \"destruct\": true,\r\n    \"wp\": [\r\n      97,\r\n      322\r\n    ]\r\n  }\r\n}",
        "ismine" : false
    }
]

are these your characters MM or someone using your client?

Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: Untidy json moves?
« Reply #5 on: March 21, 2016, 08:52:34 PM »
i can still see a lot of this bloat?

Code: [Select]
@ubuntu-huntercoin:~/huntercoin/src$ ./huntercoind name_pending
[
    {
        "name" : "dsf",
        "txid" : "a875201fe2dad32a0a3f82273bdc7829051f68a17bd379053b23fab693fc4dd9",
        "op" : "name_update",
        "value" : "{\"0\":{\"destruct\":true}}",
        "ismine" : true
    },
    {
        "name" : "gffxx",
        "txid" : "05275dd6566c110cc0c7dba7813ce41b436537e09f9285b4d08726828da8a126",
        "op" : "name_update",
        "value" : "{\"0\":{\"wp\":[38,111]}}",
        "ismine" : true
    },
    {
        "name" : "kadal5",
        "txid" : "7f442d91f599dc8ad6ce7635d510e22aa38825827e069a32cbe5a0988d1f581e",
        "op" : "name_update",
        "value" : "{\r\n  \"0\": {\r\n    \"wp\": [\r\n      428,\r\n      312,\r\n      428,\r\n      311,\r\n      429,\r\n      311,\r\n      432,\r\n      314,\r\n      429,\r\n      314,\r\n      430,\r\n      311,\r\n      428,\r\n      311,\r\n      429,\r\n      314,\r\n      431,\r\n      314,\r\n      431,\r\n      311,\r\n      430,\r\n      311,\r\n      428,\r\n      311,\r\n      428,\r\n      312,\r\n      431,\r\n      312,\r\n      432,\r\n      313,\r\n      428,\r\n      313,\r\n      429,\r\n      314,\r\n      428,\r\n      312,\r\n      428,\r\n      311,\r\n      428,\r\n      314,\r\n      429,\r\n      314,\r\n      429,\r\n      311,\r\n      430,\r\n      311,\r\n      430,\r\n      314,\r\n      431,\r\n      314,\r\n      431,\r\n      311\r\n    ]\r\n  }\r\n}",
        "ismine" : false
    },
    {
        "name" : "naga4",
        "txid" : "fb78481e87f6cb6e8d4eef81970394b16caeba56ed87dc6726e83154b68fcb38",
        "op" : "name_update",
        "value" : "{\r\n  \"0\": {\r\n    \"wp\": [\r\n      247,\r\n      253,\r\n      254,\r\n      253,\r\n      251,\r\n      243,\r\n      253,\r\n      242,\r\n      257,\r\n      242,\r\n      263,\r\n      249,\r\n      257,\r\n      242,\r\n      252,\r\n      242,\r\n      251,\r\n      244,\r\n      254,\r\n      253\r\n    ]\r\n  }\r\n}",
        "ismine" : false
    },
    {
        "name" : "sapi4",
        "txid" : "aa7848d777b5504b4aee0b3bba47c797de238dd9237be8682624f50ede8040f9",
        "op" : "name_update",
        "value" : "{\r\n  \"0\": {\r\n    \"destruct\": true,\r\n    \"wp\": [\r\n      97,\r\n      322\r\n    ]\r\n  }\r\n}",
        "ismine" : false
    }
]

are these your characters MM or someone using your client?

I fixed that problem time ago but tbh i don't know if my current released version is the one i fixed, anyway I'll release soon the next version so if this is the case it will be fixed
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC