Skip to content

Commit 23d335f

Browse files
authored
Merge pull request #6630 from ethereum/develop
Merge develop into release for 0.5.8
2 parents 6da8b01 + 18104a0 commit 23d335f

File tree

684 files changed

+12406
-3635
lines changed

Some content is hidden

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

684 files changed

+12406
-3635
lines changed

.circleci/config.yml

Lines changed: 122 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,20 @@ defaults:
1717
[ -n "$COVERAGE" -a "$CIRCLE_BRANCH" != release -a -z "$CIRCLE_TAG" ] && CMAKE_OPTIONS="$CMAKE_OPTIONS -DCOVERAGE=ON"
1818
cmake .. -DCMAKE_BUILD_TYPE=Release $CMAKE_OPTIONS
1919
make -j4
20+
- run_build_ossfuzz: &run_build_ossfuzz
21+
name: Build_ossfuzz
22+
command: |
23+
mkdir -p build
24+
cd build
25+
/src/LPM/external.protobuf/bin/protoc --proto_path=../test/tools/ossfuzz yulProto.proto --cpp_out=../test/tools/ossfuzz
26+
cmake .. -DCMAKE_BUILD_TYPE=Release $CMAKE_OPTIONS
27+
make ossfuzz ossfuzz_proto -j4
2028
- run_tests: &run_tests
2129
name: Tests
2230
command: scripts/tests.sh --junit_report test_results
31+
- run_regressions: &run_regressions
32+
name: Regression tests
33+
command: scripts/regressions.py -o test_results
2334
- solc_artifact: &solc_artifact
2435
path: build/solc/solc
2536
destination: solc
@@ -29,6 +40,15 @@ defaults:
2940
- solc/solc
3041
- test/soltest
3142
- test/tools/solfuzzer
43+
- ossfuzz_artifacts: &ossfuzz_artifacts
44+
root: build
45+
paths:
46+
- test/tools/ossfuzz/solc_opt_ossfuzz
47+
- test/tools/ossfuzz/solc_noopt_ossfuzz
48+
- test/tools/ossfuzz/const_opt_ossfuzz
49+
- test/tools/ossfuzz/strictasm_diff_ossfuzz
50+
- test/tools/ossfuzz/yul_proto_ossfuzz
51+
- test/tools/ossfuzz/yul_proto_diff_ossfuzz
3252

3353
version: 2
3454
jobs:
@@ -86,7 +106,7 @@ jobs:
86106
command: |
87107
test/solcjsTests.sh /tmp/workspace/soljson.js $(cat /tmp/workspace/version.txt)
88108
89-
test_emscripten_external:
109+
test_emscripten_external_gnosis:
90110
docker:
91111
- image: circleci/node:10
92112
environment:
@@ -96,14 +116,23 @@ jobs:
96116
- attach_workspace:
97117
at: /tmp/workspace
98118
- run:
99-
name: Install external tests deps
119+
name: External GnosisSafe tests
100120
command: |
101-
node --version
102-
npm --version
121+
test/externalTests/gnosis.sh /tmp/workspace/soljson.js || test/externalTests/gnosis.sh /tmp/workspace/soljson.js
122+
123+
test_emscripten_external_zeppelin:
124+
docker:
125+
- image: circleci/node:10
126+
environment:
127+
TERM: xterm
128+
steps:
129+
- checkout
130+
- attach_workspace:
131+
at: /tmp/workspace
103132
- run:
104-
name: External tests
133+
name: External Zeppelin tests
105134
command: |
106-
test/externalTests.sh /tmp/workspace/soljson.js || test/externalTests.sh /tmp/workspace/soljson.js
135+
test/externalTests/zeppelin.sh /tmp/workspace/soljson.js || test/externalTests/zeppelin.sh /tmp/workspace/soljson.js
107136
108137
build_x86_linux:
109138
docker:
@@ -117,8 +146,7 @@ jobs:
117146
name: Install build dependencies
118147
command: |
119148
apt-get -qq update
120-
apt-get -qy install cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev
121-
./scripts/install_obsolete_jsoncpp_1_7_4.sh
149+
apt-get -qy install cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev libjsoncpp-dev=1.7.4-\*
122150
- run: *setup_prerelease_commit_hash
123151
- run: *run_build
124152
- store_artifacts: *solc_artifact
@@ -139,8 +167,7 @@ jobs:
139167
name: Install build dependencies
140168
command: |
141169
apt-get -qq update
142-
apt-get -qy install cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev
143-
./scripts/install_obsolete_jsoncpp_1_7_4.sh
170+
apt-get -qy install cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev libjsoncpp-dev=1.7.4-\*
144171
- run: *setup_prerelease_commit_hash
145172
- run: *run_build
146173

@@ -179,8 +206,7 @@ jobs:
179206
name: Install build dependencies
180207
command: |
181208
apt-get -qq update
182-
apt-get -qy install clang-7 cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev
183-
./scripts/install_obsolete_jsoncpp_1_7_4.sh
209+
apt-get -qy install clang-7 cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev libjsoncpp-dev=1.7.4-\*
184210
- run: *setup_prerelease_commit_hash
185211
- run: *run_build
186212
- store_artifacts: *solc_artifact
@@ -306,12 +332,19 @@ jobs:
306332
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-7 1
307333
- run: mkdir -p test_results
308334
- run:
309-
name: Run tests with ASAN
335+
name: Run soltest with ASAN
310336
command: |
311337
ulimit -a
312338
# Increase stack size because ASan makes stack frames bigger and that breaks our assumptions (in tests).
313339
ulimit -s 16384
314340
build/test/soltest --logger=JUNIT,test_suite,test_results/result.xml -- --no-ipc --testpath test
341+
- run:
342+
name: Run commandline tests with ASAN
343+
command: |
344+
ulimit -a
345+
# Increase stack size because ASan makes stack frames bigger and that breaks our assumptions (in tests).
346+
ulimit -s 16384
347+
test/cmdlineTests.sh
315348
- store_test_results:
316349
path: test_results/
317350
- store_artifacts:
@@ -381,6 +414,51 @@ jobs:
381414
path: docs/_build/html/
382415
destination: docs-html
383416

417+
build_x86_linux_ossfuzz:
418+
docker:
419+
- image: buildpack-deps:cosmic
420+
environment:
421+
TERM: xterm
422+
CC: /usr/bin/clang-7
423+
CXX: /usr/bin/clang++-7
424+
CMAKE_OPTIONS: -DOSSFUZZ=1 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/libfuzzer.cmake
425+
steps:
426+
- checkout
427+
- run:
428+
name: Install build dependencies
429+
command: |
430+
apt-get -qq update
431+
apt-get -qy install clang-7 cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev libbz2-dev ninja-build zlib1g-dev libjsoncpp-dev=1.7.4-\*
432+
./scripts/install_lpm.sh
433+
./scripts/install_libfuzzer.sh
434+
- run: *setup_prerelease_commit_hash
435+
- run: *run_build_ossfuzz
436+
- persist_to_workspace: *ossfuzz_artifacts
437+
438+
test_x86_ossfuzz_regression:
439+
docker:
440+
- image: buildpack-deps:cosmic
441+
environment:
442+
TERM: xterm
443+
steps:
444+
- checkout
445+
- attach_workspace:
446+
at: build
447+
- run:
448+
name: Install dependencies
449+
command: |
450+
apt-get -qq update
451+
apt-get -qy install libcvc4-dev llvm-7-dev
452+
./scripts/download_ossfuzz_corpus.sh
453+
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-7 1
454+
- run: mkdir -p test_results
455+
- run: *run_regressions
456+
- store_test_results:
457+
path: test_results/
458+
- store_artifacts:
459+
path: test_results/
460+
destination: test_results/
461+
384462
workflows:
385463
version: 2
386464
build_all:
@@ -393,7 +471,11 @@ workflows:
393471
<<: *build_on_tags
394472
requires:
395473
- build_emscripten
396-
- test_emscripten_external:
474+
- test_emscripten_external_zeppelin:
475+
<<: *build_on_tags
476+
requires:
477+
- build_emscripten
478+
- test_emscripten_external_gnosis:
397479
<<: *build_on_tags
398480
requires:
399481
- build_emscripten
@@ -406,9 +488,7 @@ workflows:
406488
requires:
407489
- build_x86_linux
408490
- test_x86_clang7_asan:
409-
filters:
410-
branches:
411-
only: develop
491+
<<: *build_on_tags
412492
requires:
413493
- build_x86_clang7_asan
414494
- test_x86_mac:
@@ -421,3 +501,28 @@ workflows:
421501
<<: *build_on_tags
422502
requires:
423503
- build_x86_archlinux
504+
- build_x86_linux_ossfuzz: *build_on_tags
505+
506+
test_nightly:
507+
triggers:
508+
- schedule:
509+
cron: "0 0 * * *"
510+
filters:
511+
branches:
512+
only:
513+
- develop
514+
jobs:
515+
- build_emscripten: *build_on_tags
516+
- test_emscripten_external_zeppelin:
517+
<<: *build_on_tags
518+
requires:
519+
- build_emscripten
520+
- test_emscripten_external_gnosis:
521+
<<: *build_on_tags
522+
requires:
523+
- build_emscripten
524+
- build_x86_linux_ossfuzz: *build_on_tags
525+
- test_x86_ossfuzz_regression:
526+
<<: *build_on_tags
527+
requires:
528+
- build_x86_linux_ossfuzz

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ indent_size = 4
1717
[std/**.sol]
1818
indent_style = space
1919
indent_size = 4
20+
21+
[*.{txt,cmake}]
22+
indent_style = tab
23+
indent_size = 4

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ prerelease.txt
3232

3333
# Build directory
3434
build/
35+
build*/
3536
emscripten_build/
3637
docs/_build
3738
docs/utils/__pycache__
@@ -44,6 +45,9 @@ deps/cache
4445
[._]*.sw[a-p]
4546
[._]sw[a-p]
4647

48+
# emacs stuff
49+
*~
50+
4751
# IDE files
4852
.idea
4953
.vscode
@@ -53,3 +57,6 @@ CMakeLists.txt.user
5357
/.vs
5458
/.cproject
5559
/.project
60+
61+
# place to put local temporary files
62+
tmp

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include(EthPolicy)
1010
eth_policy()
1111

1212
# project name and version should be set after cmake_policy CMP0048
13-
set(PROJECT_VERSION "0.5.7")
13+
set(PROJECT_VERSION "0.5.8")
1414
project(solidity VERSION ${PROJECT_VERSION} LANGUAGES CXX)
1515

1616
option(LLL "Build LLL" OFF)

CODING_STYLE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ foo->bar(someLongVariableName,
4646
cout << "some very long string that contains completely irrelevant text that talks about this and that and contains the words \"lorem\" and \"ipsum\"" << endl;
4747
```
4848
49+
To set indentation and tab width settings uniformly, the repository contains an [EditorConfig](https://editorconfig.org/) [`.editorconfig`](https://github.com/ethereum/solidity/blob/develop/.editorconfig) file, which describes some of the styles used and which is recognized by many IDE's and editors.
50+
4951
## 1. Namespaces
5052
5153
1. No `using namespace` declarations in header files.

Changelog.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
### 0.5.8 (2019-04-30)
2+
3+
Important Bugfixes:
4+
* Code Generator: Fix initialization routine of uninitialized internal function pointers in constructor context.
5+
* Yul Optimizer: Fix SSA transform for multi-assignments.
6+
7+
8+
Language Features:
9+
* ABIEncoderV2: Implement encoding of calldata arrays and structs.
10+
* Code Generation: Implement copying recursive structs from storage to memory.
11+
* Yul: Disallow function definitions inside for-loop init blocks.
12+
13+
14+
Compiler Features:
15+
* ABI Decoder: Raise a runtime error on dirty inputs when using the experimental decoder.
16+
* Optimizer: Add rule for shifts by constants larger than 255 for Constantinople.
17+
* Optimizer: Add rule to simplify certain ANDs and SHL combinations
18+
* SMTChecker: Support arithmetic compound assignment operators.
19+
* SMTChecker: Support unary increment and decrement for array and mapping access.
20+
* SMTChecker: Show unsupported warning for inline assembly blocks.
21+
* SMTChecker: Support mod.
22+
* SMTChecker: Support ``contract`` type.
23+
* SMTChecker: Support ``this`` as address.
24+
* SMTChecker: Support address members.
25+
* Standard JSON Interface: Metadata settings now re-produce the original ``"useLiteralContent"`` setting from the compilation input.
26+
* Yul: Adds break and continue keywords to for-loop syntax.
27+
* Yul: Support ``.`` as part of identifiers.
28+
* Yul Optimizer: Adds steps for detecting and removing of dead code.
29+
30+
31+
Bugfixes:
32+
* SMTChecker: Implement Boolean short-circuiting.
33+
* SMTChecker: SSA control-flow did not take into account state variables that were modified inside inlined functions that were called inside branches.
34+
* Type System: Use correct type name for contracts in event parameters when used in libraries. This affected code generation.
35+
* Type System: Allow direct call to base class functions that have overloads.
36+
* Yul: Properly register functions and disallow shadowing between function variables and variables in the outside scope.
37+
38+
39+
Build System:
40+
* Soltest: Add commandline option `--test` / `-t` to isoltest which takes a string that allows filtering unit tests.
41+
* soltest.sh: allow environment variable ``SOLIDITY_BUILD_DIR`` to specify build folder and add ``--help`` usage.
42+
43+
144
### 0.5.7 (2019-03-26)
245

346
Important Bugfixes:
@@ -368,6 +411,20 @@ Bugfixes:
368411
* Parser: Fix incorrect source location for nameless parameters.
369412
* Command Line Interface: Fix internal error when compiling stdin with no content and --ast option.
370413

414+
415+
### 0.4.26 (2019-04-29)
416+
417+
Important Bugfixes:
418+
* Code Generator: Fix initialization routine of uninitialized internal function pointers in constructor context.
419+
* Type System: Use correct type name for contracts in event parameters when used in libraries. This affected code generation.
420+
421+
Bugfixes:
422+
* ABIEncoderV2: Refuse to generate code that is known to be potentially buggy.
423+
* General: Split rule list such that JavaScript environments with small stacks can use the compiler.
424+
425+
Note: The above changes are not included in 0.5.0, because they were backported.
426+
427+
371428
### 0.4.25 (2018-09-12)
372429

373430
Important Bugfixes:

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# The Solidity Contract-Oriented Programming Language
2-
[![Join the chat at https://gitter.im/ethereum/solidity](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/solidity?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/ethereum/solidity.svg?branch=develop)](https://travis-ci.org/ethereum/solidity)
2+
[![Join the chat at https://gitter.im/ethereum/solidity](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/solidity?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3+
34
Solidity is a statically typed, contract-oriented, high-level language for implementing smart contracts on the Ethereum platform.
45

56
## Table of Contents

cmake/EthCompilerSettings.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
3333
add_compile_options(-Werror)
3434

3535
# Configuration-specific compiler settings.
36-
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG")
36+
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -DETH_DEBUG")
3737
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
3838
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
39-
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
39+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g3")
4040

4141
# Additional GCC-specific compiler settings.
4242
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
@@ -54,6 +54,12 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
5454
# Set stack size to 32MB - by default Apple's clang defines a stack size of 8MB.
5555
# Normally 16MB is enough to run all tests, but it will exceed the stack, if -DSANITIZE=address is used.
5656
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-stack_size -Wl,0x2000000")
57+
58+
# Boost libraries use visibility=hidden to reduce unnecessary DWARF entries.
59+
# Unless we match visibility, ld will give a warning message like:
60+
# ld: warning: direct access in function 'boost::filesystem... from file ...
61+
# means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
62+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
5763
endif()
5864

5965
# Some Linux-specific Clang settings. We don't want these for OS X.

0 commit comments

Comments
 (0)