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

feat[tool]!: make cancun the default evm version #4029

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
-opt-${{ matrix.opt-mode || 'gas' }}\
${{ matrix.debug && '-debug' || '' }}\
${{ matrix.experimental-codegen && '-experimental' || '' }}\
-${{ matrix.evm-version || 'shanghai' }}\
-${{ matrix.evm-version || 'cancun' }}\
-${{ matrix.evm-backend || 'revm' }}"
strategy:
matrix:
Expand All @@ -80,7 +80,7 @@ jobs:
python-version: [["3.11", "311"]] # note: do not forget to replace 311 in the job names when upgrading!
opt-mode: [gas, none, codesize]
debug: [true, false]
evm-version: [shanghai] # note: when upgrading, check the "include" section below for conflicting jobs
evm-version: [cancun] # note: when upgrading, check the "include" section below for conflicting jobs
experimental-codegen: [false]
evm-backend: [revm]

Expand All @@ -89,15 +89,18 @@ jobs:
# test default settings with 3.11 across all supported evm versions
- evm-version: london
- evm-version: paris
- evm-version: cancun
- evm-version: shanghai

# py-evm rules
# test py-evm
- evm-backend: py-evm
evm-version: shanghai

- evm-backend: py-evm
evm-version: cancun
charles-cooper marked this conversation as resolved.
Show resolved Hide resolved

# test experimental pipeline
- experimental-codegen: true
opt-mode: gas
- experimental-codegen: true
opt-mode: none
- experimental-codegen: true
Expand Down Expand Up @@ -135,7 +138,7 @@ jobs:
pytest
-m "not fuzzing"
--optimize ${{ matrix.opt-mode || 'gas' }}
--evm-version ${{ matrix.evm-version || 'shanghai' }}
--evm-version ${{ matrix.evm-version || 'cancun' }}
--evm-backend ${{ matrix.evm-backend || 'revm' }}
${{ matrix.debug && '--enable-compiler-debug-mode' || '' }}
${{ matrix.experimental-codegen && '--experimental-codegen' || '' }}
Expand Down
6 changes: 3 additions & 3 deletions docs/compiling-a-contract.rst
charles-cooper marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ The following is a list of supported EVM versions, and changes in the compiler i

- ``block.difficulty`` is deprecated in favor of its new alias, ``block.prevrandao``.

.. py:attribute:: shanghai (default)
.. py:attribute:: shanghai

- The ``PUSH0`` opcode is automatically generated by the compiler instead of ``PUSH1 0``

.. py:attribute:: cancun (experimental)
.. py:attribute:: cancun (default)

- The ``transient`` keyword allows declaration of variables which live in transient storage
- Functions marked with ``@nonreentrant`` are protected with TLOAD/TSTORE instead of SLOAD/SSTORE
Expand Down Expand Up @@ -237,7 +237,7 @@ The following example describes the expected input format of ``vyper-json``. Com
},
// Optional
"settings": {
"evmVersion": "shanghai", // EVM version to compile for. Can be london, paris, shanghai (default) or cancun (experimental!).
"evmVersion": "shanghai", // EVM version to compile for. Can be london, paris, shanghai or cancun (default).
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file should have all default values.

Suggested change
"evmVersion": "shanghai", // EVM version to compile for. Can be london, paris, shanghai or cancun (default).
"evmVersion": "cancun", // EVM version to compile for. Can be london, paris, shanghai or cancun (default).

// optional, optimization mode
// defaults to "gas". can be one of "gas", "codesize", "none",
// false and true (the last two are for backwards compatibility).
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def pytest_addoption(parser):
parser.addoption(
"--evm-version",
choices=list(evm_opcodes.EVM_VERSIONS.keys()),
default="shanghai",
default="cancun",
help="set evm version",
)

Expand Down
2 changes: 1 addition & 1 deletion vyper/evm/opcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
_evm_versions = ("london", "paris", "shanghai", "cancun")
EVM_VERSIONS: dict[str, int] = dict((v, i) for i, v in enumerate(_evm_versions))

DEFAULT_EVM_VERSION = "shanghai"
DEFAULT_EVM_VERSION = "cancun"


# opcode as hex value
Expand Down
1 change: 1 addition & 0 deletions vyper/venom/basicblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"sstore",
"dstore",
"istore",
"tstore",
"dloadbytes",
"calldatacopy",
"mcopy",
Expand Down
Loading