Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop into release for 0.4.23 #3950

Merged
merged 43 commits into from
Apr 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3c24d64
Set version to 0.4.23
chriseth Apr 17, 2018
6a747ed
Support bionic.
chriseth Apr 17, 2018
76cde90
Merge pull request #3901 from ethereum/newVersion
chriseth Apr 17, 2018
797ce72
Report failed commandline tests.
chriseth Apr 17, 2018
6c05569
Merge pull request #3902 from ethereum/release
chriseth Apr 17, 2018
5499db0
Merge pull request #3903 from ethereum/addBionic
chriseth Apr 17, 2018
4d1467e
Enable travis tests on develop branch.
chriseth Apr 16, 2018
08b0ed4
Merge pull request #3905 from ethereum/reportCmdline
chriseth Apr 17, 2018
0304582
Merge pull request #3898 from ethereum/reEnableTestsOnTravisDevelop
chriseth Apr 17, 2018
0bf3db3
Add static_assert for the correct jsoncpp version
axic Apr 17, 2018
3710fb5
Update security considerations.
chriseth Apr 17, 2018
1e55ec7
Update release checklist.
chriseth Apr 16, 2018
d1e8aca
Merge pull request #3894 from ethereum/releaseNotes
chriseth Apr 17, 2018
2be2988
Merge pull request #3906 from ethereum/updateSecuryt
chriseth Apr 17, 2018
842fd0c
Merge pull request #3913 from ethereum/jsoncpp-version-assert
axic Apr 17, 2018
ae3350a
[SMTChecker] Integration with CVC4
Apr 6, 2018
1696c9f
Update README.md
aj07 Apr 17, 2018
4ff5dda
Merge pull request #3919 from aj07/patch-2
chriseth Apr 17, 2018
f925747
Merge pull request #3840 from ethereum/smt_cvc4
axic Apr 17, 2018
78ba346
[SMTChecker] Using solUnimplementedAssert instead of solAssert when a…
Apr 18, 2018
f510348
Extract tests.
chriseth Apr 17, 2018
29a97f1
Fix name clashes between constructor and fallback function.
chriseth Apr 17, 2018
85687a3
Merge pull request #3912 from ethereum/fixFallbackConstructor
chriseth Apr 18, 2018
64043ef
Support ubuntu bionic source builds.
chriseth Apr 18, 2018
e22929e
Remove Zeppelin patches.
chriseth Apr 18, 2018
cd17c37
Merge pull request #3925 from ethereum/supportBionic2
axic Apr 18, 2018
4895864
Warn about functions named "constructor".
chriseth Apr 18, 2018
377254d
Merge pull request #3922 from ethereum/smt_sol_unimplementedassert
axic Apr 18, 2018
39b7b44
Merge pull request #3923 from ethereum/warnConstructor
axic Apr 18, 2018
17beac1
Extract tests.
chriseth Apr 18, 2018
a94945d
Improve error message for failed member lookup.
chriseth Apr 18, 2018
b53156b
Remove -fpermissive
axic Apr 18, 2018
bff741b
Remove obsolete warning supressions for clang
axic Apr 18, 2018
d577f06
Merge pull request #3928 from ethereum/removeZeppelinPatches
axic Apr 18, 2018
ae834e3
Correct the style of coding style
tsauvajon Apr 19, 2018
6407f1f
Merge pull request #3932 from ethereum/betterErrorForFailedLookup
chriseth Apr 19, 2018
6f0fbcf
Merge pull request #3940 from ethereum/remove-old-compiler-flags
chriseth Apr 19, 2018
754d79e
Disallow explicit conversion of bytesXX to contract
axic Apr 18, 2018
2546a27
Merge pull request #3941 from ethereum/bytes-contract
chriseth Apr 19, 2018
a79c9a1
Prepare 0.4.23 release.
chriseth Apr 19, 2018
3f72237
Merge pull request #3949 from ethereum/prepareRelease
chriseth Apr 19, 2018
fb3f579
Disable tests on travis again.
chriseth Apr 19, 2018
7fb431a
Merge pull request #3952 from ethereum/disableTestsOnTravisAgain
chriseth Apr 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ cache:
install:
- test $SOLC_INSTALL_DEPS_TRAVIS != On || (scripts/install_deps.sh)
- test "$TRAVIS_OS_NAME" != "linux" || (scripts/install_cmake.sh)
# - if [ "$TRAVIS_BRANCH" != release -a -z "$TRAVIS_TAG" ]; then SOLC_TESTS=Off; fi
# Disable tests unless run on the release branch, on tags or with daily cron
#- if [ "$TRAVIS_BRANCH" != release -a -z "$TRAVIS_TAG" -a "$TRAVIS_EVENT_TYPE" != cron ]; then SOLC_TESTS=Off; fi
- SOLC_TESTS=Off
- if [ "$TRAVIS_BRANCH" = release -o -n "$TRAVIS_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi
- echo -n "$TRAVIS_COMMIT" > commit_hash.txt
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(EthPolicy)
eth_policy()

# project name and version should be set after cmake_policy CMP0048
set(PROJECT_VERSION "0.4.22")
set(PROJECT_VERSION "0.4.23")
project(solidity VERSION ${PROJECT_VERSION})

option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)
Expand Down
345 changes: 163 additions & 182 deletions CODING_STYLE.md

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
### 0.4.23 (2018-04-19)

Features:
* Build system: Support Ubuntu Bionic.
* SMTChecker: Integration with CVC4 SMT solver
* Syntax Checker: Warn about functions named "constructor".

Bugfixes:
* Type Checker: Improve error message for failed function overload resolution.
* Type Checker: Do not complain about new-style constructor and fallback function to have the same name.
* Type Checker: Detect multiple constructor declarations in the new syntax and old syntax.
* Type Checker: Explicit conversion of ``bytesXX`` to ``contract`` is properly disallowed.

### 0.4.22 (2018-04-16)

Features:
Expand Down Expand Up @@ -25,7 +38,6 @@ Features:
* Syntax Tests: Add source locations to syntax test expectations.
* Type Checker: Improve documentation and warnings for accessing contract members inherited from ``address``.


Bugfixes:
* Code Generator: Allow ``block.blockhash`` without being called.
* Code Generator: Do not include internal functions in the runtime bytecode which are only referenced in the constructor.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Solidity is still under development. So please do not hesitate and open an [issu
See the [Solidity documentation](https://solidity.readthedocs.io/en/latest/installing-solidity.html#building-from-source) for build instructions.

## How to Contribute
Please see our contribution guidelines in [the Solidity documentation](https://solidity.readthedocs.io/en/latest/contributing.html).
Please see our [contribution guidelines](https://solidity.readthedocs.io/en/latest/contributing.html) in the Solidity documentation.

Any contributions are welcome!
7 changes: 4 additions & 3 deletions ReleaseChecklist.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
Checklist for making a release:

- [ ] Check that all "nextrelease" issues and pull requests are merged to ``develop``.
- [ ] Create a commit in ``develop`` that updates the ``Changelog`` to include a release date (run the tests locally to update the bug list).
- [ ] Ensure that a Github project exists for the release.
- [ ] Check that all issues and pull requests from the Github project to be released are merged to ``develop``.
- [ ] Create a commit in ``develop`` that updates the ``Changelog`` to include a release date (run ``./scripts/tests.sh`` to update the bug list). Sort the changelog entries alphabetically and correct any errors you notice.
- [ ] Create a pull request and wait for the tests, merge it.
- [ ] Create a pull request from ``develop`` to ``release``, wait for the tests, then merge it.
- [ ] Make a final check that there are no platform-dependency issues in the ``solc-test-bytecode`` repository.
- [ ] Wait for the tests for the commit on ``release``, create a release in Github, creating the tag.
- [ ] Thank voluntary contributors in the Github release page (use ``git shortlog -s -n -e origin/release..origin/develop``).
- [ ] Wait for the CI runs on the tag itself (they should push artefacts onto the Github release page).
- [ ] Run ``scripts/release_ppa.sh release`` to create the PPA release (you need the relevant openssl key).
- [ ] Check that the Docker release was pushed to Docker Hub (this still seems to have problems).
- [ ] Check that the Docker release was pushed to Docker Hub (this still seems to have problems, run ``./scripts/docker_deploy_manual.sh release``).
- [ ] Update the homebrew realease in https://github.com/ethereum/homebrew-ethereum/blob/master/solidity.rb (version and hash)
- [ ] Update the default version on readthedocs.
- [ ] Make a release of ``solc-js``: Increment the version number, create a pull request for that, merge it after tests succeeded.
Expand Down
33 changes: 0 additions & 33 deletions cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
# TODO - Track down what breaks if we do NOT do this.
add_compile_options(-Wno-unknown-pragmas)

# To get the code building on FreeBSD and Arch Linux we seem to need the following
# warning suppression to work around some issues in Boost headers.
#
# See the following reports:
# https://github.com/ethereum/webthree-umbrella/issues/384
# https://github.com/ethereum/webthree-helpers/pull/170
#
# The issue manifest as warnings-as-errors like the following:
#
# /usr/local/include/boost/multiprecision/cpp_int.hpp:181:4: error:
# right operand of shift expression '(1u << 63u)' is >= than the precision of the left operand
#
# -fpermissive is a pretty nasty way to address this. It is described as follows:
#
# Downgrade some diagnostics about nonconformant code from errors to warnings.
# Thus, using -fpermissive will allow some nonconforming code to compile.
#
# NB: Have to use this form for the setting, so that it only applies to C++ builds.
# Applying -fpermissive to a C command-line (ie. secp256k1) gives a build error.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")

# Configuration-specific compiler settings.
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
Expand All @@ -82,18 +61,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA

# Additional Clang-specific compiler settings.
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")

# A couple of extra warnings suppressions which we seemingly
# need when building with Clang.
#
# TODO - Nail down exactly where these warnings are manifesting and
# try to suppress them in a more localized way. Notes in this file
# indicate that the first is needed for sepc256k1 and that the
# second is needed for the (clog, cwarn) macros. These will need
# testing on at least OS X and Ubuntu.
add_compile_options(-Wno-unused-function)
add_compile_options(-Wno-dangling-else)

if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
# Set stack size to 16MB - by default Apple's clang defines a stack size of 8MB, some tests require more.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-stack_size -Wl,0x1000000")
Expand Down
4 changes: 4 additions & 0 deletions cmake/FindCVC4.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
find_path(CVC4_INCLUDE_DIR cvc4/cvc4.h)
find_library(CVC4_LIBRARY NAMES cvc4 )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CVC4 DEFAULT_MSG CVC4_LIBRARY CVC4_INCLUDE_DIR)
3 changes: 3 additions & 0 deletions cmake/FindGMP.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
find_library(GMP_LIBRARY NAMES gmp )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARY)
8 changes: 8 additions & 0 deletions docs/bugs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"name": "OneOfTwoConstructorsSkipped",
"summary": "If a contract has both a new-style constructor (using the constructor keyword) and an old-style constructor (a function with the same name as the contract) at the same time, one of them will be ignored.",
"description": "If a contract has both a new-style constructor (using the constructor keyword) and an old-style constructor (a function with the same name as the contract) at the same time, one of them will be ignored. There will be a compiler warning about the old-style constructor, so contracts only using new-style constructors are fine.",
"introduced": "0.4.22",
"fixed": "0.4.23",
"severity": "very low"
},
{
"name": "ZeroFunctionSelector",
"summary": "It is possible to craft the name of a function such that it is executed instead of the fallback function in very specific circumstances.",
Expand Down
8 changes: 7 additions & 1 deletion docs/bugs_by_version.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,15 @@
"released": "2018-03-07"
},
"0.4.22": {
"bugs": [],
"bugs": [
"OneOfTwoConstructorsSkipped"
],
"released": "2018-04-16"
},
"0.4.23": {
"bugs": [],
"released": "2018-04-19"
},
"0.4.3": {
"bugs": [
"ZeroFunctionSelector",
Expand Down
19 changes: 16 additions & 3 deletions docs/security-considerations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@ Minor Details
=============

- In ``for (var i = 0; i < arrayName.length; i++) { ... }``, the type of ``i`` will be ``uint8``, because this is the smallest type that is required to hold the value ``0``. If the array has more than 255 elements, the loop will not terminate.
- The ``constant`` keyword for functions is currently not enforced by the compiler.
Furthermore, it is not enforced by the EVM, so a contract function that "claims"
to be constant might still cause changes to the state.
- Types that do not occupy the full 32 bytes might contain "dirty higher order bits".
This is especially important if you access ``msg.data`` - it poses a malleability risk:
You can craft transactions that call a function ``f(uint8 x)`` with a raw byte argument
Expand All @@ -239,6 +236,22 @@ Minor Details
Recommendations
***************

Take Warnings Seriously
=======================

If the compiler warns you about something, you should better change it.
Even if you do not think that this particular warning has security
implications, there might be another issue buried beneath it.
Any compiler warning we issue can be silenced by slight changes to the
code.

Also try to enable the "0.5.0" safety features as early as possible
by adding ``pragma experimental "v0.5.0";``. Note that in this case,
the word ``experimental`` does not mean that the safety features are in any
way risky, it is just a way to enable some features that are
not yet part of the latest version of Solidity due to backwards
compatibility.

Restrict the Amount of Ether
============================

Expand Down
5 changes: 5 additions & 0 deletions libdevcore/JSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

using namespace std;

static_assert(
(JSONCPP_VERSION_MAJOR == 1) && (JSONCPP_VERSION_MINOR == 7) && (JSONCPP_VERSION_PATCH == 7),
"Unexpected jsoncpp version: " JSONCPP_VERSION_STRING ". Expecting 1.7.7."
);

namespace dev
{

Expand Down
26 changes: 23 additions & 3 deletions libsolidity/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,35 @@ find_package(Z3 QUIET)
if (${Z3_FOUND})
include_directories(${Z3_INCLUDE_DIR})
add_definitions(-DHAVE_Z3)
message("Z3 SMT solver found. This enables optional SMT checking.")
message("Z3 SMT solver found. This enables optional SMT checking with Z3.")
list(REMOVE_ITEM sources "${CMAKE_CURRENT_SOURCE_DIR}/formal/CVC4Interface.cpp")
else()
message("Z3 SMT solver NOT found. Optional SMT checking will not be available. Please install Z3 if it is desired.")
list(REMOVE_ITEM sources "${CMAKE_CURRENT_SOURCE_DIR}/formal/Z3Interface.cpp")
find_package(GMP QUIET)
find_package(CVC4 QUIET)
if (${CVC4_FOUND})
if (${GMP_FOUND})
include_directories(${CVC4_INCLUDE_DIR})
add_definitions(-DHAVE_CVC4)
message("CVC4 SMT solver and GMP found. This enables optional SMT checking with CVC4.")
else()
message("CVC4 SMT solver found but its dependency GMP was NOT found. Optional SMT checking with CVC4 will not be available. Please install GMP if it is desired.")
list(REMOVE_ITEM sources "${CMAKE_CURRENT_SOURCE_DIR}/formal/CVC4Interface.cpp")
endif()
else()
message("No SMT solver found (Z3 or CVC4). Optional SMT checking will not be available. Please install Z3 or CVC4 if it is desired.")
list(REMOVE_ITEM sources "${CMAKE_CURRENT_SOURCE_DIR}/formal/CVC4Interface.cpp")
endif()
endif()

add_library(solidity ${sources} ${headers})
target_link_libraries(solidity PUBLIC evmasm devcore)

if (${Z3_FOUND})
target_link_libraries(solidity PUBLIC ${Z3_LIBRARY})
endif()
endif()

if (${CVC4_FOUND} AND ${GMP_FOUND})
target_link_libraries(solidity PUBLIC ${CVC4_LIBRARY})
target_link_libraries(solidity PUBLIC ${GMP_LIBRARY})
endif()
7 changes: 6 additions & 1 deletion libsolidity/analysis/SyntaxChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,13 @@ bool SyntaxChecker::visit(FunctionDefinition const& _function)
if (v050)
m_errorReporter.syntaxError(_function.location(), "Functions without implementation cannot have modifiers.");
else
m_errorReporter.warning( _function.location(), "Modifiers of functions without implementation are ignored." );
m_errorReporter.warning(_function.location(), "Modifiers of functions without implementation are ignored." );
}
if (_function.name() == "constructor")
m_errorReporter.warning(_function.location(),
"This function is named \"constructor\" but is not the constructor of the contract. "
"If you intend this to be a constructor, use \"constructor(...) { ... }\" without the \"function\" keyword to define it."
);
return true;
}

Expand Down
Loading