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

consensus/ethash, core: implement Metropolis EIP 100 #14733

Merged
merged 2 commits into from Jul 17, 2017

Conversation

Projects
None yet
5 participants
@karalabe
Member

karalabe commented Jun 30, 2017

Implements ethereum/EIPs#100.

@holiman

LGTM in the context that I think this won't break pre-metro, I think the only thing that can make an impact is the change in chainmakers.

@@ -218,6 +218,7 @@ func makeHeader(config *params.ChainConfig, parent *types.Block, state *state.St
Number: parent.Number(),
Time: new(big.Int).Sub(time, big.NewInt(10)),
Difficulty: parent.Difficulty(),
UncleHash: parent.UncleHash(),

This comment has been minimized.

@holiman

holiman Jun 30, 2017

Contributor

What is the effect of this change ?

@holiman

holiman Jun 30, 2017

Contributor

What is the effect of this change ?

This comment has been minimized.

@karalabe

karalabe Jun 30, 2017

Member

This is only used in our tests when we create artificial chains to test various corner cases. The chain maker is messing around with incomplete blocks/headers to get around certain validity checks (to evoke failures), so here we don't have a "real" parent block to calculate the difficulty of the child's based on, but instead make one up on the fly. The difficulty algo didn't require access to the uncles until now, so we just skipped copying that field over. It's however needed in metro.

@karalabe

karalabe Jun 30, 2017

Member

This is only used in our tests when we create artificial chains to test various corner cases. The chain maker is messing around with incomplete blocks/headers to get around certain validity checks (to evoke failures), so here we don't have a "real" parent block to calculate the difficulty of the child's based on, but instead make one up on the fly. The difficulty algo didn't require access to the uncles until now, so we just skipped copying that field over. It's however needed in metro.

@karalabe karalabe referenced this pull request Jun 30, 2017

Closed

Metropolis aggregate PR #14726

7 of 8 tasks complete

obscuren and others added some commits Jun 30, 2017

consensus, core: EIP 100 polishes, fix chain maker diff
This PR polishes the EIP 100 difficulty adjustment algorithm
to match the same mechanisms as the Homestead was implemented
to keep the code uniform. It also avoids a few memory allocs
by reusing big1 and big2, pulling it out of the common package
and into ethash.

The commit also fixes chain maker to forward the uncle hash
when creating a simulated chain (it wasn't needed until now
so we just skipped a copy there).
@bas-vk

bas-vk approved these changes Jun 30, 2017

LGTM

@karalabe karalabe merged commit c65f10a into ethereum:master Jul 17, 2017

3 checks passed

commit-message-check/gitcop All commit messages are valid
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@karalabe karalabe added this to the 1.7.0 milestone Jul 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment