Skip to content

Commit

Permalink
Introduces EVM version Osaka
Browse files Browse the repository at this point in the history
  • Loading branch information
r0qs committed Feb 6, 2025
1 parent 49e2433 commit 1fa5cdf
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/soltest_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ 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)
EVMS_WITH_EOF=(prague)
DEFAULT_EVM_VALUES=(constantinople petersburg istanbul berlin london paris shanghai cancun prague osaka)

# Deserialize the EVM_VALUES array if it was provided as argument or
# set EVM_VALUES to the default values.
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``

.. 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.
"evmVersion": "cancun",
// Optional: Change compilation pipeline to go through the Yul intermediate representation.
// This is false by default.
Expand Down
6 changes: 5 additions & 1 deletion 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 Down Expand Up @@ -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

0 comments on commit 1fa5cdf

Please sign in to comment.