Merge pull request #7890 from ethereum/defaultIstanbul

Set default EVM version to Istanbul.
This commit is contained in:
chriseth 2019-12-04 12:53:29 +01:00 committed by GitHub
commit e24cca314e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 75 additions and 71 deletions

View File

@ -34,4 +34,4 @@ for OPTIMIZE in 0 1; do
done
done
EVM=constantinople OPTIMIZE=1 ABI_ENCODER_V2=1 ${REPODIR}/.circleci/soltest.sh
EVM=istanbul OPTIMIZE=1 ABI_ENCODER_V2=1 ${REPODIR}/.circleci/soltest.sh

View File

@ -6,6 +6,7 @@ Language Features:
Compiler Features:
* Set the default EVM version to "Istanbul".
* Commandline Interface: Allow translation from yul / strict assembly to EWasm using ``solc --yul --yul-dialect evm --machine eWasm``
* SMTChecker: Add support to constructors including constructor inheritance.
* Yul: When compiling via Yul, string literals from the Solidity code are kept as string literals if every character is safely printable.

View File

@ -120,9 +120,9 @@ at each version. Backward compatibility is not guaranteed between each version.
- ``constantinople``
- Opcodes ``create2`, ``extcodehash``, ``shl``, ``shr`` and ``sar`` are available in assembly.
- Shifting operators use shifting opcodes and thus need less gas.
- ``petersburg`` (**default**)
- ``petersburg``
- The compiler behaves the same way as with constantinople.
- ``istanbul``
- ``istanbul`` (**default**)
- Opcodes ``chainid`` and ``selfbalance`` are available in assembly.
- ``berlin`` (**experimental**)

View File

@ -98,7 +98,7 @@ private:
EVMVersion(Version _version): m_version(_version) {}
Version m_version = Version::Petersburg;
Version m_version = Version::Istanbul;
};
}

View File

@ -656,7 +656,8 @@ Allowed options)",
(
g_strEVMVersion.c_str(),
po::value<string>()->value_name("version"),
"Select desired EVM version. Either homestead, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg (default), istanbul or berlin."
"Select desired EVM version. Either homestead, tangerineWhistle, spuriousDragon, "
"byzantium, constantinople, petersburg, istanbul (default) or berlin."
)
(g_argOptimize.c_str(), "Enable bytecode optimizer.")
(

View File

@ -900,9 +900,11 @@ BOOST_AUTO_TEST_CASE(evm_version)
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"constantinople\"") != string::npos);
result = compile(inputForVersion("\"evmVersion\": \"petersburg\","));
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"petersburg\"") != string::npos);
result = compile(inputForVersion("\"evmVersion\": \"istanbul\","));
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"istanbul\"") != string::npos);
// test default
result = compile(inputForVersion(""));
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"petersburg\"") != string::npos);
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"istanbul\"") != string::npos);
// test invalid
result = compile(inputForVersion("\"evmVersion\": \"invalid\","));
BOOST_CHECK(result["errors"][0]["message"].asString() == "Invalid EVM version requested.");

View File

@ -18,7 +18,7 @@ contract C {
// executionCost: 1167
// totalCost: 1123767
// external:
// a(): 530
// a(): 1130
// b(uint256): infinite
// f1(uint256): infinite
// f2(uint256[],string[],uint16,address): infinite

View File

@ -21,8 +21,8 @@ contract C {
// executionCost: 645
// totalCost: 609045
// external:
// a(): 429
// b(uint256): 884
// a(): 1029
// b(uint256): 2084
// f1(uint256): 351
// f2(uint256[],string[],uint16,address): infinite
// f3(uint16[],string[],uint16,address): infinite

View File

@ -28,25 +28,25 @@ contract Large {
// executionCost: 670
// totalCost: 637470
// external:
// a(): 451
// b(uint256): 846
// a(): 1051
// b(uint256): 2046
// f0(uint256): 427
// f1(uint256): 40752
// f2(uint256): 20693
// f3(uint256): 20781
// f4(uint256): 20759
// f5(uint256): 20737
// f6(uint256): 20760
// f7(uint256): 20672
// f8(uint256): 20672
// f9(uint256): 20694
// 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): 40707
// g2(uint256): 20670
// g3(uint256): 20758
// g4(uint256): 20736
// g5(uint256): 20692
// g6(uint256): 20715
// g7(uint256): 20714
// g8(uint256): 20692
// g9(uint256): 20649
// 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

View File

@ -31,25 +31,25 @@ contract Large {
// executionCost: 300
// totalCost: 260700
// external:
// a(): 398
// b(uint256): 1105
// a(): 998
// b(uint256): 2305
// f0(uint256): 334
// f1(uint256): 40874
// f2(uint256): 20940
// f3(uint256): 21028
// f4(uint256): 21006
// f5(uint256): 20984
// f6(uint256): 20896
// f7(uint256): 20676
// f8(uint256): 20808
// f9(uint256): 20830
// 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): 40586
// g2(uint256): 20674
// g3(uint256): 20762
// g4(uint256): 20740
// g5(uint256): 20828
// g6(uint256): 20608
// g7(uint256): 20718
// g8(uint256): 20696
// g9(uint256): 20542
// 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

View File

@ -15,12 +15,12 @@ contract Medium {
// executionCost: 294
// totalCost: 253294
// external:
// a(): 428
// b(uint256): 846
// f1(uint256): 40663
// f2(uint256): 20693
// f3(uint256): 20737
// a(): 1028
// b(uint256): 2046
// f1(uint256): 41263
// f2(uint256): 21293
// f3(uint256): 21337
// g0(uint256): 313
// g7(uint256): 20692
// g8(uint256): 20670
// g9(uint256): 20626
// g7(uint256): 21292
// g8(uint256): 21270
// g9(uint256): 21226

View File

@ -18,12 +18,12 @@ contract Medium {
// executionCost: 183
// totalCost: 140983
// external:
// a(): 398
// b(uint256): 863
// f1(uint256): 40654
// f2(uint256): 20698
// f3(uint256): 20742
// a(): 998
// b(uint256): 2063
// f1(uint256): 41254
// f2(uint256): 21298
// f3(uint256): 21342
// g0(uint256): 332
// g7(uint256): 20608
// g8(uint256): 20586
// g9(uint256): 20542
// g7(uint256): 21208
// g8(uint256): 21186
// g9(uint256): 21142

View File

@ -11,6 +11,6 @@ contract Small {
// totalCost: 83735
// external:
// fallback: 118
// a(): 383
// b(uint256): 802
// f1(uint256): 40663
// a(): 983
// b(uint256): 2002
// f1(uint256): 41263

View File

@ -14,6 +14,6 @@ contract Small {
// totalCost: 60511
// external:
// fallback: 118
// a(): 376
// b(uint256): 753
// f1(uint256): 40588
// a(): 976
// b(uint256): 1953
// f1(uint256): 41188