Skip to content

Commit

Permalink
Merge pull request ethereum#2667 from ethereum/develop
Browse files Browse the repository at this point in the history
Merge develop into release in proparation for 0.4.14
  • Loading branch information
chriseth authored Jul 31, 2017
2 parents 0fb4cb1 + 2abfdb6 commit c2215d4
Show file tree
Hide file tree
Showing 194 changed files with 17,492 additions and 1,581 deletions.
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.13")
set(PROJECT_VERSION "0.4.14")
project(solidity VERSION ${PROJECT_VERSION})

# Let's find our dependencies
Expand Down
22 changes: 22 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
### 0.4.14 (2017-07-31)

Features:
* C API (``jsonCompiler``): Export the ``license`` method.
* Code Generator: Optimise the fallback function, by removing a useless jump.
* Inline Assembly: Show useful error message if trying to access calldata variables.
* Inline Assembly: Support variable declaration without initial value (defaults to 0).
* Metadata: Only include files which were used to compile the given contract.
* Type Checker: Disallow value transfers to contracts without a payable fallback function.
* Type Checker: Include types in explicit conversion error message.
* Type Checker: Raise proper error for arrays too large for ABI encoding.
* Type checker: Warn if using ``this`` in a constructor.
* Type checker: Warn when existing symbols, including builtins, are overwritten.

Bugfixes:
* Code Generator: Properly clear return memory area for ecrecover.
* Type Checker: Fix crash for some assignment to non-lvalue.
* Type Checker: Fix invalid "specify storage keyword" warning for reference members of structs.
* Type Checker: Mark modifiers as internal.
* Type Checker: Re-allow multiple mentions of the same modifier per function.


### 0.4.13 (2017-07-06)

Features:
Expand Down
19 changes: 19 additions & 0 deletions ReleaseChecklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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).
- [ ] 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).
- [ ] Update the homebrew realease in https://github.com/ethereum/homebrew-ethereum/blob/master/solidity.rb (version and hash)
- [ ] Make a release of ``solc-js``: Increment the version number, create a pull request for that, merge it after tests succeeded.
- [ ] Run ``npm publish`` in the updated ``solc-js`` repository.
- [ ] Create a commit to increase the version number on ``develop`` in ``CMakeLists.txt`` and add a new skeleton changelog entry.
- [ ] Merge ``release`` back into ``develop``.
- [ ] Announce on Twitter and Reddit.
- [ ] Lean back, wait for bug reports and repeat from step 1 :)
22 changes: 18 additions & 4 deletions cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,24 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
endif()

if (EMSCRIPTEN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --memory-init-file 0 -O3 -s LINKABLE=1 -s DISABLE_EXCEPTION_CATCHING=0 -s NO_EXIT_RUNTIME=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_DYNAMIC_EXECUTION=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_FILESYSTEM=1 -s AGGRESSIVE_VARIABLE_ELIMINATION=1")
# Do emit a separate memory initialiser file
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --memory-init-file 0")
# Leave only exported symbols as public and agressively remove others
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections -fvisibility=hidden")
# Optimisation level
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
# Re-enable exception catching (optimisations above -O1 disable it)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s DISABLE_EXCEPTION_CATCHING=0")
# Remove any code related to exit (such as atexit)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_EXIT_RUNTIME=1")
# Remove any code related to filesystem access
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_FILESYSTEM=1")
# Remove variables even if it needs to be duplicated (can improve speed at the cost of size)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s AGGRESSIVE_VARIABLE_ELIMINATION=1")
# Allow memory growth, but disable some optimisations
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ALLOW_MEMORY_GROWTH=1")
# Disable eval()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_DYNAMIC_EXECUTION=1")
add_definitions(-DETH_EMSCRIPTEN=1)
endif()
endif()
Expand Down
19 changes: 10 additions & 9 deletions docs/abi-spec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
Application Binary Interface Specification
******************************************

Basic design
Basic Design
============

The Application Binary Interface is the standard way to interact with contracts in the Ethereum ecosystem, both
from outside the blockchain and for contract-to-contract interaction. Data is encoded following its type,
according to this specification.
from outside the blockchain and for contract-to-contract interaction. Data is encoded according to its type,
as described in this specification. The encoding is not self describing and thus requires a schema in order to decode.

We assume the Application Binary Interface (ABI) is strongly typed, known at compilation time and static. No introspection mechanism will be provided. We assert that all contracts will have the interface definitions of any contracts they call available at compile-time.
We assume the interface functions of a contract are strongly typed, known at compilation time and static. No introspection mechanism will be provided. We assume that all contracts will have the interface definitions of any contracts they call available at compile-time.

This specification does not address contracts whose interface is dynamic or otherwise known only at run-time. Should these cases become important they can be adequately handled as facilities built within the Ethereum ecosystem.

Expand Down Expand Up @@ -58,7 +58,7 @@ The following (fixed-size) array type exists:

- `<type>[M]`: a fixed-length array of the given fixed-length type.

The following non-fixed-size types exist:
The following non-fixed-size types exist:

- `bytes`: dynamic sized byte sequence.

Expand Down Expand Up @@ -93,6 +93,7 @@ We distinguish static and dynamic types. Static types are encoded in-place and d
* `string`
* `T[]` for any `T`
* `T[k]` for any dynamic `T` and any `k > 0`
* `(T1,...,Tk)` if any `Ti` is dynamic for `1 <= i <= k`

All other types are called "static".

Expand Down Expand Up @@ -181,6 +182,8 @@ Given the contract:

::

pragma solidity ^0.4.0;

contract Foo {
function bar(bytes3[2] xy) {}
function baz(uint32 x, bool y) returns (bool r) { r = x > 32 || y; }
Expand Down Expand Up @@ -313,6 +316,8 @@ For example,

::

pragma solidity ^0.4.0;

contract Test {
function Test(){ b = 0x12345678901234567890123456789012; }
event Event(uint indexed a, bytes32 b)
Expand All @@ -334,10 +339,6 @@ would result in the JSON:
"inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}],
"name":"Event2"
}, {
"type":"event",
"inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}],
"name":"Event2"
}, {
"type":"function",
"inputs": [{"name":"a","type":"uint256"}],
"name":"foo",
Expand Down
16 changes: 9 additions & 7 deletions docs/assembly.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ you really know what you are doing.
function sumAsm(uint[] _data) returns (uint o_sum) {
for (uint i = 0; i < _data.length; ++i) {
assembly {
o_sum := mload(add(add(_data, 0x20), mul(i, 0x20)))
o_sum := add(o_sum, mload(add(add(_data, 0x20), mul(i, 0x20))))
}
}
}
Expand All @@ -110,7 +110,7 @@ these curly braces, the following can be used (see the later sections for more d
- opcodes (in "instruction style"), e.g. ``mload sload dup1 sstore``, for a list see below
- opcodes in functional style, e.g. ``add(1, mlod(0))``
- labels, e.g. ``name:``
- variable declarations, e.g. ``let x := 7`` or ``let x := add(y, 3)``
- variable declarations, e.g. ``let x := 7``, ``let x := add(y, 3)`` or ``let x`` (initial value of empty (0) is assigned)
- identifiers (labels or assembly-local variables and externals if used as inline assembly), e.g. ``jump(name)``, ``3 x add``
- assignments (in "instruction style"), e.g. ``3 =: x``
- assignments in functional style, e.g. ``x := add(y, 3)``
Expand Down Expand Up @@ -490,7 +490,7 @@ is performed by replacing the variable's value on the stack by the new value.

.. code::
assembly {
{
let v := 0 // functional-style assignment as part of variable declaration
let g := add(v, 2)
sload(10)
Expand All @@ -509,7 +509,7 @@ case called ``default``.

.. code::
assembly {
{
let x := 0
switch calldataload(4)
case 0 {
Expand Down Expand Up @@ -538,7 +538,7 @@ The following example computes the sum of an area in memory.

.. code::
assembly {
{
let x := 0
for { let i := 0 } lt(i, 0x100) { i := add(i, 0x20) } {
x := add(x, mload(i))
Expand All @@ -565,7 +565,7 @@ The following example implements the power function by square-and-multiply.

.. code::
assembly {
{
function power(base, exponent) -> result {
switch exponent
case 0 { result := 1 }
Expand Down Expand Up @@ -679,6 +679,8 @@ Example:
We will follow an example compilation from Solidity to desugared assembly.
We consider the runtime bytecode of the following Solidity program::

pragma solidity ^0.4.0;

contract C {
function f(uint x) returns (uint y) {
y = 1;
Expand Down Expand Up @@ -965,7 +967,7 @@ adjustment. Every time a new
local variable is introduced, it is registered together with the current
stack height. If a variable is accessed (either for copying its value or for
assignment), the appropriate DUP or SWAP instruction is selected depending
on the difference bitween the current stack height and the
on the difference between the current stack height and the
stack height at the point the variable was introduced.

Pseudocode::
Expand Down
9 changes: 8 additions & 1 deletion docs/bugs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[
{
"name": "ECRecoverMalformedInput",
"summary": "The ecrecover() builtin can return garbage for malformed input.",
"description": "The ecrecover precompile does not properly signal failure for malformed input (especially in the 'v' argument) and thus the Solidity function can return data that was previously present in the return area in memory.",
"fixed": "0.4.14",
"severity": "medium"
},
{
"name": "SkipEmptyStringLiteral",
"summary": "If \"\" is used in a function call, the following function arguments will not be correctly passed to the function.",
Expand Down Expand Up @@ -107,4 +114,4 @@
"severity": "high",
"fixed": "0.3.0"
}
]
]
Loading

0 comments on commit c2215d4

Please sign in to comment.