Skip to content

Commit

Permalink
Merge pull request #3678 from ethereum/develop
Browse files Browse the repository at this point in the history
Merge develop into release.
  • Loading branch information
chriseth authored Mar 7, 2018
2 parents 3155dd8 + 15920dc commit dfe3193
Show file tree
Hide file tree
Showing 144 changed files with 4,718 additions and 1,226 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sol linguist-language=Solidity
14 changes: 0 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ env:
global:
- ENCRYPTION_LABEL="6d4541b72666"
- SOLC_BUILD_TYPE=RelWithDebInfo
- SOLC_DOCS=Off
- SOLC_EMSCRIPTEN=Off
- SOLC_INSTALL_DEPS_TRAVIS=On
- SOLC_RELEASE=On
Expand All @@ -65,18 +64,6 @@ matrix:
- ZIP_SUFFIX=ubuntu-trusty-clang
- SOLC_STOREBYTECODE=On

# Documentation target, which generates documentation using Phoenix / ReadTheDocs.
- os: linux
dist: trusty
sudo: required
compiler: gcc
before_install:
- sudo apt-get -y install python-sphinx
env:
- SOLC_DOCS=On
- SOLC_RELEASE=Off
- SOLC_TESTS=Off

# Docker target, which generates a statically linked alpine image
- os: linux
dist: trusty
Expand Down Expand Up @@ -184,7 +171,6 @@ before_script:

script:
- test $SOLC_EMSCRIPTEN != On || (scripts/test_emscripten.sh)
- test $SOLC_DOCS != On || (scripts/docs.sh)
- test $SOLC_TESTS != On || (cd $TRAVIS_BUILD_DIR && scripts/tests.sh)
- test $SOLC_STOREBYTECODE != On || (cd $TRAVIS_BUILD_DIR && scripts/bytecodecompare/storebytecode.sh)

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.20")
set(PROJECT_VERSION "0.4.21")
project(solidity VERSION ${PROJECT_VERSION})

option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)
Expand Down
31 changes: 31 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
### 0.4.21 (2018-03-07)

Features:
* Code Generator: Assert that ``k != 0`` for ``mulmod(a, b, k)`` and ``addmod(a, b, k)`` as experimental 0.5.0 feature.
* Code Generator: Do not retain any gas in calls (except if EVM version is set to homestead).
* Code Generator: Use ``STATICCALL`` opcode for calling ``view`` and ``pure`` functions as experimenal 0.5.0 feature.
* General: C99/C++-style scoping rules (instead of JavaScript function scoping) take effect as experimental v0.5.0 feature.
* General: Improved messaging when error spans multiple lines of a sourcefile
* General: Support and recommend using ``emit EventName();`` to call events explicitly.
* Inline Assembly: Enforce strict mode as experimental 0.5.0 feature.
* Interface: Provide ability to select target EVM version (homestead or byzantium, with byzantium being the default).
* Standard JSON: Reject badly formatted invalid JSON inputs.
* Type Checker: Disallow uninitialized storage pointers as experimental 0.5.0 feature.
* Syntax Analyser: Do not warn about experimental features if they do not concern code generation.
* Syntax Analyser: Do not warn about ``pragma experimental "v0.5.0"`` and do not set the experimental flag in the bytecode for this.
* Syntax Checker: Mark ``throw`` as an error as experimental 0.5.0 feature.
* Syntax Checker: Issue error if no visibility is specified on contract functions as experimental 0.5.0 feature.
* Syntax Checker: Issue warning when using overloads of ``address`` on contract instances.
* Type Checker: disallow combining hex numbers and unit denominations as experimental 0.5.0 feature.

Bugfixes:
* Assembly: Raise error on oversized number literals in assembly.
* JSON-AST: Add "documentation" property to function, event and modifier definition.
* Resolver: Properly determine shadowing for imports with aliases.
* Standalone Assembly: Do not ignore input after closing brace of top level block.
* Standard JSON: Catch errors properly when invalid "sources" are passed.
* Standard JSON: Ensure that library addresses supplied are of correct length and hex prefixed.
* Type Checker: Properly detect which array and struct types are unsupported by the old ABI encoder.
* Type Checker: Properly warn when using ``_offset`` and ``_slot`` for constants in inline assembly.
* Commandline interface: throw error if option is unknown

### 0.4.20 (2018-02-14)

Features:
Expand Down
91 changes: 67 additions & 24 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ jobs:
- image: trzeci/emscripten:sdk-tag-1.37.21-64bit
steps:
- checkout
- run:
name: Init submodules
command: |
git submodule update --init
- restore_cache:
name: Restore Boost build
key: &boost-cache-key emscripten-boost-{{ checksum "scripts/travis-emscripten/install_deps.sh" }}{{ checksum "scripts/travis-emscripten/build_emscripten.sh" }}
Expand Down Expand Up @@ -83,7 +79,7 @@ jobs:
name: External tests
command: |
. /usr/local/nvm/nvm.sh
test/externalTests.sh /tmp/workspace/soljson.js
test/externalTests.sh /tmp/workspace/soljson.js || test/externalTests.sh /tmp/workspace/soljson.js
build_x86:
docker:
- image: buildpack-deps:artful
Expand All @@ -94,41 +90,84 @@ jobs:
command: |
apt-get -qq update
apt-get -qy install ccache cmake libboost-all-dev libz3-dev
- run:
name: Init submodules
command: |
git submodule update --init
- run:
name: Store commit hash and prerelease
command: |
date -u +"nightly.%Y.%-m.%-d" > prerelease.txt
if [ "$CIRCLE_BRANCH" = release -o -n "$CIRCLE_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi
echo -n "$CIRCLE_SHA1" > commit_hash.txt
- restore_cache:
key: ccache-{{ arch }}-{{ .Branch }}
key: ccache-{{ arch }}
key: ccache
key: ccache-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
key: ccache-{{ arch }}-{{ .Branch }}-
key: ccache-{{ arch }}-develop-
key: ccache-{{ arch }}-
- run:
name: Configure ccache
command: ccache -M 200M && ccache -c && ccache -s && ccache -z
- run:
name: Build
command: ./scripts/build.sh RelWithDebInfo
command: |
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j4
- run:
name: CCache statistics
command: ccache -s
- save_cache:
key: ccache-{{ arch }}-{{ .Branch }}
key: ccache-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
when: always
paths:
- ~/.ccache
- store_artifacts:
path: build/solc/solc
destination: solc
- persist_to_workspace:
root: build
paths:
- solc/solc
- test/soltest
- test/solfuzzer

test_x86:
docker:
- image: buildpack-deps:artful
steps:
- checkout
- attach_workspace:
at: build
- run:
name: Commandline tests
command: test/cmdlineTests.sh
name: Install dependencies
command: |
apt-get -qq update
apt-get -qy install libz3-dev libleveldb1v5
- run: mkdir -p test_results
- run:
name: Test without optimizer (exclude IPC tests)
command: build/test/soltest --logger=JUNIT,test_suite,test_results/no_opt.xml -- --no-ipc
- run:
name: Test with optimizer (exclude IPC tests)
command: build/test/soltest --logger=JUNIT,test_suite,test_results/opt.xml -- --optimize --no-ipc
name: Tests
command: scripts/tests.sh --junit_report test_results
- store_test_results:
path: test_results/

docs:
docker:
- image: buildpack-deps:artful
steps:
- checkout
- run:
name: Install build dependencies
command: |
apt-get -qq update
apt-get -qy install python-sphinx
- run:
name: Store commit hash and prerelease
command: |
if [ "$CIRCLE_BRANCH" = release -o -n "$CIRCLE_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi
echo -n "$CIRCLE_SHA1" > commit_hash.txt
- run:
name: Build documentation
command: ./scripts/docs.sh
- store_artifacts:
path: build/solc/solc
destination: solc
path: docs/_build/html/
destination: docs-html

workflows:
version: 2
Expand All @@ -142,3 +181,7 @@ workflows:
requires:
- build_emscripten
- build_x86
- test_x86:
requires:
- build_x86
- docs
3 changes: 3 additions & 0 deletions cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_DYNAMIC_EXECUTION=1")
# Disable greedy exception catcher
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NODEJS_CATCH_EXIT=0")
# Abort if linking results in any undefined symbols
# Note: this is on by default in the CMake Emscripten module which we aren't using
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1")
add_definitions(-DETH_EMSCRIPTEN=1)
endif()
endif()
Expand Down
12 changes: 9 additions & 3 deletions docs/abi-spec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ The first four bytes of the call data for a function call specifies the function
first (left, high-order in big-endian) four bytes of the Keccak (SHA-3) hash of the signature of the function. The signature is defined as the canonical expression of the basic prototype, i.e.
the function name with the parenthesised list of parameter types. Parameter types are split by a single comma - no spaces are used.

.. note::
The return type of a function is not part of this signature. In :ref:`Solidity's function overloading <overload-function>` return types are not considered. The reason is to keep function call resolution context-independent.
The JSON description of the ABI however contains both inputs and outputs. See (the :ref:`JSON ABI <abi_json>`)

Argument Encoding
=================

Expand Down Expand Up @@ -155,15 +159,15 @@ on the type of ``X`` being

``enc(X) = enc(enc_utf8(X))``, i.e. ``X`` is utf-8 encoded and this value is interpreted as of ``bytes`` type and encoded further. Note that the length used in this subsequent encoding is the number of bytes of the utf-8 encoded string, not its number of characters.

- ``uint<M>``: ``enc(X)`` is the big-endian encoding of ``X``, padded on the higher-order (left) side with zero-bytes such that the length is a multiple of 32 bytes.
- ``uint<M>``: ``enc(X)`` is the big-endian encoding of ``X``, padded on the higher-order (left) side with zero-bytes such that the length is 32 bytes.
- ``address``: as in the ``uint160`` case
- ``int<M>``: ``enc(X)`` is the big-endian two's complement encoding of ``X``, padded on the higher-oder (left) side with ``0xff`` for negative ``X`` and with zero bytes for positive ``X`` such that the length is a multiple of 32 bytes.
- ``int<M>``: ``enc(X)`` is the big-endian two's complement encoding of ``X``, padded on the higher-order (left) side with ``0xff`` for negative ``X`` and with zero bytes for positive ``X`` such that the length is 32 bytes.
- ``bool``: as in the ``uint8`` case, where ``1`` is used for ``true`` and ``0`` for ``false``
- ``fixed<M>x<N>``: ``enc(X)`` is ``enc(X * 10**N)`` where ``X * 10**N`` is interpreted as a ``int256``.
- ``fixed``: as in the ``fixed128x19`` case
- ``ufixed<M>x<N>``: ``enc(X)`` is ``enc(X * 10**N)`` where ``X * 10**N`` is interpreted as a ``uint256``.
- ``ufixed``: as in the ``ufixed128x19`` case
- ``bytes<M>``: ``enc(X)`` is the sequence of bytes in ``X`` padded with zero-bytes to a length of 32.
- ``bytes<M>``: ``enc(X)`` is the sequence of bytes in ``X`` padded with trailing zero-bytes to a length of 32 bytes.

Note that for any ``X``, ``len(enc(X))`` is a multiple of 32.

Expand Down Expand Up @@ -290,6 +294,8 @@ In effect, a log entry using this ABI is described as:

For all fixed-length Solidity types, the ``EVENT_INDEXED_ARGS`` array contains the 32-byte encoded value directly. However, for *types of dynamic length*, which include ``string``, ``bytes``, and arrays, ``EVENT_INDEXED_ARGS`` will contain the *Keccak hash* of the encoded value, rather than the encoded value directly. This allows applications to efficiently query for values of dynamic-length types (by setting the hash of the encoded value as the topic), but leaves applications unable to decode indexed values they have not queried for. For dynamic-length types, application developers face a trade-off between fast search for predetermined values (if the argument is indexed) and legibility of arbitrary values (which requires that the arguments not be indexed). Developers may overcome this tradeoff and achieve both efficient search and arbitrary legibility by defining events with two arguments — one indexed, one not — intended to hold the same value.

.. _abi_json:

JSON
====

Expand Down
Loading

0 comments on commit dfe3193

Please sign in to comment.