Skip to content
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, core, tests: implement Metropolis EIP 649 #15028

Merged
merged 1 commit into from
Aug 25, 2017

Conversation

karalabe
Copy link
Member

@karalabe karalabe commented Aug 24, 2017

Implements ethereum/EIPs#669.

The PR also pulls in the latest test suite, which among other throws out explicit log validation to implicit one via RLP(logs).


Note, some tests are failing because the consensus test suite was only partially updated to the new log format, so the non-updated ones cannot be parsed. I'll keep checking the test suite to see if there are updates to fix them.

PostStateRoot common.Hash `json:"postStateRoot"`
Env stEnv `json:"env"`
Exec vmExec `json:"exec"`
Logs common.UnprefixedHash `json:"logs"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the logs check so we can merge.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll wait to see how many fail (just updates the test suite), and will disable only the failing tests (so we're not overly zealous and accidentally miss consensus issues).

@holiman
Copy link
Contributor

holiman commented Aug 24, 2017

This was already here, not new for this PR: https://github.com/ethereum/go-ethereum/pull/15028/files#diff-e226000964244889df127e5b44dbf192R546 :

 		r.Div(blockReward, big32)
 		reward.Add(reward, r)

Looks un-intuitive (reusing r which has a totally different meaning on the lines before) and unnecessary (always divide blockReward by 32).
I'd prefer:


	blockReward := frontierBlockReward
        newphewReward := frontierNewphewReward
 	if config.IsMetropolis(header.Number) {
 		blockReward = metropolisBlockReward
                nephewReward:= metropolisNephewReward
 	}
       ...
 		reward.Add(reward, nephewReward)

@devsnd
Copy link

devsnd commented Aug 24, 2017

@holiman
Copy link
Contributor

holiman commented Aug 24, 2017

@devsnd OMG wow good catch!

It's using 299999 instead of 2999999

@karalabe
Copy link
Member Author

@fjl I've disabled the 3 failing test files, we can readd them later.
@holiman I've fixed the 2_999_999 issue, PLTA.
@devsnd 2,999,999 is correct because the code there is working on the parent block number, not the actual block number. Though do ping me if you still think it's wrong.

@holiman
Copy link
Contributor

holiman commented Aug 24, 2017

Just to be clear, my initial comment above was to point out that it was supposed to be one less than 3M, but then I understood that @devsnd had correctly spotted an error - so again, good catch!

@holiman
Copy link
Contributor

holiman commented Aug 24, 2017

PTAL:ed, looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants