Skip to content
Ben Rossi edited this page Mar 28, 2014 · 22 revisions

STATUS: DRAFT

Scenario: "Frozen"

It has been observed that it is possible to shift the network into a state such that proof-of-stake stops ("frozen") with early-life transfers of shares from one node to another (or multiples). This testing protocol is designed to identify conditions that lead to this network state.

Implemented Build (with a unique genesis block)

Single Miner Variation

  • Launch a new TestNet network with at least two discrete nodes.
  • On one of the nodes, in the peershares.conf file, set gen=1 to mine the IPO
  • The other node will run with a standard peershares.conf
  • Between blocks 1 and 400, proof-of-work mining will commence, and pay the mining node a reward of 2500 shares per block.
  • After block 400 is paid, the mining node will control 100% of the available 1.0M shares.
  • At block 401, proof-of-stake minting is supposed to kick in (but doesn't)
  • Stop the nodes' daemons with ./peersharesd stop
  • Restart the nodes' daemons with ./peersharesd -daemon -testnet
  • Network should resume, and proof-of-stake should pick up
  • Send a portion of shares to the non-mining/minting node
    • Network should continue to process blocks with proof-of-stake
  • Send a larger minority of shares to the non-mining/minting node
    • Network should continue to process blocks with proof-of-stake
  • Send a all of the mining/minting node's shares to the other node

Observed (but unconfirmed) Issues / Hypotheses

  1. Generated shares maturation isn't quick enough

  2. The protocol is allowing the transfer of immature shares

  3. If immature shares are allowed to be transferred, you can move into a situation where the network cannot sustain itself because there are no shares available to mint stake with

  4. With relatively fast block times (on testnet) it's unclear if the current rate of "M1" inflation would be able to keep up with the deflation caused by the fixed 0.01 share TX fee (Note: This is supposition, at this time, but we need additional modeling to validate if it is a concern)

Test Data:

At block 400, the network "stalled" and proof-of-stake did not start up as expected. Block 400 output of getinfo on the mining node:

{
    "version" : "v0.3.0ppc-132-ge05f93f-dirty-beta",
    "protocolversion" : 60003,
    "walletversion" : 60000,
    "balance" : 802500.00000000,
    "newmint" : 197500.00000000,
    "stake" : 0.00000000,
    "blocks" : 400,
    "moneysupply" : 1000000.00000000,
    "connections" : 2,
    "proxy" : "",
    "ip" : "172.15.131.27",
    "difficulty" : 0.00024887,
    "testnet" : true,
    "keypoololdest" : 1395890309,
    "keypoolsize" : 102,
    "paytxfee" : 0.01000000,
    "errors" : ""
}

Output from listtransactions on the mining node:

[
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 10,
        "blockhash" : "000003d87a39a4751242df82c0048dc877b1250090adda97fc2c462839bb30e2",
        "blockindex" : 0,
        "txid" : "20087d247b3c8d91d3eee88ee32fa2e658d919aab56c74dcdffcbfc25f6e3fe5",
        "time" : 1395890366
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 11,
        "blockhash" : "00000c3f7fcef0c9888338802468e97285c70602e862ecb1e52e270e45f1c89d",
        "blockindex" : 0,
        "txid" : "5de9f2b83fa9614a275fa459fed5803b36eb094796b5ba2f3fbea1819b4a19a9",
        "time" : 1395890366
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 9,
        "blockhash" : "000009dad8c6cf8b8551b507e47c2c947fc3829c7774acb674fe566e349bae9c",
        "blockindex" : 0,
        "txid" : "9993cf5ddfdd6c4fa50da88adff88926da264f8720b687fe3bb5d5bc76a8757f",
        "time" : 1395890366
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 5,
        "blockhash" : "00000e0f293365d5cced7f0ffc326e8d8a6ee6d63e2f9db9f92878acf12e0c1f",
        "blockindex" : 0,
        "txid" : "2fe6768da7fc9c00cbc43190317635b001bb29a87bd000fdb36f20fa32bf8298",
        "time" : 1395890367
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 7,
        "blockhash" : "000006f24e466a07df040295c801dc078f1527249136614b9c38087c412cecbd",
        "blockindex" : 0,
        "txid" : "b177b892966a9cf0e55ee8b046f48e4c43fd30859dfb4faf08fa1ed921a005b1",
        "time" : 1395890367
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 6,
        "blockhash" : "00000f85528eda6ee42e6c4a0d76db0511ef7ee5f2d932860670347379cb932f",
        "blockindex" : 0,
        "txid" : "dfc55cf40fef2e3732c8752556676a99a29131187758d1a16b6b8d45f3da41c8",
        "time" : 1395890367
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 3,
        "blockhash" : "0000051c4e1abe1684306d0257e4cf38dfe0747f4fab5a2f7c42334970e535b5",
        "blockindex" : 0,
        "txid" : "157d7e2f66aca52c4b9f6844f2fececd4b16f7670c10289ebb9338fe93f3dcc4",
        "time" : 1395890368
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 4,
        "blockhash" : "0000096c6ae747bf692389ecfebd5f7e94b2b37087ed42b0a28cb51f179277d9",
        "blockindex" : 0,
        "txid" : "3a37b4af835dbe09d1e8dd6a87026e44f581652e9bfa67ee5371ceaad011fc9e",
        "time" : 1395890368
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 2,
        "blockhash" : "0000027bb8b2c8ecd025a7bd091b1914e2684e36bb9f50e39bc38d26001ba403",
        "blockindex" : 0,
        "txid" : "e4c3e1cdde62191972205b6c76b9203307132b49f3ac4a1ea876e25f90082a22",
        "time" : 1395890369
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 1,
        "blockhash" : "00000f31b737fe1d2f259084298f3dd6ee755027a65d3504f13e92c24c9a0334",
        "blockindex" : 0,
        "txid" : "6ed50cc8a307c1ecd0d2517c511087704eb3d9cb19e5ef940404342eb1f415f1",
        "time" : 1395890370
    }
]

Mining node debug.log file, at block 400.

After restart of the network, post-block 400. From getinfo on the node with the shares (previously the mining node, now the minting node):

{
    "version" : "v0.3.0ppc-132-ge05f93f-dirty-beta",
    "protocolversion" : 60003,
    "walletversion" : 60000,
    "balance" : 802500.00000000,
    "newmint" : 190000.00000000,
    "stake" : 7500.00000000,
    "blocks" : 403,
    "moneysupply" : 1000000.00000000,
    "connections" : 2,
    "proxy" : "",
    "ip" : "172.15.131.27",
    "difficulty" : 0.00024887,
    "testnet" : true,
    "keypoololdest" : 1395890314,
    "keypoolsize" : 101,
    "paytxfee" : 0.01000000,
    "errors" : ""
}

Sample output from debug.log, showing a block solved with stake:

new block found  
  hash: a9a9e693edb98dc231eaceb6fed2b5ee55a5854f83a130181ac06795f2d7f374  
target: 0000ffff00000000000000000000000000000000000000000000000000000000
CBlock(hash=a9a9e693edb98dc231ea, ver=1, hashPrevBlock=bd3652551a5f25106d3d, hashMerkleRoot=ccb3cd0882, nTime=1395892291, nBits=1f00ffff, nNonce=0, vtx=2, vchBlockSig=3045022100a625f502be8c41dd824f232b8c15d052f280f00e7565b6c01eac8d59bc6968df022011d0c940b314b84367fb47098f494031cf58601d22d6de36d62171f25d3b07e8)
  Coinbase(hash=0eefbea1c4, nTime=1395892291, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000, -1), coinbase 0443a03353010c062f503253482f)
    CTxOut(empty)
  Coinstake(hash=6659e9853d, nTime=1395892291, ver=1, vin.size=1, vout.size=3, nLockTime=0)
    CTxIn(COutPoint(4a620689cb, 0), scriptSig=304502206fc0958fd8fe922c)
    CTxOut(empty)
    CTxOut(nValue=1250.00, scriptPubKey=02702da61753e3db0e527f22018b3911c20233b8dc96b36721d5be0864c2c453e5 OP_CHECKSIG)
    CTxOut(nValue=1250.00, scriptPubKey=02702da61753e3db0e527f22018b3911c20233b8dc96b36721d5be0864c2c453e5 OP_CHECKSIG)
  vMerkleTree: 0eefbea1c4 6659e9853d ccb3cd0882 
2014-03-27 03:51:31 UTC generated 0.00
keypool keep 403
AddToWallet 6659e9853d  new
WalletUpdateSpent found spent coin 2500.00ppc 4a620689cb4f36ac0e96060e3501c985ae1af3bcd08b53b18ccf07ae50885e70
SetBestChain: new best=a9a9e693edb98dc231ea  height=402  trust=131475  moneysupply=1000000.00
ProcessBlock: ACCEPTED

From the minting node, listtransactions (post-block 400):

[
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 8,
        "blockhash" : "00000e0f293365d5cced7f0ffc326e8d8a6ee6d63e2f9db9f92878acf12e0c1f",
        "blockindex" : 0,
        "txid" : "2fe6768da7fc9c00cbc43190317635b001bb29a87bd000fdb36f20fa32bf8298",
        "time" : 1395890367
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 10,
        "blockhash" : "000006f24e466a07df040295c801dc078f1527249136614b9c38087c412cecbd",
        "blockindex" : 0,
        "txid" : "b177b892966a9cf0e55ee8b046f48e4c43fd30859dfb4faf08fa1ed921a005b1",
        "time" : 1395890367
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 9,
        "blockhash" : "00000f85528eda6ee42e6c4a0d76db0511ef7ee5f2d932860670347379cb932f",
        "blockindex" : 0,
        "txid" : "dfc55cf40fef2e3732c8752556676a99a29131187758d1a16b6b8d45f3da41c8",
        "time" : 1395890367
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 6,
        "blockhash" : "0000051c4e1abe1684306d0257e4cf38dfe0747f4fab5a2f7c42334970e535b5",
        "blockindex" : 0,
        "txid" : "157d7e2f66aca52c4b9f6844f2fececd4b16f7670c10289ebb9338fe93f3dcc4",
        "time" : 1395890368
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 7,
        "blockhash" : "0000096c6ae747bf692389ecfebd5f7e94b2b37087ed42b0a28cb51f179277d9",
        "blockindex" : 0,
        "txid" : "3a37b4af835dbe09d1e8dd6a87026e44f581652e9bfa67ee5371ceaad011fc9e",
        "time" : 1395890368
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 5,
        "blockhash" : "0000027bb8b2c8ecd025a7bd091b1914e2684e36bb9f50e39bc38d26001ba403",
        "blockindex" : 0,
        "txid" : "e4c3e1cdde62191972205b6c76b9203307132b49f3ac4a1ea876e25f90082a22",
        "time" : 1395890369
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 4,
        "blockhash" : "00000f31b737fe1d2f259084298f3dd6ee755027a65d3504f13e92c24c9a0334",
        "blockindex" : 0,
        "txid" : "6ed50cc8a307c1ecd0d2517c511087704eb3d9cb19e5ef940404342eb1f415f1",
        "time" : 1395890370
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 3,
        "blockhash" : "bd3652551a5f25106d3d079d20dca5d3bf5635e206940a78dae3702150dc6035",
        "blockindex" : 1,
        "txid" : "d4705859196be390db2058da70b43ef89108ab3012d7c7d348f952e2ca6d871c",
        "time" : 1395892285
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 2,
        "blockhash" : "a9a9e693edb98dc231eaceb6fed2b5ee55a5854f83a130181ac06795f2d7f374",
        "blockindex" : 1,
        "txid" : "6659e9853d9fe2ce1a3b3daaac31c0c8949b5660efd6130fe51261ff654bd6d3",
        "time" : 1395892291
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 1,
        "blockhash" : "89916c868a19c8795ee464c732a233e74edb9e54dec3fe2c0b2026375970394e",
        "blockindex" : 1,
        "txid" : "46238627534c878b68d9d09accfe22c6ae427a32f1e2c188cc90f2116e52ee34",
        "time" : 1395892331
    }
]
tester@testy01:~/.peershares$ ./ppcoind listtransactions
[
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 11,
        "blockhash" : "00000f85528eda6ee42e6c4a0d76db0511ef7ee5f2d932860670347379cb932f",
        "blockindex" : 0,
        "txid" : "dfc55cf40fef2e3732c8752556676a99a29131187758d1a16b6b8d45f3da41c8",
        "time" : 1395890367
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 8,
        "blockhash" : "0000051c4e1abe1684306d0257e4cf38dfe0747f4fab5a2f7c42334970e535b5",
        "blockindex" : 0,
        "txid" : "157d7e2f66aca52c4b9f6844f2fececd4b16f7670c10289ebb9338fe93f3dcc4",
        "time" : 1395890368
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 9,
        "blockhash" : "0000096c6ae747bf692389ecfebd5f7e94b2b37087ed42b0a28cb51f179277d9",
        "blockindex" : 0,
        "txid" : "3a37b4af835dbe09d1e8dd6a87026e44f581652e9bfa67ee5371ceaad011fc9e",
        "time" : 1395890368
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 7,
        "blockhash" : "0000027bb8b2c8ecd025a7bd091b1914e2684e36bb9f50e39bc38d26001ba403",
        "blockindex" : 0,
        "txid" : "e4c3e1cdde62191972205b6c76b9203307132b49f3ac4a1ea876e25f90082a22",
        "time" : 1395890369
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 6,
        "blockhash" : "00000f31b737fe1d2f259084298f3dd6ee755027a65d3504f13e92c24c9a0334",
        "blockindex" : 0,
        "txid" : "6ed50cc8a307c1ecd0d2517c511087704eb3d9cb19e5ef940404342eb1f415f1",
        "time" : 1395890370
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 5,
        "blockhash" : "bd3652551a5f25106d3d079d20dca5d3bf5635e206940a78dae3702150dc6035",
        "blockindex" : 1,
        "txid" : "d4705859196be390db2058da70b43ef89108ab3012d7c7d348f952e2ca6d871c",
        "time" : 1395892285
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 4,
        "blockhash" : "a9a9e693edb98dc231eaceb6fed2b5ee55a5854f83a130181ac06795f2d7f374",
        "blockindex" : 1,
        "txid" : "6659e9853d9fe2ce1a3b3daaac31c0c8949b5660efd6130fe51261ff654bd6d3",
        "time" : 1395892291
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 3,
        "blockhash" : "89916c868a19c8795ee464c732a233e74edb9e54dec3fe2c0b2026375970394e",
        "blockindex" : 1,
        "txid" : "46238627534c878b68d9d09accfe22c6ae427a32f1e2c188cc90f2116e52ee34",
        "time" : 1395892331
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 2,
        "blockhash" : "0789d755967e954cd9d8000054645770987b8f538ac8633018c3a3ede5d1d232",
        "blockindex" : 1,
        "txid" : "f32dd6263713a7ea3f18cc2e417df3d0463361976bbe2edffd490c616ed3082a",
        "time" : 1395892384
    },
    {
        "account" : "",
        "category" : "immature",
        "amount" : 2500.00000000,
        "confirmations" : 1,
        "blockhash" : "93cd74fafff1b39579ad1a038a11c24c98c214d3999f76387e4c965cf566eec4",
        "blockindex" : 1,
        "txid" : "f1c312599e854afac9527970615bf972384eb12b6f828a16fa857d01a463372a",
        "time" : 1395892394
    }
]

After block 453, using getinfo on the minting node:

{
    "version" : "v0.3.0ppc-132-ge05f93f-dirty-beta",
    "protocolversion" : 60003,
    "walletversion" : 60000,
    "balance" : 802500.00000000,
    "newmint" : 65000.00000000,
    "stake" : 132500.00000000,
    "blocks" : 453,
    "moneysupply" : 1000000.00000000,
    "connections" : 2,
    "proxy" : "",
    "ip" : "172.15.131.27",
    "difficulty" : 0.00024887,
    "testnet" : true,
    "keypoololdest" : 1395890342,
    "keypoolsize" : 101,
    "paytxfee" : 0.01000000,
    "errors" : ""
}

Update: After 2774 blocks, here is a link to the output of listtransactions "" 3000 0 showing the current state of transaction maturation, and the output of getinfo on the minting node:

{
    "version" : "v0.3.0ppc-132-ge05f93f-dirty-beta",
    "protocolversion" : 60003,
    "walletversion" : 60000,
    "balance" : 957266.64000000,
    "newmint" : 0.00000000,
    "stake" : 42734.47000000,
    "blocks" : 2774,
    "moneysupply" : 1000001.11000000,
    "connections" : 2,
    "proxy" : "",
    "ip" : "172.15.131.27",
    "difficulty" : 0.00024887,
    "testnet" : true,
    "keypoololdest" : 1395926881,
    "keypoolsize" : 101,
    "paytxfee" : 0.01000000,
    "errors" : ""
}

Update: Block 8357 passed, getinfo output from mining/minting node:

{
    "version" : "v0.3.0ppc-132-ge05f93f-dirty-beta",
    "protocolversion" : 60003,
    "walletversion" : 60000,
    "balance" : 986798.04000000,
    "newmint" : 0.00000000,
    "stake" : 13203.12000000,
    "blocks" : 8357,
    "moneysupply" : 1000001.16000000,
    "connections" : 1,
    "proxy" : "",
    "ip" : "172.15.131.27",
    "difficulty" : 0.00024887,
    "testnet" : true,
    "keypoololdest" : 1395970468,
    "keypoolsize" : 101,
    "paytxfee" : 0.01000000,
    "errors" : ""
}

Debug.log file from around block 8753, post transfer testing.


Multi-Miner Variation

  1. Launch three nodes on to a new network, each with the argument, gen=1, added to their peershares.conf file.
  2. Competitively mine the first 400 blocks, at which point proof-of-stake will kick in
  3. Confirm that blocks > 400 continue to be processed using stake.
  4. Transfer amounts of shares between the nodes to confirm that the network can not be put into a state where there are no viable stakes that can be used to solve blocks.

Questions to address

  • How many confirmations are required before a generated share is moved from "immature" to "mature"?
  • Does spreading out the mining effort affect how well the network handles spending the first few, large transactions?
  • Will proof-of-stake automatically start at block 401, or will the nodes need to be stopped and started up again like they have in the past?

Observations

  • Proof-of-stake did NOT start automatically, under this configuration, and required us to stop the nodes and restart them
  • Node 1's output from ./peersharesd listtransactions "" 400 0: