Skip to content

Commit 35e9e89

Browse files
Merge pull request #106 from yanghang8612/merge_from_v0.8.27
Merge from v0.8.27
2 parents 3e2818d + cd07cb5 commit 35e9e89

1,054 files changed

Lines changed: 18673 additions & 8369 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ version: 2.1
99
parameters:
1010
ubuntu-2004-docker-image:
1111
type: string
12-
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-23
13-
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:84a1fb8771236e8d9aa5c615a425b8929e56a6e4f150a60078c8d74a1ceaa6c2"
12+
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-24
13+
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:b8b645fa7ab40d55f2d16eac295d16ca01ec51d32be7d668ae6eaecd47dbd763"
1414
ubuntu-2204-docker-image:
1515
type: string
16-
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-8
17-
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:1c3a4118218640b2bf632242979a63d48f3d9c70d48be9574332f2dbbd04b192"
16+
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-9
17+
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:80247de9655b1f39afd4ac22b14266bc9b9a0d64b283ae8fb9cb5b8250e4e77d"
1818
ubuntu-2204-clang-docker-image:
1919
type: string
20-
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204.clang-7
21-
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:0f47e733e100080c4174381c262cfcf974bc8e7c3c41b8dff611b9641c82f714"
20+
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204.clang-8
21+
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:2662376fe0e1ec2d346495a19a6d64508c1048d5a7325d8600c33c343fa64a0f"
2222
ubuntu-clang-ossfuzz-docker-image:
2323
type: string
2424
# solbuildpackpusher/solidity-buildpack-deps:ubuntu.clang.ossfuzz-6
@@ -30,7 +30,7 @@ parameters:
3030
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:c57f2bfb8c15d70fe290629358dd1c73dc126e3760f443b54764797556b887d4"
3131
evm-version:
3232
type: string
33-
default: london
33+
default: cancun
3434

3535
orbs:
3636
win: circleci/windows@2.2.0
@@ -875,7 +875,7 @@ jobs:
875875
name: Check spelling
876876
command: |
877877
~/.local/bin/codespell \
878-
--skip "*.enc,.git,Dockerfile*,LICENSE,codespell_whitelist.txt,codespell_ignored_lines.txt" \
878+
--skip "*.enc,.git,Dockerfile*,LICENSE,codespell_whitelist.txt,codespell_ignored_lines.txt,deps" \
879879
--ignore-words scripts/codespell_whitelist.txt \
880880
--exclude-file scripts/codespell_ignored_lines.txt
881881
- matrix_notify_failure_unless_pr
@@ -1053,7 +1053,7 @@ jobs:
10531053
<<: *base_ubuntu2004_xlarge
10541054
environment:
10551055
<<: *base_ubuntu2204_xlarge_env
1056-
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DUSE_Z3_DLOPEN=ON -DUSE_CVC4=OFF -DSOLC_STATIC_STDLIBS=ON
1056+
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DUSE_Z3_DLOPEN=ON -DSOLC_STATIC_STDLIBS=ON
10571057
steps:
10581058
- checkout
10591059
- run_build
@@ -1113,7 +1113,7 @@ jobs:
11131113
environment:
11141114
<<: *base_ubuntu2204_large_env
11151115
CMAKE_BUILD_TYPE: Debug
1116-
CMAKE_OPTIONS: -DCMAKE_CXX_STANDARD=20 -DUSE_CVC4=OFF
1116+
CMAKE_OPTIONS: -DCMAKE_CXX_STANDARD=20
11171117
MAKEFLAGS: -j 10
11181118
steps:
11191119
- checkout
@@ -1282,7 +1282,7 @@ jobs:
12821282
- run:
12831283
name: Install runtime dependencies
12841284
command: |
1285-
pacman --noconfirm -Syu --noprogressbar --needed z3
1285+
pacman --noconfirm -Syu --noprogressbar --needed z3 git
12861286
- soltest
12871287

12881288
t_ubu_clang_soltest: &t_ubu_clang_soltest
@@ -1447,6 +1447,14 @@ jobs:
14471447
# TODO: temporarily set hardhat stack traces tests to use cancun hardfork
14481448
# Remove this when hardhat switch to cancun by default: https://github.com/NomicFoundation/hardhat/issues/4851
14491449
sed -i 's/hardfork: "shanghai",/hardfork: "cancun",/' test/internal/hardhat-network/stack-traces/execution.ts
1450+
# TODO: Remove these tests because they rely on specific stack sequence which has changed since
1451+
# Remove when hardhat properly fix a specific version for the tests: https://github.com/NomicFoundation/hardhat/issues/5443
1452+
rm -rf test/internal/hardhat-network/stack-traces/test-files/0_8/revert-without-message/modifiers/call-message/multiple-modifiers-require/
1453+
rm -rf test/internal/hardhat-network/stack-traces/test-files/0_8/revert-without-message/modifiers/create-message/multiple-modifiers-require/
1454+
rm -rf test/internal/hardhat-network/stack-traces/test-files/0_8/revert-without-message/revert-without-message/within-receive/between-statements/
1455+
rm -rf test/internal/hardhat-network/stack-traces/test-files/0_8/revert-without-message/revert-without-message/within-receive/no-other-statements/
1456+
rm -rf test/internal/hardhat-network/stack-traces/test-files/0_8/revert-without-message/revert-without-message/within-receive/statement-after/
1457+
rm -rf test/internal/hardhat-network/stack-traces/test-files/0_8/revert-without-message/revert-without-message/within-receive/statement-before/
14501458
pnpm test
14511459
- matrix_notify_failure_unless_pr
14521460

@@ -1542,6 +1550,19 @@ jobs:
15421550
- run:
15431551
name: Summarize reports
15441552
command: cat reports/externalTests/all-benchmarks.json | scripts/externalTests/summarize_benchmarks.sh > reports/externalTests/summarized-benchmarks.json
1553+
- store_artifacts:
1554+
path: reports/externalTests/all-benchmarks.json
1555+
- store_artifacts:
1556+
path: reports/externalTests/summarized-benchmarks.json
1557+
- run:
1558+
name: Check CircleCI token presence; Skip remaining steps if the token is not present.
1559+
command: |
1560+
# NOTE: download_benchmarks.py requires CIRCLECI_TOKEN environment variable to be set to
1561+
# a valid CircleCI API token to download the benchmark artifacts.
1562+
if [[ -z "$CIRCLECI_TOKEN" ]]; then
1563+
echo "Skipping download benchmarks..."
1564+
circleci-agent step halt
1565+
fi
15451566
- run:
15461567
name: Download reports from base branch
15471568
command: |
@@ -1586,10 +1607,6 @@ jobs:
15861607
base-branch/all-benchmarks-*.json \
15871608
all-benchmarks.json > diff/benchmark-diff-all-table-inplace-absolute.md
15881609
fi
1589-
- store_artifacts:
1590-
path: reports/externalTests/all-benchmarks.json
1591-
- store_artifacts:
1592-
path: reports/externalTests/summarized-benchmarks.json
15931610
- store_artifacts:
15941611
path: reports/externalTests/diff/
15951612
- store_artifacts:
@@ -1648,7 +1665,7 @@ jobs:
16481665
shell: powershell.exe
16491666
- run:
16501667
name: Install LSP test dependencies
1651-
command: python -m pip install --user deepdiff colorama
1668+
command: python -m pip install --user numpy deepdiff colorama
16521669
- run:
16531670
name: Executing solc LSP test suite
16541671
command: python test/lsp.py build\solc\Release\solc.exe --non-interactive

.circleci/osx_install_dependencies.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ then
8585
sudo mv /tmp/eldarica/{eld,eld-client,target,eldEnv} /usr/local/bin
8686
rm -rf /tmp/{eldarica,eld_binaries.zip}
8787

88+
#cvc5
89+
cvc5_version="1.1.2"
90+
wget "https://github.com/cvc5/cvc5/releases/download/cvc5-${cvc5_version}/cvc5-macOS-arm64-static.zip" -O /tmp/cvc5.zip
91+
validate_checksum /tmp/cvc5.zip 2017d683d924676cb713865c6d4fcf70115c65b7ec2848f242ab938902f115b5
92+
unzip /tmp/cvc5.zip -x "cvc5-macOS-arm64-static/lib/cmake/*" -d /tmp
93+
sudo mv /tmp/cvc5-macOS-arm64-static/bin/* /usr/local/bin
94+
sudo mv /tmp/cvc5-macOS-arm64-static/include/* /usr/local/include
95+
sudo mv /tmp/cvc5-macOS-arm64-static/lib/* /usr/local/lib
96+
rm -rf /tmp/{cvc5-macOS-arm64-static,cvc5.zip}
97+
8898
# z3
8999
z3_version="4.12.1"
90100
z3_dir="z3-z3-$z3_version"

.circleci/parallel_bytecode_report.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ cd test-cases/
4444
echo "Preparing input files"
4545
python3 ../scripts/isolate_tests.py ../test/
4646

47-
# FIXME: These cases crash because of https://github.com/ethereum/solidity/issues/13583
48-
rm ./*_bytecode_too_large_*.sol ./*_combined_too_large_*.sol
49-
5047
if [[ $binary_type == native || $binary_type == "osx_intel" ]]; then
5148
interface=$(echo -e "standard-json\ncli" | circleci tests split)
5249
echo "Selected interface: ${interface}"

.circleci/soltest_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ REPODIR="$(realpath "$(dirname "$0")"/..)"
3131
# shellcheck source=scripts/common.sh
3232
source "${REPODIR}/scripts/common.sh"
3333

34-
DEFAULT_EVM_VALUES=(constantinople petersburg istanbul berlin london paris shanghai cancun)
34+
DEFAULT_EVM_VALUES=(constantinople petersburg istanbul berlin london paris shanghai cancun prague)
3535
# Deserialize the EVM_VALUES array if it was provided as argument or
3636
# set EVM_VALUES to the default values.
3737
IFS=" " read -ra EVM_VALUES <<< "${1:-${DEFAULT_EVM_VALUES[@]}}"

.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
# the build context to the docker image build server
33
/build
44

5-
# in-tree builds
6-
/deps

.github/workflows/buildpack-deps.yml

Whitespace-only changes.

.gitignore

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*.o
1111
*.obj
1212
*.pyc
13-
__pycache__
13+
__pycache__/
1414

1515
# Precompiled Headers
1616
*.gch
@@ -36,12 +36,16 @@ __pycache__
3636
*.app
3737

3838
# Build directory
39-
/build*
39+
/cmake-build-*/
40+
/build*/
4041
emscripten_build/
41-
/docs/_build
42+
/docs/_build/
4243
/docs/_static/robots.txt
43-
/deps
44-
/reports
44+
/deps/
45+
46+
# Reports and benchmarks
47+
/reports/
48+
/benchmarks/
4549

4650
# vim stuff
4751
[._]*.sw[a-p]

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "deps/nlohmann-json"]
2+
path = deps/nlohmann-json
3+
url = https://github.com/nlohmann/json.git
4+
[submodule "deps/range-v3"]
5+
path = deps/range-v3
6+
url = https://github.com/ericniebler/range-v3.git
7+
[submodule "deps/fmtlib"]
8+
path = deps/fmtlib
9+
url = https://github.com/fmtlib/fmt.git

CMakeLists.txt

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ include(EthPolicy)
2121
eth_policy()
2222

2323
# project name and version should be set after cmake_policy CMP0048
24-
set(PROJECT_VERSION "0.8.26")
24+
set(PROJECT_VERSION "0.8.27")
2525
# OSX target needed in order to support std::visit
2626
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
2727
project(solidity VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
@@ -34,22 +34,30 @@ endif()
3434

3535
option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)
3636
option(SOLC_STATIC_STDLIBS "Link solc against static versions of libgcc and libstdc++ on supported platforms" OFF)
37-
option(STRICT_Z3_VERSION "Use the latest version of Z3" ON)
37+
option(STRICT_Z3_VERSION "Require the exact version of Z3 solver expected by our test suite." ON)
3838
option(PEDANTIC "Enable extra warnings and pedantic build flags. Treat all warnings as errors." ON)
3939
option(PROFILE_OPTIMIZER_STEPS "Output performance metrics for the optimiser steps." OFF)
40-
option(USE_SYSTEM_LIBRARIES "Use system libraries" OFF)
41-
option(ONLY_BUILD_SOLIDITY_LIBRARIES "Only build solidity libraries" OFF)
42-
option(STRICT_NLOHMANN_JSON_VERSION "Strictly check installed nlohmann json version" ON)
43-
mark_as_advanced(USE_SYSTEM_LIBRARIES)
40+
option(
41+
IGNORE_VENDORED_DEPENDENCIES
42+
"Ignore libraries provided as submodules of the repository and allow CMake to look for \
43+
them in the typical locations, including system-wide dirs."
44+
OFF
45+
)
46+
option(
47+
ONLY_BUILD_SOLIDITY_LIBRARIES
48+
"Only build library targets that can be statically linked against. Do not build executables or tests."
49+
OFF
50+
)
51+
mark_as_advanced(PROFILE_OPTIMIZER_STEPS)
52+
mark_as_advanced(IGNORE_VENDORED_DEPENDENCIES)
4453
mark_as_advanced(ONLY_BUILD_SOLIDITY_LIBRARIES)
45-
mark_as_advanced(STRICT_NLOHMANN_JSON_VERSION)
4654

4755
# Setup cccache.
4856
include(EthCcache)
4957

5058
# Let's find our dependencies
5159
include(EthDependencies)
52-
if (NOT USE_SYSTEM_LIBRARIES)
60+
if (NOT IGNORE_VENDORED_DEPENDENCIES)
5361
include(fmtlib)
5462
include(nlohmann-json)
5563
include(range-v3)
@@ -86,15 +94,15 @@ configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/license.h.in" include/lice
8694

8795
include(EthOptions)
8896
configure_project(TESTS)
89-
set(LATEST_Z3_VERSION "4.12.1")
97+
set(TESTED_Z3_VERSION "4.12.1")
9098
set(MINIMUM_Z3_VERSION "4.8.16")
9199
find_package(Z3)
92100
if (${Z3_FOUND})
93101
if (${STRICT_Z3_VERSION})
94-
if (NOT ("${Z3_VERSION_STRING}" VERSION_EQUAL ${LATEST_Z3_VERSION}))
102+
if (NOT ("${Z3_VERSION_STRING}" VERSION_EQUAL ${TESTED_Z3_VERSION}))
95103
message(
96104
FATAL_ERROR
97-
"SMTChecker tests require Z3 ${LATEST_Z3_VERSION} for all tests to pass.\n\
105+
"SMTChecker tests require Z3 ${TESTED_Z3_VERSION} for all tests to pass.\n\
98106
Build with -DSTRICT_Z3_VERSION=OFF if you want to use a different version. \
99107
You can also use -DUSE_Z3=OFF to build without Z3. In both cases use --no-smt when running tests."
100108
)
@@ -133,15 +141,11 @@ elseif (${Z3_FOUND})
133141
message("Z3 SMT solver found. This enables optional SMT checking with Z3.")
134142
endif()
135143

136-
find_package(CVC4 QUIET)
137-
if (${CVC4_FOUND})
138-
add_definitions(-DHAVE_CVC4)
139-
message("CVC4 SMT solver found. This enables optional SMT checking with CVC4.")
140-
endif()
144+
find_program(CVC5_PATH cvc5)
141145

142-
if (NOT (${Z3_FOUND} OR ${CVC4_FOUND}))
146+
if (NOT (${Z3_FOUND} OR CVC5_PATH))
143147
message("No SMT solver found (or it has been forcefully disabled). Optional SMT checking will not be available.\
144-
\nPlease install Z3 or CVC4 or remove the option disabling them (USE_Z3, USE_CVC4).")
148+
\nPlease install Z3 or cvc5 or remove the option disabling them (USE_Z3).")
145149
endif()
146150

147151
add_subdirectory(libsolutil)

Changelog.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
### 0.8.27 (2024-09-04)
2+
3+
Language Features:
4+
* Accept declarations of state variables with ``transient`` data location (parser support only, no code generation yet).
5+
* Make ``require(bool, Error)`` available when using the legacy pipeline.
6+
* Yul: Parsing rules for source location comments have been relaxed: Whitespace between the location components as well as single-quoted code snippets are now allowed.
7+
8+
9+
Compiler Features:
10+
* Commandline Interface: Add ``--transient-storage-layout`` output.
11+
* Commandline Interface: Allow the use of ``--asm-json`` output option in assembler mode to export EVM assembly of the contracts in JSON format.
12+
* Commandline Interface: Do not perform IR optimization when only unoptimized IR is requested.
13+
* Constant Optimizer: Uses ``PUSH0`` if supported by the selected evm version.
14+
* Error Reporting: Unimplemented features are now properly reported as errors instead of being handled as if they were bugs.
15+
* EVM: Support for the EVM version "Prague".
16+
* Peephole Optimizer: ``PUSH0``, when supported, is duplicated explicitly instead of using ``DUP1``.
17+
* Peephole Optimizer: Remove identical code snippets that terminate the control flow if they occur one after another.
18+
* SMTChecker: Add CHC engine check for underflow and overflow in unary minus operation.
19+
* SMTChecker: Replace CVC4 as a possible BMC backend with cvc5.
20+
* Standard JSON Interface: Add ``transientStorageLayout`` output.
21+
* Standard JSON Interface: Do not perform IR optimization when only unoptimized IR is requested.
22+
* Yul: Drop the deprecated typed Yul dialect that was only accessible via ``--yul`` in the CLI.
23+
* Yul: The presence of types in untyped Yul dialects is now a parser error.
24+
* Yul Optimizer: Caching of optimized IR to speed up optimization of contracts with bytecode dependencies.
25+
* Yul Optimizer: The optimizer now treats some previously unrecognized identical literals as identical.
26+
27+
28+
Bugfixes:
29+
* Assembler: Fix ICE caused by imprecise calculation of required size of tags in bytecode when code size is above 255.
30+
* Parser: Fix spuriously emitted parser error for unary plus operations when used as binary operator in some cases.
31+
* SMTChecker: Fix error that reports invalid number of verified checks for BMC and CHC engines.
32+
* SMTChecker: Fix formatting of unary minus expressions in invariants.
33+
* SMTChecker: Fix internal compiler error when reporting proved targets for BMC engine.
34+
* SMTChecker: Fix SMT logic error when assigning to an array of contracts or functions.
35+
* Standard JSON Interface: For Yul input, properly produce output artifacts in case of warnings.
36+
* TypeChecker: Fix segfault when assigning nested tuple to tuple.
37+
* Yul IR Code Generation: Deterministic order of Yul subobjects.
38+
* Yul Optimizer: Fix Yul source locations always referring to unoptimized source, even in optimized outputs.
39+
* Yul Optimizer: Fix warnings being generated twice when there are no errors.
40+
* Yul Optimizer: Name simplification could lead to forbidden identifiers with a leading and/or trailing dot, e.g., ``x._`` would get simplified into ``x.``.
41+
* Yul Parser: Fix segfault when parsing very long location comments.
42+
43+
Build System:
44+
* Change build system to use git submodules for some dependencies (nlohmann-json, fmtlib & range-v3).
45+
146
### 0.8.26 (2024-05-21)
247

348
Language Features:

0 commit comments

Comments
 (0)