Coins Vanished?

Discussion in 'Tickets' started by AngelLox, Jan 30, 2016.

  1. 2017/12/15 - Decred v1.1.2 released! → Release Notes  → Downloads
  1. AngelLox

    AngelLox New Member
    Translator (Italiano)

    Dec 17, 2015
    8
    4
    Male
    I bought a stake ticket and the change coins (about 53) disappeared from my balance for 30-40 blocks whereas in previous purchases they were available shortly thereafter. Why did it happen? Or did i do something wrong?
    Edit: just bought another one and i got the change back after one block
     
  2. ClokworkGremlin

    ClokworkGremlin Sr. Member

    Jan 10, 2016
    535
    381
    Male
    Whatever I want.
    The coins will disappear from your wallet until the ticket bought with them has been voted or expired. Tickets are selected from the voting pool randomly(target average of 1028 blocks), so they could be returned within minutes or it could take a few days.
     
  3. AngelLox

    AngelLox New Member
    Translator (Italiano)

    Dec 17, 2015
    8
    4
    Male
    I know, what happened to me is that i bought the ticket with a 57 coin input. 4 of them went into the ticket, locked for whatever the time is, but the change(the remaining 53), which were supposed to come back after 1 conf, didn't until 30-40 blocks later.
    I'm gonna post the raw tx to clear it up:
    Code:
    {
      "txid": "9a9cbec423174190158ee5c2384cc2280264318da3de5f480a74eda9896a3803",
      "version": 1,
      "locktime": 0,
      "expiry": 0,
      "vin": [
        {
          "txid": "d63abbb26f6a61436346d28809cd6f5a14b05bb929aa80b5b146d55e89d51936",
          "vout": 2,
          "tree": 1,
          "sequence": 4294967295,
          "amountin": -1,
          "blockheight": 0,
          "blockindex": 4294967295,
          "scriptSig": {
            "asm": "3044022008c849c11bd2cc53134360478d1254be325b8b4b9df7f81b2952c479a96fe16e02207c8af9974172dd79b6956f1b6e7bfaf490ac21b7cbd3775a72776e014050dcf301 02ecfb35047b44852dc597242b6a1b03ad9c1d2d18ec9b4aafd9646245679860dc",
            "hex": "473044022008c849c11bd2cc53134360478d1254be325b8b4b9df7f81b2952c479a96fe16e02207c8af9974172dd79b6956f1b6e7bfaf490ac21b7cbd3775a72776e014050dcf3012102ecfb35047b44852dc597242b6a1b03ad9c1d2d18ec9b4aafd9646245679860dc"
          }
        }
      ],
      "vout": [
        {
          "value": 4.08530152,
          "n": 0,
          "version": 0,
          "scriptPubKey": {
            "asm": "OP_SSTX OP_DUP OP_HASH160 decfb86ebb29f9903d982a9c347ebb1b94810bda OP_EQUALVERIFY OP_CHECKSIG",
            "hex": "ba76a914decfb86ebb29f9903d982a9c347ebb1b94810bda88ac",
            "reqSigs": 1,
            "type": "stakesubmission",
            "addresses": [
              "TsmLFKpFPqoUiTFddiwo7YGKND918GsXjNH"
            ]
          }
        },
        {
          "value": 0,
          "n": 1,
          "version": 0,
          "scriptPubKey": {
            "asm": "OP_RETURN 1822b64d41c27b384f0e2005fb34a86d02aecc2ed0b05918000000000054",
            "hex": "6a1e1822b64d41c27b384f0e2005fb34a86d02aecc2ed0b05918000000000054",
            "type": "nulldata"
          }
        },
        {
          "value": 53.13140376,
          "n": 2,
          "version": 0,
          "scriptPubKey": {
            "asm": "OP_SSTXCHANGE OP_DUP OP_HASH160 0725020fd23948fac91ce2aaa84c03dba9a854ad OP_EQUALVERIFY OP_CHECKSIG",
            "hex": "bd76a9140725020fd23948fac91ce2aaa84c03dba9a854ad88ac",
            "reqSigs": 1,
            "type": "sstxchange",
            "addresses": [
              "TsRfuYGTnGSj4PnydHu4N779wgR7MWdKaxy"
            ]
          }
        }
      ]
    }
     
    ClokworkGremlin likes this.
  4. davecgh

    davecgh Hero Member
    Developer Organizer

    Dec 31, 2015
    642
    788
    Male
    United States
    A wallet dev just informed me that there is a bug where the reported balance is not accounting for the change of stake tickets that are in the memory pool and they're working on a fix.

    Since there is a limit of 20 tickets/block, there are a lot of tickets waiting in the mempool until they actually make it into a block right now. So, the coins aren't actually gone, the wallet just isn't reporting the balance for the zero confirmation change correctly.

    Thanks for reporting!
     
    ClokworkGremlin likes this.
  5. sambiohazard

    sambiohazard Sr. Member

    Jan 21, 2016
    844
    372
    Is this limit just for testnet? If ticket price adjustment algo counts tickets stuck in mempool, this can create tremendous inflation in price of ticktets.
     
  6. davecgh

    davecgh Hero Member
    Developer Organizer

    Dec 31, 2015
    642
    788
    Male
    United States
    It's for mainnet as well, and yes that is exactly the point of it. When there is high demand, the price will rise which will in turn reduce demand. As demand drops, so too will the price which will spur more purchases. The end result is the ticket pool will hover around a target size and develop a natural free market equilibrium.
     
  7. sambiohazard

    sambiohazard Sr. Member

    Jan 21, 2016
    844
    372
    Can this be used to manipulate voting around big decisions? Someone can start driving up the price prior to voting and many people will be left out of voting on important decisions. Will stake pools solve this problem as malicious actor will be acting against the whole pool?
     
    jy-p likes this.
  8. jy-p

    jy-p Sr. Member
    Organizer

    Jan 2, 2016
    133
    340
    Male
    There are a few things you need to keep in mind regarding what you describe:
    • Since purchasing of tickets is rate limited to 20 tickets per block, only so many tickets can be purchased in a short period of time.
    • The size of the ticket pool is quite large, ~40K tickets, so even purchasing all 20 tickets every block only gets you so many of those 40K tickets.
    • Once the ticket price stabilizes after launch, there should not be many unmined ticket purchase transactions. It would not be surprising for the ticket price to go up in the run-up to important decisions since that means more coin holders are seeking representation on the impending vote. I would consider the ticket price going up before a major decision as a good thing because it means more users are participating in the decision making process.
     
    tacotime likes this.
  9. sambiohazard

    sambiohazard Sr. Member

    Jan 21, 2016
    844
    372
    How are sstx selected to be included in a block? as this will determine whose ticket purchasing tx will go through & who gets the tickets. Anyways it seems to my novice brain that most attacks like this are theoretical or very expensive to do.
     
  10. Dyrk

    Dyrk Sr. Member
    Developer

    Jan 7, 2016
    518
    376
    Male
    Wonderland
    Hi @davecgh,
    I have a few question:

    1. How can we get a mempool size?
    2. How works selecting of the tickets, which to include in the block from a mempool? Is it again pseudorandom, as for voting, or the queue is ordered by submitting time?
    3. Some blocks include 5 "stx" hashes, another 25 "stx" hashes (it is 5 votes + 20 purchases, right?). Why can this happen? While mempool is big, why blocks not include new tickets? I'm waiting already ~ 1 day with 5 inmature tickets, and few hours ago block with height 6000 included only 5 stx hashes.
     
  11. Johnshpon3

    Johnshpon3 Member

    Dec 25, 2015
    210
    86
    Male
    Telecommunications
    Slovenia
    At Sunday I succesfully started PoS mining with settings --balancetomaintain=500.0 --ticketmaxprice=50. Wallet balance was more than 700 tDCRD in that time. I was often checking wallet balance and it was hovering somwhere arround 500 what should be OK. But today after I came home and checked ballance it was only 240. Weird or what?
    Now I stoped PoS mining, I think after all ticket expires, wallet balance will automaticaly grow till my initial 700 + earnings?
     
  12. Dyrk

    Dyrk Sr. Member
    Developer

    Jan 7, 2016
    518
    376
    Male
    Wonderland
    That's undocumented feature ;)
     
  13. davecgh

    davecgh Hero Member
    Developer Organizer

    Dec 31, 2015
    642
    788
    Male
    United States
    1) dcrctl getmininginfo | grep pooledtx
    2) It is at the miner's discretion. They are treated the same as normal transactions, so typically miner's will choose the ones with the highest transactions fee in order to maximize earnings. If they are also staking themselves, they'll obviously prefer their own purchase tickets.
    3) I'm not really familiar with the implementation code there, but my guess is the ticket price has risen above the price the sstxs pay so they can't be included until the price drops back below that threshold.
     
  14. Dyrk

    Dyrk Sr. Member
    Developer

    Jan 7, 2016
    518
    376
    Male
    Wonderland
    wow, that sounds pretty bad, since the price can never drop so low again. So immature tickets have the same time-to-live? About 145 days until they expire and coins will be unlocked again?

    Btw, thanks for your answers ;)
     
  15. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    Tickets are rapidly removed from the mempool in daemon when they don't meet the stake difficulty. If they fail to be included in a block for a period of 64 blocks, they are ejected from mempool. Wallet was never designed with the ability to remove transactions in mind and it is not trivial to add it because of the current architecture. Unlike Bitcoin and clones, Decred has an expiry field in tickets so you can set the ticket to expire as soon as the stake difficulty changes. In the future, this will be added to wallet so that it is set for all ticket purchases. Tickets will then get automatically pruned and resubmitted when the stake difficulty changes.

    Right now they can get stuck in wallet but not daemon. This is a known issue.

    https://github.com/decred/dcrwallet/issues/3

    There was an early flag to remove stuck tickets from wallet (--prunetickets), but it appears to be buggy. To recover stuck funds for now, just resync your wallet from seed and the old, stale tickets will disappear.
     
    Dyrk and davecgh like this.
  16. Dyrk

    Dyrk Sr. Member
    Developer

    Jan 7, 2016
    518
    376
    Male
    Wonderland
    Thanks, as you suggested I removed wallet and created it again from the seed. Now balance seems to be ok, coins are still locked, but at least I can see them. Before neither "getbalance default 0" nor "getbalance default 0 all" showed me correct numbers.

    When I ran wallet again, i saw that there were errors in inserting Sstx (block 3800). Is this ok? They was stucked not for 64 blocks, but for 2200 blocks.

    Code:
    12:22:39 2016-02-04 [INF] WLLT: Rescanned through block 00000000002d0f07341e6cf7ecea6efd451ebff7b3536d3ec91cfbd587dfb139 (height 3800)
    12:22:39 2016-02-04 [ERR] WLLT: Failed to insert SStx fca2264ce3b33b2f9f8197688cc1f103bcee5fe784c692f9bbfaec03b3ce5537into the stake store.
    12:22:39 2016-02-04 [ERR] WLLT: Cannot handle chain server notification : tx manager is closed
    12:22:39 2016-02-04 [ERR] WLLT: Failed to insert SStx fca2264ce3b33b2f9f8197688cc1f103bcee5fe784c692f9bbfaec03b3ce5537into the stake store.
    12:22:39 2016-02-04 [ERR] WLLT: Cannot handle chain server notification : tx manager is closed
    12:22:39 2016-02-04 [ERR] WLLT: Cannot handle chain server notification : tx manager is closed
    12:22:39 2016-02-04 [ERR] WLLT: Cannot handle chain server notification : tx manager is closed
    12:22:39 2016-02-04 [ERR] WLLT: Cannot handle chain server notification : tx manager is closed
    12:22:39 2016-02-04 [ERR] WLLT: Cannot handle chain server notification : tx manager is closed
    12:22:40 2016-02-04 [ERR] WLLT: Failed to insert SStx 25eb5244c752a43820173fc93945431675e3475b8458c380bef6745131a5e3e2into the stake store.
    12:22:40 2016-02-04 [ERR] WLLT: Cannot handle chain server notification : tx manager is closed
    12:22:40 2016-02-04 [ERR] WLLT: Failed to insert SStx 25eb5244c752a43820173fc93945431675e3475b8458c380bef6745131a5e3e2into the stake store.
    12:22:40 2016-02-04 [ERR] WLLT: Cannot handle chain server notification : tx manager is closed
    12:22:40 2016-02-04 [ERR] WLLT: Failed to insert SStx 31816c1f9d314f076333c0963ef638511f7ddfa136df9e469a49a32de018194dinto the stake store.
    12:22:40 2016-02-04 [ERR] WLLT: Cannot handle chain server notification : tx manager is closed
    12:22:40 2016-02-04 [ERR] WLLT: Failed to insert SStx 31816c1f9d314f076333c0963ef638511f7ddfa136df9e469a49a32de018194dinto the stake store.
    12:22:40 2016-02-04 [ERR] WLLT: Cannot handle chain server notification : tx manager is closed
     
  17. sambiohazard

    sambiohazard Sr. Member

    Jan 21, 2016
    844
    372
    @Dyrk are you sure wallet is unlocked? i am not tech pro but that is one of things that causes such error if you had wallet closed for long time & start it w/o unlocking, it just throws errors everywhere but it works as soon as you unlock it.
     
  18. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    Your wallet became disconnected from the daemon somehow and automatically shut down. Because of the way insertion of transactions is handled, it may be corrupted if this happens. Attempt to restore again from seed and try to ensure the integrity of your connection.
     

Share This Page