mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #7890 from ethereum/defaultIstanbul
Set default EVM version to Istanbul.
This commit is contained in:
commit
e24cca314e
@ -34,4 +34,4 @@ for OPTIMIZE in 0 1; do
|
|||||||
done
|
done
|
||||||
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
|
||||||
|
@ -6,6 +6,7 @@ Language Features:
|
|||||||
|
|
||||||
|
|
||||||
Compiler 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``
|
* 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.
|
* 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.
|
* Yul: When compiling via Yul, string literals from the Solidity code are kept as string literals if every character is safely printable.
|
||||||
|
@ -120,9 +120,9 @@ at each version. Backward compatibility is not guaranteed between each version.
|
|||||||
- ``constantinople``
|
- ``constantinople``
|
||||||
- Opcodes ``create2`, ``extcodehash``, ``shl``, ``shr`` and ``sar`` are available in assembly.
|
- Opcodes ``create2`, ``extcodehash``, ``shl``, ``shr`` and ``sar`` are available in assembly.
|
||||||
- Shifting operators use shifting opcodes and thus need less gas.
|
- Shifting operators use shifting opcodes and thus need less gas.
|
||||||
- ``petersburg`` (**default**)
|
- ``petersburg``
|
||||||
- The compiler behaves the same way as with constantinople.
|
- The compiler behaves the same way as with constantinople.
|
||||||
- ``istanbul``
|
- ``istanbul`` (**default**)
|
||||||
- Opcodes ``chainid`` and ``selfbalance`` are available in assembly.
|
- Opcodes ``chainid`` and ``selfbalance`` are available in assembly.
|
||||||
- ``berlin`` (**experimental**)
|
- ``berlin`` (**experimental**)
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ private:
|
|||||||
|
|
||||||
EVMVersion(Version _version): m_version(_version) {}
|
EVMVersion(Version _version): m_version(_version) {}
|
||||||
|
|
||||||
Version m_version = Version::Petersburg;
|
Version m_version = Version::Istanbul;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -656,7 +656,8 @@ Allowed options)",
|
|||||||
(
|
(
|
||||||
g_strEVMVersion.c_str(),
|
g_strEVMVersion.c_str(),
|
||||||
po::value<string>()->value_name("version"),
|
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.")
|
(g_argOptimize.c_str(), "Enable bytecode optimizer.")
|
||||||
(
|
(
|
||||||
|
@ -900,9 +900,11 @@ BOOST_AUTO_TEST_CASE(evm_version)
|
|||||||
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"constantinople\"") != string::npos);
|
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"constantinople\"") != string::npos);
|
||||||
result = compile(inputForVersion("\"evmVersion\": \"petersburg\","));
|
result = compile(inputForVersion("\"evmVersion\": \"petersburg\","));
|
||||||
BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"petersburg\"") != string::npos);
|
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
|
// test default
|
||||||
result = compile(inputForVersion(""));
|
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
|
// test invalid
|
||||||
result = compile(inputForVersion("\"evmVersion\": \"invalid\","));
|
result = compile(inputForVersion("\"evmVersion\": \"invalid\","));
|
||||||
BOOST_CHECK(result["errors"][0]["message"].asString() == "Invalid EVM version requested.");
|
BOOST_CHECK(result["errors"][0]["message"].asString() == "Invalid EVM version requested.");
|
||||||
|
@ -18,7 +18,7 @@ contract C {
|
|||||||
// executionCost: 1167
|
// executionCost: 1167
|
||||||
// totalCost: 1123767
|
// totalCost: 1123767
|
||||||
// external:
|
// external:
|
||||||
// a(): 530
|
// a(): 1130
|
||||||
// b(uint256): infinite
|
// b(uint256): infinite
|
||||||
// f1(uint256): infinite
|
// f1(uint256): infinite
|
||||||
// f2(uint256[],string[],uint16,address): infinite
|
// f2(uint256[],string[],uint16,address): infinite
|
||||||
|
@ -21,8 +21,8 @@ contract C {
|
|||||||
// executionCost: 645
|
// executionCost: 645
|
||||||
// totalCost: 609045
|
// totalCost: 609045
|
||||||
// external:
|
// external:
|
||||||
// a(): 429
|
// a(): 1029
|
||||||
// b(uint256): 884
|
// b(uint256): 2084
|
||||||
// f1(uint256): 351
|
// f1(uint256): 351
|
||||||
// f2(uint256[],string[],uint16,address): infinite
|
// f2(uint256[],string[],uint16,address): infinite
|
||||||
// f3(uint16[],string[],uint16,address): infinite
|
// f3(uint16[],string[],uint16,address): infinite
|
||||||
|
@ -28,25 +28,25 @@ contract Large {
|
|||||||
// executionCost: 670
|
// executionCost: 670
|
||||||
// totalCost: 637470
|
// totalCost: 637470
|
||||||
// external:
|
// external:
|
||||||
// a(): 451
|
// a(): 1051
|
||||||
// b(uint256): 846
|
// b(uint256): 2046
|
||||||
// f0(uint256): 427
|
// f0(uint256): 427
|
||||||
// f1(uint256): 40752
|
// f1(uint256): 41352
|
||||||
// f2(uint256): 20693
|
// f2(uint256): 21293
|
||||||
// f3(uint256): 20781
|
// f3(uint256): 21381
|
||||||
// f4(uint256): 20759
|
// f4(uint256): 21359
|
||||||
// f5(uint256): 20737
|
// f5(uint256): 21337
|
||||||
// f6(uint256): 20760
|
// f6(uint256): 21360
|
||||||
// f7(uint256): 20672
|
// f7(uint256): 21272
|
||||||
// f8(uint256): 20672
|
// f8(uint256): 21272
|
||||||
// f9(uint256): 20694
|
// f9(uint256): 21294
|
||||||
// g0(uint256): 313
|
// g0(uint256): 313
|
||||||
// g1(uint256): 40707
|
// g1(uint256): 41307
|
||||||
// g2(uint256): 20670
|
// g2(uint256): 21270
|
||||||
// g3(uint256): 20758
|
// g3(uint256): 21358
|
||||||
// g4(uint256): 20736
|
// g4(uint256): 21336
|
||||||
// g5(uint256): 20692
|
// g5(uint256): 21292
|
||||||
// g6(uint256): 20715
|
// g6(uint256): 21315
|
||||||
// g7(uint256): 20714
|
// g7(uint256): 21314
|
||||||
// g8(uint256): 20692
|
// g8(uint256): 21292
|
||||||
// g9(uint256): 20649
|
// g9(uint256): 21249
|
||||||
|
@ -31,25 +31,25 @@ contract Large {
|
|||||||
// executionCost: 300
|
// executionCost: 300
|
||||||
// totalCost: 260700
|
// totalCost: 260700
|
||||||
// external:
|
// external:
|
||||||
// a(): 398
|
// a(): 998
|
||||||
// b(uint256): 1105
|
// b(uint256): 2305
|
||||||
// f0(uint256): 334
|
// f0(uint256): 334
|
||||||
// f1(uint256): 40874
|
// f1(uint256): 41474
|
||||||
// f2(uint256): 20940
|
// f2(uint256): 21540
|
||||||
// f3(uint256): 21028
|
// f3(uint256): 21628
|
||||||
// f4(uint256): 21006
|
// f4(uint256): 21606
|
||||||
// f5(uint256): 20984
|
// f5(uint256): 21584
|
||||||
// f6(uint256): 20896
|
// f6(uint256): 21496
|
||||||
// f7(uint256): 20676
|
// f7(uint256): 21276
|
||||||
// f8(uint256): 20808
|
// f8(uint256): 21408
|
||||||
// f9(uint256): 20830
|
// f9(uint256): 21430
|
||||||
// g0(uint256): 574
|
// g0(uint256): 574
|
||||||
// g1(uint256): 40586
|
// g1(uint256): 41186
|
||||||
// g2(uint256): 20674
|
// g2(uint256): 21274
|
||||||
// g3(uint256): 20762
|
// g3(uint256): 21362
|
||||||
// g4(uint256): 20740
|
// g4(uint256): 21340
|
||||||
// g5(uint256): 20828
|
// g5(uint256): 21428
|
||||||
// g6(uint256): 20608
|
// g6(uint256): 21208
|
||||||
// g7(uint256): 20718
|
// g7(uint256): 21318
|
||||||
// g8(uint256): 20696
|
// g8(uint256): 21296
|
||||||
// g9(uint256): 20542
|
// g9(uint256): 21142
|
||||||
|
@ -15,12 +15,12 @@ contract Medium {
|
|||||||
// executionCost: 294
|
// executionCost: 294
|
||||||
// totalCost: 253294
|
// totalCost: 253294
|
||||||
// external:
|
// external:
|
||||||
// a(): 428
|
// a(): 1028
|
||||||
// b(uint256): 846
|
// b(uint256): 2046
|
||||||
// f1(uint256): 40663
|
// f1(uint256): 41263
|
||||||
// f2(uint256): 20693
|
// f2(uint256): 21293
|
||||||
// f3(uint256): 20737
|
// f3(uint256): 21337
|
||||||
// g0(uint256): 313
|
// g0(uint256): 313
|
||||||
// g7(uint256): 20692
|
// g7(uint256): 21292
|
||||||
// g8(uint256): 20670
|
// g8(uint256): 21270
|
||||||
// g9(uint256): 20626
|
// g9(uint256): 21226
|
||||||
|
@ -18,12 +18,12 @@ contract Medium {
|
|||||||
// executionCost: 183
|
// executionCost: 183
|
||||||
// totalCost: 140983
|
// totalCost: 140983
|
||||||
// external:
|
// external:
|
||||||
// a(): 398
|
// a(): 998
|
||||||
// b(uint256): 863
|
// b(uint256): 2063
|
||||||
// f1(uint256): 40654
|
// f1(uint256): 41254
|
||||||
// f2(uint256): 20698
|
// f2(uint256): 21298
|
||||||
// f3(uint256): 20742
|
// f3(uint256): 21342
|
||||||
// g0(uint256): 332
|
// g0(uint256): 332
|
||||||
// g7(uint256): 20608
|
// g7(uint256): 21208
|
||||||
// g8(uint256): 20586
|
// g8(uint256): 21186
|
||||||
// g9(uint256): 20542
|
// g9(uint256): 21142
|
||||||
|
@ -11,6 +11,6 @@ contract Small {
|
|||||||
// totalCost: 83735
|
// totalCost: 83735
|
||||||
// external:
|
// external:
|
||||||
// fallback: 118
|
// fallback: 118
|
||||||
// a(): 383
|
// a(): 983
|
||||||
// b(uint256): 802
|
// b(uint256): 2002
|
||||||
// f1(uint256): 40663
|
// f1(uint256): 41263
|
||||||
|
@ -14,6 +14,6 @@ contract Small {
|
|||||||
// totalCost: 60511
|
// totalCost: 60511
|
||||||
// external:
|
// external:
|
||||||
// fallback: 118
|
// fallback: 118
|
||||||
// a(): 376
|
// a(): 976
|
||||||
// b(uint256): 753
|
// b(uint256): 1953
|
||||||
// f1(uint256): 40588
|
// f1(uint256): 41188
|
||||||
|
Loading…
Reference in New Issue
Block a user