Run gas tests on NoMetadata format only.

This commit is contained in:
Djordje Mijovic 2021-02-11 09:46:25 +01:00
parent 68a4efb2e7
commit b598948211
13 changed files with 41 additions and 41 deletions

View File

@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE(string_storage)
} }
} }
)"; )";
m_compiler.overwriteReleaseFlag(true); m_compiler.setMetadataFormat(CompilerStack::MetadataFormat::NoMetadata);
compileAndRun(sourceCode); compileAndRun(sourceCode);
auto evmVersion = solidity::test::CommonOptions::get().evmVersion(); auto evmVersion = solidity::test::CommonOptions::get().evmVersion();
@ -101,7 +101,7 @@ BOOST_AUTO_TEST_CASE(string_storage)
if (CommonOptions::get().useABIEncoderV1) if (CommonOptions::get().useABIEncoderV1)
CHECK_DEPLOY_GAS(133045, 129731, evmVersion); CHECK_DEPLOY_GAS(133045, 129731, evmVersion);
else else
CHECK_DEPLOY_GAS(155553, 132103, evmVersion); CHECK_DEPLOY_GAS(144679, 121229, evmVersion);
} }
// This is only correct on >=Constantinople. // This is only correct on >=Constantinople.
else if (!CommonOptions::get().useABIEncoderV1) else if (!CommonOptions::get().useABIEncoderV1)
@ -110,22 +110,22 @@ BOOST_AUTO_TEST_CASE(string_storage)
{ {
// Costs with 0 are cases which cannot be triggered in tests. // Costs with 0 are cases which cannot be triggered in tests.
if (evmVersion < EVMVersion::istanbul()) if (evmVersion < EVMVersion::istanbul())
CHECK_DEPLOY_GAS(0, 120189, evmVersion); CHECK_DEPLOY_GAS(0, 109241, evmVersion);
else else
CHECK_DEPLOY_GAS(0, 108541, evmVersion); CHECK_DEPLOY_GAS(0, 97697, evmVersion);
} }
else else
{ {
if (evmVersion < EVMVersion::istanbul()) if (evmVersion < EVMVersion::istanbul())
CHECK_DEPLOY_GAS(149567, 123969, evmVersion); CHECK_DEPLOY_GAS(138693, 123969, evmVersion);
else else
CHECK_DEPLOY_GAS(134123, 110969, evmVersion); CHECK_DEPLOY_GAS(123301, 110969, evmVersion);
} }
} }
else if (evmVersion < EVMVersion::istanbul()) else if (evmVersion < EVMVersion::istanbul())
CHECK_DEPLOY_GAS(125829, 118559, evmVersion); CHECK_DEPLOY_GAS(125829, 118559, evmVersion);
else else
CHECK_DEPLOY_GAS(114077, 107067, evmVersion); CHECK_DEPLOY_GAS(114077, 96461, evmVersion);
if (evmVersion >= EVMVersion::byzantium()) if (evmVersion >= EVMVersion::byzantium())
{ {

View File

@ -106,7 +106,7 @@ TestCase::TestResult GasTest::run(ostream& _stream, string const& _linePrefix, b
// Prerelease CBOR metadata varies in size due to changing version numbers and build dates. // Prerelease CBOR metadata varies in size due to changing version numbers and build dates.
// This leads to volatile creation cost estimates. Therefore we force the compiler to // This leads to volatile creation cost estimates. Therefore we force the compiler to
// release mode for testing gas estimates. // release mode for testing gas estimates.
compiler().overwriteReleaseFlag(true); compiler().setMetadataFormat(CompilerStack::MetadataFormat::NoMetadata);
OptimiserSettings settings = m_optimise ? OptimiserSettings::standard() : OptimiserSettings::minimal(); OptimiserSettings settings = m_optimise ? OptimiserSettings::standard() : OptimiserSettings::minimal();
if (m_optimiseYul) if (m_optimiseYul)
{ {

View File

@ -14,9 +14,9 @@ contract C {
} }
// ---- // ----
// creation: // creation:
// codeDepositCost: 1181400 // codeDepositCost: 1170600
// executionCost: 1227 // executionCost: 1214
// totalCost: 1182627 // totalCost: 1171814
// external: // external:
// a(): 1130 // a(): 1130
// b(uint256): infinite // b(uint256): infinite

View File

@ -17,9 +17,9 @@ contract C {
// optimize-yul: true // optimize-yul: true
// ---- // ----
// creation: // creation:
// codeDepositCost: 583400 // codeDepositCost: 572600
// executionCost: 619 // executionCost: 606
// totalCost: 584019 // totalCost: 573206
// external: // external:
// a(): 985 // a(): 985
// b(uint256): 2052 // b(uint256): 2052

View File

@ -13,8 +13,8 @@ contract C {
} }
// ---- // ----
// creation: // creation:
// codeDepositCost: 398400 // codeDepositCost: 387600
// executionCost: 436 // executionCost: 424
// totalCost: 398836 // totalCost: 388024
// external: // external:
// f(): 428 // f(): 428

View File

@ -24,9 +24,9 @@ contract Large {
} }
// ---- // ----
// creation: // creation:
// codeDepositCost: 913400 // codeDepositCost: 902600
// executionCost: 948 // executionCost: 942
// totalCost: 914348 // totalCost: 903542
// external: // external:
// a(): 1175 // a(): 1175
// b(uint256): infinite // b(uint256): infinite

View File

@ -27,9 +27,9 @@ contract Large {
// optimize-runs: 2 // optimize-runs: 2
// ---- // ----
// creation: // creation:
// codeDepositCost: 267000 // codeDepositCost: 256200
// executionCost: 306 // executionCost: 300
// totalCost: 267306 // totalCost: 256500
// external: // external:
// a(): 983 // a(): 983
// b(uint256): 2337 // b(uint256): 2337

View File

@ -11,9 +11,9 @@ contract Medium {
} }
// ---- // ----
// creation: // creation:
// codeDepositCost: 360400 // codeDepositCost: 349600
// executionCost: 399 // executionCost: 386
// totalCost: 360799 // totalCost: 349986
// external: // external:
// a(): 1152 // a(): 1152
// b(uint256): infinite // b(uint256): infinite

View File

@ -14,9 +14,9 @@ contract Medium {
// optimize-runs: 2 // optimize-runs: 2
// ---- // ----
// creation: // creation:
// codeDepositCost: 157400 // codeDepositCost: 146600
// executionCost: 202 // executionCost: 190
// totalCost: 157602 // totalCost: 146790
// external: // external:
// a(): 983 // a(): 983
// b(uint256): 2095 // b(uint256): 2095

View File

@ -6,9 +6,9 @@ contract Small {
} }
// ---- // ----
// creation: // creation:
// codeDepositCost: 123600 // codeDepositCost: 112800
// executionCost: 171 // executionCost: 159
// totalCost: 123771 // totalCost: 112959
// external: // external:
// fallback: 129 // fallback: 129
// a(): 1107 // a(): 1107

View File

@ -9,9 +9,9 @@ contract Small {
// optimize-runs: 2 // optimize-runs: 2
// ---- // ----
// creation: // creation:
// codeDepositCost: 72600 // codeDepositCost: 61800
// executionCost: 123 // executionCost: 111
// totalCost: 72723 // totalCost: 61911
// external: // external:
// fallback: 118 // fallback: 118
// a(): 961 // a(): 961

View File

@ -19,9 +19,9 @@ contract C {
// optimize-yul: false // optimize-yul: false
// ---- // ----
// creation: // creation:
// codeDepositCost: 119800 // codeDepositCost: 109000
// executionCost: 165 // executionCost: 159
// totalCost: 119965 // totalCost: 109159
// external: // external:
// exp_neg_one(uint256): 2259 // exp_neg_one(uint256): 2259
// exp_one(uint256): infinite // exp_one(uint256): infinite

View File

@ -19,9 +19,9 @@ contract C {
// optimize-yul: true // optimize-yul: true
// ---- // ----
// creation: // creation:
// codeDepositCost: 47800 // codeDepositCost: 37000
// executionCost: 99 // executionCost: 87
// totalCost: 47899 // totalCost: 37087
// external: // external:
// exp_neg_one(uint256): 1917 // exp_neg_one(uint256): 1917
// exp_one(uint256): 1870 // exp_one(uint256): 1870