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

Common: Add new isActivatedEIP() method #1125

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

holgerd77
Copy link
Member

This PR adds a new method Common.isActivatedEIP(). This method is meant to replace manual calls like this._vm._common.eips().includes(2929) (see e.g. here) which will break once such an EIP moves to a HF.

After merging all these calls - particularly in the VM - should be replaced with the functionality from here.

Note that the current terminology around the term "active" in the Common library is very unfortunate (I once introduced myself). Other methods like activeHardforks() take "active" as "being a part of the chain" - if activated or not. I therefor for now used the terminology "activated" to differentiate here at least a bit. I will add a note to the major-release-note planning, these old "active" names should be replaced with something less ambiguous.

For now all this should work out.

@@ -4,7 +4,7 @@
"comment": "Simple subroutines for the EVM",
"url": "https://eips.ethereum.org/EIPS/eip-2315",
"status": "Draft",
"minimumHardfork": "berlin",
"minimumHardfork": "istanbul",
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 is a fix, EIP can technically be applied earlier than berlin, this would otherwise not allow to instantiate the VM with istanbul and just activate this single EIP.

@codecov
Copy link

codecov bot commented Feb 22, 2021

Codecov Report

Merging #1125 (350c3b2) into master (ad9def9) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

Flag Coverage Δ
block 81.82% <ø> (+0.13%) ⬆️
blockchain 84.13% <ø> (-0.07%) ⬇️
client 87.07% <ø> (+0.03%) ⬆️
common 87.66% <100.00%> (+0.45%) ⬆️
devp2p 84.10% <ø> (-0.08%) ⬇️
ethash 82.08% <ø> (ø)
tx 92.06% <ø> (+0.12%) ⬆️
vm 83.00% <ø> (ø)

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

return true
}
for (const hfChanges of HARDFORK_CHANGES) {
const hf = hfChanges[1]
Copy link
Member

Choose a reason for hiding this comment

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

Had to do a double take here, this is a bit hard to read (but is due to how these hardforks are exposed). But yeah, this looks fine.

Copy link
Member

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

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

Yup, great!

@holgerd77 holgerd77 merged commit e0fd561 into master Feb 22, 2021
@holgerd77 holgerd77 deleted the common-active-eip-check-method branch February 22, 2021 13:21
This was referenced Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants