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

Evm versions #1783

Merged
merged 19 commits into from
Jan 2, 2020
Merged

Evm versions #1783

merged 19 commits into from
Jan 2, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

How I did it

  • Expanded vyper/opcodes.py:
    • Added missing opcodes
    • Where gas cost changes between versions, a tuple is used instead of an integer. Values correspond to (byzantium, constantinople, istanbul) - None means the opcode is not available, and where the length is < 3 it means the price does not change for future versions.
    • Use getter functions for opcodes, instead of directly importing constants into other modules
  • vyper.compiler.compile_codes now accepts evm_version as a kwarg. If not given, the default value is used (vyper.opcodes.DEFAULT_EVM_VERSION, currently byzantium)
  • Added the option to select EVM version in vyper.cli modules

How to verify it

Run the tests. I've added new test cases and parametrized a few existing ones.

Cute Animal Picture

image

@iamdefinitelyahuman
Copy link
Contributor Author

iamdefinitelyahuman commented Dec 26, 2019

Things still needed:

  • mypy / linting
  • add test cases
    • selecting different EVM versions in vyper.compiler and vyper.cli
    • gas prices with different rulesets
  • update documentation

@fubuloubu
Copy link
Member

24f4071 adds missing check mentioned in #1652

@fubuloubu
Copy link
Member

fubuloubu commented Dec 27, 2019

I was picturing something more like if version_check(begin='constaninople', end='istanbul'): ... where it would check if the current version is within begin...end (inclusive), and either begin or end is optional (but not both). If either one is skipped, there is no limit on that end.

@jacqueswww
Copy link
Contributor

jacqueswww commented Dec 30, 2019

@fubuloubu @iamdefinitelyahuman Can we merge #1739 before this one?

@iamdefinitelyahuman
Copy link
Contributor Author

@jacqueswww fine by me... will rebase this after #1739 merges

tests/cli/vyper_compile/test_compile_files.py Outdated Show resolved Hide resolved
vyper/opcodes.py Outdated Show resolved Hide resolved
@fubuloubu
Copy link
Member

fubuloubu commented Jan 1, 2020

g2g once those changes are addressed. I like how the version check works, very clean.

vyper/opcodes.py Outdated Show resolved Hide resolved
Co-Authored-By: Bryant Eisenbach <3859395+fubuloubu@users.noreply.github.com>
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.

Use SELFBALANCE opcode for balance queries VIP: EVM Ruleset Switch
3 participants