Skip to content

Commit

Permalink
Merge pull request #65 from tronprotocol/master_0.8.x
Browse files Browse the repository at this point in the history
func(merge): from v0.8.20
  • Loading branch information
yanghang8612 authored Jun 30, 2023
2 parents f18bedf + 350a86c commit 5f1834b
Show file tree
Hide file tree
Showing 1,920 changed files with 23,368 additions and 4,391 deletions.
808 changes: 420 additions & 388 deletions .circleci/config.yml

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions .circleci/osx_install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ function validate_checksum {

if [ ! -f /usr/local/lib/libz3.a ] # if this file does not exists (cache was not restored), rebuild dependencies
then
brew unlink python
brew install boost
brew install cmake
brew install wget
Expand All @@ -61,11 +60,11 @@ then
./scripts/install_obsolete_jsoncpp_1_7_4.sh

# z3
z3_version="4.11.2"
z3_version="4.12.1"
z3_dir="z3-${z3_version}-x64-osx-10.16"
z3_package="${z3_dir}.zip"
wget "https://github.com/Z3Prover/z3/releases/download/z3-${z3_version}/${z3_package}"
validate_checksum "$z3_package" a56b6c40d9251a963aabe1f15731dd88ad1cb801d0e7b16e45f8b232175e165c
validate_checksum "$z3_package" 7601f844de6d906235140d0f76cca58be7ac716f3e2c29c35845aa24b24f73b9
unzip "$z3_package"
rm "$z3_package"
cp "${z3_dir}/bin/libz3.a" /usr/local/lib
Expand All @@ -74,10 +73,10 @@ then
rm -r "$z3_dir"

# evmone
evmone_version="0.9.1"
evmone_version="0.10.0"
evmone_package="evmone-${evmone_version}-darwin-x86_64.tar.gz"
wget "https://github.com/ethereum/evmone/releases/download/v${evmone_version}/${evmone_package}"
validate_checksum "$evmone_package" 70420a893a9b1036fcb63526b806d97658db8c373bcab1c3e8382594dc8593e4
validate_checksum "$evmone_package" 1b7773779287d7908baca6b8d556a98800cbd7d6e5c910b55fa507642bc0a15c
tar xzpf "$evmone_package" -C /usr/local
rm "$evmone_package"

Expand Down
4 changes: 2 additions & 2 deletions .circleci/soltest_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ REPODIR="$(realpath "$(dirname "$0")"/..)"
# shellcheck source=scripts/common.sh
source "${REPODIR}/scripts/common.sh"

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

Expand Down
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlinesLeft: true
AlignEscapedNewlines: Left
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
Expand Down
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
name: Bug Report
about: Problems, deficiencies, inaccuracies or crashes discovered on Solidity.
title: ''
labels: 'bug :bug:'
assignees: ''

---

<!--## Prerequisites
Expand Down
12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Bug Report
url: https://github.com/ethereum/solidity/issues/new?template=bug_report.md&projects=ethereum/solidity/43
about: Bug reports for the Solidity Compiler.
- name: Documentation Issue
url: https://github.com/ethereum/solidity/issues/new?template=documentation_issue.md&projects=ethereum/solidity/43
about: Solidity documentation.
- name: Feature Request
url: https://github.com/ethereum/solidity/issues/new?template=feature_request.md&projects=ethereum/solidity/43
about: Solidity language or infrastructure feature requests.
- name: Report a security vulnerability
url: https://github.com/ethereum/solidity/security/policy
about: Please review our security policy for more details.
- name: Initiate a language design or feedback discussion
url: https://forum.soliditylang.org
about: Open a thread on the Solidity forum.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation_issue.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
name: Documentation Issue
about: Corrections, improvements or requests for new content on Solidity's documentation.
title: ''
labels: 'documentation :book:'
assignees: ''

---

## Page
Expand Down
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
---
name: Feature Request
about: Ideas, comments or messages asking for a particular functionality to be added
to Solidity.
title: ''
labels: feature
assignees: ''

---

<!--## Prerequisites
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/buildpack-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches: [ develop ]
paths:
- 'scripts/docker/buildpack-deps/Dockerfile.emscripten'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu1604.clang.ossfuzz'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu.clang.ossfuzz'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2004'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2204.clang'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2204'

Expand All @@ -22,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
image_variant: [emscripten, ubuntu1604.clang.ossfuzz, ubuntu2204.clang, ubuntu2204]
image_variant: [emscripten, ubuntu.clang.ossfuzz, ubuntu2004, ubuntu2204.clang, ubuntu2204]

steps:
- uses: actions/checkout@v2
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ permissions:
pull-requests: write

env:
BEFORE_ISSUE_STALE: 334
BEFORE_ISSUE_CLOSE: 0 #FIXME: change to 14 days
BEFORE_ISSUE_STALE: 90
BEFORE_ISSUE_CLOSE: 7
BEFORE_PR_STALE: 14
BEFORE_PR_CLOSE: 7

Expand All @@ -28,14 +28,13 @@ jobs:
This issue has been marked as stale due to inactivity for the last ${{ env.BEFORE_ISSUE_STALE }} days.
It will be automatically closed in ${{ env.BEFORE_ISSUE_CLOSE }} days.
close-issue-message: |
Hi everyone! This issue has been closed due to inactivity.
Hi everyone! This issue has been automatically closed due to inactivity.
If you think this issue is still relevant in the latest Solidity version and you have something to [contribute](https://docs.soliditylang.org/en/latest/contributing.html), feel free to reopen.
However, unless the issue is a concrete proposal that can be implemented, we recommend starting a language discussion on the [forum](https://forum.soliditylang.org) instead.
any-of-issue-labels: stale # TODO: remove this when we're done with closing ancient issues
ascending: true # TODO: remove this when we're done with closing ancient issues
ascending: true
stale-issue-label: stale
close-issue-label: closed-due-inactivity
exempt-issue-labels: 'bug :bug:,roadmap,selected-for-development,must have'
close-issue-label: 'closed due inactivity'
exempt-issue-labels: 'bug :bug:,epic,roadmap,selected for development,must have,must have eventually,smt'
stale-pr-message: |
This pull request is stale because it has been open for ${{ env.BEFORE_PR_STALE }} days with no activity.
It will be closed in ${{ env.BEFORE_PR_CLOSE }} days unless the `stale` label is removed.
Expand All @@ -48,6 +47,5 @@ jobs:
exempt-pr-labels: 'external contribution :star:,roadmap,epic'
exempt-draft-pr: false
exempt-all-milestones: true
# remove-stale-when-updated: true # TODO: uncomment and remove the line below when we're done with closing ancient issues
remove-issue-stale-when-updated: false
operations-per-run: 128
remove-stale-when-updated: true
operations-per-run: 256
118 changes: 92 additions & 26 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,122 @@ on:
- opened

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.PROJECT_BOARD_AUTOMATION }}
ORGANIZATION: ethereum
REPOSITORY: solidity
PROJECT_NUMBER: 43
PROJECT_NUMBER: 27 # Solidity Bug Triaging Board
# See: https://github.com/orgs/ethereum/projects/27/settings/fields/Status
COLUMN_FIELD_NAME: "Status"
TRIAGE_COLUMN_NAME: "To Triage"
DRY_RUN: false

jobs:
triage_issues:
runs-on: ubuntu-latest
if: join(github.event.issue.labels) == ''
steps:
- name: Retrieve the content of all columns on the board
- name: Retrieve the content of selected field on the project board
run: |
gh api graphql \
--raw-field owner="$ORGANIZATION" \
--raw-field organization="$ORGANIZATION" \
--field project_number="$PROJECT_NUMBER" \
--raw-field repository_name="$REPOSITORY" \
--raw-field query='
query($owner: String!, $repository_name: String!, $project_number: Int!) {
repository(owner: $owner, name: $repository_name) {
project(number: $project_number) {
columns(first: 10) {
query($organization: String!, $project_number: Int!) {
organization(login: $organization) {
projectV2(number: $project_number) {
id
fields(first: 20) {
nodes {
id,
name
... on ProjectV2Field {
id
name
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' > project_columns.json
echo 'COLUMN_ID='$(jq '.data.repository.project.columns.nodes[] | select(.name == "Triage") | .id' project_columns.json) >> $GITHUB_ENV
echo 'COLUMN_NAME='$(jq '.data.repository.project.columns.nodes[] | select(.name == "Triage") | .name' project_columns.json) >> $GITHUB_ENV
}' > single_select_fields.json
echo 'PROJECT_ID='$(
jq \
'.data.organization.projectV2.id' \
single_select_fields.json
) >> $GITHUB_ENV
echo 'COLUMN_FIELD_ID='$(
jq \
--arg column_field_name "$COLUMN_FIELD_NAME" \
'.data.organization.projectV2.fields.nodes[]
| select(.name == $column_field_name)
| .id' \
single_select_fields.json
) >> $GITHUB_ENV
echo 'TRIAGE_COLUMN_ID='$(
jq --raw-output \
--arg column_field_name "$COLUMN_FIELD_NAME" \
--arg triage_column_name "$TRIAGE_COLUMN_NAME" \
'.data.organization.projectV2.fields.nodes[]
| select(.name == $column_field_name)
| .options[]
| select(.name == $triage_column_name)
| .id' \
single_select_fields.json
) >> $GITHUB_ENV
- name: Add issue#${{ github.event.issue.number }} to Triage column
- name: Add issue#${{ github.event.issue.number }} to project
env:
ISSUE_ID: ${{ github.event.issue.node_id }}
run: |
echo "Adding issue: ${{ github.event.issue.number }} to column $COLUMN_NAME in project $PROJECT_NUMBER"
if [[ $DRY_RUN == "false" ]]; then
echo "Adding issue: ${{ github.event.issue.number }} to project ${{ env.PROJECT_NUMBER }}"
if [[ $DRY_RUN == 'false' ]]; then
echo 'ITEM_ID='$(
gh api graphql \
--jq '.data.addProjectV2ItemById.item.id' \
--raw-field project_id="$PROJECT_ID" \
--raw-field issue_id="$ISSUE_ID" \
--raw-field query='
mutation($project_id: ID!, $issue_id: ID!) {
addProjectV2ItemById(input: {projectId: $project_id, contentId: $issue_id}) {
item {
id
}
}
}'
) >> $GITHUB_ENV
fi
- name: Move issue#${{ github.event.issue.number }} to Triage column
run: |
echo "Moving issue: ${{ github.event.issue.number }} to Triage column in project ${{ env.PROJECT_NUMBER }}"
if [[ $DRY_RUN == 'false' ]]; then
gh api graphql \
--silent \
--raw-field column=$COLUMN_ID \
--raw-field issue=$ISSUE_ID \
--raw-field project_id="$PROJECT_ID" \
--raw-field item_id="$ITEM_ID" \
--raw-field column_field_id="$COLUMN_FIELD_ID" \
--raw-field column_value_id="$TRIAGE_COLUMN_ID" \
--raw-field query='
mutation($column: ID!, $issue: ID!) {
addProjectCard(input: {
projectColumnId: $column,
contentId: $issue
mutation (
$project_id: ID!
$item_id: ID!
$column_field_id: ID!
$column_value_id: String!
) {
updateProjectV2ItemFieldValue(input: {
projectId: $project_id
itemId: $item_id
fieldId: $column_field_id
value: {
singleSelectOptionId: $column_value_id
}
}) {
clientMutationId
projectV2Item {
id
}
}
}'
fi
4 changes: 2 additions & 2 deletions 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.18")
set(PROJECT_VERSION "0.8.20")
# 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 Expand Up @@ -75,7 +75,7 @@ configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/license.h.in" include/licens

include(EthOptions)
configure_project(TESTS)
set(LATEST_Z3_VERSION "4.11.2")
set(LATEST_Z3_VERSION "4.12.1")
set(MINIMUM_Z3_VERSION "4.8.16")
find_package(Z3)
if (${Z3_FOUND})
Expand Down
2 changes: 1 addition & 1 deletion CODING_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ To set indentation and tab width settings uniformly, the repository contains an
3. All symbols should be declared in a namespace except for final applications.
4. Use anonymous namespaces for helpers whose scope is a cpp file only.
5. Preprocessor symbols should be prefixed with the namespace in all-caps and an underscore.
6. Do not use `std::` qualifier in cpp files (see 2.), except for `std::move`, which will otherwise cause the `check_style` step to fail.
6. Do not use `std::` qualifier in cpp files (see 2.), except for `std::move` and `std::forward`, which will otherwise cause the `check_style` step to fail.
Only in the header:
```cpp
Expand Down
51 changes: 51 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
### 0.8.20 (2023-05-10)

Compiler Features:
* Assembler: Use ``push0`` for placing ``0`` on the stack for EVM versions starting from "Shanghai". This decreases the deployment and runtime 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.
* NatSpec: Include NatSpec from events that are emitted by a contract but defined outside of it in userdoc and devdoc output.
* Optimizer: Re-implement simplified version of ``UnusedAssignEliminator`` and ``UnusedStoreEliminator``. It can correctly remove some unused assignments in deeply nested loops that were ignored by the old version.
* Parser: Unary plus is no longer recognized as a unary operator in the AST and triggers an error at the parsing stage (rather than later during the analysis).
* SMTChecker: Group all messages about unsupported language features in a single warning. The CLI option ``--model-checker-show-unsupported`` and the JSON option ``settings.modelChecker.showUnsupported`` can be enabled to show the full list.
* SMTChecker: Properties that are proved safe are now reported explicitly at the end of analysis. By default, only the number of safe properties is shown. The CLI option ``--model-checker-show-proved-safe`` and the JSON option ``settings.modelChecker.showProvedSafe`` can be enabled to show the full list of safe properties.
* Standard JSON Interface: Add experimental support for importing ASTs via Standard JSON.
* Yul EVM Code Transform: If available, use ``push0`` instead of ``codesize`` to produce an arbitrary value on stack in order to create equal stack heights between branches.


Bugfixes:
* ABI: Include events in the ABI that are emitted by a contract but defined outside of it.
* Immutables: Disallow initialization of immutables in try/catch statements.
* SMTChecker: Fix false positives in ternary operators that contain verification targets in its branches, directly or indirectly.


AST Changes:
* AST: Add the ``internalFunctionIDs`` field to the AST nodes of contracts containing IDs of functions that may be called via the internal dispatch. The field is a map from function AST IDs to internal dispatch function IDs. These IDs are always generated, but they are only used in via-IR code generation.
* AST: Add the ``usedEvents`` field to ``ContractDefinition`` which contains the AST IDs of all events emitted by the contract as well as all events defined and inherited by the contract.


### 0.8.19 (2023-02-22)

Language Features:
* Allow defining custom operators for user-defined value types via ``using {f as +} for T global`` syntax.


Compiler Features:
* SMTChecker: New trusted mode that assumes that any compile-time available code is the actual used code even in external calls. This can be used via the CLI option ``--model-checker-ext-calls trusted`` or the JSON field ``settings.modelChecker.extCalls: "trusted"``.


Bugfixes:
* Assembler: Avoid duplicating subassembly bytecode where possible.
* Code Generator: Avoid including references to the deployed label of referenced functions if they are called right away.
* ContractLevelChecker: Properly distinguish the case of missing base constructor arguments from having an unimplemented base function.
* SMTChecker: Fix internal error caused by unhandled ``z3`` expressions that come from the solver when bitwise operators are used.
* SMTChecker: Fix internal error when using the custom NatSpec annotation to abstract free functions.
* TypeChecker: Also allow external library functions in ``using for``.


AST Changes:
* AST: Add ``function`` field to ``UnaryOperation`` and ``BinaryOperation`` AST nodes. ``functionList`` in ``UsingForDirective`` AST nodes will now contain ``operator`` and ``definition`` members instead of ``function`` when the list entry defines an operator.


### 0.8.18 (2023-02-01)

Language Features:
Expand Down
Loading

0 comments on commit 5f1834b

Please sign in to comment.