mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove obsolete enforce-via-yul logic and CI run.
This commit is contained in:
parent
0cb9590298
commit
e93ad30e43
@ -1035,16 +1035,6 @@ jobs:
|
||||
condition: true
|
||||
<<: *steps_soltest
|
||||
|
||||
t_ubu_soltest_enforce_yul: &t_ubu_soltest_enforce_yul
|
||||
<<: *base_ubuntu2004
|
||||
parallelism: 20
|
||||
environment:
|
||||
EVM: << pipeline.parameters.evm-version >>
|
||||
SOLTEST_FLAGS: --enforce-via-yul
|
||||
OPTIMIZE: 0
|
||||
TERM: xterm
|
||||
<<: *steps_soltest
|
||||
|
||||
t_ubu_clang_soltest: &t_ubu_clang_soltest
|
||||
<<: *base_ubuntu2004_clang
|
||||
parallelism: 20
|
||||
@ -1515,7 +1505,6 @@ workflows:
|
||||
- t_ubu_cli: *workflow_ubuntu2004
|
||||
- t_ubu_locale: *workflow_ubuntu2004
|
||||
- t_ubu_soltest_all: *workflow_ubuntu2004
|
||||
- t_ubu_soltest_enforce_yul: *workflow_ubuntu2004
|
||||
- b_ubu_clang: *workflow_trigger_on_tags
|
||||
- t_ubu_clang_soltest: *workflow_ubuntu2004_clang
|
||||
- t_ubu_lsp: *workflow_ubuntu2004
|
||||
|
@ -107,7 +107,6 @@ void CommonOptions::addOptions()
|
||||
("no-semantic-tests", po::bool_switch(&disableSemanticTests)->default_value(disableSemanticTests), "disable semantic tests")
|
||||
("no-smt", po::bool_switch(&disableSMT)->default_value(disableSMT), "disable SMT checker")
|
||||
("optimize", po::bool_switch(&optimize)->default_value(optimize), "enables optimization")
|
||||
("enforce-via-yul", po::value<bool>(&enforceViaYul)->default_value(enforceViaYul)->implicit_value(true), "Enforce compiling all tests via yul to see if additional tests can be activated.")
|
||||
("enforce-compile-to-ewasm", po::bool_switch(&enforceCompileToEwasm)->default_value(enforceCompileToEwasm), "Enforce compiling all tests to Ewasm to see if additional tests can be activated.")
|
||||
("enforce-gas-cost", po::value<bool>(&enforceGasTest)->default_value(enforceGasTest)->implicit_value(true), "Enforce checking gas cost in semantic tests.")
|
||||
("enforce-gas-cost-min-value", po::value(&enforceGasTestMinValue)->default_value(enforceGasTestMinValue), "Threshold value to enforce adding gas checks to a test.")
|
||||
|
@ -60,7 +60,6 @@ struct CommonOptions
|
||||
boost::filesystem::path testPath;
|
||||
bool ewasm = false;
|
||||
bool optimize = false;
|
||||
bool enforceViaYul = false;
|
||||
bool enforceCompileToEwasm = false;
|
||||
bool enforceGasTest = false;
|
||||
u256 enforceGasTestMinValue = 100000;
|
||||
|
@ -40,7 +40,6 @@ public:
|
||||
std::string filename;
|
||||
langutil::EVMVersion evmVersion;
|
||||
std::vector<boost::filesystem::path> vmPaths;
|
||||
bool enforceCompileViaYul = false;
|
||||
bool enforceCompileToEwasm = false;
|
||||
bool enforceGasCost = false;
|
||||
u256 enforceGasCostMinValue;
|
||||
|
@ -133,7 +133,6 @@ int registerTests(
|
||||
boost::unit_test::test_suite& _suite,
|
||||
boost::filesystem::path const& _basepath,
|
||||
boost::filesystem::path const& _path,
|
||||
bool _enforceViaYul,
|
||||
bool _enforceCompileToEwasm,
|
||||
vector<string> const& _labels,
|
||||
TestCase::TestCaseCreator _testCaseCreator,
|
||||
@ -146,7 +145,6 @@ int registerTests(
|
||||
fullpath.string(),
|
||||
solidity::test::CommonOptions::get().evmVersion(),
|
||||
solidity::test::CommonOptions::get().vmPaths,
|
||||
_enforceViaYul,
|
||||
_enforceCompileToEwasm,
|
||||
solidity::test::CommonOptions::get().enforceGasTest,
|
||||
solidity::test::CommonOptions::get().enforceGasTestMinValue,
|
||||
@ -165,7 +163,6 @@ int registerTests(
|
||||
numTestsAdded += registerTests(
|
||||
*sub_suite,
|
||||
_basepath, _path / entry.path().filename(),
|
||||
_enforceViaYul,
|
||||
_enforceCompileToEwasm,
|
||||
_labels,
|
||||
_testCaseCreator,
|
||||
@ -271,7 +268,6 @@ test_suite* init_unit_test_suite(int /*argc*/, char* /*argv*/[])
|
||||
master,
|
||||
options.testPath / ts.path,
|
||||
ts.subpath,
|
||||
options.enforceViaYul,
|
||||
options.enforceCompileToEwasm,
|
||||
ts.labels,
|
||||
ts.testCaseCreator,
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -59,7 +59,6 @@ std::string editorPath()
|
||||
IsolTestOptions::IsolTestOptions():
|
||||
CommonOptions(description)
|
||||
{
|
||||
enforceViaYul = true;
|
||||
}
|
||||
|
||||
void IsolTestOptions::addOptions()
|
||||
|
@ -160,7 +160,6 @@ TestTool::Result TestTool::process()
|
||||
m_path.string(),
|
||||
m_options.evmVersion(),
|
||||
m_options.vmPaths,
|
||||
m_options.enforceViaYul,
|
||||
m_options.enforceCompileToEwasm,
|
||||
m_options.enforceGasTest,
|
||||
m_options.enforceGasTestMinValue
|
||||
|
Loading…
Reference in New Issue
Block a user