Skip to content

Commit

Permalink
Merge pull request #3099 from ethereum/develop
Browse files Browse the repository at this point in the history
Merge develop into release for 0.4.18.
  • Loading branch information
chriseth authored Oct 18, 2017
2 parents bdeb9e5 + c85c418 commit 9cf6e91
Show file tree
Hide file tree
Showing 99 changed files with 3,258 additions and 1,432 deletions.
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ env:

matrix:
include:
# Ubuntu 14.04 LTS "Trusty Tahr"
# https://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Ubuntu_14.04_LTS_.28Trusty_Tahr.29
#
# TravisCI doesn't directly support any new Ubuntu releases. These is
# some Docker support, which we should probably investigate, at least for
# Ubuntu 16.04 LTS "Xenial Xerus"
# See https://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Ubuntu_16.04_LTS_.28Xenial_Xerus.29.
- os: linux
dist: trusty
sudo: required
Expand Down
4 changes: 2 additions & 2 deletions 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.17")
set(PROJECT_VERSION "0.4.18")
project(solidity VERSION ${PROJECT_VERSION})

option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)
Expand All @@ -35,7 +35,7 @@ string(REGEX MATCHALL ".." LICENSE_TEXT "${LICENSE_TEXT}")
string(REGEX REPLACE ";" ",\n\t0x" LICENSE_TEXT "${LICENSE_TEXT}")
set(LICENSE_TEXT "0x${LICENSE_TEXT}")

configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/license.h.in" "license.h")
configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/license.h.in" include/license.h)

include(EthOptions)
configure_project(TESTS)
Expand Down
28 changes: 28 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
### 0.4.18 (2017-10-18)

Features:
* Code Generator: Always use all available gas for calls as experimental 0.5.0 feature
(previously, some amount was retained in order to work in pre-Tangerine-Whistle
EVM versions)
* Parser: Better error message for unexpected trailing comma in parameter lists.
* Standard JSON: Support the ``outputSelection`` field for selective compilation of supplied sources.
* Syntax Checker: Unary ``+`` is now a syntax error as experimental 0.5.0 feature.
* Type Checker: Disallow non-pure constant state variables as experimental 0.5.0 feature.
* Type Checker: Do not add members of ``address`` to contracts as experimental 0.5.0 feature.
* Type Checker: Force interface functions to be external as experimental 0.5.0 feature.
* Type Checker: Require ``storage`` or ``memory`` keyword for local variables as experimental 0.5.0 feature.

Bugfixes:
* Code Generator: Allocate one byte per memory byte array element instead of 32.
* Code Generator: Do not accept data with less than four bytes (truncated function
signature) for regular function calls - fallback function is invoked instead.
* Optimizer: Remove unused stack computation results.
* Parser: Fix source location of VariableDeclarationStatement.
* Type Checker: Allow ``gas`` in view functions.
* Type Checker: Do not mark event parameters as shadowing state variables.
* Type Checker: Prevent duplicate event declarations.
* Type Checker: Properly check array length and don't rely on an assertion in code generation.
* Type Checker: Properly support overwriting members inherited from ``address`` in a contract
(such as ``balance``, ``transfer``, etc.)
* Type Checker: Validate each number literal in tuple expressions even if they are not assigned from.

### 0.4.17 (2017-09-21)

Features:
Expand Down
17 changes: 11 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ environment:
#init:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
install:
- ps: $fileContent = "-----BEGIN RSA PRIVATE KEY-----`n"
- ps: $fileContent += $env:priv_key.Replace(' ', "`n")
- ps: $fileContent += "`n-----END RSA PRIVATE KEY-----`n"
- ps: Set-Content c:\users\appveyor\.ssh\id_rsa $fileContent
- ps: if ($env:priv_key) {
$fileContent = "-----BEGIN RSA PRIVATE KEY-----`n";
$fileContent += $env:priv_key.Replace(' ', "`n");
$fileContent += "`n-----END RSA PRIVATE KEY-----`n";
Set-Content c:\users\appveyor\.ssh\id_rsa $fileContent
}
- git submodule update --init --recursive
- ps: $prerelease = "nightly."
- ps: $prerelease += Get-Date -format "yyyy.M.d"
Expand All @@ -66,12 +68,15 @@ build_script:
- cd %APPVEYOR_BUILD_FOLDER%
- scripts\release.bat %CONFIGURATION%
- ps: $bytecodedir = git show -s --format="%cd-%H" --date=short
- ps: scripts\bytecodecompare\storebytecode.bat $Env:CONFIGURATION $bytecodedir
# Skip bytecode compare if private key is not available
- ps: if ($env:priv_key) {
scripts\bytecodecompare\storebytecode.bat $Env:CONFIGURATION $bytecodedir
}

test_script:
- cd %APPVEYOR_BUILD_FOLDER%
- cd %APPVEYOR_BUILD_FOLDER%\build\test\%CONFIGURATION%
- soltest.exe --show-progress -- --no-ipc
- soltest.exe --show-progress -- --no-ipc --no-smt

artifacts:
- path: solidity-windows.zip
Expand Down
2 changes: 1 addition & 1 deletion cmake/EthBuildInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ function(create_build_info NAME)
-DPROJECT_VERSION="${PROJECT_VERSION}"
-P "${ETH_SCRIPTS_DIR}/buildinfo.cmake"
)
include_directories(BEFORE ${PROJECT_BINARY_DIR})
include_directories("${PROJECT_BINARY_DIR}/include")
endfunction()
23 changes: 23 additions & 0 deletions cmake/EthCheckCXXCompilerFlag.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
include(CheckCXXCompilerFlag)

# Adds CXX compiler flag if the flag is supported by the compiler.
#
# This is effectively a combination of CMake's check_cxx_compiler_flag()
# and add_compile_options():
#
# if(check_cxx_compiler_flag(flag))
# add_compile_options(flag)
#
function(eth_add_cxx_compiler_flag_if_supported FLAG)
# Remove leading - or / from the flag name.
string(REGEX REPLACE "^-|/" "" name ${FLAG})
check_cxx_compiler_flag(${FLAG} ${name})
if(${name})
add_compile_options(${FLAG})
endif()

# If the optional argument passed, store the result there.
if(ARGV1)
set(${ARGV1} ${name} PARENT_SCOPE)
endif()
endfunction()
23 changes: 7 additions & 16 deletions cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# CMake file for cpp-ethereum project which specifies our compiler settings
# for each supported platform and build configuration.
#
# See http://www.ethdocs.org/en/latest/ethereum-clients/cpp-ethereum/.
# The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org
#
# Copyright (c) 2014-2016 cpp-ethereum contributors.
#------------------------------------------------------------------------------
Expand All @@ -14,18 +14,15 @@
#
# These settings then end up spanning all POSIX platforms (Linux, OS X, BSD, etc)

include(CheckCXXCompilerFlag)
include(EthCheckCXXCompilerFlag)

check_cxx_compiler_flag(-fstack-protector-strong have_stack_protector_strong)
if (have_stack_protector_strong)
add_compile_options(-fstack-protector-strong)
else()
check_cxx_compiler_flag(-fstack-protector have_stack_protector)
if(have_stack_protector)
add_compile_options(-fstack-protector)
endif()
eth_add_cxx_compiler_flag_if_supported(-fstack-protector-strong have_stack_protector_strong_support)
if(NOT have_stack_protector_strong_support)
eth_add_cxx_compiler_flag_if_supported(-fstack-protector)
endif()

eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough)

if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))

# Use ISO C++11 standard language.
Expand Down Expand Up @@ -83,12 +80,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7 or greater.")
endif ()

# Until https://github.com/ethereum/solidity/issues/2479 is handled
# disable all implicit fallthrough warnings in the codebase for GCC > 7.0
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
add_compile_options(-Wno-implicit-fallthrough)
endif()

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

Expand Down
7 changes: 0 additions & 7 deletions cmake/EthDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,3 @@ option(Boost_USE_STATIC_LIBS "Link Boost statically" ON)
find_package(Boost 1.54.0 QUIET REQUIRED COMPONENTS regex filesystem unit_test_framework program_options system)

eth_show_dependency(Boost boost)

if (APPLE)
link_directories(/usr/local/lib)
include_directories(/usr/local/include)
endif()

include_directories(BEFORE "${PROJECT_BINARY_DIR}/include")
21 changes: 20 additions & 1 deletion docs/abi-spec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ Events

Events are an abstraction of the Ethereum logging/event-watching protocol. Log entries provide the contract's address, a series of up to four topics and some arbitrary length binary data. Events leverage the existing function ABI in order to interpret this (together with an interface spec) as a properly typed structure.

Given an event name and series of event parameters, we split them into two sub-series: those which are indexed and those which are not. Those which are indexed, which may number up to 3, are used alongside the Keccak hash of the event signature to form the topics of the log entry. Those which as not indexed form the byte array of the event.
Given an event name and series of event parameters, we split them into two sub-series: those which are indexed and those which are not. Those which are indexed, which may number up to 3, are used alongside the Keccak hash of the event signature to form the topics of the log entry. Those which are not indexed form the byte array of the event.

In effect, a log entry using this ABI is described as:

Expand Down Expand Up @@ -442,3 +442,22 @@ would result in the JSON:
"outputs": []
}
]
.. _abi_packed_mode:

Non-standard Packed Mode
========================

Solidity supports a non-standard packed mode where:

- no :ref:`function selector <abi_function_selector>` is encoded,
- short types are not zero padded and
- dynamic types are encoded in-place and without the length.

As an example encoding ``uint1, bytes1, uint8, string`` with values ``1, 0x42, 0x2424, "Hello, world!"`` results in ::

0x0142242448656c6c6f2c20776f726c6421
^^ uint1(1)
^^ bytes1(0x42)
^^^^ uint8(0x2424)
^^^^^^^^^^^^^^^^^^^^^^^^^^ string("Hello, world!") without a length field
7 changes: 7 additions & 0 deletions docs/bugs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[
{
"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.",
"description": "If a function has a selector consisting only of zeros, is payable and part of a contract that does not have a fallback function and at most five external functions in total, this function is called instead of the fallback function if Ether is sent to the contract without data.",
"fixed": "0.4.18",
"severity": "very low"
},
{
"name": "DelegateCallReturnValue",
"summary": "The low-level .delegatecall() does not return the execution outcome, but converts the value returned by the functioned called to a boolean instead.",
Expand Down
2 changes: 1 addition & 1 deletion docs/bugs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fixed
publish
The date at which the bug became known publicly, optional
severity
Severity of the bug: low, medium, high. Takes into account
Severity of the bug: very low, low, medium, high. Takes into account
discoverability in contract tests, likelihood of occurrence and
potential damage by exploits.
conditions
Expand Down
Loading

0 comments on commit 9cf6e91

Please sign in to comment.