mirror of https://github.com/status-im/EIPs.git
create file for EIP 100
This commit is contained in:
parent
465c4d6550
commit
0aa35f0e05
|
@ -0,0 +1,33 @@
|
|||
EDITOR NOTE: below is a copy of the EIP 100 https://github.com/ethereum/EIPs/issues/100#issue-151777532 raw text fetched on 2017-08-15.
|
||||
|
||||
### Specification
|
||||
|
||||
Currently, the formula to compute the difficulty of a block includes the following logic:
|
||||
|
||||
``` python
|
||||
adj_factor = max(1 - ((timestamp - parent.timestamp) // 10), -99)
|
||||
child_diff = int(max(parent.difficulty + (parent.difficulty // BLOCK_DIFF_FACTOR) * adj_factor, min(parent.difficulty, MIN_DIFF)))
|
||||
...
|
||||
```
|
||||
|
||||
If `block.number >= METROPOLIS_FORK_BLKNUM`, we change the first line to the following:
|
||||
|
||||
``` python
|
||||
adj_factor = max(1 + len(parent.uncles) - ((timestamp - parent.timestamp) // 9), -99)
|
||||
```
|
||||
### Specification (1b)
|
||||
|
||||
``` python
|
||||
adj_factor = max((2 if len(parent.uncles) else 1) - ((timestamp - parent.timestamp) // 9), -99)
|
||||
```
|
||||
### Rationale
|
||||
|
||||
This new formula ensures that the difficulty adjustment algorithm targets a constant average rate of blocks produced including uncles, and so ensures a highly predictable issuance rate that cannot be manipulated upward by manipulating the uncle rate. The formula can be fairly easily seen to be (to within a tolerance of ~3/4194304) mathematically equivalent to assuming that a block with `k` uncles is equivalent to a sequence of `k+1` blocks that all appear with the exact same timestamp, and this is likely the simplest possible way to accomplish the desired effect.
|
||||
|
||||
Changing the denominator from 10 to 9 ensures that the block time remains roughly the same (in fact, it should decrease by ~3% given the current uncle rate of 7%).
|
||||
|
||||
(1b) accomplishes almost the same effect but has the benefit that it depends only on the block header (as you can check the uncle hash against the blank hash) and not the entire block.
|
||||
|
||||
### Update 2017.06.29
|
||||
|
||||
Version (1b) was chosen.
|
Loading…
Reference in New Issue