mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add basic support for the EVM version Paris
This mostly means testing with evmone, but instruction renaming of difficulty->prevrandao is omitted.
This commit is contained in:
committed by
Kamil Śliwak
parent
0b4b1045cf
commit
eb8af2caec
+2
-1
@@ -122,7 +122,8 @@ EVMHost::EVMHost(langutil::EVMVersion _evmVersion, evmc::VM& _vm):
|
||||
m_evmRevision = EVMC_BERLIN;
|
||||
else if (_evmVersion == langutil::EVMVersion::london())
|
||||
m_evmRevision = EVMC_LONDON;
|
||||
// TODO: support EVMVersion::paris()
|
||||
else if (_evmVersion == langutil::EVMVersion::paris())
|
||||
m_evmRevision = EVMC_PARIS;
|
||||
else
|
||||
assertThrow(false, Exception, "Unsupported EVM version");
|
||||
|
||||
|
||||
@@ -1082,6 +1082,8 @@ BOOST_AUTO_TEST_CASE(evm_version)
|
||||
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);
|
||||
result = compile(inputForVersion("\"evmVersion\": \"paris\","));
|
||||
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"paris\"") != string::npos);
|
||||
// test default
|
||||
result = compile(inputForVersion(""));
|
||||
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"london\"") != string::npos);
|
||||
|
||||
@@ -5,6 +5,7 @@ contract C {
|
||||
}
|
||||
// ====
|
||||
// compileToEwasm: also
|
||||
// EVMVersion: <paris
|
||||
// ----
|
||||
// f() -> 200000000
|
||||
// f() -> 200000000
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
return block.difficulty;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileToEwasm: also
|
||||
// EVMVersion: >=paris
|
||||
// ----
|
||||
// f() -> 0xa86c2e601b6c44eb4848f7d23d9df3113fbcac42041c49cbed5000cb4f118777
|
||||
// f() -> 0xa86c2e601b6c44eb4848f7d23d9df3113fbcac42041c49cbed5000cb4f118777
|
||||
// f() -> 0xa86c2e601b6c44eb4848f7d23d9df3113fbcac42041c49cbed5000cb4f118777
|
||||
@@ -48,7 +48,9 @@ static vector<EVMVersion> s_evmVersions = {
|
||||
EVMVersion::constantinople(),
|
||||
EVMVersion::petersburg(),
|
||||
EVMVersion::istanbul(),
|
||||
EVMVersion::berlin()
|
||||
EVMVersion::berlin(),
|
||||
EVMVersion::london(),
|
||||
EVMVersion::paris()
|
||||
};
|
||||
|
||||
void FuzzerUtil::testCompilerJsonInterface(string const& _input, bool _optimize, bool _quiet)
|
||||
|
||||
@@ -112,6 +112,10 @@ EVMVersion ProtoConverter::evmVersionMapping(Program_Version const& _ver)
|
||||
return EVMVersion::istanbul();
|
||||
case Program::BERLIN:
|
||||
return EVMVersion::berlin();
|
||||
case Program::LONDON:
|
||||
return EVMVersion::london();
|
||||
case Program::PARIS:
|
||||
return EVMVersion::paris();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -396,6 +396,8 @@ message Program {
|
||||
PETERSBURG = 5;
|
||||
ISTANBUL = 6;
|
||||
BERLIN = 7;
|
||||
LONDON = 8;
|
||||
PARIS = 9;
|
||||
}
|
||||
oneof program_oneof {
|
||||
Block block = 1;
|
||||
|
||||
Reference in New Issue
Block a user