Skip to content

Commit

Permalink
Add the batch of release v3.4.0-beta-20181212 commits
Browse files Browse the repository at this point in the history
  • Loading branch information
developer-at-bcn committed Dec 12, 2018
1 parent fa8fa01 commit d721103
Show file tree
Hide file tree
Showing 207 changed files with 15,634 additions and 11,311 deletions.
112 changes: 54 additions & 58 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ cmake_minimum_required(VERSION 3.0)
project(bytecoin)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_C_STANDARD 11)
# message(STATUS "Bytecoind profile: According to cmake, sizeof(void *) == " ${CMAKE_SIZEOF_VOID_P})
set(CRYPTONOTE_NAME bytecoin)
add_definitions(-DCRYPTONOTE_NAME=\"${CRYPTONOTE_NAME}\")
option(USE_INSTRUMENTATION "For testing - builds with address sanitizer instrument" OFF)
option(WITH_THREAD_SANITIZER "For testing - builds with thread sanitizer instrument, USE_INSTRUMENTATION must be also set" OFF)
option(BETTER_DEBUG "Disables optimizations. We do not use standard debug/realease configurations because they change too much" OFF)
option(USE_SSL "Builds with support of https between walletd and bytecoind" ON)
get_filename_component(PARENT_DIR ${CMAKE_SOURCE_DIR} DIRECTORY)

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
option(USE_SQLITE "Builds with SQLite instead of LMDB. 4x slower, but works on 32-bit and mobile platforms" OFF)
set(OPENSSL_ROOT ../openssl)
set(OPENSSL_ROOT ${PARENT_DIR}/openssl)
else()
option(USE_SQLITE "Builds with sqlite instead of LMDB. 4x slower, but works on 32-bit and mobile platforms" ON)
set(OPENSSL_ROOT ../openssl32)
set(OPENSSL_ROOT ${PARENT_DIR}/openssl32)
endif()
if(WIN32)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
add_definitions(-D_SCL_SECURE_NO_WARNINGS=1 -D_CRT_SECURE_NO_WARNINGS=1 -D_WIN32_WINNT=0x0501)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes -g -Wall -Wextra -Werror=return-type -Wno-unused-parameter")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes -g -Wall -Wextra -Werror=return-type -Wno-unused-parameter")
if(BETTER_DEBUG)
message(STATUS "Using better debug: " ${BETTER_DEBUG})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
endif()
message(STATUS "Better debug: " ${BETTER_DEBUG})
message(STATUS "Instrumentation usage: " ${USE_INSTRUMENTATION})
message(STATUS "Thread sanitizer usage: " ${WITH_THREAD_SANITIZER})
if(USE_INSTRUMENTATION)
Expand All @@ -44,30 +44,34 @@ else()
endif()
endif()
endif()
include_directories(${PARENT_DIR}/sqlite)
if(NOT EXISTS "${PARENT_DIR}/sqlite/sqlite3.c")
message(FATAL_ERROR "${PARENT_DIR}/sqlite/sqlite3.c not found. Make sure amalgamated sqlite is in ../sqlite/")
endif()
set(SRC_WARNINGS_DB ../sqlite/sqlite3.c)
set(SRC_DB src/platform/DBsqlite3.cpp src/platform/DBsqlite3.hpp)
if(USE_SQLITE)
# Requires dl on Linux, we add it unconditionally for simplicity.
message(STATUS "Database selected: SQLite 3. Make sure it is put into ../sqlite/")
include_directories(../sqlite)
set(SRC_WARNINGS_DB ../sqlite/sqlite3.c)
set(SRC_DB src/platform/DBsqlite3.cpp src/platform/DBsqlite3.hpp)
message(STATUS "Database selected: SQLite 3")
add_definitions(-Dplatform_USE_SQLITE=1)
else()
message(STATUS "Database selected: LMDB. Make sure it is put into ../lmdb/")
message(STATUS "Database selected: LMDB")
include_directories(../lmdb/libraries/liblmdb)
set(SRC_WARNINGS_DB ../lmdb/libraries/liblmdb/mdb.c ../lmdb/libraries/liblmdb/midl.c)
set(SRC_DB src/platform/DBlmdb.cpp src/platform/DBlmdb.hpp)
endif()
if(USE_SSL)
message(STATUS "SSL usage: ON. Make sure openssl headers are in " ${OPENSSL_ROOT} "/include and static libs are in " ${OPENSSL_ROOT} "/")
include_directories(${OPENSSL_ROOT}/include)
link_directories(${OPENSSL_ROOT}) # Must be placed before add_executable, add_library.
set(LINK_OPENSSL ssl crypto)
add_definitions(-Dplatform_USE_SSL=1)
else()
message(STATUS "SSL usage: OFF")
if(NOT EXISTS "${PARENT_DIR}/lmdb/libraries/liblmdb/mdb.c")
message(FATAL_ERROR "${PARENT_DIR}/lmdb/libraries/liblmdb/mdb.c not found. Make sure lmdb is cloned into ../lmdb/")
endif()
set(SRC_WARNINGS_DB ${SRC_WARNINGS_DB} ../lmdb/libraries/liblmdb/mdb.c ../lmdb/libraries/liblmdb/midl.c)
set(SRC_DB ${SRC_DB} src/platform/DBlmdb.cpp src/platform/DBlmdb.hpp)
endif()

message(STATUS "Make sure OpenSSL headers are in " ${OPENSSL_ROOT} "/include and static libs are in " ${OPENSSL_ROOT} "/")
include_directories(${OPENSSL_ROOT}/include)
link_directories(${OPENSSL_ROOT}) # Must be placed before add_executable, add_library.
set(LINK_OPENSSL ssl crypto)
add_definitions(-Dplatform_USE_SSL=1)

file(GLOB SRC_CRYPTO
src/crypto/*.cpp src/crypto/*.hpp src/crypto/*.h
src/crypto/*.cpp src/crypto/*.hpp
src/crypto/*.c src/crypto/*.h
src/crypto/bernstein/*.h src/crypto/bernstein/*.c
src/crypto/blake/*.h src/crypto/blake/*.c
Expand All @@ -78,7 +82,6 @@ file(GLOB SRC_CRYPTO
src/crypto/skein/*.h src/crypto/skein/*.c
)
file(GLOB SRC_COMMON src/common/*.cpp src/common/*.hpp)
file(GLOB SRC_SERIALIZATION src/Serialization/*.cpp src/Serialization/*.hpp)
file(GLOB SRC_SERIA src/seria/*.cpp src/seria/*.hpp)
file(GLOB SRC_LOGGING src/logging/*.cpp src/logging/*.hpp)
file(GLOB SRC_P2P src/p2p/*.cpp src/p2p/*.hpp)
Expand All @@ -93,29 +96,28 @@ file(GLOB SRC_PLATFORM
src/platform/PreventSleep.cpp src/platform/PreventSleep.hpp
src/platform/Windows.hpp src/platform/DB.hpp
)
# We compile those folders with full optimization even in debug mode, otherwise binaries will run much slower in debug
if(WIN32)
set_property(SOURCE ${SRC_CRYPTO} PROPERTY COMPILE_FLAGS -Ot)
set_property(SOURCE ${SRC_DB} PROPERTY COMPILE_FLAGS -Ot)
set_property(SOURCE ${SRC_WARNINGS_DB} PROPERTY COMPILE_FLAGS "-Ot -w")
set_property(SOURCE ${SRC_COMMON} PROPERTY COMPILE_FLAGS -Ot)
set_property(SOURCE ${SRC_SERIALIZATION} PROPERTY COMPILE_FLAGS -Ot)
set_property(SOURCE ${SRC_SERIA} PROPERTY COMPILE_FLAGS -Ot)
else()
set_property(SOURCE ${SRC_CRYPTO} PROPERTY COMPILE_FLAGS -O3)
set_property(SOURCE ${SRC_DB} PROPERTY COMPILE_FLAGS -O3)
set_property(SOURCE ${SRC_WARNINGS_DB} PROPERTY COMPILE_FLAGS "-O3 -w")
set_property(SOURCE ${SRC_COMMON} PROPERTY COMPILE_FLAGS -O3)
set_property(SOURCE ${SRC_SERIALIZATION} PROPERTY COMPILE_FLAGS -O3)
set_property(SOURCE ${SRC_SERIA} PROPERTY COMPILE_FLAGS -O3)
endif()
include_directories(src)
include_directories(${CMAKE_BINARY_DIR})
set(SOURCE_FILES
${SRC_DB}
${SRC_WARNINGS_DB}
${SRC_COMMON}
${SRC_HTTP}
${SRC_CORE}
${SRC_SERIALIZATION}
${SRC_SERIA}
${SRC_LOGGING}
${SRC_PLATFORM}
Expand All @@ -127,23 +129,15 @@ set(SOURCE_FILES
)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/libs")
if(WIN32)
include_directories(SYSTEM ../boost)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
link_directories(SYSTEM ../boost/stage/lib) # must be before add_executable, add_library
else()
link_directories(SYSTEM ../boost/stage32/lib) # must be before add_executable, add_library
endif()
endif()
add_library(bytecoin-crypto ${SRC_CRYPTO})
add_library(bytecoin-core ${SOURCE_FILES})
target_link_libraries(bytecoin-core bytecoin-crypto)
if(WIN32)
add_executable(walletd src/main_walletd.cpp src/bytecoin.rc) # .rc works only if referenced directly in add_executable
add_executable(bytecoind src/main_bytecoind.cpp src/bytecoin.rc) # .rc works only if referenced directly in add_executable
add_executable(${CRYPTONOTE_NAME}d src/main_bytecoind.cpp src/bytecoin.rc) # .rc works only if referenced directly in add_executable
else()
add_executable(walletd src/main_walletd.cpp)
add_executable(bytecoind src/main_bytecoind.cpp)
add_executable(${CRYPTONOTE_NAME}d src/main_bytecoind.cpp)
endif()
add_executable(tests src/main_tests.cpp tests/io.hpp tests/Random.hpp
tests/blockchain/test_blockchain.cpp tests/blockchain/test_blockchain.hpp
Expand All @@ -154,30 +148,32 @@ add_executable(tests src/main_tests.cpp tests/io.hpp tests/Random.hpp
tests/wallet_file/test_wallet_file.cpp tests/wallet_file/test_wallet_file.hpp)
set(Boost_USE_STATIC_LIBS ON)
add_definitions(-DBOOST_BIND_NO_PLACEHOLDERS=1 -DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE=1) # boost::_1 conflicts with std::_1
target_link_libraries(walletd bytecoin-crypto bytecoin-core)
target_link_libraries(bytecoind bytecoin-crypto bytecoin-core)
target_link_libraries(tests bytecoin-crypto bytecoin-core)
if(WIN32)
add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY=1 -DBOOST_SYSTEM_NO_DEPRECATED=1) # required for header-only compilation
add_definitions(-DBOOST_DATE_TIME_NO_LIB=1 -DBOOST_SYSTEM_NO_LIB=1 -DBOOST_REGEX_NO_LIB=1) # required for header-only compilation
set(Boost_USE_MULTITHREADED OFF) # all boost libraries are multithreaded since some version
find_package(Boost 1.65)
if(Boost_FOUND)
message( STATUS "Boost found by find_boost, Boost_INCLUDE_DIRS: " ${Boost_INCLUDE_DIRS})
else()
set(Boost_USE_MULTITHREADED OFF) # all boost libraries are multithreaded since some version
if(APPLE)
set(BOOST_ROOT ../boost)
find_package(Boost 1.62 REQUIRED COMPONENTS system)
message(STATUS "Boost_INCLUDE_DIRS: " ${Boost_INCLUDE_DIRS})
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
#set(Boost_LIBRARIES "${Boost_LIBRARIES}")
else()
message(STATUS "Boost_INCLUDE_DIRS: ../boost")
include_directories(SYSTEM ../boost)
set(Boost_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../boost/stage/lib/libboost_system.a")
if(NOT EXISTS "${PARENT_DIR}/boost/boost/version.hpp")
message(FATAL_ERROR "Boost not found, please download and unpack boost into ${PARENT_DIR}/boost")
endif()
message(STATUS "Boost_LIBRARIES: " ${Boost_LIBRARIES})
set(Boost_INCLUDE_DIRS ${PARENT_DIR}/boost)
message( STATUS "Using boost from local folder, Boost_INCLUDE_DIRS: " ${Boost_INCLUDE_DIRS})
endif()
include_directories(${Boost_INCLUDE_DIRS})

target_link_libraries(walletd bytecoin-crypto bytecoin-core)
target_link_libraries(${CRYPTONOTE_NAME}d bytecoin-crypto bytecoin-core)
target_link_libraries(tests bytecoin-crypto bytecoin-core)

if(NOT WIN32)
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11")
target_link_libraries(walletd "-framework Foundation" "-framework IOKit")
target_link_libraries(bytecoind "-framework Foundation" "-framework IOKit")
target_link_libraries(${CRYPTONOTE_NAME}d "-framework Foundation" "-framework IOKit")
endif()
target_link_libraries(walletd ${Boost_LIBRARIES} ${LINK_OPENSSL} dl pthread)
target_link_libraries(bytecoind ${Boost_LIBRARIES} ${LINK_OPENSSL} dl pthread)
target_link_libraries(tests ${Boost_LIBRARIES} ${LINK_OPENSSL} dl pthread)
target_link_libraries(walletd ${LINK_OPENSSL} dl pthread)
target_link_libraries(${CRYPTONOTE_NAME}d ${LINK_OPENSSL} dl pthread)
target_link_libraries(tests ${LINK_OPENSSL} dl pthread)
endif()
47 changes: 46 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,57 @@
## Release Notes

### v3.4.0-beta-20181212

*Consensus update (hard fork)*
- The release starts immediate voting in the stagenet. Voting in the mainnet will start when v3.4.0 is released.
- Introduce new unlinkable addresses, stored in new HD wallet. Single mnemonic is enough to restore all wallet addresses.
- Destination addresses can now be derived from blockchain with wallet secrets, so saving history is now unnecessary.
- Greatly simplified maximum block size calculations. Miners will now explicitly vote for maximum block size (up to hard limit of 2 MB), depending on how many expensive transactions are in memory pool. Reward penalties are removed and most other unnecessary checks on block/transactions sizes are also removed from consensus.
- New HD wallet is encrypted with chacha20 with salt (major improvement to previous wallet format)
- New auditable addresses, guaranteed to always have balance exactly equal to what view-only version of the same wallet shows (useful for public deposits).
- Signatures are now half size.
- The requirement that coinbase transactions are locked for 10 blocks is removed from consensus.
- Creating dust (or other not round output amounts) are now prohibited by consensus rules.
- Minimum anonymity is now 3 (4 output references per input). This does not apply to dust or not round outputs.
- `bytecoind` now calculates output obfuscation value, and does not use less-than-ideal outputs for mix-in

*Command line changes/additions*
- New walletd command-line parameter to set creation time when importing keys or mnemonic (which have no inherent timestamp)
- New walletd command-line parameter to generate mnemonics
- New walletd command-line parameter to create unlinkable wallet from mnemonics
- New walletd command-line parameter to enable getting secrets bia JSON RPC API

*Specific API improvements*
- By default, getting secrets via JSON RPC API is disabled.
- New walletd method 'get_wallet_records' with optional 'create' parameter can be used to get (creating if needed) wallet records from linkable wallet
- New walletd method `set_address_label` to set labels for addresses (labels are returned by `get_wallet_records`)
- New error code `TOO_MUCH_ANONYMITY` (`-305`) can be returned from `create_transaction`.

*API deprecations (will be removed in version 3.5.0)*
- `walletd` method `get_addresses` is marked as deprecated, use `get_wallet_records` instead.
- `walletd` method `get_view_key_pair` is marked as deprecated, use `get_wallet_info` with `need_secrets` set to true instead.
- `walletd` method 'create_transaction' has 'save_history' and 'save_history_error' deprecated, because history is now always implicitly saved to blockchain.
- `next_block_effective_median_size` renamed to `recommended_max_transaction_size` with `next_block_effective_median_size` deprecated.

*Incompatible API changes*
- `parent_block` is renamed to `root_block` in all contexts without deprecation, due to widespread confusion.

*Improvements to P2P protocol to handle large network load*
- Header relay instead of block body relay. In most cases receiver will reasemble block from memory pool. In rare case when this is not possible, the block body will be requested.
- Transaction description relay instead of transactions body relay. Only new transactions will be requested. Transaction descriptions contain most recent referenced block hash, so that receiver can easily distinguish between "wrong signatures due to malicious intent" and "wrong signatures due to chain reorganisations"
- Incremental memory pool sync with cut-off limit by fee/byte. Allows pools with huge assymetry in size to quickly get into stable state.

*Other changes*
- Memory pool size increased to 4 MB.
- `walletd` will automatically rebuild wallet cache after upgrade to this version. This can take long time for large wallets.

### v3.3.3

- Fixed bug when `walletd` fails to create transactions for certain coins.

### v3.3.2

- Fixed bug when an invalid transaction may persist in the payment queue.
- Now all folders we get from user/system are normalized by removing excess slashes from the tail

### v3.3.1

Expand Down
Loading

0 comments on commit d721103

Please sign in to comment.