Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .circleci/soltest_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set -e
REPODIR="$(realpath "$(dirname "$0")"/..)"

EVM_VALUES=(homestead byzantium constantinople petersburg istanbul berlin london)
DEFAULT_EVM=berlin
DEFAULT_EVM=london
[[ " ${EVM_VALUES[*]} " =~ $DEFAULT_EVM ]]
OPTIMIZE_VALUES=(0 1)
STEPS=$(( 1 + ${#EVM_VALUES[@]} * ${#OPTIMIZE_VALUES[@]} ))
Expand Down
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Language Features:

Compiler Features:
* AssemblyStack: Also run opcode-based optimizer when compiling Yul code.
* EVM: Set the default EVM version to "London".
* Yul EVM Code Transform: Do not reuse stack slots that immediately become unreachable.
* Yul EVM Code Transform: Also pop unused argument slots for functions without return variables (under the same restrictions as for functions with return variables).
* Yul Optimizer: Move function arguments and return variables to memory with the experimental Stack Limit Evader (which is not enabled by default).
Expand Down
4 changes: 3 additions & 1 deletion docs/using-the-compiler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,12 @@ at each version. Backward compatibility is not guaranteed between each version.
- The compiler behaves the same way as with constantinople.
- ``istanbul``
- Opcodes ``chainid`` and ``selfbalance`` are available in assembly.
- ``berlin`` (**default**)
- ``berlin``
- Gas costs for ``SLOAD``, ``*CALL``, ``BALANCE``, ``EXT*`` and ``SELFDESTRUCT`` increased. The
compiler assumes cold gas costs for such operations. This is relevant for gas estimation and
the optimizer.
- ``london`` (**default**)
- 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.


.. index:: ! standard JSON, ! --standard-json
Expand Down
2 changes: 1 addition & 1 deletion liblangutil/EVMVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class EVMVersion:

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

Version m_version = Version::Berlin;
Version m_version = Version::London;
};

}
6 changes: 3 additions & 3 deletions scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ EVM_VERSIONS="homestead byzantium"

if [ -z "$CI" ]
then
EVM_VERSIONS+=" constantinople petersburg istanbul berlin"
EVM_VERSIONS+=" constantinople petersburg istanbul berlin london"
fi

# And then run the Solidity unit-tests in the matrix combination of optimizer / no optimizer
Expand All @@ -96,9 +96,9 @@ do
for vm in $EVM_VERSIONS
do
FORCE_ABIV1_RUNS="no"
if [[ "$vm" == "berlin" ]]
if [[ "$vm" == "london" ]]
then
FORCE_ABIV1_RUNS="no yes" # run both in berlin
FORCE_ABIV1_RUNS="no yes" # run both in london
fi
for abiv1 in $FORCE_ABIV1_RUNS
do
Expand Down
2 changes: 1 addition & 1 deletion solc/CommandLineParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ General Information)").c_str(),
g_strEVMVersion.c_str(),
po::value<string>()->value_name("version")->default_value(EVMVersion{}.name()),
"Select desired EVM version. Either homestead, tangerineWhistle, spuriousDragon, "
"byzantium, constantinople, petersburg, istanbul or berlin."
"byzantium, constantinople, petersburg, istanbul, berlin or london."
)
(
g_strExperimentalViaIR.c_str(),
Expand Down
4 changes: 2 additions & 2 deletions test/externalTests/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function run_install

replace_version_pragmas
force_truffle_solc_modules "$soljson"
force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$OPTIMIZER_LEVEL" berlin
force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$OPTIMIZER_LEVEL" london

$init_fn
}
Expand Down Expand Up @@ -234,7 +234,7 @@ function truffle_run_test
for level in $(seq "$OPTIMIZER_LEVEL" 3)
do
clean
force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$level" berlin
force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$level" london

printLog "Running compile function..."
$compile_fn
Expand Down
4 changes: 3 additions & 1 deletion test/libsolidity/StandardCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,9 +1067,11 @@ BOOST_AUTO_TEST_CASE(evm_version)
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"istanbul\"") != string::npos);
result = compile(inputForVersion("\"evmVersion\": \"berlin\","));
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"berlin\"") != string::npos);
result = compile(inputForVersion("\"evmVersion\": \"london\","));
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"london\"") != string::npos);
// test default
result = compile(inputForVersion(""));
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"berlin\"") != string::npos);
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"london\"") != string::npos);
// test invalid
result = compile(inputForVersion("\"evmVersion\": \"invalid\","));
BOOST_CHECK(result["errors"][0]["message"].asString() == "Invalid EVM version requested.");
Expand Down