Remove obsolete enforce-via-yul logic and CI run.

This commit is contained in:
Daniel Kirchner
2022-05-19 20:23:28 +02:00
parent 0cb9590298
commit e93ad30e43
30 changed files with 34 additions and 46 deletions
+12 -20
View File
@@ -49,7 +49,6 @@ SemanticTest::SemanticTest(
string const& _filename,
langutil::EVMVersion _evmVersion,
vector<boost::filesystem::path> const& _vmPaths,
bool _enforceViaYul,
bool _enforceCompileToEwasm,
bool _enforceGasCost,
u256 _enforceGasCostMinValue
@@ -60,27 +59,32 @@ SemanticTest::SemanticTest(
m_lineOffset(m_reader.lineNumber()),
m_builtins(makeBuiltins()),
m_sideEffectHooks(makeSideEffectHooks()),
m_enforceViaYul(_enforceViaYul),
m_enforceCompileToEwasm(_enforceCompileToEwasm),
m_enforceGasCost(_enforceGasCost),
m_enforceGasCostMinValue(move(_enforceGasCostMinValue))
{
static set<string> const compileViaYulAllowedValues{"also", "true", "false", "default"};
static set<string> const compileViaYulAllowedValues{"also", "true", "false"};
static set<string> const yulRunTriggers{"also", "true"};
static set<string> const legacyRunTriggers{"also", "false", "default"};
m_runWithABIEncoderV1Only = m_reader.boolSetting("ABIEncoderV1Only", false);
if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1)
m_shouldRun = false;
string compileViaYul = m_reader.stringSetting("compileViaYul", "default");
if (m_runWithABIEncoderV1Only && compileViaYul != "false")
BOOST_THROW_EXCEPTION(runtime_error(
"ABIEncoderV1Only tests cannot be run via yul, "
"so they need to also specify ``compileViaYul: false``"
));
if (!util::contains(compileViaYulAllowedValues, compileViaYul))
BOOST_THROW_EXCEPTION(runtime_error("Invalid compileViaYul value: " + compileViaYul + "."));
m_testCaseWantsYulRun = util::contains(yulRunTriggers, compileViaYul);
m_testCaseWantsLegacyRun = util::contains(legacyRunTriggers, compileViaYul);
// Do not enforce via yul and ewasm, if via yul was explicitly denied.
// Do not enforce ewasm, if via yul was explicitly denied.
if (compileViaYul == "false")
{
m_enforceViaYul = false;
m_enforceCompileToEwasm = false;
}
string compileToEwasm = m_reader.stringSetting("compileToEwasm", "false");
if (compileToEwasm == "also")
@@ -97,18 +101,6 @@ SemanticTest::SemanticTest(
if (m_testCaseWantsEwasmRun && !m_supportsEwasm)
m_testCaseWantsEwasmRun = false;
m_runWithABIEncoderV1Only = m_reader.boolSetting("ABIEncoderV1Only", false);
if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1)
m_shouldRun = false;
// Sanity check
if (m_runWithABIEncoderV1Only && (compileViaYul == "true" || compileViaYul == "also"))
BOOST_THROW_EXCEPTION(runtime_error(
"ABIEncoderV1Only can not be used with compileViaYul=" + compileViaYul +
", set it to false or omit the flag. The compileViaYul setting ignores the abicoder pragma"
" and runs everything with ABICoder V2."
));
auto revertStrings = revertStringsFromString(m_reader.stringSetting("revertStrings", "default"));
soltestAssert(revertStrings, "Invalid revertStrings setting.");
m_revertStrings = revertStrings.value();
@@ -307,7 +299,7 @@ TestCase::TestResult SemanticTest::run(ostream& _stream, string const& _linePref
if (m_testCaseWantsLegacyRun)
result = runTest(_stream, _linePrefix, _formatted, false, false);
if ((m_testCaseWantsYulRun || m_enforceViaYul) && result == TestResult::Success)
if (m_testCaseWantsYulRun && result == TestResult::Success)
result = runTest(_stream, _linePrefix, _formatted, true, false);
if ((m_testCaseWantsEwasmRun || m_enforceCompileToEwasm) && result == TestResult::Success)
+1 -4
View File
@@ -52,7 +52,6 @@ public:
_options.filename,
_options.evmVersion,
_options.vmPaths,
_options.enforceCompileViaYul,
_options.enforceCompileToEwasm,
_options.enforceGasCost,
_options.enforceGasCostMinValue
@@ -63,7 +62,6 @@ public:
std::string const& _filename,
langutil::EVMVersion _evmVersion,
std::vector<boost::filesystem::path> const& _vmPaths,
bool _enforceViaYul = false,
bool _enforceCompileToEwasm = false,
bool _enforceGasCost = false,
u256 _enforceGasCostMinValue = 100000
@@ -97,10 +95,9 @@ private:
std::vector<TestFunctionCall> m_tests;
std::map<std::string, Builtin> const m_builtins;
std::vector<SideEffectHook> const m_sideEffectHooks;
bool m_testCaseWantsYulRun = false;
bool m_testCaseWantsYulRun = true;
bool m_testCaseWantsEwasmRun = false;
bool m_testCaseWantsLegacyRun = true;
bool m_enforceViaYul = false;
bool m_enforceCompileToEwasm = false;
bool m_runWithABIEncoderV1Only = false;
bool m_allowNonExistingFunctions = false;
@@ -4,6 +4,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(bool): true -> true
// f(bool): false -> false
@@ -7,6 +7,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(uint16,int16,address,bytes3,bool): 1, 2, 3, "a", true -> 1, 2, 3, "a", true
// f(uint16,int16,address,bytes3,bool): 0xffffff, 0x1ffff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, "abcd", 1 -> 0xffff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, 0xffffffffffffffffffffffffffffffffffffffff, "abc", true
@@ -7,6 +7,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(uint8): 0 -> 0
// f(uint8): 1 -> 1
@@ -8,5 +8,6 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f() -> 0x40, 0xa0, 0x40, 0x20, 0x0, 0x0
@@ -7,6 +7,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(uint16,uint16): 65534, 0 -> 0xfffe
// f(uint16,uint16): 65536, 0 -> 0x00
@@ -11,6 +11,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(bool): 0x0 -> 0x0
// f(bool): 0x1 -> 0x1
@@ -13,6 +13,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(address): 0xffff1234567890123456789012345678901234567890 -> 0x0 # We input longer data on purpose.#
// g(address): 0xffff1234567890123456789012345678901234567890 -> 0x0
@@ -10,5 +10,6 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(bytes2,uint16): "abc", 0x40102 -> 0x0 # We input longer data on purpose. #
@@ -18,6 +18,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(int8,uint8): 0x00, 0x03 -> 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe
// f(int8,uint8): 0x00, 0x04 -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
@@ -10,6 +10,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(uint8,uint8): 0x00, 0x04 -> 0x0f
// f(uint8,uint8): 0x00, 0x1004 -> 0x0f
@@ -6,6 +6,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(int16,uint16): 0xff99, 0x00 -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff99
// f(int16,uint16): 0xff99, 0x01 -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcc
@@ -6,6 +6,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(int32,uint32): 0xffffff99, 0x00 -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff99
// f(int32,uint32): 0xffffff99, 0x01 -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcc
@@ -6,6 +6,7 @@ contract C {
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(int8,uint8): 0x99, 0x00 -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff99
// f(int8,uint8): 0x99, 0x01 -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcc
@@ -8,5 +8,6 @@ contract C {
// EVMVersion: >=byzantium
// revertStrings: debug
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// d(bytes): 0x20, 0x01, 0x0000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"08c379a0", 0x20, 18, "Calldata too short"
@@ -10,8 +10,8 @@ contract C {
// ====
// ABIEncoderV1Only: true
// EVMVersion: >=byzantium
// compileViaYul: false
// revertStrings: debug
// compileViaYul: false
// ----
// f() -> FAILURE, hex"08c379a0", 0x20, 0
// g(string): 0x20, 0, "" -> FAILURE, hex"08c379a0", 0x20, 0
@@ -9,5 +9,6 @@ contract C {
// EVMVersion: >=byzantium
// revertStrings: debug
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(uint8[]): 0x20, 2, 3, 3 -> FAILURE, hex"08c379a0", 0x20, 17, "Enum out of range"
@@ -5,7 +5,7 @@ contract C {
// ====
// EVMVersion: >=byzantium
// ABIEncoderV1Only: true
// compileViaYul: false
// revertStrings: debug
// compileViaYul: false
// ----
// t(uint256) -> FAILURE, hex"08c379a0", 0x20, 0x12, "Calldata too short"
@@ -8,6 +8,7 @@ contract C {
// EVMVersion: >=byzantium
// revertStrings: debug
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// d(bytes): 0x20, 0x20, 0x0000000000000000000000000000000000000000000000000000000000000000 -> 0
// d(bytes): 0x100, 0x20, 0x0000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"08c379a0", 0x20, 43, "ABI calldata decoding: invalid h", "ead pointer"
@@ -16,6 +16,7 @@ contract C {
// EVMVersion: >=byzantium
// revertStrings: debug
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// f(uint256,uint256,uint256): 0, 0x200, 0x60 -> FAILURE, hex"08c379a0", 0x20, 39, "ABI memory decoding: invalid dat", "a start"
// f(uint256,uint256,uint256): 0, 0x20, 0x60 -> FAILURE, hex"08c379a0", 0x20, 40, "ABI memory decoding: invalid dat", "a length"
@@ -12,6 +12,7 @@ contract test {
// ====
// ABIEncoderV1Only: true
// EVMVersion: >=byzantium
// compileViaYul: false
// ----
// table(uint8): 0 -> 0
// table(uint8): 0x01 -> 0
@@ -20,6 +20,7 @@ contract test {
// ====
// EVMVersion: >=byzantium
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// library: L
// get(uint8): 0 -> 0