Skip to content

Commit

Permalink
Merge pull request #6630 from ethereum/develop
Browse files Browse the repository at this point in the history
Merge develop into release for 0.5.8
  • Loading branch information
chriseth authored Apr 30, 2019
2 parents 6da8b01 + 18104a0 commit 23d335f
Show file tree
Hide file tree
Showing 684 changed files with 12,406 additions and 3,635 deletions.
139 changes: 122 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,20 @@ defaults:
[ -n "$COVERAGE" -a "$CIRCLE_BRANCH" != release -a -z "$CIRCLE_TAG" ] && CMAKE_OPTIONS="$CMAKE_OPTIONS -DCOVERAGE=ON"
cmake .. -DCMAKE_BUILD_TYPE=Release $CMAKE_OPTIONS
make -j4
- run_build_ossfuzz: &run_build_ossfuzz
name: Build_ossfuzz
command: |
mkdir -p build
cd build
/src/LPM/external.protobuf/bin/protoc --proto_path=../test/tools/ossfuzz yulProto.proto --cpp_out=../test/tools/ossfuzz
cmake .. -DCMAKE_BUILD_TYPE=Release $CMAKE_OPTIONS
make ossfuzz ossfuzz_proto -j4
- run_tests: &run_tests
name: Tests
command: scripts/tests.sh --junit_report test_results
- run_regressions: &run_regressions
name: Regression tests
command: scripts/regressions.py -o test_results
- solc_artifact: &solc_artifact
path: build/solc/solc
destination: solc
Expand All @@ -29,6 +40,15 @@ defaults:
- solc/solc
- test/soltest
- test/tools/solfuzzer
- ossfuzz_artifacts: &ossfuzz_artifacts
root: build
paths:
- test/tools/ossfuzz/solc_opt_ossfuzz
- test/tools/ossfuzz/solc_noopt_ossfuzz
- test/tools/ossfuzz/const_opt_ossfuzz
- test/tools/ossfuzz/strictasm_diff_ossfuzz
- test/tools/ossfuzz/yul_proto_ossfuzz
- test/tools/ossfuzz/yul_proto_diff_ossfuzz

version: 2
jobs:
Expand Down Expand Up @@ -86,7 +106,7 @@ jobs:
command: |
test/solcjsTests.sh /tmp/workspace/soljson.js $(cat /tmp/workspace/version.txt)
test_emscripten_external:
test_emscripten_external_gnosis:
docker:
- image: circleci/node:10
environment:
Expand All @@ -96,14 +116,23 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- run:
name: Install external tests deps
name: External GnosisSafe tests
command: |
node --version
npm --version
test/externalTests/gnosis.sh /tmp/workspace/soljson.js || test/externalTests/gnosis.sh /tmp/workspace/soljson.js
test_emscripten_external_zeppelin:
docker:
- image: circleci/node:10
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: External tests
name: External Zeppelin tests
command: |
test/externalTests.sh /tmp/workspace/soljson.js || test/externalTests.sh /tmp/workspace/soljson.js
test/externalTests/zeppelin.sh /tmp/workspace/soljson.js || test/externalTests/zeppelin.sh /tmp/workspace/soljson.js
build_x86_linux:
docker:
Expand All @@ -117,8 +146,7 @@ jobs:
name: Install build dependencies
command: |
apt-get -qq update
apt-get -qy install cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev
./scripts/install_obsolete_jsoncpp_1_7_4.sh
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-\*
- run: *setup_prerelease_commit_hash
- run: *run_build
- store_artifacts: *solc_artifact
Expand All @@ -139,8 +167,7 @@ jobs:
name: Install build dependencies
command: |
apt-get -qq update
apt-get -qy install cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev
./scripts/install_obsolete_jsoncpp_1_7_4.sh
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-\*
- run: *setup_prerelease_commit_hash
- run: *run_build

Expand Down Expand Up @@ -179,8 +206,7 @@ jobs:
name: Install build dependencies
command: |
apt-get -qq update
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
./scripts/install_obsolete_jsoncpp_1_7_4.sh
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-\*
- run: *setup_prerelease_commit_hash
- run: *run_build
- store_artifacts: *solc_artifact
Expand Down Expand Up @@ -306,12 +332,19 @@ jobs:
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-7 1
- run: mkdir -p test_results
- run:
name: Run tests with ASAN
name: Run soltest with ASAN
command: |
ulimit -a
# Increase stack size because ASan makes stack frames bigger and that breaks our assumptions (in tests).
ulimit -s 16384
build/test/soltest --logger=JUNIT,test_suite,test_results/result.xml -- --no-ipc --testpath test
- run:
name: Run commandline tests with ASAN
command: |
ulimit -a
# Increase stack size because ASan makes stack frames bigger and that breaks our assumptions (in tests).
ulimit -s 16384
test/cmdlineTests.sh
- store_test_results:
path: test_results/
- store_artifacts:
Expand Down Expand Up @@ -381,6 +414,51 @@ jobs:
path: docs/_build/html/
destination: docs-html

build_x86_linux_ossfuzz:
docker:
- image: buildpack-deps:cosmic
environment:
TERM: xterm
CC: /usr/bin/clang-7
CXX: /usr/bin/clang++-7
CMAKE_OPTIONS: -DOSSFUZZ=1 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/libfuzzer.cmake
steps:
- checkout
- run:
name: Install build dependencies
command: |
apt-get -qq update
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-\*
./scripts/install_lpm.sh
./scripts/install_libfuzzer.sh
- run: *setup_prerelease_commit_hash
- run: *run_build_ossfuzz
- persist_to_workspace: *ossfuzz_artifacts

test_x86_ossfuzz_regression:
docker:
- image: buildpack-deps:cosmic
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: build
- run:
name: Install dependencies
command: |
apt-get -qq update
apt-get -qy install libcvc4-dev llvm-7-dev
./scripts/download_ossfuzz_corpus.sh
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-7 1
- run: mkdir -p test_results
- run: *run_regressions
- store_test_results:
path: test_results/
- store_artifacts:
path: test_results/
destination: test_results/

workflows:
version: 2
build_all:
Expand All @@ -393,7 +471,11 @@ workflows:
<<: *build_on_tags
requires:
- build_emscripten
- test_emscripten_external:
- test_emscripten_external_zeppelin:
<<: *build_on_tags
requires:
- build_emscripten
- test_emscripten_external_gnosis:
<<: *build_on_tags
requires:
- build_emscripten
Expand All @@ -406,9 +488,7 @@ workflows:
requires:
- build_x86_linux
- test_x86_clang7_asan:
filters:
branches:
only: develop
<<: *build_on_tags
requires:
- build_x86_clang7_asan
- test_x86_mac:
Expand All @@ -421,3 +501,28 @@ workflows:
<<: *build_on_tags
requires:
- build_x86_archlinux
- build_x86_linux_ossfuzz: *build_on_tags

test_nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- develop
jobs:
- build_emscripten: *build_on_tags
- test_emscripten_external_zeppelin:
<<: *build_on_tags
requires:
- build_emscripten
- test_emscripten_external_gnosis:
<<: *build_on_tags
requires:
- build_emscripten
- build_x86_linux_ossfuzz: *build_on_tags
- test_x86_ossfuzz_regression:
<<: *build_on_tags
requires:
- build_x86_linux_ossfuzz
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ indent_size = 4
[std/**.sol]
indent_style = space
indent_size = 4

[*.{txt,cmake}]
indent_style = tab
indent_size = 4
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ prerelease.txt

# Build directory
build/
build*/
emscripten_build/
docs/_build
docs/utils/__pycache__
Expand All @@ -44,6 +45,9 @@ deps/cache
[._]*.sw[a-p]
[._]sw[a-p]

# emacs stuff
*~

# IDE files
.idea
.vscode
Expand All @@ -53,3 +57,6 @@ CMakeLists.txt.user
/.vs
/.cproject
/.project

# place to put local temporary files
tmp
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include(EthPolicy)
eth_policy()

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

option(LLL "Build LLL" OFF)
Expand Down
2 changes: 2 additions & 0 deletions CODING_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ foo->bar(someLongVariableName,
cout << "some very long string that contains completely irrelevant text that talks about this and that and contains the words \"lorem\" and \"ipsum\"" << endl;
```
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.
## 1. Namespaces
1. No `using namespace` declarations in header files.
Expand Down
57 changes: 57 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
### 0.5.8 (2019-04-30)

Important Bugfixes:
* Code Generator: Fix initialization routine of uninitialized internal function pointers in constructor context.
* Yul Optimizer: Fix SSA transform for multi-assignments.


Language Features:
* ABIEncoderV2: Implement encoding of calldata arrays and structs.
* Code Generation: Implement copying recursive structs from storage to memory.
* Yul: Disallow function definitions inside for-loop init blocks.


Compiler Features:
* ABI Decoder: Raise a runtime error on dirty inputs when using the experimental decoder.
* Optimizer: Add rule for shifts by constants larger than 255 for Constantinople.
* Optimizer: Add rule to simplify certain ANDs and SHL combinations
* SMTChecker: Support arithmetic compound assignment operators.
* SMTChecker: Support unary increment and decrement for array and mapping access.
* SMTChecker: Show unsupported warning for inline assembly blocks.
* SMTChecker: Support mod.
* SMTChecker: Support ``contract`` type.
* SMTChecker: Support ``this`` as address.
* SMTChecker: Support address members.
* Standard JSON Interface: Metadata settings now re-produce the original ``"useLiteralContent"`` setting from the compilation input.
* Yul: Adds break and continue keywords to for-loop syntax.
* Yul: Support ``.`` as part of identifiers.
* Yul Optimizer: Adds steps for detecting and removing of dead code.


Bugfixes:
* SMTChecker: Implement Boolean short-circuiting.
* SMTChecker: SSA control-flow did not take into account state variables that were modified inside inlined functions that were called inside branches.
* Type System: Use correct type name for contracts in event parameters when used in libraries. This affected code generation.
* Type System: Allow direct call to base class functions that have overloads.
* Yul: Properly register functions and disallow shadowing between function variables and variables in the outside scope.


Build System:
* Soltest: Add commandline option `--test` / `-t` to isoltest which takes a string that allows filtering unit tests.
* soltest.sh: allow environment variable ``SOLIDITY_BUILD_DIR`` to specify build folder and add ``--help`` usage.


### 0.5.7 (2019-03-26)

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


### 0.4.26 (2019-04-29)

Important Bugfixes:
* Code Generator: Fix initialization routine of uninitialized internal function pointers in constructor context.
* Type System: Use correct type name for contracts in event parameters when used in libraries. This affected code generation.

Bugfixes:
* ABIEncoderV2: Refuse to generate code that is known to be potentially buggy.
* General: Split rule list such that JavaScript environments with small stacks can use the compiler.

Note: The above changes are not included in 0.5.0, because they were backported.


### 0.4.25 (2018-09-12)

Important Bugfixes:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# The Solidity Contract-Oriented Programming Language
[![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)
[![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)

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

## Table of Contents
Expand Down
10 changes: 8 additions & 2 deletions cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
add_compile_options(-Werror)

# Configuration-specific compiler settings.
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -DETH_DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g3")

# Additional GCC-specific compiler settings.
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
Expand All @@ -54,6 +54,12 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
# Set stack size to 32MB - by default Apple's clang defines a stack size of 8MB.
# Normally 16MB is enough to run all tests, but it will exceed the stack, if -DSANITIZE=address is used.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-stack_size -Wl,0x2000000")

# Boost libraries use visibility=hidden to reduce unnecessary DWARF entries.
# Unless we match visibility, ld will give a warning message like:
# ld: warning: direct access in function 'boost::filesystem... from file ...
# means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
endif()

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

0 comments on commit 23d335f

Please sign in to comment.