diff --git a/.circleci/compare_bytecode_reports.sh b/.circleci/compare_bytecode_reports.sh
new file mode 100755
index 000000000000..7574b0656c81
--- /dev/null
+++ b/.circleci/compare_bytecode_reports.sh
@@ -0,0 +1,60 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+#------------------------------------------------------------------------------
+# Compares bytecode reports generated by prepare_report.py/.js.
+#
+# ------------------------------------------------------------------------------
+# This file is part of solidity.
+#
+# solidity is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# solidity is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with solidity. If not, see
+#
+# (c) 2023 solidity contributors.
+#------------------------------------------------------------------------------
+
+no_cli_platforms=(
+ emscripten
+)
+native_platforms=(
+ ubuntu2004-static
+ ubuntu
+ osx
+ osx_intel
+ windows
+)
+interfaces=(
+ cli
+ standard-json
+)
+
+for preset in "$@"; do
+ report_files=()
+ for platform in "${no_cli_platforms[@]}"; do
+ report_files+=("bytecode-report-${platform}-${preset}.txt")
+ done
+ for platform in "${native_platforms[@]}"; do
+ for interface in "${interfaces[@]}"; do
+ report_files+=("bytecode-report-${platform}-${interface}-${preset}.txt")
+ done
+ done
+
+ echo "Reports to compare:"
+ printf -- "- %s\n" "${report_files[@]}"
+
+ if ! diff --brief --report-identical-files --from-file "${report_files[@]}"; then
+ diff --unified=0 --report-identical-files --from-file "${report_files[@]}" | head --lines 50
+ zip "bytecode-reports-${preset}.zip" "${report_files[@]}"
+ exit 1
+ fi
+done
diff --git a/.circleci/config.yml b/.circleci/config.yml
index c11b5f8b45a3..722de138a41e 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -9,24 +9,25 @@ version: 2.1
parameters:
ubuntu-2004-docker-image:
type: string
- # solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-19
- default: "solbuildpackpusher/solidity-buildpack-deps@sha256:9c7d3be930936a70f0340d5e9fa9a0b8bf69e11192e7e2d37807afe1b7f55534"
+ # solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-21
+ default: "solbuildpackpusher/solidity-buildpack-deps@sha256:6f64c7b35aabddb416d28f621a3c4bbae768c257d6866f6a7f05f8225acc94f0"
ubuntu-2204-docker-image:
type: string
- # solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-4
- default: "solbuildpackpusher/solidity-buildpack-deps@sha256:7555c26c82fd0dcbc02cbd422b74468f8de1b7f2972b84fadcfa90f7371d6de5"
+ # solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-6
+ default: "solbuildpackpusher/solidity-buildpack-deps@sha256:6eee10420382588b274374c6a18cb2e5d4f8a9fef5cf440b3a1acfc32bf52837"
ubuntu-2204-clang-docker-image:
type: string
- # solbuildpackpusher/solidity-buildpack-deps:ubuntu2204.clang-3
- default: "solbuildpackpusher/solidity-buildpack-deps@sha256:3d5efffd1e4c381041d1dff6331add86976373bde1c9dfca97ebd3d735e09dab"
+ # solbuildpackpusher/solidity-buildpack-deps:ubuntu2204.clang-5
+ default: "solbuildpackpusher/solidity-buildpack-deps@sha256:e991421ce9f44d6476b29588fc355da1c3b3fedcc424fd12d844bbe310ad7851"
ubuntu-clang-ossfuzz-docker-image:
type: string
- # solbuildpackpusher/solidity-buildpack-deps:ubuntu.clang.ossfuzz-1
- default: "solbuildpackpusher/solidity-buildpack-deps@sha256:d1bba750ab3f9ad9d28d45e332c2ec2126d248c1d619af369a3ef0c29f5936c3"
+ # solbuildpackpusher/solidity-buildpack-deps:ubuntu.clang.ossfuzz-4
+ default: "solbuildpackpusher/solidity-buildpack-deps@sha256:b122ef9dca71a8f90b74f3ba13cda4453681506e4a4ff047e7bc2130c76b0d1e"
emscripten-docker-image:
type: string
- # solbuildpackpusher/solidity-buildpack-deps:emscripten-15
- default: "solbuildpackpusher/solidity-buildpack-deps@sha256:e2729bd6c0734bb49d04e2688fec3dcf880394f351f69358dd2bd92c0f6fd309"
+ # NOTE: Please remember to update the `build_emscripten.sh` whenever the hash of this image changes.
+ # solbuildpackpusher/solidity-buildpack-deps:emscripten-16
+ default: "solbuildpackpusher/solidity-buildpack-deps@sha256:19fcb5ac029bbc27ec36e10f7d14ea224d8010145f9690562ef084fd16146b0c"
evm-version:
type: string
default: london
@@ -75,22 +76,35 @@ commands:
parameters:
label:
type: string
+ binary_type:
+ type: enum
+ enum:
+ - solcjs
+ - native
+ - osx_intel
binary_path:
type: string
+ preset:
+ type: string
steps:
- - run: mkdir test-cases/
- - run: cd test-cases && python3 ../scripts/isolate_tests.py ../test/
- - run: cd test-cases && python3 ../scripts/bytecodecompare/prepare_report.py << parameters.binary_path >> --interface standard-json --report-file "../bytecode-report-<< parameters.label >>-json.txt"
- - run: cd test-cases && python3 ../scripts/bytecodecompare/prepare_report.py << parameters.binary_path >> --interface cli --report-file "../bytecode-report-<< parameters.label >>-cli.txt"
+ - run:
+ name: Generate bytecode reports for the selected preset
+ command: |
+ .circleci/parallel_bytecode_report.sh \
+ "<< parameters.label >>" \
+ "<< parameters.binary_type >>" \
+ "${PWD}/<< parameters.binary_path >>" \
+ "<< parameters.preset >>"
- store_artifacts:
- path: bytecode-report-<< parameters.label >>-json.txt
+ path: bytecode-report-<< parameters.label >>-standard-json-<< parameters.preset >>.txt
- store_artifacts:
- path: bytecode-report-<< parameters.label >>-cli.txt
+ path: bytecode-report-<< parameters.label >>-cli-<< parameters.preset >>.txt
+ - store_artifacts:
+ path: bytecode-report-<< parameters.label >>-<< parameters.preset >>.txt
- persist_to_workspace:
root: .
paths:
- - bytecode-report-<< parameters.label >>-json.txt
- - bytecode-report-<< parameters.label >>-cli.txt
+ - bytecode-report-<< parameters.label >>*.txt
- matrix_notify_failure_unless_pr
install_python3:
@@ -127,10 +141,15 @@ commands:
command: |
FOUNDRY_REPO="foundry-rs/foundry"
FOUNDRY_VERSION="<< parameters.version >>"
+ # Make authenticated requests when the Github token is available
+ if [[ -n "$GITHUB_ACCESS_TOKEN" ]]; then
+ EXTRA_HEADERS=(--header 'Authorization: Bearer '"${GITHUB_ACCESS_TOKEN}")
+ fi
FOUNDRY_RELEASE_SHA=$(curl \
--silent \
--fail \
--show-error \
+ "${EXTRA_HEADERS[@]}" \
"https://api.github.com/repos/${FOUNDRY_REPO}/git/refs/tags/${FOUNDRY_VERSION}" \
| jq --raw-output .object.sha \
)
@@ -160,311 +179,425 @@ commands:
paths:
- << parameters.install_path >>
-defaults:
-
# --------------------------------------------------------------------------
- # Build Templates
+ # Build Commands
+
+ setup_prerelease_commit_hash:
+ steps:
+ - run:
+ name: Store commit hash and prerelease
+ command: |
+ if [[ $CIRCLE_BRANCH == release || -n $CIRCLE_TAG ]]; then
+ echo -n > prerelease.txt;
+ else
+ date -u +"nightly.%Y.%-m.%-d" > prerelease.txt;
+ fi
+ echo -n "$CIRCLE_SHA1" > commit_hash.txt
+
+ run_build:
+ steps:
+ - run:
+ name: Build
+ command: scripts/ci/build.sh
+
+ run_build_ossfuzz:
+ steps:
+ - run:
+ name: Build_ossfuzz
+ command: scripts/ci/build_ossfuzz.sh
+
+ run_proofs:
+ steps:
+ - run:
+ name: Correctness proofs for optimization rules
+ command: scripts/run_proofs.sh
+
+ run_soltest:
+ steps:
+ - run:
+ name: soltest
+ no_output_timeout: 30m
+ command: .circleci/soltest.sh
- - setup_prerelease_commit_hash: &setup_prerelease_commit_hash
- name: Store commit hash and prerelease
- command: |
- if [ "$CIRCLE_BRANCH" = release -o -n "$CIRCLE_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi
- echo -n "$CIRCLE_SHA1" > commit_hash.txt
+ run_soltest_all:
+ steps:
+ - run:
+ name: soltest_all
+ no_output_timeout: 30m
+ command: .circleci/soltest_all.sh
- - run_build: &run_build
- name: Build
- command: scripts/ci/build.sh
+ run_cmdline_tests:
+ steps:
+ - run:
+ name: command line tests
+ no_output_timeout: 30m
+ command: .circleci/parallel_cli_tests.py
- - run_build_ossfuzz: &run_build_ossfuzz
- name: Build_ossfuzz
- command: scripts/ci/build_ossfuzz.sh
+ run_docs_pragma_min_version:
+ steps:
+ - run:
+ name: docs pragma version check
+ command: scripts/docs_version_pragma_check.sh
- - run_proofs: &run_proofs
- name: Correctness proofs for optimization rules
- command: scripts/run_proofs.sh
+ # --------------------------------------------------------------------------
+ # Artifact Commands
- - run_soltest: &run_soltest
- name: soltest
- no_output_timeout: 30m
- command: ./.circleci/soltest.sh
+ store_artifacts_solc:
+ description: Store compiled solc executable as artifact
+ steps:
+ - store_artifacts:
+ path: build/solc/solc
+ destination: solc
- - run_soltest_all: &run_soltest_all
- name: soltest_all
- no_output_timeout: 30m
- command: ./.circleci/soltest_all.sh
+ store_artifacts_yul_phaser:
+ steps:
+ - store_artifacts:
+ path: build/tools/yul-phaser
+ destination: yul-phaser
- - run_cmdline_tests: &run_cmdline_tests
- name: command line tests
- no_output_timeout: 30m
- command: ./test/cmdlineTests.sh
+ persist_executables_to_workspace:
+ description: Persist compiled target executables to workspace
+ steps:
+ - persist_to_workspace:
+ root: build
+ paths:
+ - solc/solc
+ - test/soltest
+ - test/tools/solfuzzer
+
+ persist_executables_to_workspace_osx:
+ description: Persist compiled target executables to workspace on macOS
+ steps:
+ - persist_to_workspace:
+ root: .
+ paths:
+ - build/solc/solc
+ - build/test/soltest
+ - build/test/tools/solfuzzer
- - run_docs_pragma_min_version: &run_docs_pragma_min_version
- name: docs pragma version check
- command: ./scripts/docs_version_pragma_check.sh
+ persist_ossfuzz_executables_to_workspace:
+ description: Persist compiled OSSFUZZ executables to workspace
+ steps:
+ - persist_to_workspace:
+ root: build
+ paths:
+ - test/tools/ossfuzz/abiv2_proto_ossfuzz
+ - test/tools/ossfuzz/abiv2_isabelle_ossfuzz
+ - test/tools/ossfuzz/const_opt_ossfuzz
+ - test/tools/ossfuzz/solc_mutator_ossfuzz
+ - test/tools/ossfuzz/solc_ossfuzz
+ - test/tools/ossfuzz/stack_reuse_codegen_ossfuzz
+ - test/tools/ossfuzz/strictasm_assembly_ossfuzz
+ - test/tools/ossfuzz/strictasm_diff_ossfuzz
+ - test/tools/ossfuzz/strictasm_opt_ossfuzz
+ - test/tools/ossfuzz/yul_proto_diff_ossfuzz
+ - test/tools/ossfuzz/yul_proto_diff_custom_mutate_ossfuzz
+ - test/tools/ossfuzz/yul_proto_ossfuzz
+ - test/tools/ossfuzz/sol_proto_ossfuzz
+
+ store_artifacts_test_results:
+ description: Store test output dir as artifact
+ steps:
+ - store_artifacts:
+ path: test_results/
+ destination: test_results/
# --------------------------------------------------------------------------
- # Artifacts Templates
-
- # compiled solc executable target
- - artifacts_solc: &artifacts_solc
- path: build/solc/solc
- destination: solc
-
- # windows artifacts
- - artifact_solc_windows: &artifact_solc_windows
- path: upload/
-
- - artifact_yul_phaser: &artifact_yul_phaser
- path: build/tools/yul-phaser
- destination: yul-phaser
-
- # compiled executable targets
- - artifacts_executables: &artifacts_executables
- root: build
- paths:
- - solc/solc
- - test/soltest
- - test/tools/solfuzzer
-
- # compiled OSSFUZZ targets
- - artifacts_executables_ossfuzz: &artifacts_executables_ossfuzz
- root: build
- paths:
- - test/tools/ossfuzz/abiv2_proto_ossfuzz
- - test/tools/ossfuzz/abiv2_isabelle_ossfuzz
- - test/tools/ossfuzz/const_opt_ossfuzz
- - test/tools/ossfuzz/solc_mutator_ossfuzz
- - test/tools/ossfuzz/solc_ossfuzz
- - test/tools/ossfuzz/stack_reuse_codegen_ossfuzz
- - test/tools/ossfuzz/strictasm_assembly_ossfuzz
- - test/tools/ossfuzz/strictasm_diff_ossfuzz
- - test/tools/ossfuzz/strictasm_opt_ossfuzz
- - test/tools/ossfuzz/yul_proto_diff_ossfuzz
- - test/tools/ossfuzz/yul_proto_diff_custom_mutate_ossfuzz
- - test/tools/ossfuzz/yul_proto_ossfuzz
- - test/tools/ossfuzz/sol_proto_ossfuzz
-
- # test result output directory
- - artifacts_test_results: &artifacts_test_results
- path: test_results/
- destination: test_results/
+ # Complex Build Commands
+
+ soltest:
+ steps:
+ - checkout
+ - attach_workspace:
+ at: build
+ # NOTE: Different build jobs produce different soltest executables (release/debug,
+ # clang/gcc, windows/linux/macos, etc.). The executable used by these steps comes from the
+ # attached workspace and we only see the items added to the workspace by jobs we depend on.
+ - run_soltest
+ - store_test_results:
+ path: test_results/
+ - store_artifacts_test_results
+ - matrix_notify_failure_unless_pr
+
+ test_lsp:
+ steps:
+ - checkout
+ - attach_workspace:
+ at: build
+ - run:
+ name: Install dependencies
+ command: pip install --user deepdiff colorama
+ - run:
+ name: Executing solc LSP test suite
+ command: test/lsp.py build/solc/solc --non-interactive
+ - matrix_notify_failure_unless_pr
+
+ build:
+ steps:
+ - checkout
+ - run_build
+ - store_artifacts_solc
+ - store_artifacts_yul_phaser
+ - persist_executables_to_workspace
+ - matrix_notify_failure_unless_pr
+
+ soltest_all:
+ steps:
+ - checkout
+ - attach_workspace:
+ at: build
+ - run_soltest_all
+ - store_test_results:
+ path: test_results/
+ - store_artifacts_test_results
+ - matrix_notify_failure_unless_pr
+
+ cmdline_tests:
+ steps:
+ - checkout
+ - attach_workspace:
+ at: build
+ - run_cmdline_tests
+ - store_test_results:
+ path: test_results/
+ - store_artifacts_test_results
+ - matrix_notify_failure_unless_pr
+
+ install_dependencies_osx:
+ # An extra cache key is used to only save the flag that communicates whether the cache exists.
+ # if this flag was set (the cache exist) we remove all files located in /usr/local & /opt/homebrew.
+ # With this simple trick restoring the cache is much faster. Otherwise CircleCI is generating
+ # warning messages if a file from the cache is overwriting an already existing file on disk.
+ # Restoring the cache is much faster if we remove all potentially conflicting files beforehand.
+ steps:
+ - restore_cache:
+ keys:
+ - osx-dependencies-cached-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
+ - run:
+ name: Installing dependencies / Restoring dependency cache
+ command: |
+ if [[ -f ~/osx-dependencies-cached ]]; then
+ echo "Dependency flag exists. Removing /usr/local/ and /opt/homebrew/. These directories will be restored from cache."
+
+ # CircleCI is providing the circleci cli tools via some kind of symlink magic.
+ # So we just save the original symlinks and restore them later.
+ circleci_binary_path=$(command -v circleci)
+ circleci_agent_binary_path=$(command -v circleci-agent)
+ cp "${circleci_binary_path}" /tmp/circleci
+ cp "${circleci_agent_binary_path}" /tmp/circleci-agent
+
+ # Homebrew is installed in /usr/local on intel macs, but in /opt/homebrew on apple silicon.
+ if [[ -d /opt/homebrew ]]; then
+ sudo rm -rf /opt/homebrew
+ sudo mkdir -p /opt/homebrew/bin
+ sudo chmod 777 /opt/{homebrew,homebrew/bin}
+ fi
+ # under macos /usr/local itself is read-only, so we just remove its sub-directories.
+ sudo rm -rf /usr/local/*
+ sudo mkdir -p /usr/local/bin
+ sudo chmod 777 /usr/{local,local/bin}
+
+ mv /tmp/circleci "${circleci_binary_path}"
+ mv /tmp/circleci-agent "${circleci_agent_binary_path}"
+ fi
+ - restore_cache:
+ keys:
+ - osx-dependencies-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
+ # DO NOT EDIT between here and save_cache, but rather edit ./circleci/osx_install_dependencies.sh
+ # WARNING! If you do edit anything here instead, remember to invalidate the cache manually.
+ - run:
+ name: Install build dependencies
+ command: .circleci/osx_install_dependencies.sh
+ - run:
+ name: Mark dependencies as cached
+ command: touch ~/osx-dependencies-cached
+ - save_cache:
+ key: osx-dependencies-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
+ paths:
+ # Homebrew is installed in /usr/local on intel macs, but in /opt/homebrew on apple silicon.
+ - /usr/local
+ - /opt/homebrew
+ - save_cache:
+ key: osx-dependencies-cached-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
+ paths:
+ - ~/osx-dependencies-cached
+
+defaults:
# --------------------------------------------------------------------------
- # Step Templates
-
- # store_test_results helper
- - store_test_results: &store_test_results
- path: test_results/
-
- - steps_soltest: &steps_soltest
- steps:
- - checkout
- - attach_workspace:
- at: build
- # NOTE: Different build jobs produce different soltest executables (release/debug,
- # clang/gcc, windows/linux/macos, etc.). The executable used by these steps comes from the
- # attached workspace and we only see the items added to the workspace by jobs we depend on.
- - run: *run_soltest
- - store_test_results: *store_test_results
- - store_artifacts: *artifacts_test_results
- - matrix_notify_failure_unless_pr
-
- - steps_test_lsp: &steps_test_lsp
- steps:
- - checkout
- - attach_workspace:
- at: build
- - run:
- name: Install dependencies
- command: pip install --user deepdiff colorama
- - run:
- name: Executing solc LSP test suite
- command: ./test/lsp.py ./build/solc/solc --non-interactive
- - matrix_notify_failure_unless_pr
-
- - steps_build: &steps_build
- steps:
- - checkout
- - run: *run_build
- - store_artifacts: *artifacts_solc
- - store_artifacts: *artifact_yul_phaser
- - persist_to_workspace: *artifacts_executables
- - matrix_notify_failure_unless_pr
-
- - steps_soltest_all: &steps_soltest_all
- steps:
- - checkout
- - attach_workspace:
- at: build
- - run: *run_soltest_all
- - store_test_results: *store_test_results
- - store_artifacts: *artifacts_test_results
- - matrix_notify_failure_unless_pr
-
- - steps_cmdline_tests: &steps_cmdline_tests
- steps:
- - checkout
- - attach_workspace:
- at: build
- - run: *run_cmdline_tests
- - store_test_results: *store_test_results
- - store_artifacts: *artifacts_test_results
- - matrix_notify_failure_unless_pr
-
- - steps_install_dependencies_osx: &steps_install_dependencies_osx
- steps:
- # FIXME: We used to cache dependencies on macOS but now it takes longer than just installing
- # them each time. See https://github.com/ethereum/solidity/issues/12925.
- - run:
- name: Install build dependencies
- command: ./.circleci/osx_install_dependencies.sh
+ # Matrix templates
+
+ - bytecode_compare_env_presets: &bytecode_compare_env_presets
+ PRESETS:
+ legacy-optimize
+ legacy-no-optimize
+ via-ir-optimize
+ via-ir-no-optimize
+
+ - bytecode_compare_preset_matrix: &bytecode_compare_preset_matrix
+ parameters:
+ preset:
+ # NOTE: Keep in sync with preset list in bytecode_compare_env_presets
+ - legacy-optimize
+ - legacy-no-optimize
+ - via-ir-optimize
+ - via-ir-no-optimize
+ # --------------------------------------------------------------------------
# --------------------------------------------------------------------------
# Base Image Templates
- base_archlinux: &base_archlinux
docker:
- image: archlinux:base
- environment:
+ environment: &base_archlinux_env
TERM: xterm
MAKEFLAGS: -j 3
+ CPUs: 3
- base_archlinux_large: &base_archlinux_large
- docker:
- - image: archlinux:base
+ <<: *base_archlinux
resource_class: large
- environment:
- TERM: xterm
+ environment: &base_archlinux_large_env
+ <<: *base_archlinux_env
MAKEFLAGS: -j 5
+ CPUs: 5
- base_cimg_small: &base_cimg_small
docker:
- image: cimg/base:current
resource_class: small
- environment:
+ environment: &base_cimg_small_env
TERM: xterm
MAKEFLAGS: -j 2
+ CPUs: 2
- base_ems_large: &base_ems_large
docker:
- image: << pipeline.parameters.emscripten-docker-image >>
resource_class: large
- environment:
+ environment: &base_ems_large_env
TERM: xterm
MAKEFLAGS: -j 5
+ CPUs: 5
- base_node_small: &base_node_small
docker:
- image: cimg/node:current
resource_class: small
- environment:
+ environment: &base_node_small_env
TERM: xterm
MAKEFLAGS: -j 2
+ CPUs: 2
- base_osx: &base_osx
macos:
- xcode: "14.2.0"
- resource_class: macos.x86.medium.gen2
- environment:
+ xcode: "15.0.0"
+ resource_class: macos.m1.medium.gen1
+ environment: &base_osx_env
TERM: xterm
MAKEFLAGS: -j5
-
- - base_osx_large: &base_osx_large
- macos:
- xcode: "14.2.0"
- resource_class: large
- environment:
- TERM: xterm
- MAKEFLAGS: -j10
+ CPUs: 5
+ ETH_EVMONE: /usr/local/lib/libevmone.dylib
- base_python_small: &base_python_small
docker:
- image: cimg/python:3.6
resource_class: small
- environment:
+ environment: &base_python_small_env
TERM: xterm
MAKEFLAGS: -j 2
+ CPUs: 2
- base_ubuntu_clang: &base_ubuntu_clang
docker:
- image: << pipeline.parameters.ubuntu-clang-ossfuzz-docker-image >>
- environment:
+ environment: &base_ubuntu_clang_env
TERM: xterm
MAKEFLAGS: -j 3
+ CPUs: 3
- base_ubuntu_clang_small: &base_ubuntu_clang_small
<<: *base_ubuntu_clang
resource_class: small
- environment:
- TERM: xterm
+ environment: &base_ubuntu_clang_small_env
+ <<: *base_ubuntu_clang_env
MAKEFLAGS: -j 2
+ CPUs: 2
- base_ubuntu2004: &base_ubuntu2004
docker:
- - image: << pipeline.parameters.ubuntu-2004-docker-image >>
- environment:
- TERM: xterm
- MAKEFLAGS: -j 3
+ - image: << pipeline.parameters.ubuntu-2004-docker-image >>
+ environment: &base_ubuntu2004_env
+ TERM: xterm
+ MAKEFLAGS: -j 3
+ CPUs: 3
- base_ubuntu2004_small: &base_ubuntu2004_small
<<: *base_ubuntu2004
resource_class: small
- environment:
- TERM: xterm
- MAKEFLAGS: -j 2
+ environment: &base_ubuntu2004_small_env
+ <<: *base_ubuntu2004_env
+ MAKEFLAGS: -j 2
+ CPUs: 2
- base_ubuntu2004_xlarge: &base_ubuntu2004_xlarge
<<: *base_ubuntu2004
resource_class: xlarge
- environment:
- TERM: xterm
- MAKEFLAGS: -j 10
+ environment: &base_ubuntu2004_xlarge_env
+ <<: *base_ubuntu2004_env
+ MAKEFLAGS: -j 10
+ CPUs: 10
- base_ubuntu2204: &base_ubuntu2204
docker:
- image: << pipeline.parameters.ubuntu-2204-docker-image >>
- environment:
+ environment: &base_ubuntu2204_env
TERM: xterm
MAKEFLAGS: -j 3
+ CPUs: 3
- base_ubuntu2204_clang: &base_ubuntu2204_clang
docker:
- image: << pipeline.parameters.ubuntu-2204-clang-docker-image >>
- environment:
+ environment: &base_ubuntu2204_clang_env
TERM: xterm
CC: clang
CXX: clang++
MAKEFLAGS: -j 3
+ CPUs: 3
- base_ubuntu2204_clang_large: &base_ubuntu2204_clang_large
<<: *base_ubuntu2204_clang
resource_class: large
- environment:
- TERM: xterm
- CC: clang
- CXX: clang++
+ environment: &base_ubuntu2204_clang_large_env
+ <<: *base_ubuntu2204_clang_env
MAKEFLAGS: -j 5
+ CPUs: 5
- base_ubuntu2204_small: &base_ubuntu2204_small
<<: *base_ubuntu2204
resource_class: small
- environment:
- TERM: xterm
+ environment: &base_ubuntu2204_small_env
+ <<: *base_ubuntu2204_env
MAKEFLAGS: -j 2
+ CPUs: 2
- base_ubuntu2204_large: &base_ubuntu2204_large
<<: *base_ubuntu2204
resource_class: large
- environment:
- TERM: xterm
+ environment: &base_ubuntu2204_large_env
+ <<: *base_ubuntu2204_env
MAKEFLAGS: -j 5
+ CPUs: 5
- base_ubuntu2204_xlarge: &base_ubuntu2204_xlarge
<<: *base_ubuntu2204
resource_class: xlarge
- environment:
- TERM: xterm
+ environment: &base_ubuntu2204_xlarge_env
+ <<: *base_ubuntu2204_env
MAKEFLAGS: -j 10
+ CPUs: 10
- base_win: &base_win
executor:
@@ -483,7 +616,9 @@ defaults:
- on_all_tags_and_branches: &on_all_tags_and_branches
filters:
tags:
- only: /.*/
+ only: /^tv.*/
+ branches:
+ ignore: /.*/
- on_version_tags: &on_version_tags
filters:
@@ -570,6 +705,8 @@ defaults:
# Parameterized Job Templates
# Separate compile-only runs of those external tests where a full run takes much longer.
+ # Also see https://github.com/ethereum/solidity/pull/14234 for why we excluded those
+ # external tests from the nightly jobs.
- job_ems_compile_ext_colony: &job_ems_compile_ext_colony
<<: *requires_b_ems
name: t_ems_compile_ext_colony
@@ -584,13 +721,14 @@ defaults:
name: t_native_test_ext_gnosis
project: gnosis
binary_type: native
- image: cimg/node:16.18
+ image: cimg/node:18.16
- job_native_test_ext_zeppelin: &job_native_test_ext_zeppelin
<<: *requires_b_ubu_static
name: t_native_test_ext_zeppelin
project: zeppelin
binary_type: native
+ image: cimg/node:18.16
resource_class: large
- job_native_test_ext_ens: &job_native_test_ext_ens
@@ -598,14 +736,14 @@ defaults:
name: t_native_test_ext_ens
project: ens
binary_type: native
- image: cimg/node:18.11
+ image: cimg/node:18.16
- job_native_test_ext_trident: &job_native_test_ext_trident
<<: *requires_b_ubu_static
name: t_native_test_ext_trident
project: trident
binary_type: native
- image: cimg/node:16.18
+ image: cimg/node:18.16
- job_native_test_ext_euler: &job_native_test_ext_euler
<<: *requires_b_ubu_static
@@ -619,6 +757,7 @@ defaults:
name: t_native_test_ext_yield_liquidator
project: yield-liquidator
binary_type: native
+ image: cimg/node:18.16
- job_native_test_ext_bleeps: &job_native_test_ext_bleeps
<<: *requires_b_ubu_static
@@ -632,34 +771,36 @@ defaults:
name: t_native_test_ext_pool_together
project: pool-together
binary_type: native
- image: cimg/node:16.18
+ image: cimg/node:18.16
- job_native_test_ext_perpetual_pools: &job_native_test_ext_perpetual_pools
<<: *requires_b_ubu_static
name: t_native_test_ext_perpetual_pools
project: perpetual-pools
binary_type: native
- image: cimg/node:18.11
+ image: cimg/node:18.16
- job_native_test_ext_uniswap: &job_native_test_ext_uniswap
<<: *requires_b_ubu_static
name: t_native_test_ext_uniswap
project: uniswap
binary_type: native
- image: cimg/node:16.18
+ image: cimg/node:18.16
- job_native_test_ext_prb_math: &job_native_test_ext_prb_math
<<: *requires_b_ubu_static
name: t_native_test_ext_prb_math
project: prb-math
binary_type: native
- image: cimg/node:18.11
+ image: cimg/rust:1.74.0-node
+ resource_class: medium
- job_native_test_ext_elementfi: &job_native_test_ext_elementfi
<<: *requires_b_ubu_static
name: t_native_test_ext_elementfi
project: elementfi
binary_type: native
+ image: cimg/node:18.16
resource_class: medium
- job_native_test_ext_brink: &job_native_test_ext_brink
@@ -667,14 +808,14 @@ defaults:
name: t_native_test_ext_brink
project: brink
binary_type: native
- image: cimg/node:18.11
+ image: cimg/node:18.16
- job_native_test_ext_chainlink: &job_native_test_ext_chainlink
<<: *requires_b_ubu_static
name: t_native_test_ext_chainlink
project: chainlink
binary_type: native
- image: cimg/node:16.18
+ image: cimg/node:18.16
resource_class: large # Tests run out of memory on a smaller machine
- job_native_test_ext_gp2: &job_native_test_ext_gp2
@@ -682,16 +823,7 @@ defaults:
name: t_native_test_ext_gp2
project: gp2
binary_type: native
- image: cimg/node:18.11
-
- - job_ems_test_ext_colony: &job_ems_test_ext_colony
- <<: *requires_b_ems
- name: t_ems_test_ext_colony
- project: colony
- binary_type: solcjs
- image: cimg/node:14.20
- resource_class: medium
- python2: true
+ image: cimg/node:18.16
- job_b_ubu_asan_clang: &job_b_ubu_asan_clang
<<: *on_all_tags_and_branches
@@ -718,7 +850,11 @@ jobs:
pip install --user codespell
- run:
name: Check spelling
- command: ~/.local/bin/codespell --skip "*.enc,.git,Dockerfile*,LICENSE,codespell_whitelist.txt,codespell_ignored_lines.txt" --ignore-words ./scripts/codespell_whitelist.txt --exclude-file ./scripts/codespell_ignored_lines.txt
+ command: |
+ ~/.local/bin/codespell \
+ --skip "*.enc,.git,Dockerfile*,LICENSE,codespell_whitelist.txt,codespell_ignored_lines.txt" \
+ --ignore-words scripts/codespell_whitelist.txt \
+ --exclude-file scripts/codespell_ignored_lines.txt
- matrix_notify_failure_unless_pr
chk_docs_examples:
@@ -732,7 +868,7 @@ jobs:
command: sudo npm install -g solhint
- run:
name: Test Docs examples
- command: ./test/docsCodeStyle.sh
+ command: test/docsCodeStyle.sh
- matrix_notify_failure_unless_pr
chk_coding_style:
@@ -746,13 +882,13 @@ jobs:
sudo apt install -y shellcheck
- run:
name: Check for C++ coding style
- command: ./scripts/check_style.sh
+ command: scripts/check_style.sh
- run:
name: checking shell scripts
- command: ./scripts/chk_shellscripts/chk_shellscripts.sh
+ command: scripts/chk_shellscripts/chk_shellscripts.sh
- run:
name: Check for broken symlinks
- command: ./scripts/check_symlinks.sh
+ command: scripts/check_symlinks.sh
- matrix_notify_failure_unless_pr
chk_errorcodes:
@@ -761,7 +897,7 @@ jobs:
- checkout
- run:
name: Check for error codes
- command: ./scripts/error_codes.py --check
+ command: scripts/error_codes.py --check
- matrix_notify_failure_unless_pr
chk_pylint:
@@ -781,7 +917,7 @@ jobs:
- run: pylint --version
- run:
name: Linting Python Scripts
- command: ./scripts/pylint_all.py
+ command: scripts/pylint_all.py
- matrix_notify_failure_unless_pr
chk_antlr_grammar:
@@ -795,7 +931,7 @@ jobs:
sudo apt install -y openjdk-17-jdk
- run:
name: Run tests
- command: ./scripts/test_antlr_grammar.sh
+ command: scripts/test_antlr_grammar.sh
- matrix_notify_failure_unless_pr
chk_buglist:
@@ -810,7 +946,7 @@ jobs:
npm install mktemp
- run:
name: Test buglist
- command: ./test/buglistTests.js
+ command: test/buglistTests.js
- matrix_notify_failure_unless_pr
chk_proofs:
@@ -819,14 +955,14 @@ jobs:
- checkout
- install_python3:
packages: z3-solver
- - run: *run_proofs
+ - run_proofs
- matrix_notify_failure_unless_pr
chk_docs_pragma_min_version:
<<: *base_ubuntu2204_small
steps:
- checkout
- - run: *run_docs_pragma_min_version
+ - run_docs_pragma_min_version
- matrix_notify_failure_unless_pr
t_ubu_pyscripts:
@@ -852,26 +988,27 @@ jobs:
# this runs 2x faster on xlarge but takes 4x more resources (compared to medium).
# Enough other jobs depend on it that it's worth it though.
<<: *base_ubuntu2204_xlarge
- <<: *steps_build
+ steps:
+ - build
# x64 ASAN build, for testing for memory related bugs
b_ubu_asan: &b_ubu_asan
# Runs slightly faster on large and xlarge but we only run it nightly so efficiency matters more.
<<: *base_ubuntu2204
environment:
+ <<: *base_ubuntu2204_env
CMAKE_OPTIONS: -DSANITIZE=address
- MAKEFLAGS: -j 3
CMAKE_BUILD_TYPE: Release
- <<: *steps_build
+ steps:
+ - build
b_ubu_clang: &b_ubu_clang
<<: *base_ubuntu2204_clang_large
environment:
- TERM: xterm
- CC: clang
- CXX: clang++
+ <<: *base_ubuntu2204_clang_large_env
MAKEFLAGS: -j 10
- <<: *steps_build
+ steps:
+ - build
b_ubu_san_clang:
# This runs a bit faster on large and xlarge but on nightly efficiency matters more.
@@ -880,18 +1017,16 @@ jobs:
type: string
<<: *base_ubuntu2204_clang
environment:
- TERM: xterm
- CC: clang
- CXX: clang++
- MAKEFLAGS: -j 3
+ <<: *base_ubuntu2204_clang_env
CMAKE_OPTIONS: << parameters.cmake_options >>
- <<: *steps_build
+ steps:
+ - build
b_ubu_force_release: &b_ubu_force_release
<<: *b_ubu
environment:
+ <<: *base_ubuntu2204_xlarge_env
FORCE_RELEASE: ON
- MAKEFLAGS: -j 10
b_ubu_static:
# We temporarily keep building static release binaries on ubuntu 20.04
@@ -900,12 +1035,11 @@ jobs:
# On large runs 2x faster than on medium. 3x on xlarge.
<<: *base_ubuntu2004_xlarge
environment:
- TERM: xterm
- MAKEFLAGS: -j 10
+ <<: *base_ubuntu2204_xlarge_env
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DUSE_Z3_DLOPEN=ON -DUSE_CVC4=OFF -DSOLC_STATIC_STDLIBS=ON
steps:
- checkout
- - run: *run_build
+ - run_build
- run:
name: strip binary
command: strip build/solc/solc
@@ -923,18 +1057,19 @@ jobs:
# Runs ~30% faster on large but we only run it nightly so efficiency matters more.
<<: *base_ubuntu2204
environment:
+ <<: *base_ubuntu2204_env
COVERAGE: ON
CMAKE_BUILD_TYPE: Debug
- MAKEFLAGS: -j 3
steps:
- checkout
- - run: *run_build
- - persist_to_workspace: *artifacts_executables
+ - run_build
+ - persist_executables_to_workspace
- matrix_notify_failure_unless_pr
t_ubu_codecov:
<<: *base_ubuntu2204_large
environment:
+ <<: *base_ubuntu2204_large_env
EVM: << pipeline.parameters.evm-version >>
OPTIMIZE: 1
steps:
@@ -947,11 +1082,11 @@ jobs:
- run:
name: "Code Coverage: Syntax Tests"
command: codecov --flags syntax --gcov-root build
- - run: *run_soltest
+ - run_soltest
- run:
name: "Coverage: All"
command: codecov --flags all --gcov-root build
- - store_artifacts: *artifacts_test_results
+ - store_artifacts_test_results
- matrix_notify_failure_unless_pr
# Builds in C++20 mode and uses debug build in order to speed up.
@@ -959,21 +1094,22 @@ jobs:
b_ubu_cxx20:
<<: *base_ubuntu2204_large
environment:
+ <<: *base_ubuntu2204_large_env
CMAKE_BUILD_TYPE: Debug
CMAKE_OPTIONS: -DCMAKE_CXX_STANDARD=20 -DUSE_CVC4=OFF
MAKEFLAGS: -j 10
steps:
- checkout
- - run: *run_build
+ - run_build
- matrix_notify_failure_unless_pr
b_ubu_ossfuzz: &b_ubu_ossfuzz
<<: *base_ubuntu_clang
steps:
- checkout
- - run: *setup_prerelease_commit_hash
- - run: *run_build_ossfuzz
- - persist_to_workspace: *artifacts_executables_ossfuzz
+ - setup_prerelease_commit_hash
+ - run_build_ossfuzz
+ - persist_ossfuzz_executables_to_workspace
- matrix_notify_failure_unless_pr
t_ubu_ossfuzz: &t_ubu_ossfuzz
@@ -988,14 +1124,14 @@ jobs:
git clone https://github.com/ethereum/solidity-fuzzing-corpus /tmp/solidity-fuzzing-corpus
mkdir -p test_results
scripts/regressions.py -o test_results
- - store_test_results: *store_test_results
- - store_artifacts: *artifacts_test_results
+ - store_test_results:
+ path: test_results/
+ - store_artifacts_test_results
b_archlinux:
<<: *base_archlinux_large
environment:
- TERM: xterm
- MAKEFLAGS: -j 5
+ <<: *base_archlinux_large_env
# This can be switched off if we run out of sync with Arch.
USE_Z3: ON
steps:
@@ -1004,68 +1140,59 @@ jobs:
command: |
pacman --noconfirm -Syu --noprogressbar --needed base-devel boost cmake cvc4 git openssh tar
- checkout
- - run: *run_build
- - store_artifacts: *artifacts_solc
- - persist_to_workspace: *artifacts_executables
+ - run_build
+ - store_artifacts_solc
+ - persist_executables_to_workspace
- matrix_notify_failure_unless_pr
b_osx:
<<: *base_osx
environment:
- TERM: xterm
+ <<: *base_osx_env
CMAKE_BUILD_TYPE: Release
- MAKEFLAGS: -j10
+ CMAKE_OPTIONS: -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64;arm64
steps:
- checkout
- - when:
- condition: true
- <<: *steps_install_dependencies_osx
- - run: *run_build
- - store_artifacts: *artifacts_solc
- - store_artifacts: *artifact_yul_phaser
- - persist_to_workspace:
- root: .
- paths:
- - build/solc/solc
- - build/test/soltest
- - build/test/tools/solfuzzer
+ - install_dependencies_osx
+ - run_build
+ - store_artifacts_solc
+ - store_artifacts_yul_phaser
+ - persist_executables_to_workspace_osx
- matrix_notify_failure_unless_pr
t_osx_soltest: &t_osx_soltest
<<: *base_osx
environment:
+ <<: *base_osx_env
EVM: << pipeline.parameters.evm-version >>
OPTIMIZE: 0
- TERM: xterm
steps:
- checkout
- - when:
- condition: true
- <<: *steps_install_dependencies_osx
+ - install_dependencies_osx
- attach_workspace:
at: .
- - run: *run_soltest
- - store_test_results: *store_test_results
- - store_artifacts: *artifacts_test_results
+ - run_soltest
+ - store_test_results:
+ path: test_results/
+ - store_artifacts_test_results
- matrix_notify_failure_unless_pr
t_osx_cli:
<<: *base_osx
+ parallelism: 8 # Should match number of tests in .circleci/parallel_cli_tests.py
steps:
- checkout
- - when:
- condition: true
- <<: *steps_install_dependencies_osx
+ - install_dependencies_osx
- attach_workspace:
at: .
- - run: *run_cmdline_tests
- - store_artifacts: *artifacts_test_results
+ - run_cmdline_tests
+ - store_artifacts_test_results
- matrix_notify_failure_unless_pr
b_ems:
<<: *base_ems_large
environment:
- TERM: xterm
+ <<: *base_ems_large_env
MAKEFLAGS: -j 10
steps:
- checkout
@@ -1090,10 +1217,10 @@ jobs:
<<: *base_ubuntu2204_small
steps:
- checkout
- - run: *setup_prerelease_commit_hash
+ - setup_prerelease_commit_hash
- run:
name: Build documentation
- command: ./docs/docs.sh
+ command: docs/docs.sh
- store_artifacts:
path: docs/_build/html/
destination: docs-html
@@ -1102,19 +1229,21 @@ jobs:
t_ubu_soltest_all: &t_ubu_soltest_all
<<: *base_ubuntu2204_large
parallelism: 50
- <<: *steps_soltest_all
+ steps:
+ - soltest_all
t_ubu_lsp: &t_ubu_lsp
<<: *base_ubuntu2204_small
- <<: *steps_test_lsp
+ steps:
+ - test_lsp
t_archlinux_soltest: &t_archlinux_soltest
<<: *base_archlinux
parallelism: 20
environment:
+ <<: *base_archlinux_env
EVM: << pipeline.parameters.evm-version >>
OPTIMIZE: 0
- TERM: xterm
# For Archlinux we do not have prebuilt docker images and we would need to build evmone from source,
# thus we forgo semantics tests to speed things up.
SOLTEST_FLAGS: --no-semantic-tests --no-smt
@@ -1123,20 +1252,20 @@ jobs:
name: Install runtime dependencies
command: |
pacman --noconfirm -Syu --noprogressbar --needed base-devel boost cmake z3 cvc4 git openssh tar
- - when:
- condition: true
- <<: *steps_soltest
+ - soltest
t_ubu_clang_soltest: &t_ubu_clang_soltest
<<: *base_ubuntu2204_clang
parallelism: 20
environment:
+ <<: *base_ubuntu2204_clang_env
EVM: << pipeline.parameters.evm-version >>
OPTIMIZE: 0
# The high parallelism in this job is causing the SMT tests to run out of memory,
# so disabling for now.
SOLTEST_FLAGS: --no-smt
- <<: *steps_soltest
+ steps:
+ - soltest
t_ubu_force_release_soltest_all: &t_ubu_force_release_soltest_all
# NOTE: This definition is identical to t_ubu_soltest_all but in the workflow we make it depend on
@@ -1145,7 +1274,9 @@ jobs:
t_ubu_cli: &t_ubu_cli
<<: *base_ubuntu2204_small
- <<: *steps_cmdline_tests
+ parallelism: 8 # Should match number of tests in .circleci/parallel_cli_tests.py
+ steps:
+ - cmdline_tests
t_ubu_force_release_cli: &t_ubu_force_release_cli
<<: *t_ubu_cli
@@ -1162,18 +1293,21 @@ jobs:
t_ubu_asan_cli:
# Runs slightly faster on medium but we only run it nightly so efficiency matters more.
<<: *base_ubuntu2204
+ parallelism: 8 # Should match number of tests in .circleci/parallel_cli_tests.py
environment:
- TERM: xterm
+ <<: *base_ubuntu2204_env
ASAN_OPTIONS: check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2
# Suppress CLN memory leak.
# See: https://github.com/ethereum/solidity/issues/13891 for details.
LSAN_OPTIONS: suppressions=/root/project/.circleci/cln-asan.supp:print_suppressions=0
- <<: *steps_cmdline_tests
+ steps:
+ - cmdline_tests
t_ubu_asan_soltest:
<<: *base_ubuntu2204
parallelism: 20
environment:
+ <<: *base_ubuntu2204_env
EVM: << pipeline.parameters.evm-version >>
OPTIMIZE: 0
SOLTEST_FLAGS: --no-smt
@@ -1181,29 +1315,36 @@ jobs:
# Suppress CLN memory leak.
# See: https://github.com/ethereum/solidity/issues/13891 for details.
LSAN_OPTIONS: suppressions=/root/project/.circleci/cln-asan.supp
- <<: *steps_soltest
+ steps:
+ - soltest
t_ubu_asan_clang_soltest:
<<: *base_ubuntu2204_clang
parallelism: 20
environment:
+ <<: *base_ubuntu2204_clang_env
EVM: << pipeline.parameters.evm-version >>
OPTIMIZE: 0
SOLTEST_FLAGS: --no-smt
ASAN_OPTIONS: check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2
- <<: *steps_soltest
+ steps:
+ - soltest
t_ubu_ubsan_clang_soltest:
<<: *base_ubuntu2204_clang
parallelism: 20
environment:
+ <<: *base_ubuntu2204_clang_env
EVM: << pipeline.parameters.evm-version >>
SOLTEST_FLAGS: --no-smt
- <<: *steps_soltest
+ steps:
+ - soltest
t_ubu_ubsan_clang_cli:
<<: *base_ubuntu2204_clang
- <<: *steps_cmdline_tests
+ parallelism: 8 # Should match number of tests in .circleci/parallel_cli_tests.py
+ steps:
+ - cmdline_tests
t_ems_solcjs:
# Unlike other t_ems jobs this one actually runs 2x faster on medium (compared to small).
@@ -1229,9 +1370,9 @@ jobs:
t_ems_ext_hardhat:
<<: *base_node_small
docker:
- - image: cimg/node:18.11
+ - image: cimg/node:18.16
environment:
- TERM: xterm
+ <<: *base_node_small_env
HARDHAT_TESTS_SOLC_PATH: /tmp/workspace/soljson.js
steps:
- checkout
@@ -1242,16 +1383,16 @@ jobs:
name: Install dependencies
command: |
cd hardhat
- yarn
+ pnpm install
- run:
name: Run hardhat-core test suite
command: |
HARDHAT_TESTS_SOLC_VERSION=$(scripts/get_version.sh)
export HARDHAT_TESTS_SOLC_VERSION
- # NOTE: This is expected to work without running `yarn build` first.
+ # NOTE: This is expected to work without running `pnpm build` first.
cd hardhat/packages/hardhat-core
- yarn test
+ pnpm test
- matrix_notify_failure_unless_pr
t_ext:
@@ -1289,6 +1430,12 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- install_foundry
+ - run:
+ name: Ensure pnpm is installed if npm is present
+ command: |
+ if command -v npm &> /dev/null; then
+ sudo npm install -g pnpm
+ fi
- install_python3:
packages: requests
- run:
@@ -1427,7 +1574,8 @@ jobs:
name: "Run solc.exe to make sure build was successful."
command: .\build\solc\Release\solc.exe --version
shell: powershell.exe
- - store_artifacts: *artifact_solc_windows
+ - store_artifacts:
+ path: upload/
- persist_to_workspace:
root: build
paths:
@@ -1456,61 +1604,86 @@ jobs:
command: python -m pip install --user deepdiff colorama
- run:
name: Executing solc LSP test suite
- command: python ./test/lsp.py .\build\solc\Release\solc.exe --non-interactive
+ command: python test/lsp.py build\solc\Release\solc.exe --non-interactive
shell: powershell.exe
- - store_test_results: *store_test_results
- - store_artifacts: *artifacts_test_results
+ - store_test_results:
+ path: test_results/
+ - store_artifacts_test_results
- matrix_notify_failure_unless_pr
# Note: b_bytecode_ubu_static is required because b_ubu_static and b_ubu
# are currently built on different Ubuntu base images.
# It can be safely removed once we move both to the same Ubuntu version.
b_bytecode_ubu_static:
+ parameters:
+ preset:
+ type: string
<<: *base_ubuntu2004_small
- environment:
- TERM: xterm
- MAKEFLAGS: -j 2
- LC_ALL: C
+ parallelism: 2 # For prepare_bytecode_report
steps:
- checkout
- attach_workspace:
at: build
- prepare_bytecode_report:
label: "ubuntu2004-static"
- binary_path: "../build/solc/solc-static-linux"
+ binary_type: native
+ binary_path: "build/solc/solc-static-linux"
+ preset: "<< parameters.preset >>"
b_bytecode_ubu:
+ parameters:
+ preset:
+ type: string
<<: *base_ubuntu2204_small
- environment:
- TERM: xterm
- MAKEFLAGS: -j 2
- LC_ALL: C
+ parallelism: 2 # For prepare_bytecode_report
steps:
- checkout
- attach_workspace:
at: build
- prepare_bytecode_report:
label: "ubuntu"
- binary_path: "../build/solc/solc"
+ binary_type: native
+ binary_path: "build/solc/solc"
+ preset: "<< parameters.preset >>"
b_bytecode_osx:
+ parameters:
+ preset:
+ type: string
<<: *base_osx
- environment:
- TERM: xterm
- MAKEFLAGS: -j 5
- LC_ALL: C
+ parallelism: 2 # For prepare_bytecode_report
steps:
- checkout
- attach_workspace:
at: .
- prepare_bytecode_report:
label: "osx"
- binary_path: "../build/solc/solc"
+ binary_type: native
+ binary_path: "build/solc/solc"
+ preset: "<< parameters.preset >>"
+
+ b_bytecode_osx_intel:
+ parameters:
+ preset:
+ type: string
+ <<: *base_osx
+ parallelism: 2 # For prepare_bytecode_report
+ steps:
+ - checkout
+ - attach_workspace:
+ at: .
+ - prepare_bytecode_report:
+ label: "osx_intel"
+ binary_type: osx_intel
+ binary_path: "build/solc/solc"
+ preset: "<< parameters.preset >>"
b_bytecode_win:
+ parameters:
+ preset:
+ type: string
<<: *base_win
- environment:
- LC_ALL: C
+ parallelism: 2 # For prepare_bytecode_report
steps:
# NOTE: For bytecode generation we need the input files to be byte-for-byte identical on all
# platforms so line ending conversions must absolutely be disabled.
@@ -1522,57 +1695,39 @@ jobs:
at: build
- prepare_bytecode_report:
label: "windows"
- binary_path: "../build/solc/Release/solc.exe"
+ binary_type: native
+ binary_path: "build/solc/Release/solc.exe"
+ preset: "<< parameters.preset >>"
b_bytecode_ems:
+ parameters:
+ preset:
+ type: string
<<: *base_node_small
- environment:
- SOLC_EMSCRIPTEN: "On"
- LC_ALL: C
steps:
- checkout
- attach_workspace:
at: emscripten_build/libsolc
- - run: scripts/bytecodecompare/storebytecode.sh && mv -v report.txt bytecode-report-emscripten.txt
- - store_artifacts:
- path: bytecode-report-emscripten.txt
- - persist_to_workspace:
- root: .
- paths:
- - bytecode-report-emscripten.txt
- - matrix_notify_failure_unless_pr
+ - prepare_bytecode_report:
+ label: "emscripten"
+ binary_type: solcjs
+ binary_path: "emscripten_build/libsolc/soljson.js"
+ preset: "<< parameters.preset >>"
t_bytecode_compare:
<<: *base_ubuntu2204_small
environment:
- REPORT_FILES: |
- bytecode-report-emscripten.txt
- bytecode-report-ubuntu2004-static-json.txt
- bytecode-report-ubuntu2004-static-cli.txt
- bytecode-report-ubuntu-json.txt
- bytecode-report-ubuntu-cli.txt
- bytecode-report-osx-json.txt
- bytecode-report-osx-cli.txt
- bytecode-report-windows-json.txt
- bytecode-report-windows-cli.txt
+ <<: *base_ubuntu2204_small_env
+ <<: *bytecode_compare_env_presets
steps:
+ - checkout
- attach_workspace:
at: .
- - run:
- name: Compare reports
- command: diff --brief --report-identical-files --from-file $REPORT_FILES
- - run:
- name: Print diff
- when: on_fail
- command: diff --unified=0 --report-identical-files --from-file $REPORT_FILES | head --lines 50
- - run:
- name: Bundle reports into a single package
- when: on_fail
- command: zip all-bytecode-reports.zip $REPORT_FILES
+ - run: .circleci/compare_bytecode_reports.sh $PRESETS
- store_artifacts:
# NOTE: store_artifacts does not support the 'when' attribute.
# Fortunately when the artifact does not exist it just says "No artifact files found" and ignores it.
- path: all-bytecode-reports.zip
+ path: bytecode-reports-*.zip
- matrix_notify_failure_unless_pr
c_release_binaries:
@@ -1673,7 +1828,9 @@ workflows:
- t_ext: *job_ems_compile_ext_colony
- - t_ext: *job_native_test_ext_gnosis
+ # NOTE: We are disabling the gnosis test suite due to version discrepancies that are difficult to fix.
+ # Check again after (and if) https://github.com/safe-global/safe-contracts/pull/644 is merged.
+ #- 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_yield_liquidator
@@ -1682,7 +1839,8 @@ workflows:
- 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_gp2
+ # NOTE: We are disabling gp2 tests due to constant failures.
+ # - 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
@@ -1695,16 +1853,21 @@ workflows:
<<: *requires_nothing
requires:
- t_ems_compile_ext_colony
- - t_native_test_ext_gnosis
+ # NOTE: We are disabling the gnosis test suite due to version discrepancies that are difficult to fix.
+ # Check again after (and if) https://github.com/safe-global/safe-contracts/pull/644 is merged.
+ #- t_native_test_ext_gnosis
- t_native_test_ext_zeppelin
- t_native_test_ext_ens
- t_native_test_ext_yield_liquidator
- 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_gp2
+ # NOTE: We are disabling gp2 tests due to constant failures.
+ #- t_native_test_ext_gp2
+ # TODO: Dropping prb-math from the benchmarks since it is not implemented yet
+ # in the new Foundry external testing infrastructure.
+ # - t_native_test_ext_prb_math
# 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
@@ -1719,32 +1882,43 @@ workflows:
# Bytecode comparison:
- b_bytecode_ubu_static:
- <<: *requires_nothing
+ <<: *on_all_tags_and_branches
+ matrix: *bytecode_compare_preset_matrix
requires:
- b_ubu_static
- b_bytecode_ubu:
- <<: *requires_nothing
+ <<: *on_all_tags_and_branches
+ matrix: *bytecode_compare_preset_matrix
requires:
- b_ubu
- b_bytecode_win:
- <<: *requires_nothing
+ <<: *on_all_tags_and_branches
+ matrix: *bytecode_compare_preset_matrix
requires:
- b_win
- b_bytecode_osx:
- <<: *requires_nothing
+ <<: *on_all_tags_and_branches
+ matrix: *bytecode_compare_preset_matrix
+ requires:
+ - b_osx
+ - b_bytecode_osx_intel:
+ <<: *on_all_tags_and_branches
+ matrix: *bytecode_compare_preset_matrix
requires:
- b_osx
- b_bytecode_ems:
- <<: *requires_nothing
+ <<: *on_all_tags_and_branches
+ matrix: *bytecode_compare_preset_matrix
requires:
- b_ems
- t_bytecode_compare:
- <<: *requires_nothing
+ <<: *on_all_tags_and_branches
requires:
- b_bytecode_ubu_static
- b_bytecode_ubu
- b_bytecode_win
- b_bytecode_osx
+ - b_bytecode_osx_intel
- b_bytecode_ems
# Final artifacts
@@ -1755,35 +1929,3 @@ workflows:
- b_osx
- b_win
- b_ems
-
-# nightly:
-#
-# triggers:
-# - schedule:
-# cron: "0 0 * * *"
-# <<: *on_develop
-#
-# jobs:
-# # OSSFUZZ builds and (regression) tests
-# - b_ubu_ossfuzz: *requires_nothing
-# - t_ubu_ossfuzz: *requires_b_ubu_ossfuzz
-#
-# # Code Coverage enabled build and tests
-# - b_ubu_codecov: *requires_nothing
-# - t_ubu_codecov: *requires_b_ubu_codecov
-#
-# # ASan build and tests
-# - b_ubu_asan: *requires_nothing
-# - b_ubu_san_clang: *job_b_ubu_asan_clang
-# - t_ubu_asan_soltest: *requires_b_ubu_asan
-# - t_ubu_asan_clang_soltest: *requires_b_ubu_asan_clang
-# - t_ubu_asan_cli: *requires_b_ubu_asan
-#
-# # UBSan build and tests
-# - b_ubu_san_clang: *job_b_ubu_ubsan_clang
-# - t_ubu_ubsan_clang_soltest: *requires_b_ubu_ubsan_clang
-# - t_ubu_ubsan_clang_cli: *requires_b_ubu_ubsan_clang
-#
-# # Emscripten build and tests that take more than 15 minutes to execute
-# - b_ems: *requires_nothing
-# - t_ext: *job_ems_test_ext_colony
diff --git a/.circleci/osx_install_dependencies.sh b/.circleci/osx_install_dependencies.sh
index 5e779700c9f6..4ca4a31d503b 100755
--- a/.circleci/osx_install_dependencies.sh
+++ b/.circleci/osx_install_dependencies.sh
@@ -26,12 +26,8 @@
# ------------------------------------------------------------------------------
# note that the following directories may be cached by circleci:
-# - /usr/local/bin
-# - /usr/local/sbin
-# - /usr/local/lib
-# - /usr/local/include
-# - /usr/local/Cellar
-# - /usr/local/Homebrew
+# - /usr/local
+# - /opt/homebrew
set -eu
@@ -52,32 +48,69 @@ function validate_checksum {
if [ ! -f /usr/local/lib/libz3.a ] # if this file does not exists (cache was not restored), rebuild dependencies
then
- brew install boost
+ brew update
+ brew upgrade
brew install cmake
brew install wget
brew install coreutils
brew install diffutils
- ./scripts/install_obsolete_jsoncpp_1_7_4.sh
+ brew install grep
+
+ # writing to /usr/local/lib need administrative privileges.
+ sudo ./scripts/install_obsolete_jsoncpp_1_7_4.sh
+
+ # boost
+ boost_version="1.84.0"
+ boost_package="boost_${boost_version//./_}.tar.bz2"
+ boost_dir="boost_${boost_version//./_}"
+ wget "https://boostorg.jfrog.io/artifactory/main/release/$boost_version/source/$boost_package"
+ tar xf "$boost_package"
+ rm "$boost_package"
+ cd "$boost_dir"
+ ./bootstrap.sh --with-toolset=clang --with-libraries=thread,system,filesystem,program_options,serialization,test
+ # the default number of jobs that b2 is taking, is the number of detected available CPU threads.
+ sudo ./b2 -a address-model=64 architecture=arm+x86 install
+ cd ..
+ sudo rm -rf "$boost_dir"
# z3
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" 7601f844de6d906235140d0f76cca58be7ac716f3e2c29c35845aa24b24f73b9
- unzip "$z3_package"
+ z3_dir="z3-z3-$z3_version"
+ z3_package="z3-$z3_version.tar.gz"
+ wget "https://github.com/Z3Prover/z3/archive/refs/tags/$z3_package"
+ validate_checksum "$z3_package" a3735fabf00e1341adcc70394993c05fd3e2ae167a3e9bb46045e33084eb64a3
+ tar xf "$z3_package"
rm "$z3_package"
- cp "${z3_dir}/bin/libz3.a" /usr/local/lib
- cp "${z3_dir}/bin/z3" /usr/local/bin
- cp "${z3_dir}/include/"* /usr/local/include
- rm -r "$z3_dir"
+ cd "$z3_dir"
+ mkdir build
+ cd build
+ cmake -DCMAKE_OSX_ARCHITECTURES:STRING="x86_64;arm64" -DZ3_BUILD_LIBZ3_SHARED=false ..
+ make -j
+ sudo make install
+ cd ../..
+ rm -rf "$z3_dir"
# evmone
- 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" 1b7773779287d7908baca6b8d556a98800cbd7d6e5c910b55fa507642bc0a15c
- tar xzpf "$evmone_package" -C /usr/local
- rm "$evmone_package"
-
+ evmone_version="0.11.0"
+ if [[ $(uname -m) == 'arm64' ]]
+ then
+ # evmone does not provide any builds for apple silicon yet. so lets just build it locally.
+ # be aware that we are only building the arm version here, we don't build a universal binary.
+ git clone https://github.com/ethereum/evmone.git
+ cd evmone
+ git checkout "v${evmone_version}"
+ git submodule update --init
+ cmake -S . -B build
+ cmake --build build
+ cd build
+ sudo make install
+ cd ../..
+ rm -rf evmone
+ else
+ 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" 83ed20676681d9a31bd30cac399ab7c615ccab8adb8087cc2c7e9cd22b4d2efc
+ tar xzpf "$evmone_package" -C /usr/local
+ rm "$evmone_package"
+ fi
fi
diff --git a/.circleci/parallel_bytecode_report.sh b/.circleci/parallel_bytecode_report.sh
new file mode 100755
index 000000000000..d77b8a24f1ef
--- /dev/null
+++ b/.circleci/parallel_bytecode_report.sh
@@ -0,0 +1,80 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+#------------------------------------------------------------------------------
+# Splits all test source code into multiple files, generates bytecode and metadata
+# for each file and combines it into a single report.txt file.
+#
+# The script is meant to be executed in CI on all supported platforms. All generated
+# reports must be identical for a given compiler version.
+#
+# ------------------------------------------------------------------------------
+# This file is part of solidity.
+#
+# solidity is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# solidity is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with solidity. If not, see
+#
+# (c) 2023 solidity contributors.
+#------------------------------------------------------------------------------
+
+(( $# == 4 )) || { >&2 echo "Wrong number of arguments."; exit 1; }
+label="$1"
+binary_type="$2"
+binary_path="$3" # This path must be absolute
+preset="$4"
+
+[[ $binary_type == native || $binary_type == "osx_intel" || $binary_type == solcjs ]] || { >&2 echo "Invalid binary type: ${binary_type}"; exit 1; }
+
+# NOTE: Locale affects the order of the globbed files.
+export LC_ALL=C
+
+mkdir test-cases/
+cd test-cases/
+
+echo "Preparing input files"
+python3 ../scripts/isolate_tests.py ../test/
+
+# FIXME: These cases crash because of https://github.com/ethereum/solidity/issues/13583
+rm ./*_bytecode_too_large_*.sol ./*_combined_too_large_*.sol
+
+if [[ $binary_type == native || $binary_type == "osx_intel" ]]; then
+ interface=$(echo -e "standard-json\ncli" | circleci tests split)
+ echo "Selected interface: ${interface}"
+
+ echo "Generating bytecode reports"
+ python3 ../scripts/bytecodecompare/prepare_report.py \
+ "$binary_path" \
+ --interface "$interface" \
+ --preset "$preset" \
+ --execution-arch "$binary_type" \
+ --report-file "../bytecode-report-${label}-${interface}-${preset}.txt"
+else
+ echo "Installing solc-js"
+ git clone --depth 1 https://github.com/ethereum/solc-js.git solc-js
+ cp "$binary_path" solc-js/soljson.js
+
+ cd solc-js/
+ npm install
+ npm run build
+
+ cd ..
+ npm install ./solc-js/dist
+
+ cp ../scripts/bytecodecompare/prepare_report.js .
+
+ echo "Generating bytecode reports"
+ # shellcheck disable=SC2035
+ ./prepare_report.js \
+ --preset "$preset" \
+ *.sol > "../bytecode-report-${label}-${preset}.txt"
+fi
diff --git a/.circleci/parallel_cli_tests.py b/.circleci/parallel_cli_tests.py
new file mode 100755
index 000000000000..ef789218063a
--- /dev/null
+++ b/.circleci/parallel_cli_tests.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+
+import subprocess
+import sys
+
+# Slowest CLI tests, whose execution takes time on the order of minutes (as of June 2023).
+# When adding/removing items here, remember to update `parallelism` value in jobs that run this script.
+# TODO: We should switch to time-based splitting but that requires JUnit XML report support in cmdlineTests.sh.
+tests_to_run_in_parallel = [
+ '~ast_import_export', # ~7 min
+ '~ast_export_with_stop_after_parsing', # ~4 min
+ '~soljson_via_fuzzer', # ~3 min
+ '~via_ir_equivalence', # ~1 min
+ '~compilation_tests', # ~1 min
+ '~documentation_examples', # ~1 min
+ '*', # This item represents all the remaining tests
+]
+
+# Ask CircleCI to select a subset of tests for this parallel execution.
+# If `parallelism` in CI config is set correctly, we should get just one but we can handle any split.
+selected_tests = subprocess.check_output(
+ ['circleci', 'tests', 'split'],
+ input='\n'.join(tests_to_run_in_parallel),
+ encoding='ascii',
+).strip().split('\n')
+selected_tests = set(selected_tests) - {''}
+excluded_tests = set(tests_to_run_in_parallel) - selected_tests
+assert selected_tests.issubset(set(tests_to_run_in_parallel))
+
+if len(selected_tests) == 0:
+ print("No tests to run.")
+ sys.exit(0)
+
+if '*' in selected_tests:
+ filters = [arg for test_name in excluded_tests for arg in ['--exclude', test_name]]
+else:
+ filters = list(selected_tests)
+
+subprocess.run(
+ ['test/cmdlineTests.sh'] + filters,
+ stdin=sys.stdin,
+ stdout=sys.stdout,
+ stderr=sys.stderr,
+ check=True,
+)
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 49acab231fa4..30c09039ef79 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -36,7 +36,7 @@ assignees: ''
version is bumped to 0.5.0.
5. The 0.5.0 release is made.
-This behaviour works well with the :ref:`version pragma `.
+This behavior works well with the :ref:`version pragma `.
diff --git a/docs/internals/optimizer.rst b/docs/internals/optimizer.rst
index 9ede5ef2ac15..ab37872ffb17 100644
--- a/docs/internals/optimizer.rst
+++ b/docs/internals/optimizer.rst
@@ -27,7 +27,7 @@ optimized Yul IR for a Solidity source. Similarly, one can use ``solc --strict-a
for a stand-alone Yul mode.
.. note::
- The `peephole optimizer `_ and the inliner are always
+ The `peephole optimizer `_ is always
enabled by default and can only be turned off via the :ref:`Standard JSON `.
You can find more details on both optimizer modules and their optimization steps below.
@@ -316,7 +316,6 @@ Abbreviation Full name
``L`` :ref:`load-resolver`
``M`` :ref:`loop-invariant-code-motion`
``r`` :ref:`redundant-assign-eliminator`
-``R`` :ref:`reasoning-based-simplifier` - highly experimental
``m`` :ref:`rematerialiser`
``V`` :ref:`SSA-reverser`
``a`` :ref:`SSA-transform`
@@ -330,10 +329,6 @@ 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.
-The ReasoningBasedSimplifier is an optimizer step that is currently not enabled
-in the default set of steps. It uses an SMT solver to simplify arithmetic expressions
-and boolean conditions. It has not received thorough testing or validation yet and can produce
-non-reproducible results, so please use with care!
Selecting Optimizations
-----------------------
@@ -575,7 +570,7 @@ It is not applied to loop iteration-condition, because the loop control flow doe
this "outlining" of the inner expressions in all cases. We can sidestep this limitation by applying
:ref:`for-loop-condition-into-body` to move the iteration condition into loop body.
-The final program should be in a form such that (with the exception of loop conditions)
+The final program should be in an *expression-split form*, where (with the exception of loop conditions)
function calls cannot appear nested inside expressions
and all function call arguments have to be variables.
@@ -863,22 +858,6 @@ Works best if the code is in SSA form.
Prerequisite: Disambiguator, ForLoopInitRewriter.
-.. _reasoning-based-simplifier:
-
-ReasoningBasedSimplifier
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-This optimizer uses SMT solvers to check whether ``if`` conditions are constant.
-
-- If ``constraints AND condition`` is UNSAT, the condition is never true and the whole body can be removed.
-- If ``constraints AND NOT condition`` is UNSAT, the condition is always true and can be replaced by ``1``.
-
-The simplifications above can only be applied if the condition is movable.
-
-It is only effective on the EVM dialect, but safe to use on other dialects.
-
-Prerequisite: Disambiguator, SSATransform.
-
Statement-Scale Simplifications
-------------------------------
@@ -1213,7 +1192,7 @@ This component can only be used on sources with unique names.
FullInliner
^^^^^^^^^^^
-The Full Inliner replaces certain calls of certain functions
+The FullInliner replaces certain calls of certain functions
by the function's body. This is not very helpful in most cases, because
it just increases the code size but does not have a benefit. Furthermore,
code is usually very expensive and we would often rather have shorter
@@ -1237,6 +1216,11 @@ we can run the optimizer on this specialized function. If it
results in heavy gains, the specialized function is kept,
otherwise the original function is used instead.
+FunctionHoister and ExpressionSplitter are recommended as prerequisites since they make the step
+more efficient, but are not required for correctness.
+In particular, function calls with other function calls as arguments are not inlined, but running
+ExpressionSplitter beforehand ensures that there are no such calls in the input.
+
Cleanup
-------
@@ -1279,8 +1263,8 @@ This is a tiny step that helps in reversing the effects of the SSA transform
if it is combined with the Common Subexpression Eliminator and the
Unused Pruner.
-The SSA form we generate is detrimental to code generation on the EVM and
-WebAssembly alike because it generates many local variables. It would
+The SSA form we generate is detrimental to code generation
+because it produces many local variables. It would
be better to just re-use existing variables with assignments instead of
fresh variable declarations.
@@ -1398,15 +1382,3 @@ into
}
The LiteralRematerialiser should be run before this step.
-
-
-WebAssembly specific
---------------------
-
-MainFunction
-^^^^^^^^^^^^
-
-Changes the topmost block to be a function with a specific name ("main") which has no
-inputs nor outputs.
-
-Depends on the Function Grouper.
diff --git a/docs/introduction-to-smart-contracts.rst b/docs/introduction-to-smart-contracts.rst
index acef49122f33..48768cb8bfed 100644
--- a/docs/introduction-to-smart-contracts.rst
+++ b/docs/introduction-to-smart-contracts.rst
@@ -282,7 +282,7 @@ the source account is also not modified.
Furthermore, a transaction is always cryptographically signed by the sender (creator).
This makes it straightforward to guard access to specific modifications of the
database. In the example of the electronic currency, a simple check ensures that
-only the person holding the keys to the account can transfer money from it.
+only the person holding the keys to the account can transfer some compensation, e.g. Ether, from it.
.. index:: ! block
@@ -564,7 +564,7 @@ contracts, the Ether is forever lost.
.. warning::
From version 0.8.18 and up, the use of ``selfdestruct`` in both Solidity and Yul will trigger a
- deprecation warning, since the ``SELFDESTRUCT`` opcode will eventually undergo breaking changes in behaviour
+ deprecation warning, since the ``SELFDESTRUCT`` opcode will eventually undergo breaking changes in behavior
as stated in `EIP-6049 `_.
.. warning::
@@ -591,7 +591,7 @@ Precompiled Contracts
There is a small set of contract addresses that are special:
The address range between ``1`` and (including) ``8`` contains
"precompiled contracts" that can be called as any other contract
-but their behaviour (and their gas consumption) is not defined
+but their behavior (and their gas consumption) is not defined
by EVM code stored at that address (they do not contain code)
but instead is implemented in the EVM execution environment itself.
diff --git a/docs/ir-breaking-changes.rst b/docs/ir-breaking-changes.rst
index 9cee46793284..4917cfc7158d 100644
--- a/docs/ir-breaking-changes.rst
+++ b/docs/ir-breaking-changes.rst
@@ -15,13 +15,13 @@ The IR-based code generator was introduced with an aim to not only allow
code generation to be more transparent and auditable but also
to enable more powerful optimization passes that span across functions.
-You can enable it on the command line using ``--via-ir``
+You can enable it on the command-line using ``--via-ir``
or with the option ``{"viaIR": true}`` in standard-json and we
encourage everyone to try it out!
For several reasons, there are tiny semantic differences between the old
and the IR-based code generator, mostly in areas where we would not
-expect people to rely on this behaviour anyway.
+expect people to rely on this behavior anyway.
This section highlights the main differences between the old and the IR-based codegen.
Semantic Only Changes
@@ -30,6 +30,8 @@ Semantic Only Changes
This section lists the changes that are semantic-only, thus potentially
hiding new and different behavior in existing code.
+.. _state-variable-initialization-order:
+
- The order of state variable initialization has changed in case of inheritance.
The order used to be:
diff --git a/docs/logo.svg b/docs/logo.svg
index 86b9f4995b24..19391843b407 100644
--- a/docs/logo.svg
+++ b/docs/logo.svg
@@ -1,27 +1,8 @@
-
-
-
-