Gonna work on that as soon as I can...
Also, on another issue, I think fees are way too high. If you look at Bitcoin, min. fees are 0.001 BTC for non-free transactions. With Noirdice, we're at 0.1 NRB for non-free transaction. So basically, NRB transaction are 100x more expensive than BTC. I think we should lower them to 0.001 NRB to encourage NRB transactions.
The change could be included with the upcoming difficulty rules to ensure everyone gets those changes at the same time...
agreed, what do you think of the 5 block retarget?
Not too fond of the idea. I think evaluating retarget at every block is a smoother move : it gives the block chain the opportunity to recover from hashrates spikes as soon as they are gone, and inversely, to raise difficulty as soon as hashrate spikes (like, when a multipool kicks in). Retargetting every 5 blocks is too short if you only look back 5 blocks, you need to take variance into account.
The core idea is not to lower the count of blocks used to evaluate difficulty, but rather to evaluate retarget at every block, by looking back at the last 30 blocks and the time it took to find them. So when a hashrate spike comes along, the next block is going to be found way too fast. Difficulty might rise just a little bit, or not at all. But on second block after spike starts, it will rise just a bit more. And so on...
Assuming we have a stable 2 minute block time before a spike that brings block time down to 10s, you'll have this sequence going on for block times :
120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120 = 2mn avg
120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-10 = 1.93mn avg
120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-10-10 = 1.87mn avg
120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-120-10-10-10 = 1.81mn avg
....
And so on... if you don't retarget.
But if you retarget everytime the 30 block average time is off, by say +/-10%, you'll be forcing retarget by 3 block. Diff won't rise as much, but it will rise. The same will be true the other way around, but we won't reach situations where spikes leave diff. way too high. The previous difficulty fix had a bug, but it still proved useful. Difficulty was left by a spike @ 10 at one point. By next block, which took more than four hours to find, diff. dropped back to 6. I didn't monitor what went on afterwards, and don't remember the block height, but it shows that this is a good starting point.
What we really need to avoid is massive difficulty variations, they penalize loyal miners and encourage coin hoppers, who only come back when diff. has dropped back to looow values thanks to the backing of loyal miners.