Skip to content

Commit 74ec3c1

Browse files
authored
Merge pull request #11760 from ethereum/default-evmversion-london
Set default EVM version to London.
2 parents 0fc3e2d + 79733fc commit 74ec3c1

File tree

8 files changed

+15
-10
lines changed

8 files changed

+15
-10
lines changed

.circleci/soltest_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set -e
2929
REPODIR="$(realpath "$(dirname "$0")"/..)"
3030

3131
EVM_VALUES=(homestead byzantium constantinople petersburg istanbul berlin london)
32-
DEFAULT_EVM=berlin
32+
DEFAULT_EVM=london
3333
[[ " ${EVM_VALUES[*]} " =~ $DEFAULT_EVM ]]
3434
OPTIMIZE_VALUES=(0 1)
3535
STEPS=$(( 1 + ${#EVM_VALUES[@]} * ${#OPTIMIZE_VALUES[@]} ))

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Language Features:
77

88
Compiler Features:
99
* AssemblyStack: Also run opcode-based optimizer when compiling Yul code.
10+
* EVM: Set the default EVM version to "London".
1011
* Yul EVM Code Transform: Do not reuse stack slots that immediately become unreachable.
1112
* Yul EVM Code Transform: Also pop unused argument slots for functions without return variables (under the same restrictions as for functions with return variables).
1213
* Yul Optimizer: Move function arguments and return variables to memory with the experimental Stack Limit Evader (which is not enabled by default).

docs/using-the-compiler.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,12 @@ at each version. Backward compatibility is not guaranteed between each version.
169169
- The compiler behaves the same way as with constantinople.
170170
- ``istanbul``
171171
- Opcodes ``chainid`` and ``selfbalance`` are available in assembly.
172-
- ``berlin`` (**default**)
172+
- ``berlin``
173173
- Gas costs for ``SLOAD``, ``*CALL``, ``BALANCE``, ``EXT*`` and ``SELFDESTRUCT`` increased. The
174174
compiler assumes cold gas costs for such operations. This is relevant for gas estimation and
175175
the optimizer.
176+
- ``london`` (**default**)
177+
- 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.
176178

177179

178180
.. index:: ! standard JSON, ! --standard-json

liblangutil/EVMVersion.h

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

103103
EVMVersion(Version _version): m_version(_version) {}
104104

105-
Version m_version = Version::Berlin;
105+
Version m_version = Version::London;
106106
};
107107

108108
}

scripts/tests.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ EVM_VERSIONS="homestead byzantium"
8686

8787
if [ -z "$CI" ]
8888
then
89-
EVM_VERSIONS+=" constantinople petersburg istanbul berlin"
89+
EVM_VERSIONS+=" constantinople petersburg istanbul berlin london"
9090
fi
9191

9292
# And then run the Solidity unit-tests in the matrix combination of optimizer / no optimizer
@@ -96,9 +96,9 @@ do
9696
for vm in $EVM_VERSIONS
9797
do
9898
FORCE_ABIV1_RUNS="no"
99-
if [[ "$vm" == "berlin" ]]
99+
if [[ "$vm" == "london" ]]
100100
then
101-
FORCE_ABIV1_RUNS="no yes" # run both in berlin
101+
FORCE_ABIV1_RUNS="no yes" # run both in london
102102
fi
103103
for abiv1 in $FORCE_ABIV1_RUNS
104104
do

solc/CommandLineParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ General Information)").c_str(),
523523
g_strEVMVersion.c_str(),
524524
po::value<string>()->value_name("version")->default_value(EVMVersion{}.name()),
525525
"Select desired EVM version. Either homestead, tangerineWhistle, spuriousDragon, "
526-
"byzantium, constantinople, petersburg, istanbul or berlin."
526+
"byzantium, constantinople, petersburg, istanbul, berlin or london."
527527
)
528528
(
529529
g_strExperimentalViaIR.c_str(),

test/externalTests/common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function run_install
173173

174174
replace_version_pragmas
175175
force_truffle_solc_modules "$soljson"
176-
force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$OPTIMIZER_LEVEL" berlin
176+
force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$OPTIMIZER_LEVEL" london
177177

178178
$init_fn
179179
}
@@ -234,7 +234,7 @@ function truffle_run_test
234234
for level in $(seq "$OPTIMIZER_LEVEL" 3)
235235
do
236236
clean
237-
force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$level" berlin
237+
force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$level" london
238238

239239
printLog "Running compile function..."
240240
$compile_fn

test/libsolidity/StandardCompiler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,9 +1067,11 @@ BOOST_AUTO_TEST_CASE(evm_version)
10671067
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"istanbul\"") != string::npos);
10681068
result = compile(inputForVersion("\"evmVersion\": \"berlin\","));
10691069
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"berlin\"") != string::npos);
1070+
result = compile(inputForVersion("\"evmVersion\": \"london\","));
1071+
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"london\"") != string::npos);
10701072
// test default
10711073
result = compile(inputForVersion(""));
1072-
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"berlin\"") != string::npos);
1074+
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"london\"") != string::npos);
10731075
// test invalid
10741076
result = compile(inputForVersion("\"evmVersion\": \"invalid\","));
10751077
BOOST_CHECK(result["errors"][0]["message"].asString() == "Invalid EVM version requested.");

0 commit comments

Comments
 (0)