Skip to content

Commit 759f5a7

Browse files
authored
Merge pull request ethereum#14907 from ethereum/makeCancunDefault
Make Cancun the default EVM version
2 parents 9e23506 + a388ccb commit 759f5a7

File tree

62 files changed

+301
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+301
-299
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,9 @@ jobs:
14691469
14701470
# NOTE: This is expected to work without running `pnpm build` first.
14711471
cd hardhat/packages/hardhat-core
1472+
# TODO: temporarily set hardhat stack traces tests to use cancun hardfork
1473+
# Remove this when hardhat switch to cancun by default: https://github.com/NomicFoundation/hardhat/issues/4851
1474+
sed -i 's/hardfork: "shanghai",/hardfork: "cancun",/' test/internal/hardhat-network/stack-traces/execution.ts
14721475
pnpm test
14731476
- matrix_notify_failure_unless_pr
14741477

.circleci/soltest_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ DEFAULT_EVM_VALUES=(constantinople petersburg istanbul berlin london paris shang
3636
# set EVM_VALUES to the default values.
3737
IFS=" " read -ra EVM_VALUES <<< "${1:-${DEFAULT_EVM_VALUES[@]}}"
3838

39-
DEFAULT_EVM=shanghai
39+
DEFAULT_EVM=cancun
4040
OPTIMIZE_VALUES=(0 1)
4141

4242
# Run for ABI encoder v1, without SMTChecker tests.

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Language Features:
66
Compiler Features:
77
* Code Generator: Use ``MCOPY`` instead of ``MLOAD``/``MSTORE`` loop when copying byte arrays.
88
* Yul Analyzer: Emit transient storage warning only for the first occurrence of ``tstore``.
9+
* EVM: Set default EVM version to ``cancun``.
910

1011

1112
Bugfixes:

docs/using-the-compiler.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ at each version. Backward compatibility is not guaranteed between each version.
174174
- The block's base fee (`EIP-3198 <https://eips.ethereum.org/EIPS/eip-3198>`_ and `EIP-1559 <https://eips.ethereum.org/EIPS/eip-1559>`_) can be accessed via the global ``block.basefee`` or ``basefee()`` in inline assembly.
175175
- ``paris``
176176
- Introduces ``prevrandao()`` and ``block.prevrandao``, and changes the semantics of the now deprecated ``block.difficulty``, disallowing ``difficulty()`` in inline assembly (see `EIP-4399 <https://eips.ethereum.org/EIPS/eip-4399>`_).
177-
- ``shanghai`` (**default**)
177+
- ``shanghai``
178178
- Smaller code size and gas savings due to the introduction of ``push0`` (see `EIP-3855 <https://eips.ethereum.org/EIPS/eip-3855>`_).
179-
- ``cancun``
179+
- ``cancun`` (**default**)
180180
- The block's blob base fee (`EIP-7516 <https://eips.ethereum.org/EIPS/eip-7516>`_ and `EIP-4844 <https://eips.ethereum.org/EIPS/eip-4844>`_) can be accessed via the global ``block.blobbasefee`` or ``blobbasefee()`` in inline assembly.
181181
- Introduces ``blobhash()`` in inline assembly and a corresponding global function to retrieve versioned hashes of blobs associated with the transaction (see `EIP-4844 <https://eips.ethereum.org/EIPS/eip-4844>`_).
182182
- Opcode ``mcopy`` is available in assembly (see `EIP-5656 <https://eips.ethereum.org/EIPS/eip-5656>`_).
@@ -344,8 +344,8 @@ Input Description
344344
// Version of the EVM to compile for.
345345
// Affects type checking and code generation. Can be homestead,
346346
// tangerineWhistle, spuriousDragon, byzantium, constantinople,
347-
// petersburg, istanbul, berlin, london, paris or shanghai (default)
348-
"evmVersion": "shanghai",
347+
// petersburg, istanbul, berlin, london, paris, shanghai or cancun (default)
348+
"evmVersion": "cancun",
349349
// Optional: Change compilation pipeline to go through the Yul intermediate representation.
350350
// This is false by default.
351351
"viaIR": true,

liblangutil/EVMVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class EVMVersion:
119119

120120
EVMVersion(Version _version): m_version(_version) {}
121121

122-
Version m_version = Version::Shanghai;
122+
Version m_version = Version::Cancun;
123123
};
124124

125125
}

libyul/AsmAnalysis.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -752,14 +752,11 @@ bool AsmAnalyzer::validateInstructions(evmasm::Instruction _instr, SourceLocatio
752752
else if (_instr == evmasm::Instruction::BLOBBASEFEE && !m_evmVersion.hasBlobBaseFee())
753753
errorForVM(6679_error, "only available for Cancun-compatible");
754754
else if (_instr == evmasm::Instruction::BLOBHASH && !m_evmVersion.hasBlobHash())
755-
// TODO: Change this assertion to an error, similar to the ones above, when Cancun becomes the default EVM version.
756-
yulAssert(false);
755+
errorForVM(8314_error, "only available for Cancun-compatible");
757756
else if (_instr == evmasm::Instruction::MCOPY && !m_evmVersion.hasMcopy())
758-
// TODO: Change this assertion to an error, similar to the ones above, when Cancun becomes the default EVM version.
759-
yulAssert(false);
757+
errorForVM(7755_error, "only available for Cancun-compatible");
760758
else if ((_instr == evmasm::Instruction::TSTORE || _instr == evmasm::Instruction::TLOAD) && !m_evmVersion.supportsTransientStorage())
761-
// TODO: Change this assertion to an error, similar to the ones above, when Cancun becomes the default EVM version.
762-
yulAssert(false);
759+
errorForVM(6243_error, "only available for Cancun-compatible");
763760
else if (_instr == evmasm::Instruction::PC)
764761
m_errorReporter.error(
765762
2450_error,

scripts/error_codes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ def examine_id_coverage(top_dir, source_id_to_file_names, new_ids_only=False):
202202
"4591", # "There are more than 256 warnings. Ignoring the rest."
203203
# Due to 3805, the warning lists look different for different compiler builds.
204204
"1834", # Unimplemented feature error, as we do not test it anymore via cmdLineTests
205-
"6679", # blobbasefee being used in inline assembly for EVMVersion < cancun
206205
"1180", # SMTChecker, covered by CL tests
207206
"2339", # SMTChecker, covered by CL tests
208207
"2961", # SMTChecker, covered by CL tests

scripts/externalTests/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set -e
2222

2323
# Requires $REPO_ROOT to be defined and "${REPO_ROOT}/scripts/common.sh" to be included before.
2424

25-
CURRENT_EVM_VERSION=shanghai
25+
CURRENT_EVM_VERSION=cancun
2626

2727
AVAILABLE_PRESETS=(
2828
legacy-no-optimize

scripts/externalTests/runners/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from test_helpers import settings_from_preset
4242
from test_helpers import SettingsPreset
4343

44-
CURRENT_EVM_VERSION: str = "shanghai"
44+
CURRENT_EVM_VERSION: str = "cancun"
4545

4646
@dataclass
4747
class TestConfig:

scripts/tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ do
115115
for vm in $EVM_VERSIONS
116116
do
117117
FORCE_ABIV1_RUNS="no"
118-
if [[ "$vm" == "shanghai" ]]
118+
if [[ "$vm" == "cancun" ]]
119119
then
120120
FORCE_ABIV1_RUNS="no yes" # run both in paris
121121
fi

0 commit comments

Comments
 (0)