diff --git a/CMakeLists.txt b/CMakeLists.txt index 8385ea229..abd5b409a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ include(EthPolicy) eth_policy() # project name and version should be set after cmake_policy CMP0048 -project(cpp-ethereum VERSION "1.2.4") +project(cpp-ethereum VERSION "1.2.5") include(EthCompilerSettings) diff --git a/CodingStandards.txt b/CodingStandards.txt index 9e4765355..c18d2722b 100644 --- a/CodingStandards.txt +++ b/CodingStandards.txt @@ -1,12 +1,11 @@ 0. Formatting +GOLDEN RULE: Follow the style of the existing code when you make changes. -GOLDEN RULE: Never *ever* use spaces for formatting. - -a. Use tabs for indentation! +a. Use tabs for leading indentation - tab stops are every 4 characters. - One indentation level -> exactly one byte (i.e. a tab character) in the source file. -- Never use spaces to line up sequential lines: If you have run-on lines, indent as you would for a block. +- If you have run-on lines, indent as you would for a block. b. Line widths: - Don't worry about having lines of code > 80-char wide. - Lines of comments should be formatted according to ease of viewing, but simplicity is to be prefered over beauty. @@ -60,8 +59,6 @@ std::tuple meanAndSigma(std::vector const& _v); 2. Preprocessor; a. File comment is always at top, and includes: -- Original author, date. -- Later maintainers (not contributors - they can be seen through VCS log). - Copyright. - License (e.g. see COPYING). b. Never use #ifdef/#define/#endif file guards. Prefer #pragma once as first line below file comment. @@ -179,7 +176,7 @@ a. Collection conventions: b. Class conventions: - -Face means the interface of some shared concept. (e.g. FooFace might be a pure virtual class.) c. Avoid unpronouncable names; -- If you need to shorten a name favour a pronouncable slice of the original to a scatterred set of consonants. +- If you need to shorten a name favour a pronouncable slice of the original to a scattered set of consonants. - e.g. Manager shortens to Man rather than Mgr. d. Avoid prefixes of initials (e.g. DON'T use IMyInterface, CMyImplementation) e. Find short, memorable & (at least semi-) descriptive names for commonly used classes or name-fragments. @@ -201,6 +198,7 @@ c. Where there are exceptions to this (due to excessive use and clear meaning), d. In general expressions should be roughly as important/semantically meaningful as the space they occupy. + 11. Commenting a. Comments should be doxygen-compilable, using @notation rather than \notation. @@ -228,6 +226,8 @@ a. Includes should go in order of lower level (STL -> boost -> libdevcore -> lib b. The only exception to the above rule is the top of a .cpp file where its corresponding header should be located. + + 13. Logging Logging should be performed at appropriate verbosities depending on the logging message. @@ -239,3 +239,17 @@ Some rules to keep in mind: - Verbosity >= 2 -> Anything that is or might be displayed more than once every minute - Verbosity >= 3 -> Anything that only a developer would understand - Verbosity >= 4 -> Anything that is low-level (e.g. peer disconnects, timers being cancelled) + + +14. Recommended reading + +Herb Sutter and Bjarne Stroustrup +- "C++ Core Guidelines" (https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md) + +Herb Sutter and Andrei Alexandrescu +- "C++ Coding Standards: 101 Rules, Guidelines, and Best Practices" + +Scott Meyers +- "Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition)" +- "More Effective C++: 35 New Ways to Improve Your Programs and Designs" +- "Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14" diff --git a/alethzero b/alethzero index 0e65260c8..6a2a2f0b7 160000 --- a/alethzero +++ b/alethzero @@ -1 +1 @@ -Subproject commit 0e65260c86c66a04dd97f80940850f63bce9e35e +Subproject commit 6a2a2f0b746052b5e065d47e44a4bacd98c9b2a8 diff --git a/astylerc b/astylerc deleted file mode 100644 index d4e1188eb..000000000 --- a/astylerc +++ /dev/null @@ -1,11 +0,0 @@ -style=allman -indent=force-tab=4 -convert-tabs -indent-preprocessor -min-conditional-indent=1 -pad-oper -pad-header -unpad-paren -align-pointer=type -keep-one-line-blocks -close-templates diff --git a/dependency_graph/generate.py b/dependency_graph/generate.py index 2ca3f74bb..08da2499f 100755 --- a/dependency_graph/generate.py +++ b/dependency_graph/generate.py @@ -99,7 +99,7 @@ def processSubmodule(root, submodule): # Mix doesn't have the same sub-module structure as everything else if (submodule == "mix"): - print 'Mix\n' + print '"Mix-ide"\n' else: print getLibraryAndApplicationNames(submodulePath) diff --git a/diffscript.sh b/diffscript.sh deleted file mode 100755 index ef664e8cc..000000000 --- a/diffscript.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# author: Lefteris Karapetsas -# -# A script to list all changes of the submodule compared -# to a revision passed as the only argument. -# @ -echo "Listing changes for umbreall repo itself" -git --no-pager diff $1 -subs=(`git submodule | awk '{print $2}'`) -for sub in ${subs[*]}; do - lastrevision=`git diff $1 $sub | fgrep "Subproject" | head -n1 | awk '{print $3}'` - cd $sub - echo "Listing changes for $sub" - git --no-pager diff $lastrevision - cd .. -done diff --git a/foreach.sh b/foreach.sh deleted file mode 100755 index e46f63580..000000000 --- a/foreach.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -branch=$(git branch | grep "\*" | cut -c 3-) -for i in webthree-helpers libweb3core libethereum web3.js solidity webthree alethzero mix; do -cd $i -lbranch=$(git branch | grep "\*" | cut -c 3-) -if [ "$lbranch" == "$branch" ] ; then -echo Entering $i ... -"$@" -else -echo "Skipping $i (branch $lbranch is not $branch)". -fi -cd .. -done diff --git a/getcoverage.sh b/getcoverage.sh deleted file mode 100755 index b11f8dced..000000000 --- a/getcoverage.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -CPP_ETHEREUM_PATH=$(pwd) -BUILD_DIR=$CPP_ETHEREUM_PATH/build -TEST_MODE="" - -for i in "$@" -do -case $i in - -builddir) - shift - ((i++)) - BUILD_DIR=${!i} - shift - ;; - --all) - TEST_MODE="--all" - shift - ;; - --filltests) - TEST_FILL="--filltests" - shift - ;; -esac -done - -which $BUILD_DIR/test/testeth >/dev/null 2>&1 -if [ $? != 0 ] -then - echo "You need to compile and build ethereum with cmake -DPROFILING option to the build dir!" - exit; -fi - -OUTPUT_DIR=$BUILD_DIR/test/coverage -if which lcov >/dev/null; then - if which genhtml >/dev/null; then - echo Cleaning previous report... - if [ -d "$OUTPUT_DIR" ]; then - rm -r $OUTPUT_DIR - fi - mkdir $OUTPUT_DIR - lcov --directory $BUILD_DIR --zerocounters - lcov --capture --initial --directory $BUILD_DIR --output-file $OUTPUT_DIR/coverage_base.info - - echo Running testeth... - $BUILD_DIR/test/testeth $TEST_MODE $TEST_FILL - $BUILD_DIR/test/testeth -t StateTests --jit $TEST_MODE - $BUILD_DIR/test/testeth -t VMTests --jit $TEST_MODE - - echo Prepearing coverage info... - lcov --capture --directory $BUILD_DIR --output-file $OUTPUT_DIR/coverage_test.info - lcov --add-tracefile $OUTPUT_DIR/coverage_base.info --add-tracefile $OUTPUT_DIR/coverage_test.info --output-file $OUTPUT_DIR/coverage_all.info - lcov --extract $OUTPUT_DIR/coverage_all.info *cpp-ethereum/* --output-file $OUTPUT_DIR/coverage_export.info - genhtml $OUTPUT_DIR/coverage_export.info --output-directory $OUTPUT_DIR/testeth - else - echo genhtml not found - exit; - fi -else - echo lcov not found - exit; -fi - -echo "Coverage info should be located at: $OUTPUT_DIR/testeth" -echo "Opening index..." - -xdg-open $OUTPUT_DIR/testeth/index.html & diff --git a/getdev.sh b/getdev.sh deleted file mode 100755 index 9f815f3e0..000000000 --- a/getdev.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -for i in libweb3core libethereum webthree alethzero; do -cd $i -git checkout develop -cd .. -done diff --git a/libethereum b/libethereum index 4b55bf902..e63fcb0d1 160000 --- a/libethereum +++ b/libethereum @@ -1 +1 @@ -Subproject commit 4b55bf902e2b5bc3e826e261099c2a4f52c3ef4d +Subproject commit e63fcb0d1b0174b32193699b792789e58b82ad2c diff --git a/libweb3core b/libweb3core index 300ade534..53535c63a 160000 --- a/libweb3core +++ b/libweb3core @@ -1 +1 @@ -Subproject commit 300ade534ff90acffb3e01db8b5de2789ed0227d +Subproject commit 53535c63a7ef766daeff3d1cf580519517495361 diff --git a/mix b/mix index 91fbfc104..f3d50a8f4 160000 --- a/mix +++ b/mix @@ -1 +1 @@ -Subproject commit 91fbfc1046c80669bddcaaedcaa0109fe13e6c94 +Subproject commit f3d50a8f4f855d9689a50cdc2eab680e849ef414 diff --git a/nameeach.sh b/nameeach.sh deleted file mode 100755 index c56badcdb..000000000 --- a/nameeach.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -branch=$(git branch | grep "\*" | cut -c 3-) -for i in webthree-helpers libweb3core libethereum web3.js solidity webthree alethzero mix; do -cd $i -lbranch=$(git branch | grep "\*" | cut -c 3-) -cd .. -if [ "$lbranch" == "$branch" ] ; then -echo Entering $i ... -"$@" "$i" -else -echo "Skipping $i (branch $lbranch is not $branch)". -fi -done diff --git a/new.sh b/new.sh deleted file mode 100755 index aac356576..000000000 --- a/new.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -cd webthree-helpers -./new.sh "$1" "../$2" "$3" -cd .. - diff --git a/push.sh b/push.sh deleted file mode 100755 index d9e1fb33e..000000000 --- a/push.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -cd $1 -git pull -git push git@github.com:ethereum/$1 -cd .. - diff --git a/recreate-cpp-ethereum.sh b/recreate-cpp-ethereum.sh new file mode 100755 index 000000000..e0a093df0 --- /dev/null +++ b/recreate-cpp-ethereum.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash +# +# Script to recreate the cpp-ethereum repository by copying directories from webthree-umbrella. +# +# This is for one step of the "Dry run for repository reorganization" which is to get the content +# correct, automated and tested, before pulling the trigger on the real move, which will need to +# preserve history. +# +# See https://github.com/ethereum/webthree-umbrella/issues/453 + +outputDirectory=../cpp-ethereum-recreated + +rm -rf $outputDirectory +mkdir -p $outputDirectory +mkdir -p $outputDirectory/test/ + +# alethzero intentionally omitted +rsync -r ./dependency_graph/ $outputDirectory/dependency_graph/ +rsync -r ./doc/ $outputDirectory/doc/ +rsync -r ./docker/ $outputDirectory/docker/ +rsync -r ./libethereum/ethkey/ $outputDirectory/ethkey/ +rsync -r ./libethereum/ethminer/ $outputDirectory/ethminer/ +rsync -r ./libethereum/ethvm/ $outputDirectory/ethvm/ +rsync -r ./libethereum/libethash/ $outputDirectory/libethash/ +rsync -r ./libethereum/libethash-cl/ $outputDirectory/libethash-cl/ +rsync -r ./libethereum/libethashseal/ $outputDirectory/libethashseal/ +rsync -r ./libethereum/libethcore/ $outputDirectory/libethcore/ +rsync -r ./libethereum/libethereum/ $outputDirectory/libethereum/ +rsync -r ./libethereum/libevm/ $outputDirectory/libevm/ +rsync -r ./libethereum/libevmcore/ $outputDirectory/libevmcore/ +rsync -r ./libethereum/libnatspec/ $outputDirectory/libnatspec/ +rsync -r ./libethereum/libtestutils/ $outputDirectory/libtestutils/ +rsync -r ./libethereum/test/deprecated/ $outputDirectory/test/deprecated/ +rsync -r ./libethereum/test/external-dependencies/ $outputDirectory/test/external-dependencies/ +rsync -r ./libethereum/test/fuzzTesting/ $outputDirectory/test/fuzzTesting/ +rsync -r ./libethereum/test/libethcore/ $outputDirectory/test/libethcore/ +rsync -r ./libethereum/test/libethereum/ $outputDirectory/test/libethereum/ +rsync -r ./libethereum/test/libevm/ $outputDirectory/test/libevm/ +rsync -r ./libethereum/test/libnatspec/ $outputDirectory/test/libnatspec/ +rsync -r ./libethereum/test/libweb3core/ $outputDirectory/test/libweb3core/ +rsync -r ./libethereum/test/BlockChainHelper.cpp $outputDirectory/test/BlockChainHelper.cpp +rsync -r ./libethereum/test/BlockChainHelper.h $outputDirectory/test/BlockChainHelper.h +rsync -r ./libethereum/test/boostTest.cpp $outputDirectory/test/boostTest.cpp +rsync -r ./libethereum/test/JSON_test.sol $outputDirectory/test/JSON_test.sol +rsync -r ./libethereum/test/JsonSpiritHeaders.h $outputDirectory/test/JsonSpiritHeaders.h +rsync -r ./libethereum/test/Stats.cpp $outputDirectory/test/Stats.cpp +rsync -r ./libethereum/test/Stats.h $outputDirectory/test/Stats.h +rsync -r ./libethereum/test/TestHelper.cpp $outputDirectory/test/TestHelper.cpp +rsync -r ./libethereum/test/TestHelper.h $outputDirectory/test/TestHelper.h +rsync -r ./libethereum/test/TestUtils.cpp $outputDirectory/test/TestUtils.cpp +rsync -r ./libethereum/test/TestUtils.h $outputDirectory/test/TestUtils.h +rsync -r ./libweb3core/bench/ $outputDirectory/bench/ +rsync -r ./libweb3core/libdevcore/ $outputDirectory/libdevcore/ +rsync -r ./libweb3core/libdevcrypto/ $outputDirectory/libdevcrypto/ +rsync -r ./libweb3core/libp2p/ $outputDirectory/libp2p/ +rsync -r ./libweb3core/rlp/ $outputDirectory/rlp/ +rsync -r ./libweb3core/test/libdevcore/ $outputDirectory/test/libdevcore/ +rsync -r ./libweb3core/test/libdevcrypto/ $outputDirectory/test/libdevcrypto/ +rsync -r ./libweb3core/test/libp2p/ $outputDirectory/test/libp2p/ +rsync -r ./libweb3core/test/memorydb.cpp $outputDirectory/test/memorydb.cpp +rsync -r ./libweb3core/test/overlaydb.cpp $outputDirectory/test/overlaydb.cpp +# libweb3core/test/test.cpp and test.h intentionally omitted because they clash with boosttest.cpp from libethereum/test. +# mix intentionally omitted +# res intentionally omitted +# solidity intentionally omitted +# web3.js intentionally omitted +rsync -r ./webthree/eth/ $outputDirectory/eth/ +rsync -r ./webthree/libweb3jsonrpc/ $outputDirectory/libweb3jsonrpc/ +rsync -r ./webthree/libwebthree/ $outputDirectory/libwebthree/ +rsync -r ./webthree/libwhisper/ $outputDirectory/libwhisper/ +rsync -r ./webthree/test/ethrpctest/ $outputDirectory/test/ethrpctest/ +rsync -r ./webthree/test/libweb3jsonrpc/ $outputDirectory/test/libweb3jsonrpc/ +rsync -r ./webthree/test/libwhisper/ $outputDirectory/test/libwhisper/ +rsync -r ./webthree-helpers/cmake/ $outputDirectory/cmake/ +rsync -r ./webthree-helpers/extdep/ $outputDirectory/extdep/ +rsync -r ./webthree-helpers/homebrew/ $outputDirectory/homebrew/ +rsync -r ./webthree-helpers/js/ $outputDirectory/js/ +rsync -r ./webthree-helpers/scripts/ $outputDirectory/scripts/ +rsync -r ./webthree-helpers/templates/ $outputDirectory/templates/ +rsync -r ./webthree-helpers/utils/ $outputDirectory/utils/ +# intentionally left /webthree-helpers root files behind: (LICENSE, new.sh, README.md) +# TODO /webthree-helpers/cmake has (LICENSE, README.md), but why? +# TODO /webthree-helpers/homebrew has (LICENSE, README.md), but why? +# Tried unsuccessfully to delete homebrew ones. Needed in some release flow? + +# Loose files in the root directory of webthree-umbrella. +# TODO - Move all these loose scripts in the root into /scripts +# CMakeLists.txt intentionally omitted. +rsync -r ./CodingStandards.txt $outputDirectory/CodingStandards.txt +rsync -r ./CONTRIBUTING.md $outputDirectory/CONTRIBUTING.md +rsync -r ./GPLV3_LICENSE $outputDirectory/GPLV3_LICENSE +rsync -r ./LICENSE $outputDirectory/LICENSE +# qtcreator-style intentionally omitted. +# README.md intentionally omitted. +rsync -r ./sanitizer-blacklist.txt $outputDirectory/sanitizer-blacklist.txt +rsync -r ./sync.sh $outputDirectory/sync.sh + +# These files cannot be upstreamed, but instead need to be manually maintained and then dropped into 'cpp-ethereum' when we merge. +# These CMakeLists.txt were manually synthesized by Bob. +curl https://raw.githubusercontent.com/bobsummerwill/cpp-ethereum/merge_repos/cmake/EthOptions.cmake > $outputDirectory/cmake/EthOptions.cmake +curl https://raw.githubusercontent.com/bobsummerwill/cpp-ethereum/merge_repos/CMakeLists.txt > $outputDirectory/CMakeLists.txt +curl https://raw.githubusercontent.com/bobsummerwill/cpp-ethereum/merge_repos/README.md > $outputDirectory/README.md +curl https://raw.githubusercontent.com/bobsummerwill/cpp-ethereum/merge_repos/test/CMakeLists.txt > $outputDirectory/test/CMakeLists.txt + +# These files could be upstreamed, but it isn't worth doing so, because they can only be used after the repo reorganization. +curl https://raw.githubusercontent.com/bobsummerwill/cpp-ethereum/merge_repos/.travis.yml > $outputDirectory/.travis.yml +curl https://raw.githubusercontent.com/bobsummerwill/cpp-ethereum/merge_repos/appveyor.yml > $outputDirectory/appveyor.yml +curl https://raw.githubusercontent.com/bobsummerwill/cpp-ethereum/merge_repos/circle.yml > $outputDirectory/circle.yml +curl https://raw.githubusercontent.com/bobsummerwill/cpp-ethereum/merge_repos/setup.sh > $outputDirectory/setup.sh + +# TODO - evmjit submodule will need "hooking up", for now we'll just git clone it into a local directory to get +# the content we need for testing. +git clone https://github.com/ethereum/evmjit $outputDirectory/evmjit + +# TODO - Move Contributing and coding standards to http://ethdocs.org +# TODO - Where will qtcreator-style go? Ditto for res folder. diff --git a/solidity b/solidity index 81ae2a783..4dc1cb149 160000 --- a/solidity +++ b/solidity @@ -1 +1 @@ -Subproject commit 81ae2a78321fddcd2d32efc51568ebeca28866a8 +Subproject commit 4dc1cb149c7e3677119b052ae0f7dc7a019fa952 diff --git a/web3.js b/web3.js index 3ba32a673..0f1ab3227 160000 --- a/web3.js +++ b/web3.js @@ -1 +1 @@ -Subproject commit 3ba32a673426f888d9372591f6d6037bda03118a +Subproject commit 0f1ab3227b8985fa5b9cd1fdc75315383f4d7249 diff --git a/webthree b/webthree index 240a3aa7a..5ec02cbee 160000 --- a/webthree +++ b/webthree @@ -1 +1 @@ -Subproject commit 240a3aa7af4d55f6551099583b74ac6fc557f65e +Subproject commit 5ec02cbeeba4e83d38464ad337f6e811b63f8921 diff --git a/webthree-helpers b/webthree-helpers index f37cc061d..4900c17d5 160000 --- a/webthree-helpers +++ b/webthree-helpers @@ -1 +1 @@ -Subproject commit f37cc061d7004c7e69d2fc39f76651900edc3d78 +Subproject commit 4900c17d5c2c84ce8f34cc3699218039173e8f42