Sorry I haven't looked at the code.. busy busy busy..
assuming nTargetSpacing == 150, you recommend rejecting a solved block that comes in less than 50 seconds after the last one?.. maybe this is a little too aggressive?.. or not?.. I'm on the fence.. would be interested in other's thoughts.
Does the default digi code actually reject a solved block with timestamp earlier than the previously accepted? or is this just something you are suggesting?
Thanks --Mark
There is no code in place in the algo to reject blocks under a certain time. This is something he is proposing as a new feature. I like the idea, but
this would require testing. Not to prove it's validity, but rather it's vulnerabilities. Timestamps can be altered, like I mentioned, and are the basis for TW attacks. Delaying a set of blocks past the accepted time limit could be easily achieved by someone with enough know-how and patience. I would suppose that 24Kilo could do it with his knowledge of TW attacks, but we would have to test this.
While it's a valid proposal, IMO it's not likely something that will be immediately needed with the DIGI implementation. I would like to look into the possibility of implementing something like this in the future, although not as aggressive as suggested by c_e_d. Maybe a community led testnet?
-Fuse
To make it clear: Rejecting blocks is not part of any diff algo code. There are parts like CheckBlock or CheckProofOfWork that do rejects of blocks under certain conditions.
Why do I think that it is needed now?
Let's look at the following (it does not matter that those blocks are from Oct 2014):
Block Date Time
135199 16.10.2014 17:06:53
135200 16.10.2014 17:07:38
135201 16.10.2014
17:07:19135202 16.10.2014 17:08:19
135203 16.10.2014 17:14:55
The diff algo takes a negative timespan for block 135201 and is using that for further calculations. Doesn't matter if you use DGW3 or DIGI. Only the min/max checks before the final diff calculation are keeping it someway under control. There is no way I can see to know what the real block time should be. Think of it as a normal or long block and lets use DIGI as example. DIGI would see it as a very short block and would increase the diff as much as allowed. While the block should maintain or lower the next diff, it will increase it heavy.
Hope this explains the problem I see.
From what I see, this problem have been in the code from long before NLG exists. It was always covert by long intervals of blocks used to calculate the next diff.
The more blocks you use for the diff calculation, the less influence a single bad timestamp has.
With DGW3 a single bad timestamp had only 4% influence, with the new DIGI it has 100% influence as explained above.
What does that mean?
DIGI does what it is supposed to do, react as fast as possible to changes in hashrate. It's not trying to smooth them like DGW3 does with it's 24 blocks interval.
On the other side it takes the cover off from the timestamp problem and this can not be fixed in the diff algo. It does not belong there. It belongs into places where blocks are checked before inserted into the chain or are getting rejected because of various reasons.
Can it be that hard for a miner of today to keep his clock synced within a few seconds variance? It is easy to do and lazy not to do it.
So the first and most important point would be to reject blocks with bad timestamps.
There is already code in place to reject blocks with a time stamp too far into the future. We can add some lines of code to reject blocks with time stamps too far into the past.
But this alone will not do it. Atleast I can't see it. Still I would add it.
What I would do is to make sure every new block has a time stamp newer than the previous block. And this leads to a minimum time diff between blocks.
How high should this minimum be? 1 second? 10 seconds? 20 seconds? 30 seconds? 50 seconds? For sure that needs to be discussed and agreed on!
We wouldn't be the first coin to check to a certain amount of work time between blocks and reject those that are coming in too fast.
I know I have seen it in the code of atleast 1 or 2 coins but for the heck of it I can't remember which coin code it was.