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

VM: fix selectHardforkByBlockNumber default value #967

Merged
merged 2 commits into from Nov 27, 2020

Conversation

jochem-brouwer
Copy link
Member

Fixes the default value of the selectHardforkByBlockNumber as pointed out by @holgerd77 in #966.

@jochem-brouwer jochem-brouwer added PR state: needs review package: vm type: test all hardforks This special label enables VM state and blockchain tests for all hardforks on the respective PR. labels Nov 26, 2020
@codecov
Copy link

codecov bot commented Nov 26, 2020

Codecov Report

Merging #967 (a1e6f0a) into master (93b476e) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

Flag Coverage Δ
block 77.69% <ø> (+0.27%) ⬆️
blockchain 77.39% <ø> (ø)
common 92.11% <ø> (ø)
ethash 82.08% <ø> (ø)
tx 86.04% <ø> (ø)
vm 87.43% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@holgerd77
Copy link
Member

Can you also remove the options in the tests from the old PR which are not seeing the value to the default value?

const vm = new VM({ common: common1 })
const vm_noSelect = new VM({ common: common2, selectHardforkByBlockNumber: false })
const vm = new VM({ common: common1, selectHardforkByBlockNumber: true })
const vm_noSelect = new VM({ common: common2 })
Copy link
Member Author

Choose a reason for hiding this comment

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

This checks that the default value is indeed false? @holgerd77

holgerd77
holgerd77 previously approved these changes Nov 27, 2020
Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Also don't want to make this a blocker, just meant that the selectHardforkByBlockNumber: false initializations in the tests like https://github.com/ethereumjs/ethereumjs-vm/pull/966/files#diff-0ecbdf07c84f7c9ab5c8d5aa79ff9e4f4d38b935c0af79214e575d86f10deae8R74 could now be removed.

But just some cosmetics, just leave if you want and directly merge.

@jochem-brouwer
Copy link
Member Author

Ah yes you are right, I will add this.

@jochem-brouwer
Copy link
Member Author

Huh this is weird... 🤔 Tests fail.

@jochem-brouwer
Copy link
Member Author

Okay this makes no sense! I just re-ran the tests and now they pass? Failing test

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Will approve for now, if you're ok with the test runs you can merge.

@jochem-brouwer
Copy link
Member Author

It seems the failing test was a random event, worth investigating, but in a different PR.

@jochem-brouwer jochem-brouwer merged commit eb05651 into master Nov 27, 2020
@jochem-brouwer jochem-brouwer deleted the fix-selecthardfork-default branch November 27, 2020 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: vm PR state: needs review type: test all hardforks This special label enables VM state and blockchain tests for all hardforks on the respective PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants