Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduces EVM version Osaka #15830

Merged
merged 1 commit into from
Feb 7, 2025
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 @@ -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
Expand Down
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion docs/using-the-compiler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ at each version. Backward compatibility is not guaranteed between each version.
- Opcode ``mcopy`` is available in assembly (see `EIP-5656 <https://eips.ethereum.org/EIPS/eip-5656>`_).
- Opcodes ``tstore`` and ``tload`` are available in assembly (see `EIP-1153 <https://eips.ethereum.org/EIPS/eip-1153>`_).
- ``prague`` (**experimental**)
- ``osaka`` (**experimental**)

.. index:: ! standard JSON, ! --standard-json
.. _compiler-api:
Expand Down Expand Up @@ -349,7 +350,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 (experimental).
"evmVersion": "cancun",
// Optional: Change compilation pipeline to go through the Yul intermediate representation.
// This is false by default.
Expand Down
8 changes: 6 additions & 2 deletions liblangutil/EVMVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<EVMVersion> allVersions() {
return {
Expand All @@ -80,6 +81,7 @@ class EVMVersion:
shanghai(),
cancun(),
prague(),
osaka(),
};
}

Expand All @@ -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; }
Expand All @@ -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();
}
Expand Down Expand Up @@ -155,7 +158,8 @@ class EVMVersion:
Paris,
Shanghai,
Cancun,
Prague
Prague,
Osaka,
};

EVMVersion(Version _version): m_version(_version) {}
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/EVMHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
2 changes: 2 additions & 0 deletions test/tools/ossfuzz/protoToYul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
1 change: 1 addition & 0 deletions test/tools/ossfuzz/yulProto.proto
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ message Program {
SHANGHAI = 10;
CANCUN = 11;
PRAGUE = 12;
OSAKA = 13;
}
oneof program_oneof {
Block block = 1;
Expand Down