Skip to content

Commit 1b5775a

Browse files
authored
Merge pull request #14591 from ethereum/old-evm-deprecation-warning
Deprecate support for `byzantium` and older EVM versions
2 parents 1b7652e + 127a390 commit 1b5775a

File tree

28 files changed

+154
-8
lines changed

28 files changed

+154
-8
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Language Features:
77
Compiler Features:
88
* Commandline Interface: Add ``--no-import-callback`` option that prevents the compiler from loading source files not given explicitly on the CLI or in Standard JSON input.
99
* Commandline Interface: Use proper severity and coloring also for error messages produced outside of the compilation pipeline.
10+
* EVM: Deprecate support for "homestead", "tangerineWhistle", "spuriousDragon" and "byzantium" EVM versions.
1011
* Parser: Remove the experimental error recovery mode (``--error-recovery`` / ``settings.parserErrorRecovery``).
1112
* SMTChecker: Support user-defined operators.
1213
* Yul Optimizer: If ``PUSH0`` is supported, favor zero literals over storing zero values in variables.

docs/using-the-compiler.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ Target Options
147147
Below is a list of target EVM versions and the compiler-relevant changes introduced
148148
at each version. Backward compatibility is not guaranteed between each version.
149149

150-
- ``homestead``
150+
- ``homestead`` (*support deprecated*)
151151
- (oldest version)
152-
- ``tangerineWhistle``
152+
- ``tangerineWhistle`` (*support deprecated*)
153153
- Gas cost for access to other accounts increased, relevant for gas estimation and the optimizer.
154154
- All gas sent by default for external calls, previously a certain amount had to be retained.
155-
- ``spuriousDragon``
155+
- ``spuriousDragon`` (*support deprecated*)
156156
- Gas cost for the ``exp`` opcode increased, relevant for gas estimation and the optimizer.
157-
- ``byzantium``
157+
- ``byzantium`` (*support deprecated*)
158158
- Opcodes ``returndatacopy``, ``returndatasize`` and ``staticcall`` are available in assembly.
159159
- The ``staticcall`` opcode is used when calling non-library view or pure functions, which prevents the functions from modifying state at the EVM level, i.e., even applies when you use invalid type conversions.
160160
- It is possible to access dynamic data returned from function calls.
@@ -175,7 +175,7 @@ at each version. Backward compatibility is not guaranteed between each version.
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>`_).
177177
- ``shanghai`` (**default**)
178-
- Smaller code size and gas savings due to the introduction of ``push0`` (see `EIP-3855 <https://eips.ethereum.org/EIPS/eip-3855>`_).
178+
- Smaller code size and gas savings due to the introduction of ``push0`` (see `EIP-3855 <https://eips.ethereum.org/EIPS/eip-3855>`_).
179179

180180
.. index:: ! standard JSON, ! --standard-json
181181
.. _compiler-api:
@@ -318,7 +318,7 @@ Input Description
318318
// Affects type checking and code generation. Can be homestead,
319319
// tangerineWhistle, spuriousDragon, byzantium, constantinople,
320320
// petersburg, istanbul, berlin, london, paris or shanghai (default)
321-
"evmVersion": "byzantium",
321+
"evmVersion": "shanghai",
322322
// Optional: Change compilation pipeline to go through the Yul intermediate representation.
323323
// This is false by default.
324324
"viaIR": true,

libsolidity/interface/StandardCompiler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,12 @@ std::variant<StandardCompiler::InputsAndSettings, Json::Value> StandardCompiler:
787787
std::optional<langutil::EVMVersion> version = langutil::EVMVersion::fromString(settings["evmVersion"].asString());
788788
if (!version)
789789
return formatFatalError(Error::Type::JSONError, "Invalid EVM version requested.");
790+
if (version < EVMVersion::constantinople())
791+
ret.errors.append(formatError(
792+
Error::Type::Warning,
793+
"general",
794+
"Support for EVM versions older than constantinople is deprecated and will be removed in the future."
795+
));
790796
ret.evmVersion = *version;
791797
}
792798

solc/CommandLineInterface.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,12 @@ bool CommandLineInterface::parseArguments(int _argc, char const* const* _argv)
681681

682682
void CommandLineInterface::processInput()
683683
{
684+
if (m_options.output.evmVersion < EVMVersion::constantinople())
685+
report(
686+
Error::Severity::Warning,
687+
"Support for EVM versions older than constantinople is deprecated and will be removed in the future."
688+
);
689+
684690
switch (m_options.input.mode)
685691
{
686692
case InputMode::Help:

test/cmdlineTests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ EOF
240240
sed -i.bak -e 's/\(\\"version\\":[ ]*\\"\)[^"\\]*\(\\"\)/\1<VERSION REMOVED>\2/' "$stdout_path"
241241
rm "$stdout_path.bak"
242242
else
243-
sed -i.bak -e '/^Warning: This is a pre-release compiler version, please do not use it in production./d' "$stderr_path"
243+
sed -i.bak -e '/^Warning: This is a pre-release compiler version, please do not use it in production./,+1d' "$stderr_path"
244244
sed -i.bak -e '/^Compiler run successful, no output requested\.$/d' "$stderr_path"
245-
sed -i.bak -e '/^Warning (3805): This is a pre-release compiler version, please do not use it in production./d' "$stderr_path"
245+
sed -i.bak -e '/^Warning (3805): This is a pre-release compiler version, please do not use it in production./,+1d' "$stderr_path"
246246
sed -i.bak -e 's/\(^[ ]*auxdata: \)0x[0-9a-f]*$/\1<AUXDATA REMOVED>/' "$stdout_path"
247247
sed -i.bak -e 's/ Consider adding "pragma .*$//' "$stderr_path"
248248
sed -i.bak -e 's/\(Unimplemented feature error.* in \).*$/\1<FILENAME REMOVED>/' "$stderr_path"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
Warning: Support for EVM versions older than constantinople is deprecated and will be removed in the future.
12
Error: Failed to import AST: Imported tree evm version differs from configured evm version!
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--evm-version byzantium
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Warning: Support for EVM versions older than constantinople is deprecated and will be removed in the future.
2+
Warning: Source file does not specify required compiler version!
3+
--> evm_version_byzantium/input.sol
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// SPDX-License-Identifier: GPL-3.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--evm-version constantinople

0 commit comments

Comments
 (0)