From 3f5925e1c39a2a6de2a0cae14e59e59cb9aa7647 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 2 Dec 2020 14:15:26 +0100 Subject: [PATCH] Update gas cost tests. --- test/libsolidity/GasCosts.cpp | 9 +++- test/libsolidity/gasTests/data_storage.sol | 8 +-- test/libsolidity/gasTests/dispatch_large.sol | 50 +++++++++---------- .../gasTests/dispatch_large_optimised.sol | 50 +++++++++---------- test/libsolidity/gasTests/dispatch_medium.sol | 22 ++++---- .../gasTests/dispatch_medium_optimised.sol | 24 ++++----- test/libsolidity/gasTests/dispatch_small.sol | 12 ++--- .../gasTests/dispatch_small_optimised.sol | 10 ++-- 8 files changed, 95 insertions(+), 90 deletions(-) diff --git a/test/libsolidity/GasCosts.cpp b/test/libsolidity/GasCosts.cpp index 836f45d49..e23de065a 100644 --- a/test/libsolidity/GasCosts.cpp +++ b/test/libsolidity/GasCosts.cpp @@ -97,7 +97,12 @@ BOOST_AUTO_TEST_CASE(string_storage) auto evmVersion = solidity::test::CommonOptions::get().evmVersion(); if (evmVersion <= EVMVersion::byzantium()) - CHECK_DEPLOY_GAS(133045, 129731, evmVersion); + { + if (CommonOptions::get().useABIEncoderV1) + CHECK_DEPLOY_GAS(133045, 129731, evmVersion); + else + CHECK_DEPLOY_GAS(152657, 135201, evmVersion); + } // This is only correct on >=Constantinople. else if (!CommonOptions::get().useABIEncoderV1) { @@ -126,7 +131,7 @@ BOOST_AUTO_TEST_CASE(string_storage) { callContractFunction("f()"); if (evmVersion == EVMVersion::byzantium()) - CHECK_GAS(21545, 21526, 20); + CHECK_GAS(21712, 21555, 20); // This is only correct on >=Constantinople. else if (!CommonOptions::get().useABIEncoderV1) { diff --git a/test/libsolidity/gasTests/data_storage.sol b/test/libsolidity/gasTests/data_storage.sol index 29cade28c..de74c4037 100644 --- a/test/libsolidity/gasTests/data_storage.sol +++ b/test/libsolidity/gasTests/data_storage.sol @@ -13,8 +13,8 @@ contract C { } // ---- // creation: -// codeDepositCost: 257000 -// executionCost: 300 -// totalCost: 257300 +// codeDepositCost: 376800 +// executionCost: 411 +// totalCost: 377211 // external: -// f(): 252 +// f(): 399 diff --git a/test/libsolidity/gasTests/dispatch_large.sol b/test/libsolidity/gasTests/dispatch_large.sol index 1e16d121c..8413957cd 100644 --- a/test/libsolidity/gasTests/dispatch_large.sol +++ b/test/libsolidity/gasTests/dispatch_large.sol @@ -24,29 +24,29 @@ contract Large { } // ---- // creation: -// codeDepositCost: 961600 -// executionCost: 1001 -// totalCost: 962601 +// codeDepositCost: 913400 +// executionCost: 948 +// totalCost: 914348 // external: -// a(): 1051 -// b(uint256): 2046 -// f0(uint256): 427 -// f1(uint256): 41352 -// f2(uint256): 21293 -// f3(uint256): 21381 -// f4(uint256): 21359 -// f5(uint256): 21337 -// f6(uint256): 21360 -// f7(uint256): 21272 -// f8(uint256): 21272 -// f9(uint256): 21294 -// g0(uint256): 313 -// g1(uint256): 41307 -// g2(uint256): 21270 -// g3(uint256): 21358 -// g4(uint256): 21336 -// g5(uint256): 21292 -// g6(uint256): 21315 -// g7(uint256): 21314 -// g8(uint256): 21292 -// g9(uint256): 21249 +// a(): 1175 +// b(uint256): infinite +// f0(uint256): infinite +// f1(uint256): infinite +// f2(uint256): infinite +// f3(uint256): infinite +// f4(uint256): infinite +// f5(uint256): infinite +// f6(uint256): infinite +// f7(uint256): infinite +// f8(uint256): infinite +// f9(uint256): infinite +// g0(uint256): infinite +// g1(uint256): infinite +// g2(uint256): infinite +// g3(uint256): infinite +// g4(uint256): infinite +// g5(uint256): infinite +// g6(uint256): infinite +// g7(uint256): infinite +// g8(uint256): infinite +// g9(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_large_optimised.sol b/test/libsolidity/gasTests/dispatch_large_optimised.sol index 099031bab..4108ca121 100644 --- a/test/libsolidity/gasTests/dispatch_large_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_large_optimised.sol @@ -27,29 +27,29 @@ contract Large { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 301200 -// executionCost: 343 -// totalCost: 301543 +// codeDepositCost: 270600 +// executionCost: 312 +// totalCost: 270912 // external: -// a(): 998 -// b(uint256): 2305 -// f0(uint256): 334 -// f1(uint256): 41474 -// f2(uint256): 21540 -// f3(uint256): 21628 -// f4(uint256): 21606 -// f5(uint256): 21584 -// f6(uint256): 21496 -// f7(uint256): 21276 -// f8(uint256): 21408 -// f9(uint256): 21430 -// g0(uint256): 574 -// g1(uint256): 41186 -// g2(uint256): 21274 -// g3(uint256): 21362 -// g4(uint256): 21340 -// g5(uint256): 21428 -// g6(uint256): 21208 -// g7(uint256): 21318 -// g8(uint256): 21296 -// g9(uint256): 21142 +// a(): 1028 +// b(uint256): 2370 +// f0(uint256): 399 +// f1(uint256): 41539 +// f2(uint256): 21605 +// f3(uint256): 21693 +// f4(uint256): 21671 +// f5(uint256): 21649 +// f6(uint256): 21561 +// f7(uint256): 21341 +// f8(uint256): 21473 +// f9(uint256): 21495 +// g0(uint256): 639 +// g1(uint256): 41251 +// g2(uint256): 21339 +// g3(uint256): 21427 +// g4(uint256): 21405 +// g5(uint256): 21493 +// g6(uint256): 21273 +// g7(uint256): 21383 +// g8(uint256): 21361 +// g9(uint256): 21207 diff --git a/test/libsolidity/gasTests/dispatch_medium.sol b/test/libsolidity/gasTests/dispatch_medium.sol index cd1368ca5..b9076c9cd 100644 --- a/test/libsolidity/gasTests/dispatch_medium.sol +++ b/test/libsolidity/gasTests/dispatch_medium.sol @@ -11,16 +11,16 @@ contract Medium { } // ---- // creation: -// codeDepositCost: 361800 +// codeDepositCost: 360400 // executionCost: 399 -// totalCost: 362199 +// totalCost: 360799 // external: -// a(): 1028 -// b(uint256): 2046 -// f1(uint256): 41263 -// f2(uint256): 21293 -// f3(uint256): 21337 -// g0(uint256): 313 -// g7(uint256): 21292 -// g8(uint256): 21270 -// g9(uint256): 21226 +// a(): 1152 +// b(uint256): infinite +// f1(uint256): infinite +// f2(uint256): infinite +// f3(uint256): infinite +// g0(uint256): infinite +// g7(uint256): infinite +// g8(uint256): infinite +// g9(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_medium_optimised.sol b/test/libsolidity/gasTests/dispatch_medium_optimised.sol index af7748c63..2bc22cc58 100644 --- a/test/libsolidity/gasTests/dispatch_medium_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_medium_optimised.sol @@ -14,16 +14,16 @@ contract Medium { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 169600 -// executionCost: 214 -// totalCost: 169814 +// codeDepositCost: 161000 +// executionCost: 208 +// totalCost: 161208 // external: -// a(): 998 -// b(uint256): 2063 -// f1(uint256): 41254 -// f2(uint256): 21298 -// f3(uint256): 21342 -// g0(uint256): 332 -// g7(uint256): 21208 -// g8(uint256): 21186 -// g9(uint256): 21142 +// a(): 1028 +// b(uint256): 2128 +// f1(uint256): 41319 +// f2(uint256): 21363 +// f3(uint256): 21407 +// g0(uint256): 397 +// g7(uint256): 21273 +// g8(uint256): 21251 +// g9(uint256): 21207 diff --git a/test/libsolidity/gasTests/dispatch_small.sol b/test/libsolidity/gasTests/dispatch_small.sol index d520d1bb0..6a062e530 100644 --- a/test/libsolidity/gasTests/dispatch_small.sol +++ b/test/libsolidity/gasTests/dispatch_small.sol @@ -6,11 +6,11 @@ contract Small { } // ---- // creation: -// codeDepositCost: 103400 -// executionCost: 153 -// totalCost: 103553 +// codeDepositCost: 123600 +// executionCost: 171 +// totalCost: 123771 // external: // fallback: 129 -// a(): 983 -// b(uint256): 2002 -// f1(uint256): 41263 +// a(): 1107 +// b(uint256): infinite +// f1(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_small_optimised.sol b/test/libsolidity/gasTests/dispatch_small_optimised.sol index f4fa28e20..3f595229a 100644 --- a/test/libsolidity/gasTests/dispatch_small_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_small_optimised.sol @@ -9,11 +9,11 @@ contract Small { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 72800 +// codeDepositCost: 76200 // executionCost: 123 -// totalCost: 72923 +// totalCost: 76323 // external: // fallback: 118 -// a(): 976 -// b(uint256): 1953 -// f1(uint256): 41188 +// a(): 1006 +// b(uint256): 2018 +// f1(uint256): 41253