Another TestChain stops mining.

+2 votes
I had another Testchain running for about two weeks.  Four nodes were running with connect,receive,mine permissions. None of the nodes were encrypted. The group of nodes stop mining and the chain pretty much locked up again. This time multichain made it to 68785 blocks and then the lock up occurred.

Getpeerinfo does show each node is connected but there is just no mining. I tried restarting and -reindex=1 but nothing gets any of the nodes to mine again. This is my third multichain with mining lock after a few weeks in operation.  I cannot seem to get past 100,000 blocks without lockup. Is there some way to recover after all nodes stop mining.
asked Oct 11, 2016 by dtarsio

1 Answer

0 votes

First I want to confirm you are not using wallet encryption, because that prevents mining in the default case where blocks need to be signed.

If that's not the solution then you have probably found a rare bug, and we would like your help to resolve it. Please can you stop all the nodes, compress all of their blockchain directories (by default, ~/.multichain/[chain-name]) and send them to multichain dot debug at gmail. If the files are too big to email in individual messages, leave a comment here and we'll contact you to find another solution. Thanks!

answered Oct 12, 2016 by MultiChain
There are 8 addresses with mining permission in this chain. With mining-diversity=0.3 this means that every miner can mine only every third block. This will work only if each miner is connected to at least two other miner nodes.

Looking into the logs (I have logs from 6 nodes), I can see that the nodes are not connected two each other. Please check (using getpeerinfo) that at least 3 active miners are connected to each other.

If it is indeed connection problem and you cannot resolve it by yourself, please let us know, we'll try to help you.

If it is not connection problem (i.e. 3 miners are connected to each other), please send us only debug.log file from these 3 nodes.
Ok actually I think the chain may have started again. I added more nodes. I will keep an eye on how the nodes are connected. I think some of the problem is with nodes staying online which is really a network problem. Can you explain the mining-diversity parameter a little more in detail. Say I change it to 0.2 what would that signify?
For more information about mining please see section "Mining in MultiChain" in http://www.multichain.com/download/MultiChain-White-Paper.pdf. But in short:

spacing = round-up(<# of addresses with mine permission>*<mining-diversity>)
If the miner of block mined one of the previous <spacing>-1 block, the block is invalid

So to prevent chain from "freezing" you have to have at least <spacing> miners connected to each other (may be indirectly)

for mining-diversity=0.3,  # of miners=8, spacing=3
for mining-diversity=0.2,  # of miners=8, spacing=2

The idea of mining-diversity is to protect blockchain form being controlled by minority of the miners (or even single miner), but from the other hand to prevent "freezing". If mining-diversity is very high - you should take care that enough miners are connected to the chain. It mining-diversity is very low - there is a chance one rogue miner can take control of the chain.

You should estimate what are the percentages of:
1. miners connected simultaneously to the chain
2. "rogue" miners in your chain
Then you can choose mining-diversity appropriately.
...