From 9e9f40eb8a16c236eb40a1b22674a43dfaf4c107 Mon Sep 17 00:00:00 2001 From: r0qs Date: Mon, 3 Feb 2025 21:12:54 +0100 Subject: [PATCH] Introduces EVM version Osaka --- .circleci/soltest_all.sh | 2 +- Changelog.md | 1 + docs/using-the-compiler.rst | 6 ++++-- liblangutil/EVMVersion.h | 8 ++++++-- scripts/tests.sh | 2 +- test/EVMHost.cpp | 2 ++ test/tools/ossfuzz/protoToYul.cpp | 2 ++ test/tools/ossfuzz/yulProto.proto | 1 + 8 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.circleci/soltest_all.sh b/.circleci/soltest_all.sh index 1c7882448ca1..1e765c6f9e32 100755 --- a/.circleci/soltest_all.sh +++ b/.circleci/soltest_all.sh @@ -31,7 +31,7 @@ REPODIR="$(realpath "$(dirname "$0")"/..)" # shellcheck source=scripts/common.sh source "${REPODIR}/scripts/common.sh" -DEFAULT_EVM_VALUES=(constantinople petersburg istanbul berlin london paris shanghai cancun prague) +DEFAULT_EVM_VALUES=(constantinople petersburg istanbul berlin london paris shanghai cancun prague osaka) EVMS_WITH_EOF=(prague) # Deserialize the EVM_VALUES array if it was provided as argument or diff --git a/Changelog.md b/Changelog.md index be3209702455..0bf7cb988081 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,6 +5,7 @@ Language Features: Compiler Features: * Error Reporting: Errors reported during code generation now point at the location of the contract when more fine-grained location is not available. + * EVM: Support for the EVM version "Osaka". * SMTChecker: Support `block.blobbasefee` and `blobhash`. * SMTChecker: Z3 is now a runtime dependency, not a build dependency (except for emscripten build). * Yul Parser: Make name clash with a builtin a non-fatal error. diff --git a/docs/using-the-compiler.rst b/docs/using-the-compiler.rst index 48151a637713..485820ef9727 100644 --- a/docs/using-the-compiler.rst +++ b/docs/using-the-compiler.rst @@ -181,7 +181,9 @@ at each version. Backward compatibility is not guaranteed between each version. - Introduces ``blobhash()`` in inline assembly and a corresponding global function to retrieve versioned hashes of blobs associated with the transaction (see `EIP-4844 `_). - Opcode ``mcopy`` is available in assembly (see `EIP-5656 `_). - Opcodes ``tstore`` and ``tload`` are available in assembly (see `EIP-1153 `_). -- ``prague`` (**experimental**) +- ``prague`` +- ``osaka`` (**experimental**) + - Introduces support to `EVM Object Format (EOFv1) `_. .. index:: ! standard JSON, ! --standard-json .. _compiler-api: @@ -349,7 +351,7 @@ Input Description // Version of the EVM to compile for. // Affects type checking and code generation. Can be homestead, // tangerineWhistle, spuriousDragon, byzantium, constantinople, - // petersburg, istanbul, berlin, london, paris, shanghai, cancun (default) or prague (experimental). + // petersburg, istanbul, berlin, london, paris, shanghai, cancun (default), prague (experimental) or osaka. "evmVersion": "cancun", // Optional: Change compilation pipeline to go through the Yul intermediate representation. // This is false by default. diff --git a/liblangutil/EVMVersion.h b/liblangutil/EVMVersion.h index 2201f3c9dd1e..71df3a75cbeb 100644 --- a/liblangutil/EVMVersion.h +++ b/liblangutil/EVMVersion.h @@ -64,6 +64,7 @@ class EVMVersion: static EVMVersion shanghai() { return {Version::Shanghai}; } static EVMVersion cancun() { return {Version::Cancun}; } static EVMVersion prague() { return {Version::Prague}; } + static EVMVersion osaka() { return {Version::Osaka}; } static std::vector allVersions() { return { @@ -80,6 +81,7 @@ class EVMVersion: shanghai(), cancun(), prague(), + osaka() }; } @@ -92,7 +94,7 @@ class EVMVersion: } bool isExperimental() const { - return m_version == Version::Prague; + return *this > EVMVersion{}; } bool operator==(EVMVersion const& _other) const { return m_version == _other.m_version; } @@ -115,6 +117,7 @@ class EVMVersion: case Version::Shanghai: return "shanghai"; case Version::Cancun: return "cancun"; case Version::Prague: return "prague"; + case Version::Osaka: return "osaka"; } util::unreachable(); } @@ -155,7 +158,8 @@ class EVMVersion: Paris, Shanghai, Cancun, - Prague + Prague, + Osaka, }; EVMVersion(Version _version): m_version(_version) {} diff --git a/scripts/tests.sh b/scripts/tests.sh index dfbc0477342d..3d2849369eca 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -105,7 +105,7 @@ EVM_VERSIONS="homestead byzantium" if [ -z "$CI" ] then - EVM_VERSIONS+=" constantinople petersburg istanbul berlin london paris shanghai cancun prague" + EVM_VERSIONS+=" constantinople petersburg istanbul berlin london paris shanghai cancun prague osaka" fi # And then run the Solidity unit-tests in the matrix combination of optimizer / no optimizer diff --git a/test/EVMHost.cpp b/test/EVMHost.cpp index 897f01c68ac3..7df39bf71ee8 100644 --- a/test/EVMHost.cpp +++ b/test/EVMHost.cpp @@ -134,6 +134,8 @@ EVMHost::EVMHost(langutil::EVMVersion _evmVersion, evmc::VM& _vm): m_evmRevision = EVMC_CANCUN; else if (_evmVersion == langutil::EVMVersion::prague()) m_evmRevision = EVMC_PRAGUE; + else if (_evmVersion == langutil::EVMVersion::osaka()) + m_evmRevision = EVMC_OSAKA; else assertThrow(false, Exception, "Unsupported EVM version"); diff --git a/test/tools/ossfuzz/protoToYul.cpp b/test/tools/ossfuzz/protoToYul.cpp index 5a57b779dc87..cc5f68e71ecf 100644 --- a/test/tools/ossfuzz/protoToYul.cpp +++ b/test/tools/ossfuzz/protoToYul.cpp @@ -121,6 +121,8 @@ EVMVersion ProtoConverter::evmVersionMapping(Program_Version const& _ver) return EVMVersion::cancun(); case Program::PRAGUE: return EVMVersion::prague(); + case Program::OSAKA: + return EVMVersion::osaka(); } } diff --git a/test/tools/ossfuzz/yulProto.proto b/test/tools/ossfuzz/yulProto.proto index 15ac01396bcc..a22aacb0df03 100644 --- a/test/tools/ossfuzz/yulProto.proto +++ b/test/tools/ossfuzz/yulProto.proto @@ -407,6 +407,7 @@ message Program { SHANGHAI = 10; CANCUN = 11; PRAGUE = 12; + OSAKA = 13; } oneof program_oneof { Block block = 1;