-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change difficulty adjustment to target mean block time including uncles #100
Comments
lgtm |
lgtm. |
Uncle number is not the part of the header, so now to validate the header we need not only the parent header, but parent body, too. Wouldn't this cause troubles for the light clients? Update. This was the concern only for 1a specification, but now 1b seems to be the consensus and it doesn't require the parent body. |
The activation should be |
The proposed change has a negative conseguence on the effective gas throughtput of the network per second. Since uncle rates increas 0.77% per each additional 1M unit of gas consumed, after applying this change, increasing the block gas limit would result in a less than linear increase in effective throughput per second, due to the increased uncles which are now taken in consideration for blocktime calculation. The effect becomes evident already at around 20M block gas limit, where the available throughtput is around 80% of what would be with today difficulty algorithm, at least in theory. Assuming linearity of the uncle rate probability, the effective throughput per second converges then to a value equivalent to a 50M gas block limit, which becomes kinda of hardcoded since voting the gas beyond that actually decreases the throughtput because of the increasing uncle rate. |
@vbuterin This needs to be a PR. |
When you make a PR maybe just include the chosen option 1b. |
This has a PR #692 |
PR has been merged and EIP is active in the main repository with status Final |
Specification
Currently, the formula to compute the difficulty of a block includes the following logic:
If
block.number >= METROPOLIS_FORK_BLKNUM
, we change the first line to the following:Specification (1b)
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 ofk+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.
The text was updated successfully, but these errors were encountered: