Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from v0.8.23 #71

Merged
merged 26 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f121e7e
Update abi-spec.rst
robriks May 17, 2023
c43c3c3
Merge branch 'develop' into patch-2
robriks Sep 13, 2023
609ef15
Set version to 0.8.23
nikola-matic Oct 25, 2023
28ee5d3
Merge pull request #14645 from ethereum/set-version-to-0-8-23
cameel Oct 25, 2023
23bcc69
Fix wrong file path in standard json tests
nikola-matic Oct 26, 2023
d8de97d
Merge pull request #14651 from ethereum/fix-wrong-url-name-in-standar…
nikola-matic Oct 26, 2023
ad3caa7
Merge pull request #14238 from robriks/patch-2
ekpyron Oct 30, 2023
74c2440
Update the release checklist
nikola-matic Oct 25, 2023
79b1f55
Remove references to homebrew-ethereum
nikola-matic Oct 26, 2023
7df949e
Merge pull request #14644 from ethereum/update-release-checklist
ekpyron Oct 31, 2023
7bf058b
Update ubuntu versions in PPA scripts.
ekpyron Oct 25, 2023
f70bd94
Merge pull request #14646 from ethereum/updateUbuntuVersions
ekpyron Nov 6, 2023
4d10cb5
Update README.md for X (Twitter) new brand guidelines (#14665)
Nuzair46 Nov 7, 2023
d899d9c
Accept empty optimizer sequence with Yul optimizer disabled
nikola-matic Oct 30, 2023
cb93e6e
Merge pull request #14657 from ethereum/accept-empty-optimizer-sequen…
nikola-matic Nov 7, 2023
cc56cb5
Add verbatim bug test case.
ekpyron Nov 7, 2023
48fdbd3
Fix assembly item comparison for verbatim.
ekpyron Oct 25, 2023
41ceb48
Add cmdline test
matheusaaguiar Nov 8, 2023
34b70af
Merge pull request #14649 from ethereum/assemblyItemVerbatimComparison
ekpyron Nov 8, 2023
8292d7b
Remove superflous language features category from Changelog
nikola-matic Nov 8, 2023
12f7c7a
Merge pull request #14671 from ethereum/remove-language-features-from…
nikola-matic Nov 8, 2023
7e84be6
Set date for 0.8.23 release
nikola-matic Nov 8, 2023
5cafa8c
Fix link in bugs.json for 0.8.23
nikola-matic Nov 8, 2023
9736b17
Merge pull request #14675 from ethereum/fix-invalid-link-in-bug-blog-…
ekpyron Nov 8, 2023
f704f36
Merge pull request #14672 from ethereum/set-release-date-for-0-8-23
nikola-matic Nov 8, 2023
5f7a237
Merge tag 'v0.8.23' into develop
yanghang8612 Jan 13, 2025
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include(EthPolicy)
eth_policy()

# project name and version should be set after cmake_policy CMP0048
set(PROJECT_VERSION "0.8.22")
set(PROJECT_VERSION "0.8.23")
# OSX target needed in order to support std::visit
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
project(solidity VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
Expand Down
11 changes: 11 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### 0.8.23 (2023-11-08)

Important Bugfixes:
* Optimizer: Fix block deduplicator bug which led to blocks which are identical apart from the contents of ``verbatim`` instructions to be treated as equivalent and thus collapsed into a single one.


Compiler Features:
* Commandline Interface: An empty ``--yul-optimizations`` sequence can now be always provided.
* Standard JSON Interface: An empty ``optimizerSteps`` sequence can now always be provided.


### 0.8.22 (2023-10-25)

Language Features:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
[![Matrix Chat](https://img.shields.io/badge/Matrix%20-chat-brightgreen?style=plastic&logo=matrix)](https://matrix.to/#/#ethereum_solidity:gitter.im)
[![Gitter Chat](https://img.shields.io/badge/Gitter%20-chat-brightgreen?style=plastic&logo=gitter)](https://gitter.im/ethereum/solidity)
[![Solidity Forum](https://img.shields.io/badge/Solidity_Forum%20-discuss-brightgreen?style=plastic&logo=discourse)](https://forum.soliditylang.org/)
[![Twitter Follow](https://img.shields.io/twitter/follow/solidity_lang?style=plastic&logo=twitter)](https://twitter.com/solidity_lang)
[![X Follow](https://img.shields.io/twitter/follow/solidity_lang?style=plastic&logo=x)](https://X.com/solidity_lang)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/000335908?domain=https%3A%2F%2Ffosstodon.org%2F&logo=mastodon&style=plastic)](https://fosstodon.org/@solidity)

You can talk to us on Gitter and Matrix, tweet at us on Twitter or create a new topic in the Solidity forum. Questions, feedback, and suggestions are welcome!
You can talk to us on Gitter and Matrix, tweet at us on X (previously Twitter) or create a new topic in the Solidity forum. Questions, feedback, and suggestions are welcome!

Solidity is a statically typed, contract-oriented, high-level language for implementing smart contracts on the Tron platform.

Expand Down
6 changes: 2 additions & 4 deletions ReleaseChecklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

### Requirements
- [ ] GitHub account with access to [solidity](https://github.com/ethereum/solidity), [solc-js](https://github.com/ethereum/solc-js),
[solc-bin](https://github.com/ethereum/solc-bin), [homebrew-ethereum](https://github.com/ethereum/homebrew-ethereum),
[solidity-website](https://github.com/ethereum/solidity-website).
[solc-bin](https://github.com/ethereum/solc-bin), [solidity-website](https://github.com/ethereum/solidity-website).
- [ ] DockerHub account with push rights to the [``solc`` image](https://hub.docker.com/r/ethereum/solc).
- [ ] Launchpad (Ubuntu One) account with a membership in the ["Ethereum" team](https://launchpad.net/~ethereum) and
a gnupg key for your email in the ``ethereum.org`` domain (has to be version 1, gpg2 won't work).
Expand All @@ -21,7 +20,6 @@ At least a day before the release:
- [ ] Rerun CI on the top commits of main branches in all repositories that do not have daily activity by creating a test branch or PR:
- [ ] ``solc-js``
- [ ] ``solc-bin`` (make sure the bytecode comparison check did run)
- [ ] ``homebrew-ethereum``
- [ ] (Optional) Create a prerelease in our Ubuntu PPA by following the steps in the PPA section below on ``develop`` rather than on a tag.
This is recommended especially when dealing with PPA for the first time, when we add a new Ubuntu version or when the PPA scripts were modified in this release cycle.
- [ ] Verify that the release tarball of ``solc-js`` works.
Expand Down Expand Up @@ -58,6 +56,7 @@ At least a day before the release:
Remove different variants of the same name manually before using the output.
- [ ] Check that all tests on the latest commit in ``develop`` are green.
- [ ] Click the ``Publish release`` button on the release page, creating the tag.
**Important: Must not be done before all the PRs, including changelog cleanup and date, are merged.**
- [ ] Wait for the CI runs on the tag itself.

### Upload Release Artifacts and Publish Binaries
Expand All @@ -73,7 +72,6 @@ At least a day before the release:

### Homebrew and MacOS
- [ ] Update the version and the hash (``sha256sum solidity_$VERSION.tar.gz``) in the [``solidity`` formula in Homebrew core repository](https://github.com/Homebrew/homebrew-core/blob/master/Formula/solidity.rb).
- [ ] Update the version and the hash (``sha256sum solidity_$VERSION.tar.gz``) in [our custom ``solidity`` Homebrew formula](https://github.com/ethereum/homebrew-ethereum/blob/master/solidity.rb).

### Docker
- [ ] Run ``./scripts/docker_deploy_manual.sh v$VERSION``.
Expand Down
30 changes: 15 additions & 15 deletions docs/abi-spec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,21 @@ Given the contract:
}


Thus, for our ``Foo`` example if we wanted to call ``baz`` with the parameters ``69`` and
Thus, for our ``Foo`` example, if we wanted to call ``bar`` with the argument ``["abc", "def"]``, we would pass 68 bytes total, broken down into:

- ``0xfce353f6``: the Method ID. This is derived from the signature ``bar(bytes3[2])``.
- ``0x6162630000000000000000000000000000000000000000000000000000000000``: the first part of the first
parameter, a ``bytes3`` value ``"abc"`` (left-aligned).
- ``0x6465660000000000000000000000000000000000000000000000000000000000``: the second part of the first
parameter, a ``bytes3`` value ``"def"`` (left-aligned).

In total:

.. code-block:: none

0xfce353f661626300000000000000000000000000000000000000000000000000000000006465660000000000000000000000000000000000000000000000000000000000

If we wanted to call ``baz`` with the parameters ``69`` and
``true``, we would pass 68 bytes total, which can be broken down into:

- ``0xcdcd77c0``: the Method ID. This is derived as the first 4 bytes of the Keccak hash of
Expand All @@ -271,20 +285,6 @@ In total:
It returns a single ``bool``. If, for example, it were to return ``false``, its output would be
the single byte array ``0x0000000000000000000000000000000000000000000000000000000000000000``, a single bool.

If we wanted to call ``bar`` with the argument ``["abc", "def"]``, we would pass 68 bytes total, broken down into:

- ``0xfce353f6``: the Method ID. This is derived from the signature ``bar(bytes3[2])``.
- ``0x6162630000000000000000000000000000000000000000000000000000000000``: the first part of the first
parameter, a ``bytes3`` value ``"abc"`` (left-aligned).
- ``0x6465660000000000000000000000000000000000000000000000000000000000``: the second part of the first
parameter, a ``bytes3`` value ``"def"`` (left-aligned).

In total:

.. code-block:: none

0xfce353f661626300000000000000000000000000000000000000000000000000000000006465660000000000000000000000000000000000000000000000000000000000

If we wanted to call ``sam`` with the arguments ``"dave"``, ``true`` and ``[1,2,3]``, we would
pass 292 bytes total, broken down into:

Expand Down
10 changes: 10 additions & 0 deletions docs/bugs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
[
{
"uid": "SOL-2023-3",
"name": "VerbatimInvalidDeduplication",
"summary": "All ``verbatim`` blocks are considered identical by deduplicator and can incorrectly be unified when surrounded by identical opcodes.",
"description": "The block deduplicator is a step of the opcode-based optimizer which identifies equivalent assembly blocks and merges them into a single one. However, when blocks contained ``verbatim``, their comparison was performed incorrectly, leading to the collapse of assembly blocks which are identical except for the contents of the ``verbatim`` items. Since ``verbatim`` is only available in Yul, compilation of Solidity sources is not affected.",
"link": "https://blog.soliditylang.org/2023/11/08/verbatim-invalid-deduplication-bug/",
"introduced": "0.8.5",
"fixed": "0.8.23",
"severity": "low"
},
{
"uid": "SOL-2023-2",
"name": "FullInlinerNonExpressionSplitArgumentEvaluationOrder",
Expand Down
28 changes: 26 additions & 2 deletions docs/bugs_by_version.json
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,7 @@
},
"0.8.10": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
Expand All @@ -1754,6 +1755,7 @@
},
"0.8.11": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
Expand All @@ -1766,6 +1768,7 @@
},
"0.8.12": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
Expand All @@ -1778,6 +1781,7 @@
},
"0.8.13": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"StorageWriteRemovalBeforeConditionalTermination",
Expand All @@ -1791,6 +1795,7 @@
},
"0.8.14": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"StorageWriteRemovalBeforeConditionalTermination",
Expand All @@ -1802,6 +1807,7 @@
},
"0.8.15": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"StorageWriteRemovalBeforeConditionalTermination",
Expand All @@ -1811,6 +1817,7 @@
},
"0.8.16": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"StorageWriteRemovalBeforeConditionalTermination"
Expand All @@ -1819,20 +1826,23 @@
},
"0.8.17": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess"
],
"released": "2022-09-08"
},
"0.8.18": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess"
],
"released": "2023-02-01"
},
"0.8.19": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess"
],
Expand All @@ -1854,19 +1864,28 @@
},
"0.8.20": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess"
],
"released": "2023-05-10"
},
"0.8.21": {
"bugs": [],
"bugs": [
"VerbatimInvalidDeduplication"
],
"released": "2023-07-19"
},
"0.8.22": {
"bugs": [],
"bugs": [
"VerbatimInvalidDeduplication"
],
"released": "2023-10-25"
},
"0.8.23": {
"bugs": [],
"released": "2023-11-08"
},
"0.8.3": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
Expand Down Expand Up @@ -1894,6 +1913,7 @@
},
"0.8.5": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
Expand All @@ -1906,6 +1926,7 @@
},
"0.8.6": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
Expand All @@ -1918,6 +1939,7 @@
},
"0.8.7": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
Expand All @@ -1930,6 +1952,7 @@
},
"0.8.8": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
Expand All @@ -1943,6 +1966,7 @@
},
"0.8.9": {
"bugs": [
"VerbatimInvalidDeduplication",
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
Expand Down
6 changes: 6 additions & 0 deletions docs/internals/optimizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ for a stand-alone Yul mode.
The `peephole optimizer <https://en.wikipedia.org/wiki/Peephole_optimization>`_ is always
enabled by default and can only be turned off via the :ref:`Standard JSON <compiler-api>`.

.. note::
An empty optimizer sequence is accepted even without ``--optimize`` in order to fully disable
the user-supplied portion of the Yul :ref:`optimizer sequence <selecting-optimizations>`, as by default,
even when the optimizer is not turned on, the :ref:`unused pruner <unused-pruner>` step will be run.

You can find more details on both optimizer modules and their optimization steps below.

Benefits of Optimizing Solidity Code
Expand Down Expand Up @@ -329,6 +334,7 @@ Abbreviation Full name
Some steps depend on properties ensured by ``BlockFlattener``, ``FunctionGrouper``, ``ForLoopInitRewriter``.
For this reason the Yul optimizer always applies them before applying any steps supplied by the user.

.. _selecting-optimizations:

Selecting Optimizations
-----------------------
Expand Down
2 changes: 1 addition & 1 deletion libevmasm/AssemblyItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class AssemblyItem
else if (type() == Operation)
return instruction() < _other.instruction();
else if (type() == VerbatimBytecode)
return *m_verbatimBytecode == *_other.m_verbatimBytecode;
return *m_verbatimBytecode < *_other.m_verbatimBytecode;
else
return data() < _other.data();
}
Expand Down
17 changes: 17 additions & 0 deletions libsolidity/interface/CompilerStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#include <libyul/YulStack.h>
#include <libyul/AST.h>
#include <libyul/AsmParser.h>
#include <libyul/optimiser/Suite.h>

#include <liblangutil/Scanner.h>
#include <liblangutil/SemVerHandler.h>
Expand Down Expand Up @@ -99,6 +100,7 @@ using namespace solidity;
using namespace solidity::langutil;
using namespace solidity::frontend;
using namespace solidity::stdlib;
using namespace solidity::yul;
using namespace std::string_literals;

using solidity::util::errinfo_comment;
Expand Down Expand Up @@ -1672,6 +1674,21 @@ std::string CompilerStack::createMetadata(Contract const& _contract, bool _forIR
details["yulDetails"]["stackAllocation"] = m_optimiserSettings.optimizeStackAllocation;
details["yulDetails"]["optimizerSteps"] = m_optimiserSettings.yulOptimiserSteps + ":" + m_optimiserSettings.yulOptimiserCleanupSteps;
}
else if (
OptimiserSuite::isEmptyOptimizerSequence(m_optimiserSettings.yulOptimiserSteps) &&
OptimiserSuite::isEmptyOptimizerSequence(m_optimiserSettings.yulOptimiserCleanupSteps)
)
{
solAssert(m_optimiserSettings.optimizeStackAllocation == false);
details["yulDetails"] = Json::objectValue;
details["yulDetails"]["optimizerSteps"] = ":";
}
else
{
solAssert(m_optimiserSettings.optimizeStackAllocation == false);
solAssert(m_optimiserSettings.yulOptimiserSteps == OptimiserSettings::DefaultYulOptimiserSteps);
solAssert(m_optimiserSettings.yulOptimiserCleanupSteps == OptimiserSettings::DefaultYulOptimiserCleanupSteps);
}

meta["settings"]["optimizer"]["details"] = std::move(details);
}
Expand Down
Loading
Loading