Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1619,18 +1619,20 @@ workflows:
- t_ext: *job_native_test_ext_gnosis
- t_ext: *job_native_test_ext_zeppelin
- t_ext: *job_native_test_ext_ens
- t_ext: *job_native_test_ext_trident
- t_ext: *job_native_test_ext_euler
- t_ext: *job_native_test_ext_yield_liquidator
- t_ext: *job_native_test_ext_bleeps
- t_ext: *job_native_test_ext_pool_together
- t_ext: *job_native_test_ext_perpetual_pools
- t_ext: *job_native_test_ext_uniswap
- t_ext: *job_native_test_ext_prb_math
- t_ext: *job_native_test_ext_elementfi
- t_ext: *job_native_test_ext_brink
- t_ext: *job_native_test_ext_chainlink
- t_ext: *job_native_test_ext_gp2
# NOTE: The external tests below were commented because they
# depend on a specific version of hardhat which does not support shanghai EVM.
#- t_ext: *job_native_test_ext_trident
#- t_ext: *job_native_test_ext_euler
#- t_ext: *job_native_test_ext_bleeps
#- t_ext: *job_native_test_ext_pool_together
#- t_ext: *job_native_test_ext_chainlink

- c_ext_benchmarks:
<<: *requires_nothing
Expand All @@ -1639,18 +1641,20 @@ workflows:
- t_native_test_ext_gnosis
- t_native_test_ext_zeppelin
- t_native_test_ext_ens
- t_native_test_ext_trident
- t_native_test_ext_euler
- t_native_test_ext_yield_liquidator
- t_native_test_ext_bleeps
- t_native_test_ext_pool_together
- t_native_test_ext_perpetual_pools
- t_native_test_ext_uniswap
- t_native_test_ext_prb_math
- t_native_test_ext_elementfi
- t_native_test_ext_brink
- t_native_test_ext_chainlink
- t_native_test_ext_gp2
# NOTE: The external tests below were commented because they
# depend on a specific version of hardhat which does not support shanghai EVM.
#- t_native_test_ext_trident
#- t_native_test_ext_euler
#- t_native_test_ext_bleeps
#- t_native_test_ext_pool_together
#- t_native_test_ext_chainlink

# Windows build and tests
- b_win: *requires_nothing
Expand Down
2 changes: 1 addition & 1 deletion .circleci/soltest_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ REPODIR="$(realpath "$(dirname "$0")"/..)"
source "${REPODIR}/scripts/common.sh"

EVM_VALUES=(homestead byzantium constantinople petersburg istanbul berlin london paris shanghai)
DEFAULT_EVM=paris
DEFAULT_EVM=shanghai
[[ " ${EVM_VALUES[*]} " =~ $DEFAULT_EVM ]]
OPTIMIZE_VALUES=(0 1)

Expand Down
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Language Features:

Compiler Features:
* Assembler: Use ``push0`` for placing ``0`` in the stack for EVM versions starting from "Shanghai". This decreases the deployment costs.
* EVM: Set default EVM version to "Shanghai".
* EVM: Support for the EVM Version "Shanghai".
* NatSpec: Add support for NatSpec documentation in ``enum`` definitions.
* NatSpec: Add support for NatSpec documentation in ``struct`` definitions.
Expand Down
6 changes: 3 additions & 3 deletions docs/using-the-compiler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ at each version. Backward compatibility is not guaranteed between each version.
the optimizer.
- ``london``
- The block's base fee (`EIP-3198 <https://eips.ethereum.org/EIPS/eip-3198>`_ and `EIP-1559 <https://eips.ethereum.org/EIPS/eip-1559>`_) can be accessed via the global ``block.basefee`` or ``basefee()`` in inline assembly.
- ``paris`` (**default**)
- ``paris``
- Introduces ``prevrandao()`` and ``block.prevrandao``, and changes the semantics of the now deprecated ``block.difficulty``, disallowing ``difficulty()`` in inline assembly (see `EIP-4399 <https://eips.ethereum.org/EIPS/eip-4399>`_).
- ``shanghai``
- Cheaper deployment cost due to the introduction of ``push0`` (see `EIP-3855 <https://eips.ethereum.org/EIPS/eip-3855>`_).
- ``shanghai`` (**default**)
- Smaller code size and gas savings due to the introduction of ``push0`` (see `EIP-3855 <https://eips.ethereum.org/EIPS/eip-3855>`_).

.. index:: ! standard JSON, ! --standard-json
.. _compiler-api:
Expand Down
6 changes: 6 additions & 0 deletions libevmasm/GasMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _
switch (_item.type())
{
case Push:
if (m_evmVersion.hasPush0() && _item.data() == 0)
{
gas = runGas(Instruction::PUSH0, m_evmVersion);
break;
}
[[fallthrough]];
case PushTag:
case PushData:
case PushSub:
Expand Down
2 changes: 1 addition & 1 deletion liblangutil/EVMVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class EVMVersion:

EVMVersion(Version _version): m_version(_version) {}

Version m_version = Version::Paris;
Version m_version = Version::Shanghai;
};

}
2 changes: 1 addition & 1 deletion scripts/externalTests/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -e

# Requires $REPO_ROOT to be defined and "${REPO_ROOT}/scripts/common.sh" to be included before.

CURRENT_EVM_VERSION=paris
CURRENT_EVM_VERSION=shanghai

AVAILABLE_PRESETS=(
legacy-no-optimize
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ do
for vm in $EVM_VERSIONS
do
FORCE_ABIV1_RUNS="no"
if [[ "$vm" == "paris" ]]
if [[ "$vm" == "shanghai" ]]
then
FORCE_ABIV1_RUNS="no yes" # run both in paris
fi
Expand Down
10 changes: 5 additions & 5 deletions test/cmdlineTests/function_debug_info/output
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"abi_decode_tuple_t_uint256_fromMemory":
{
"entryPoint": 94,
"entryPoint": 92,
"parameterSlots": 2,
"returnSlots": 1
}
Expand All @@ -22,7 +22,7 @@
{
"@f_14":
{
"entryPoint": 128,
"entryPoint": 124,
"id": 14,
"parameterSlots": 2,
"returnSlots": 1
Expand All @@ -35,13 +35,13 @@
},
"abi_decode_tuple_t_array$_t_uint256_$dyn_calldata_ptr":
{
"entryPoint": 164,
"entryPoint": 158,
"parameterSlots": 2,
"returnSlots": 2
},
"abi_decode_tuple_t_uint256":
{
"entryPoint": 281,
"entryPoint": 269,
"parameterSlots": 2,
"returnSlots": 1
},
Expand All @@ -52,7 +52,7 @@
},
"panic_error_0x32":
{
"entryPoint": 306,
"entryPoint": 292,
"parameterSlots": 0,
"returnSlots": 0
}
Expand Down
54 changes: 27 additions & 27 deletions test/cmdlineTests/inline_assembly_function_name_clash/output
Original file line number Diff line number Diff line change
Expand Up @@ -7,169 +7,169 @@
{
"abi_decode_tuple_":
{
"entryPoint": 122,
"entryPoint": 117,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_t_uint256_to_t_uint256_fromStack":
{
"entryPoint": 156,
"entryPoint": 149,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_tuple_t_uint256__to_t_uint256__fromStack":
{
"entryPoint": 171,
"entryPoint": 164,
"parameterSlots": 2,
"returnSlots": 1
},
"allocate_unbounded":
{
"entryPoint": 102,
"entryPoint": 100,
"parameterSlots": 0,
"returnSlots": 1
},
"cleanup_t_uint256":
{
"entryPoint": 146,
"entryPoint": 140,
"parameterSlots": 1,
"returnSlots": 1
},
"convert_t_uint256_to_t_uint256":
{
"entryPoint": 413,
"entryPoint": 398,
"parameterSlots": 1,
"returnSlots": 1
},
"external_fun_f_25":
{
"entryPoint": 198,
"entryPoint": 189,
"parameterSlots": 0,
"returnSlots": 0
},
"external_fun_g_36":
{
"entryPoint": 256,
"entryPoint": 247,
"parameterSlots": 0,
"returnSlots": 0
},
"fun_f_25":
{
"entryPoint": 680,
"entryPoint": 653,
"id": 25,
"parameterSlots": 0,
"returnSlots": 1
},
"fun_f_25_inner":
{
"entryPoint": 646,
"entryPoint": 621,
"parameterSlots": 1,
"returnSlots": 1
},
"fun_g_36":
{
"entryPoint": 896,
"entryPoint": 858,
"id": 36,
"parameterSlots": 0,
"returnSlots": 1
},
"fun_g_36_inner":
{
"entryPoint": 862,
"entryPoint": 826,
"parameterSlots": 1,
"returnSlots": 1
},
"identity":
{
"entryPoint": 403,
"entryPoint": 389,
"parameterSlots": 1,
"returnSlots": 1
},
"modifier_m_17":
{
"entryPoint": 492,
"entryPoint": 475,
"id": 14,
"parameterSlots": 1,
"returnSlots": 1
},
"modifier_m_19":
{
"entryPoint": 569,
"entryPoint": 548,
"id": 14,
"parameterSlots": 1,
"returnSlots": 1
},
"modifier_m_28":
{
"entryPoint": 708,
"entryPoint": 680,
"id": 14,
"parameterSlots": 1,
"returnSlots": 1
},
"modifier_m_30":
{
"entryPoint": 785,
"entryPoint": 753,
"id": 14,
"parameterSlots": 1,
"returnSlots": 1
},
"prepare_store_t_uint256":
{
"entryPoint": 447,
"entryPoint": 431,
"parameterSlots": 1,
"returnSlots": 1
},
"revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74":
{
"entryPoint": 314,
"entryPoint": 305,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb":
{
"entryPoint": 112,
"entryPoint": 109,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b":
{
"entryPoint": 117,
"entryPoint": 113,
"parameterSlots": 0,
"returnSlots": 0
},
"shift_left_0":
{
"entryPoint": 324,
"entryPoint": 313,
"parameterSlots": 1,
"returnSlots": 1
},
"shift_right_224_unsigned":
{
"entryPoint": 89,
"entryPoint": 88,
"parameterSlots": 1,
"returnSlots": 1
},
"update_byte_slice_32_shift_0":
{
"entryPoint": 337,
"entryPoint": 324,
"parameterSlots": 2,
"returnSlots": 1
},
"update_storage_value_offset_0t_uint256_to_t_uint256":
{
"entryPoint": 457,
"entryPoint": 440,
"parameterSlots": 2,
"returnSlots": 0
},
"usr$f":
{
"entryPoint": 515,
"entryPoint": 496,
"parameterSlots": 0,
"returnSlots": 1
},
"zero_value_for_split_t_uint256":
{
"entryPoint": 319,
"entryPoint": 309,
"parameterSlots": 0,
"returnSlots": 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
[
{
"length": 20,
"start": 184
"start": 174
},
{
"length": 20,
"start": 368
"start": 350
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion test/cmdlineTests/linking_strict_assembly/output
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object "a" {


Binary representation:
7312345678901234567890123456789012345678908060005550
731234567890123456789012345678901234567890805f5550

Text representation:
/* "linking_strict_assembly/input.yul":44:79 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object "a" {


Binary representation:
7312345678901234567890123456789012345678908060005550
731234567890123456789012345678901234567890805f5550

Text representation:
linkerSymbol("20a18a9bf97d889dcf77111b674da319a4e9e3e05d3f4df9e0bf5c588dd4f0f8")
Expand Down
Loading