mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Set default EVM version to London.
This commit is contained in:
parent
43605d9299
commit
79733fca48
@ -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[@]} ))
|
||||
|
@ -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).
|
||||
|
@ -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
|
||||
|
@ -102,7 +102,7 @@ private:
|
||||
|
||||
EVMVersion(Version _version): m_version(_version) {}
|
||||
|
||||
Version m_version = Version::Berlin;
|
||||
Version m_version = Version::London;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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
|
||||
@ -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
|
||||
|
@ -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(),
|
||||
|
@ -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
|
||||
}
|
||||
@ -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
|
||||
|
@ -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.");
|
||||
|
Loading…
Reference in New Issue
Block a user