Closed realcodywburns closed 6 years ago
@realcodywburns 0x0d
is 13s, is that correct? Anyway, my mistake. I'll change all the documentations.
So from my reading of EIP-2: if blocktime is 13s, excluding the difficulty bomb, the difficulty would decrease, and if blocktime is 12s, the difficulty would increase. So the avg blocktime is therefore 12.5s. @realcodywburns Can you confirm this calculation?
No. @realcodywburns my previous comment was wrong, ~the blocktime for Ellaism is indeed 10s.~ The targeted block time is 10-19s.
Here's the start of the lines that calculate the target difficulty in Parity. Notice that durationLimit
is only used when we are below Frontier hard-fork. In Ellaism we're always above that, so it comes to this line:
let diff_inc = (header.timestamp() - parent.timestamp()) / increment_divisor;
And increment_divisor
is set from difficulty_increment_divisor
which defaults to 10
. ~So Ellaism's blocktime is indeed 10s.~ So when blocktime is 10-19s, 1 - diff_inc
would be 0
and difficulty would not be changed. From EIP-2 you can also confirm this.
Anyway, thanks for noticing this. ~Although there's nothing wrong with blocktime,~ durationLimit
is indeed a parameter that is not used. Closing this issue if no objections.
I made a mistake in the above again. diff_inc
would be 0
for all block times in range 10-19s, so the expected block time is a range, and average block time cannot be easily calculated.
So let's just use the real-world statistics data 14s
for Ellaism average block time. I'll change all the documentations.
Your block time is set to 14s(0x0d) by this config setting. For 10s you need to set it to (0x0a)
https://github.com/ellaism/parity-config/blob/c6817bdce2ad5daab081c059513e5e37cd8c4f6a/ellaism.json#L10